[PATCH] D16889: [mips] Addition of the immediate cases for the instructions [d]div, [d]divu

Srdjan Obucina via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 08:57:03 PDT 2016


obucina added inline comments.

================
Comment at: lib/Target/Mips/MipsInstrInfo.td:2093
@@ +2092,3 @@
+def DSDivIMacro : MipsAsmPseudoInst<(outs GPR32Opnd:$rd),
+                                    (ins GPR32Opnd:$rs, imm64:$imm),
+                                    "ddiv\t$rd, $rs, $imm">,
----------------
In llvm, simm64 is not defined. Only imm64 is allowed.

================
Comment at: test/MC/Mips/macro-ddiv.s:121-125
@@ +120,7 @@
+# CHECK-NOTRAP: mflo $4                   # encoding: [0x00,0x00,0x20,0x12]
+# CHECK-TRAP: lui $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
+# CHECK-TRAP: ddiv $zero, $4, $1          # encoding: [0x00,0x81,0x00,0x1e]
+# CHECK-TRAP: mflo $4                     # encoding: [0x00,0x00,0x20,0x12]
+
+  ddiv $4,0x1a5a5
+# CHECK-NOTRAP: lui $1, 1                 # encoding: [0x3c,0x01,0x00,0x01]
----------------
In gcc, for constants larger than 32 bits, we get the error message: 
"Error: number (0x0000000fffffffff) larger than 32 bits".

Do we need to get the same error in llvm for 64bit constants?


http://reviews.llvm.org/D16889





More information about the llvm-commits mailing list