[PATCH] [mips][FastISel] Implement div instruction.

Daniel Sanders daniel.sanders at imgtec.com
Mon Jun 1 06:28:57 PDT 2015


LGTM with a couple nits


================
Comment at: lib/Target/Mips/MipsFastISel.cpp:100
@@ -99,2 +99,3 @@
   bool selectFPToInt(const Instruction *I, bool IsSigned);
+  bool selectRem(const Instruction *I, unsigned ISDOpcode);
   bool selectRet(const Instruction *I);
----------------
Nit: Not needed anymore.

================
Comment at: lib/Target/Mips/MipsFastISel.cpp:100
@@ -99,2 +99,3 @@
   bool selectFPToInt(const Instruction *I, bool IsSigned);
+  bool selectRem(const Instruction *I, unsigned ISDOpcode);
   bool selectRet(const Instruction *I);
----------------
dsanders wrote:
> Nit: Not needed anymore.
Not done.

================
Comment at: lib/Target/Mips/MipsFastISel.cpp:1459-1461
@@ +1458,5 @@
+
+  unsigned MFOpc = Mips::MFLO;
+  if (ISDOpcode == ISD::SREM || ISDOpcode == ISD::UREM)
+    MFOpc = Mips::MFHI;
+  emitInst(MFOpc, ResultReg);
----------------
Nit: Use ternary operator

================
Comment at: test/CodeGen/Mips/Fast-ISel/div1.ll:12
@@ +11,3 @@
+; Function Attrs: noinline nounwind
+define void @divs() #0 {
+entry:
----------------
dsanders wrote:
> As mentioned in D6774, we can significantly simplify this using arguments and returns.
> 
> As noted there, I don't mind if this is part of the big cleanup.
Not done, but I'm ok with this tidy up being in the cleanup so this is not a problem.

http://reviews.llvm.org/D7028

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list