From 770f0646dbce9c429beee5f8703d272b4d9450ec Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Mon, 7 Nov 2011 18:59:49 +0000 Subject: [PATCH] Make the type of shift amount i32 in order to reduce the number of shift instruction definitions. llvm-svn: 143989 --- llvm/lib/Target/Mips/Mips64InstrInfo.td | 6 +++--- llvm/lib/Target/Mips/MipsISelLowering.h | 2 ++ llvm/lib/Target/Mips/MipsInstrInfo.td | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/Mips/Mips64InstrInfo.td b/llvm/lib/Target/Mips/Mips64InstrInfo.td index 3708c4a3627b..83bd7b88c596 100644 --- a/llvm/lib/Target/Mips/Mips64InstrInfo.td +++ b/llvm/lib/Target/Mips/Mips64InstrInfo.td @@ -32,7 +32,7 @@ def Subtract32 : SDNodeXForm; // imm32_63 predicate - True if imm is in range [32, 63]. -def imm32_63 : ImmLeaf= 32 && (int32_t)Imm < 64;}], Subtract32>; @@ -43,12 +43,12 @@ def imm32_63 : ImmLeaf func, bits<5> isRotate, string instr_asm, SDNode OpNode>: - shift_rotate_imm; class shift_rotate_imm64_32 func, bits<5> isRotate, string instr_asm, SDNode OpNode>: - shift_rotate_imm; // Mul, Div diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h index 62e7f095826e..f2b64e36f1c6 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -98,6 +98,8 @@ namespace llvm { public: explicit MipsTargetLowering(MipsTargetMachine &TM); + virtual MVT getShiftAmountTy(EVT LHSTy) const { return MVT::i32; } + virtual bool allowsUnalignedMemoryAccesses (EVT VT) const; /// LowerOperation - Provide custom lowering hooks for some operations. diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td index fd99b1312621..64dbd264690c 100644 --- a/llvm/lib/Target/Mips/MipsInstrInfo.td +++ b/llvm/lib/Target/Mips/MipsInstrInfo.td @@ -327,9 +327,9 @@ class shift_rotate_imm32 func, bits<5> isRotate, string instr_asm, class shift_rotate_reg func, bits<5> isRotate, string instr_asm, SDNode OpNode, RegisterClass RC>: - FR<0x00, func, (outs RC:$rd), (ins RC:$rs, RC:$rt), + FR<0x00, func, (outs RC:$rd), (ins CPURegs:$rs, RC:$rt), !strconcat(instr_asm, "\t$rd, $rt, $rs"), - [(set RC:$rd, (OpNode RC:$rt, RC:$rs))], IIAlu> { + [(set RC:$rd, (OpNode RC:$rt, CPURegs:$rs))], IIAlu> { let shamt = isRotate; }