Skip to content

Commit 43d308d

Browse files
authored
[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.
1 parent 80b08d1 commit 43d308d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler-rt/lib/builtins/arm/negdf2vfp.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ DEFINE_COMPILERRT_FUNCTION(__negdf2vfp)
2020
#if defined(COMPILER_RT_ARMHF_TARGET)
2121
vneg.f64 d0, d0
2222
#else
23-
eor r1, r1, #-2147483648 // flip sign bit on double in r0/r1 pair
23+
#if _YUGA_BIG_ENDIAN
24+
eor r0, r0, #0x80000000 // flip sign bit on double in r0/r1 pair
25+
#else
26+
eor r1, r1, #0x80000000 // flip sign bit on double in r0/r1 pair
27+
#endif
2428
#endif
2529
bx lr
2630
END_COMPILERRT_FUNCTION(__negdf2vfp)

0 commit comments

Comments
 (0)