[llvm] [PowerPC][SDAG] fix bitcast on ppc_f128 swapping the two halves (PR #208969)

Folkert de Vries via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 06:33:14 PDT 2026


folkertdev wrote:

> Yikes - I think that was what `APFloat::hasSignBitInMSB` was supposed to handle, whether ppc_fp128 actually sets it correctly based on endianness is another question

It does not, it's unconditionally true. Which I think is even accurate given the `APFloat` internal representation, but the same information is used for runtime float values and then it is wrong for LE.

So we could set it to `false` to make these bugs less likely (and guard by `hasSignBitInMSB` in a couple more places)? That might optimize slightly less well, but otherwise it's just a game of whac-a-mole. Given this is quite a dated target, I'd rather have it be correct than slightly more optimized and sometimes miscompiling.

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


More information about the llvm-commits mailing list