]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
AArch64: Reset HWCAP2_AFP bits in FPCR for default fenv
authorTejas Belagod <Tejas.Belagod@arm.com>
Tue, 5 Jul 2022 10:35:24 +0000 (11:35 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 5 Jul 2022 13:01:17 +0000 (14:01 +0100)
The AFP feature (Alternate floating-point behavior) was added in armv8.7 and
introduced new FPCR bits.

Currently, HWCAP2_AFP bits (bit 0, 1, 2) in FPCR are preserved when fenv is
set to default environment.  This is a deviation from standard behaviour.
Clear these bits when setting the fenv to default.

There is no libc API to modify the new FPCR bits.  Restoring those bits matters
if the user changed them directly.

sysdeps/aarch64/fpu/fpu_control.h

index 764ed5cdbb6a90a4d6ac9af1f8874fd71c379e62..429f4910e7a165a7ba8170b173c4fbb3960afa3f 100644 (file)
@@ -46,7 +46,7 @@
    contents. These two masks indicate which bits in each of FPCR and
    FPSR should not be changed.  */
 
-#define _FPU_RESERVED          0xfe0fe0ff
+#define _FPU_RESERVED          0xfe0fe0f8
 #define _FPU_FPSR_RESERVED     0x0fffffe0
 
 #define _FPU_DEFAULT           0x00000000