[mips] Allow dsubu to take an immediate as an alias for dsubiu.

Summary:
Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

Differential Revision: http://llvm-reviews.chandlerc.com/D3155

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204611 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Sanders 2014-03-24 15:38:00 +00:00
parent 38a80e9b21
commit eaae583095
2 changed files with 5 additions and 0 deletions

View File

@ -403,6 +403,9 @@ def DSUBi : MipsInst<(outs GPR64Opnd: $rt), (ins GPR64Opnd: $rs, simm16_64: $imm
def DSUBiu : MipsInst<(outs GPR64Opnd: $rt), (ins GPR64Opnd: $rs, simm16_64: $imm),
"ssubu\t$rt, $rs, $imm", [], II_DSUB, Pseudo>;
}
def : InstAlias<"dsubu $rt, $rs, $imm",
(DSUBiu GPR64Opnd:$rt, GPR64Opnd:$rs, simm16_64: $imm),
0>;
def : InstAlias<"sub $rs, $imm",
(SUBi GPR32Opnd:$rs, GPR32Opnd:$rs, simm16:$imm),
0>;

View File

@ -83,6 +83,7 @@
# CHECK: multu $3, $5 # encoding: [0x19,0x00,0x65,0x00]
# CHECK: dsub $9, $6, $7 # encoding: [0x2e,0x48,0xc7,0x00]
# CHECK: dsubu $4, $3, $5 # encoding: [0x2f,0x20,0x65,0x00]
# CHECK: daddiu $9, $6, -17767 # encoding: [0x99,0xba,0xc9,0x64]
# CHECK: move $7, $8 # encoding: [0x2d,0x38,0x00,0x01]
# CHECK: .set push
# CHECK: .set mips32r2
@ -107,6 +108,7 @@
multu $3,$5
dsub $9,$6,$7
dsubu $4,$3,$5
dsubu $9,$6,17767
move $7,$8
rdhwr $5, $29