https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103348
Bug ID: 103348
Summary: Bad code generated for fabs(long double) under aarch64
Product: gcc
Version: 6.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jacob at jacob dot remcomp.fr
Target Milestone: ---
Machine aarch64 linux
when compiling:
long double ld;
ld = fabs(ld);
The compiler generates:
ldr q0, [x29, 16]
bl __trunctfdf2
fabs d0, d0
bl __extenddftf2
str q0, [x29, 16]
You truncate de 128 bit long double to 64, then extend it to 128 bits! You
loose ALL PRECISION!
Incredible