[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
Sun Jul 12 10:38:45 PDT 2026


folkertdev wrote:

@RKSimon is this what you remember?

https://github.com/llvm/llvm-project/blob/3a27d292c353328a9a03422319ff1c0b9264648b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L18059-L18067

It's in a function that deals with bitcasts, and uses 

```
static unsigned getPPCf128HiElementSelector(const SelectionDAG &DAG) {
  // On little-endian machines, bitcasting from ppcf128 to i128 does swap the Hi
  // and Lo parts; on big-endian machines it doesn't.
  return DAG.getDataLayout().isBigEndian() ? 1 : 0;
}
```

So it seems very related, but the bug here is (I believe) specifically about bitcasts on constant values.

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


More information about the llvm-commits mailing list