diff options
author | Jack Carter <jack.carter@imgtec.com> | 2013-05-13 20:26:46 +0000 |
---|---|---|
committer | Jack Carter <jack.carter@imgtec.com> | 2013-05-13 20:26:46 +0000 |
commit | f4a1377322a9234c17b1d324c47248bdb5f62158 (patch) | |
tree | cd20ef7d4377b6a264206993dd04155714ffbd28 | |
parent | 774a8cf2f5a5f8cd580c71f5eb3055a293917102 (diff) | |
download | external_llvm-f4a1377322a9234c17b1d324c47248bdb5f62158.zip external_llvm-f4a1377322a9234c17b1d324c47248bdb5f62158.tar.gz external_llvm-f4a1377322a9234c17b1d324c47248bdb5f62158.tar.bz2 |
Mips assembler: Assembler macro ADDIU $rs,imm
This patch adds alias for addiu instruction which enables following syntax:
addiu $rs,imm
The macro is translated as:
addiu $rs,$rs,imm
Contributer: Vladimir Medic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181729 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Mips/MipsInstrInfo.td | 3 | ||||
-rw-r--r-- | test/MC/Mips/mips-alu-instructions.s | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/Mips/MipsInstrInfo.td b/lib/Target/Mips/MipsInstrInfo.td index 3d31937..5ada1df 100644 --- a/lib/Target/Mips/MipsInstrInfo.td +++ b/lib/Target/Mips/MipsInstrInfo.td @@ -1095,7 +1095,8 @@ def : InstAlias<"mfc2 $rt, $rd", (MFC2_3OP CPURegsOpnd:$rt, CPURegsOpnd:$rd, 0), 0>; def : InstAlias<"mtc2 $rt, $rd", (MTC2_3OP CPURegsOpnd:$rd, 0, CPURegsOpnd:$rt), 0>; - +def : InstAlias<"addiu $rs, $imm", + (ADDiu CPURegsOpnd:$rs, CPURegsOpnd:$rs, simm16:$imm), 0>; //===----------------------------------------------------------------------===// // Assembler Pseudo Instructions //===----------------------------------------------------------------------===// diff --git a/test/MC/Mips/mips-alu-instructions.s b/test/MC/Mips/mips-alu-instructions.s index 586e88b..0df6f85 100644 --- a/test/MC/Mips/mips-alu-instructions.s +++ b/test/MC/Mips/mips-alu-instructions.s @@ -70,6 +70,7 @@ # CHECK: addiu $9, $6, -15001 # encoding: [0x67,0xc5,0xc9,0x24] # CHECK: addi $9, $6, 17767 # encoding: [0x67,0x45,0xc9,0x20] # CHECK: addiu $9, $6, -15001 # encoding: [0x67,0xc5,0xc9,0x24] +# CHECK: addiu $11, $11, 40 # encoding: [0x28,0x00,0x6b,0x25] # CHECK: addu $9, $6, $7 # encoding: [0x21,0x48,0xc7,0x00] # CHECK: madd $6, $7 # encoding: [0x00,0x00,0xc7,0x70] # CHECK: maddu $6, $7 # encoding: [0x01,0x00,0xc7,0x70] @@ -91,6 +92,7 @@ addu $9,$6,-15001 addi $9,$6,17767 addiu $9,$6,-15001 + addiu $11,40 addu $9,$6,$7 madd $6,$7 maddu $6,$7 |