This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 08/17] RISC-V: Generic <math.h> and soft-fp Routines
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Palmer Dabbelt <palmer at dabbelt dot com>
- Cc: <libc-alpha at sourceware dot org>, Andrew Waterman <andrew at sifive dot com>, Darius Rad <darius at bluespec dot com>, <dj at redhat dot com>, <patches at groups dot riscv dot org>
- Date: Thu, 25 Jan 2018 17:12:49 +0000
- Subject: Re: [PATCH 08/17] RISC-V: Generic <math.h> and soft-fp Routines
- Authentication-results: sourceware.org; auth=none
- References: <20180125043621.19972-1-palmer@dabbelt.com> <20180125043621.19972-9-palmer@dabbelt.com>
On Wed, 24 Jan 2018, Palmer Dabbelt wrote:
> FIXME: add ieee745/soft-fp via a riscv/soft-fp directory.
You need to remove that FIXME (and, in general, update patch descriptions
when sending new versions of a patch series - though in this case it
doesn't matter so much, as it makes sense for the final commit of a new
port to go in a single commit, not lots of separate commits of different
pieces that don't work without each other, so an overall commit message is
what's needed at that point anyway).
> +/* Despite not supporting trapping exceptions, we support setting
> + floating-point exception flags on hard-float targets. These are not
> + supported on soft-float targets. */
> +#if __riscv_flen == 0
> +#define EXCEPTION_TESTS_float 0
> +#define EXCEPTION_TESTS_double 0
> +#endif
Missing preprocessor indentation, "# define".
> +/* We don't support the Q extension yet, so long double is always soft float
> + * and therefor doesn't support exceptions. */
> +#define EXCEPTION_TESTS_long_double 0
That's not accurate. The EXCEPTION_TESTS_long_double definition should be
inside the same conditional as the others - the RISC-V sfp-machine.h, in
both glibc and libgcc, already handles making software floating-point
types use the hardware exceptions and rounding modes when those exist.
(I expect that if you completed a soft-float test run you'd find that
ROUNDING_TESTS_* definitions, similar to those on other ports, are also
needed inside that conditional, to disable tests of rounding modes other
than FE_TONEAREST for soft-float.)
--
Joseph S. Myers
joseph@codesourcery.com