Re: Access to arm box
> Is it correct
> that arm does not support setting the FPU rounding mode via fesetround()? At
> least, <bits/fenv.h> does not define FE_UPWARD, FE_DOWNWARD and FE_TOWARDZERO.
It says in that file:
/* The ARM FPU basically only supports round-to-nearest. Other rounding
modes exist, but you have to encode them in the actual instruction. */
#define FE_TONEAREST 0
- that's talking about the ancient "FPA" unit that a few early ARM
CPUs had, and which is supported in linux on all modern CPUs by
emulating the illegal instructions in the kernel.
> While at it I also builded the package on armel. <bits/fenv.h> defines all four
> FE_* constants, but fegetround() always returns FE_TONEAREST. Is this a bug/not
> supported/...? (I didn't check the rounding mode by a computation yet.)
The armel version of the file says:
/* VFP supports all of the four defined rounding modes. */
... but the implementaion you were using has no FPU, so uses the
soft-float library coded in ARM assembler in glibc. It could be that
either it doesn't implement rounding modes or the set/get function is
broken (just guessing).
I'm afraid I don't have any units with a VFP FPU here to test on. If
you can make a testcase that would be interesting. however there are
also other FPUs around associated with ARM processors, such as the
buggy Cirrus Maverick Crunch unit, so if you are in a position to test
for macro existence and possibly also run "configure" tests to see
whether the implementation actually works, rather than relying on
system-specific knowledge, that might result in more robust software.