AArch64: Reset HWCAP2_AFP bits in FPCR for default fenv
commit05844d18f7893bf96965f163c428214fd5ebe10a
authorTejas Belagod <Tejas.Belagod@arm.com>
Tue, 5 Jul 2022 10:35:24 +0000 (5 11:35 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Tue, 5 Jul 2022 13:01:17 +0000 (5 14:01 +0100)
tree53b241dc66872ef2effafb50bc5070b1397b616d
parenta9f9ee2381944cee8b4b50c5c8321e3529c77e49
AArch64: Reset HWCAP2_AFP bits in FPCR for default fenv

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