This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 08/17] RISC-V: Generic <math.h> and soft-fp Routines


On Thu, 25 Jan 2018 09:12:49 PST (-0800), joseph@codesourcery.com wrote:
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.

OK, thanks, I guess I wasn't aware of how this works.

(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.)

I'm speculatively adding them -- we're still trying to get a rv64imac/lp64 test run through to make sure that's sane, if not then I'll remove it before the v5.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]