[PATCH] D47718: [Mips] Use UADDO/ADDCARRY instead of ADDC/ADDE

Simon Dardis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 12 09:13:56 PDT 2018


sdardis added inline comments.


================
Comment at: lib/Target/Mips/MipsSEISelDAGToDAG.cpp:310
+    // to bit 20 of the dsp control register.
+    ReplaceUses(SDValue(Node, 1), extractCarryFlag(Result, 20, CurDAG));
+  }
----------------
deadalnix wrote:
> sdardis wrote:
> > You also need to clear bit 20 in the dsp control register after performing a addwc. On page 40 of the MIPS DSP AFP (MD00374-2B-MIPS32DSP-AFP-03.01.pdf) , it notes that the over/underflow flags are sticky.
> Question is, does addsc clean the flag register ? If yes, then we are good, if not, then existing code is broken as well.
By the spec from my reading, addsc only writes the carry bit (bit 13) on every execution and bit 20 is untouched.




Repository:
  rL LLVM

https://reviews.llvm.org/D47718





More information about the llvm-commits mailing list