[compiler-rt] [compiler-rt] Add big endian support to __aeabi_(idivmod|uidivmod|uldivmod) (PR #126277)

Victor Campos via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 04:09:22 PST 2025


vhscampos wrote:

>From what you have said, the tests are what's wrong, not the implementations. I will make the changes.

The respective tests were failing in big endian, and I interpreted that the implementation had to swap the values according to endianness. We recently had a similar bug somewhere else in compiler-rt.

The RTABI isn't very clear to me: "The 32-bit integer division functions return the quotient in r0 or both quotient and remainder in {r0, r1}". It doesn't explicitly say "in {r0, r1} _respectively_", which made me dubious about whether the order changed with endianness or not.

`_YUGA_BIG_ENDIAN` is defined in `int_endianness.h`. It's a macro internal to compiler-rt that's in theory compatible with more toolchains than gcc and clang.

https://github.com/llvm/llvm-project/pull/126277


More information about the llvm-commits mailing list