[PATCH] D16889: [mips] Addition of the immediate cases for the instructions [d]div, [d]divu
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 15 09:27:26 PDT 2016
dsanders 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">,
----------------
obucina wrote:
> In llvm, simm64 is not defined. Only imm64 is allowed.
The majority of these operands are target defined. For example, simm32 is:
def simm32 : Operand<i32>;
================
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]
----------------
obucina wrote:
> 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?
I don't get this error:
$ cat t.s
ddiv $2, $3, 0xffffffff
$ mips-mti-linux-gnu-gcc -c -o t.o t.s -mips64r2
http://reviews.llvm.org/D16889
More information about the llvm-commits
mailing list