[PATCH] D91845: [PowerPC] Fix FLT_ROUNDS_ on little endian

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 22:39:12 PST 2020

qiucf added inline comments.

Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:8899
-  // Save FP register to stack slot
-  int SSFI = MF.getFrameInfo().CreateStackObject(8, Align(8), false);
-  SDValue StackSlot = DAG.getFrameIndex(SSFI, PtrVT);
-  Chain = DAG.getStore(Chain, dl, MFFS, StackSlot, MachinePointerInfo());
-  // Load FP Control Word from low 32 bits of stack slot.
-  SDValue Four = DAG.getConstant(4, dl, PtrVT);
-  SDValue Addr = DAG.getNode(ISD::ADD, dl, PtrVT, StackSlot, Four);
-  SDValue CWD = DAG.getLoad(MVT::i32, dl, Chain, Addr, MachinePointerInfo());
-  Chain = CWD.getValue(1);
+  SDValue CWD;
+  if (Subtarget.hasDirectMove()) {
steven.zhang wrote:
> Can we use some generic node to express this semantic ? So that , we will handle it automatically. i.e.
> x = MFFS
> y = bitcast f64 to i64
> z = trunc y to i32
Yes. But the original code needs to be kept for ppc32 (`i64` is illegal on that so crash will happen for the bitcast).



More information about the llvm-commits mailing list