Trapping exceptions in AArch64 are optional. The relevant exception
control bits in FPCR are are defined as RES0 hence the absence of
support can be detected by reading back the FPCR and comparing with
the desired value.
+2014-03-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * sysdeps/aarch64/fpu/feenablxcpt.c (feenableexcept): Detect and
+ error absence of trapping exception support.
+ * sysdeps/aarch64/fpu/fesetenv.c (fesetenv): Likewise.
+
2014-03-07 Joseph Myers <joseph@codesourcery.com>
* catgets/Makefile (tests-special): Add $(objpfx)sample.SJIS.cat.
_FPU_SETCW (fpcr);
+ /* Trapping exceptions are optional in AArch64 the relevant enable
+ bits in FPCR are RES0 hence the absence of support can be
+ detected by reading back the FPCR and comparing with the required
+ value. */
+ if (excepts)
+ {
+ fpu_control_t updated_fpcr;
+
+ _FPU_GETCW (updated_fpcr);
+ if (((updated_fpcr >> FE_EXCEPT_SHIFT) & excepts) != excepts)
+ return -1;
+ }
+
return original_excepts;
}
{
fpu_control_t fpcr;
fpu_fpsr_t fpsr;
+ fpu_control_t updated_fpcr;
_FPU_GETCW (fpcr);
_FPU_GETFPSR (fpsr);
_FPU_SETCW (fpcr);
+ /* Trapping exceptions are optional in AArch64 the relevant enable
+ bits in FPCR are RES0 hence the absence of support can be
+ detected by reading back the FPCR and comparing with the required
+ value. */
+
+ _FPU_GETCW (updated_fpcr);
+ if ((updated_fpcr & fpcr) != fpcr)
+ return 1;
+
return 0;
}