[compiler-rt] Add support for big endian for Arm's __negdf2vfp (#127096)

In soft floating-point ABI, this function takes the double argument as a
pair of registers r0 and r1.

The ordering of these two registers follow the endianness rules,
therefore the register on which the bit flipping must happen depends on
the endianness.
This commit is contained in:
Victor Campos
2025-02-17 11:43:36 +00:00
committed by GitHub
parent 80b08d1bb8
commit 43d308dd0d

View File

@@ -20,7 +20,11 @@ DEFINE_COMPILERRT_FUNCTION(__negdf2vfp)
#if defined(COMPILER_RT_ARMHF_TARGET)
vneg.f64 d0, d0
#else
eor r1, r1, #-2147483648 // flip sign bit on double in r0/r1 pair
#if _YUGA_BIG_ENDIAN
eor r0, r0, #0x80000000 // flip sign bit on double in r0/r1 pair
#else
eor r1, r1, #0x80000000 // flip sign bit on double in r0/r1 pair
#endif
#endif
bx lr
END_COMPILERRT_FUNCTION(__negdf2vfp)