[mips] Fix 64bit slt/sltu/nor with immediates

Patch By: Alexander Richardson

Reviewers: atanasyan, theraven, sdardis

Differential Revision: https://reviews.llvm.org/D30330



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296482 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Dardis 2017-02-28 15:55:23 +00:00
parent 1e598cbf73
commit 7569719e94
5 changed files with 369 additions and 112 deletions

View File

@ -2378,6 +2378,19 @@ MipsAsmParser::tryExpandInstruction(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
case Mips::Usw:
return expandUxw(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
case Mips::NORImm:
case Mips::NORImm64:
return expandAliasImmediate(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
case Mips::SLTImm64:
if (isInt<16>(Inst.getOperand(2).getImm())) {
Inst.setOpcode(Mips::SLTi64);
return MER_NotAMacro;
}
return expandAliasImmediate(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
case Mips::SLTUImm64:
if (isInt<16>(Inst.getOperand(2).getImm())) {
Inst.setOpcode(Mips::SLTiu64);
return MER_NotAMacro;
}
return expandAliasImmediate(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
case Mips::ADDi: case Mips::ADDi_MM:
case Mips::ADDiu: case Mips::ADDiu_MM:
@ -3868,9 +3881,18 @@ bool MipsAsmParser::expandAliasImmediate(MCInst &Inst, SMLoc IDLoc,
case Mips::ANDi64:
FinalOpcode = Mips::AND64;
break;
case Mips::NORImm64:
FinalOpcode = Mips::NOR64;
break;
case Mips::ORi64:
FinalOpcode = Mips::OR64;
break;
case Mips::SLTImm64:
FinalOpcode = Mips::SLT64;
break;
case Mips::SLTUImm64:
FinalOpcode = Mips::SLTu64;
break;
case Mips::XORi64:
FinalOpcode = Mips::XOR64;
break;

View File

@ -892,3 +892,17 @@ let AdditionalPredicates = [NotInMicroMips] in {
imm64:$imm), 0>,
ISA_MIPS3_NOT_32R6_64R6;
}
def NORImm64 : NORIMM_DESC_BASE<GPR64Opnd, imm64>, GPR_64;
def : MipsInstAlias<"nor\t$rs, $imm", (NORImm64 GPR64Opnd:$rs, GPR64Opnd:$rs,
imm64:$imm)>, GPR_64;
def SLTImm64 : MipsAsmPseudoInst<(outs GPR64Opnd:$rs),
(ins GPR64Opnd:$rt, imm64:$imm),
"slt\t$rs, $rt, $imm">, GPR_64;
def : MipsInstAlias<"slt\t$rs, $imm", (SLTImm64 GPR64Opnd:$rs, GPR64Opnd:$rs,
imm64:$imm)>, GPR_64;
def SLTUImm64 : MipsAsmPseudoInst<(outs GPR64Opnd:$rs),
(ins GPR64Opnd:$rt, imm64:$imm),
"sltu\t$rs, $rt, $imm">, GPR_64;
def : MipsInstAlias<"sltu\t$rs, $imm", (SLTUImm64 GPR64Opnd:$rs, GPR64Opnd:$rs,
imm64:$imm)>, GPR_64;

View File

@ -2406,9 +2406,9 @@ let AdditionalPredicates = [NotInMicroMips] in {
defm : OneOrTwoOperandMacroImmediateAlias<"xor", XORi>, GPR_32;
defm : OneOrTwoOperandMacroImmediateAlias<"slt", SLTi>;
defm : OneOrTwoOperandMacroImmediateAlias<"slt", SLTi>, GPR_32;
defm : OneOrTwoOperandMacroImmediateAlias<"sltu", SLTiu>;
defm : OneOrTwoOperandMacroImmediateAlias<"sltu", SLTiu>, GPR_32;
}
def : MipsInstAlias<"mfc0 $rt, $rd", (MFC0 GPR32Opnd:$rt, COP0Opnd:$rd, 0), 0>;
def : MipsInstAlias<"mtc0 $rt, $rd", (MTC0 COP0Opnd:$rd, GPR32Opnd:$rt, 0), 0>;
@ -2516,11 +2516,12 @@ def JalTwoReg : MipsAsmPseudoInst<(outs GPR32Opnd:$rd), (ins GPR32Opnd:$rs),
def JalOneReg : MipsAsmPseudoInst<(outs), (ins GPR32Opnd:$rs),
"jal\t$rs"> ;
def NORImm : MipsAsmPseudoInst<
(outs), (ins GPR32Opnd:$rs, GPR32Opnd:$rt, simm32_relaxed:$imm),
"nor\t$rs, $rt, $imm">;
class NORIMM_DESC_BASE<RegisterOperand RO, DAGOperand Imm> :
MipsAsmPseudoInst<(outs RO:$rs), (ins RO:$rt, Imm:$imm),
"nor\t$rs, $rt, $imm">;
def NORImm : NORIMM_DESC_BASE<GPR32Opnd, simm32_relaxed>, GPR_32;
def : MipsInstAlias<"nor\t$rs, $imm", (NORImm GPR32Opnd:$rs, GPR32Opnd:$rs,
simm32_relaxed:$imm)>;
simm32_relaxed:$imm)>, GPR_32;
let hasDelaySlot = 1, isCTI = 1 in {
def BneImm : MipsAsmPseudoInst<(outs GPR32Opnd:$rt),

View File

@ -1,106 +0,0 @@
# RUN: llvm-mc -triple mips64el-unknown-linux -show-encoding -print-imm-hex %s | FileCheck %s
# XFAIL: *
.text
text_label:
# CHECK: text_label:
nor $4, $5, 0
# CHECK: addiu $4, $zero, 0x0 # encoding: [0x00,0x00,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 1
# CHECK-NEXT: addiu $4, $zero, 0x1 # encoding: [0x01,0x00,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x8000
# CHECK-NEXT: ori $4, $zero, 0x8000 # encoding: [0x00,0x80,0x04,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, -0x8000
# CHECK-NEXT: addiu $4, $zero, -0x8000 # encoding: [0x00,0x80,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x10000
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x1a5a5
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xa5a5 # encoding: [0xa5,0xa5,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xFFFFFFFF
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: dsrl32 $4, $4, 0x0 # encoding: [0x3e,0x20,0x04,0x00]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xF0000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x7FFFFFFF
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x7FFFFFFFFFFFFFFF
# FIXME: this is awfully inefficient...
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: addiu $4, $zero, -0x1 # encoding: [0xff,0xff,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xF000000000000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x30 # encoding: [0x3c,0x24,0x04,0x00]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $4, $zero, -0x1 # encoding: [0xff,0xff,0x04,0x24]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff # encoding: [0xff,0x00,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff0f # encoding: [0x0f,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xff00ff00
# CHECK-NEXT: ori $4, $zero, 0xff00 # encoding: [0x00,0xff,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff00 # encoding: [0x00,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
slt $4, $5, -0x80000000
# CHECK: lui $4, 0x8000 # encoding: [0x00,0x80,0x04,0x3c]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, -0x8001
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0x7fff # encoding: [0xff,0x7f,0x84,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, -0x8000
# CHECK-NEXT: slti $4, $5, -0x8000 # encoding: [0x00,0x80,0xa4,0x28]
slt $4, $5, 0
# CHECK-NEXT: slti $4, $5, 0x0 # encoding: [0x00,0x00,0xa4,0x28]
slt $4, $5, 0xFFFF
# CHECK-NEXT: ori $4, $zero, 0xffff # encoding: [0xff,0xff,0x04,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0x10000
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0xFFFFFFFF
# CHECK-NOT: slti $4, $5, -0x1 # encoding: [0xff,0xff,0xa4,0x28]
sltu $4, $5, -0x80000000
# CHECK: lui $4, 0x8000 # encoding: [0x00,0x80,0x04,0x3c]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, -0x8001
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0x7fff # encoding: [0xff,0x7f,0x84,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, -0x8000
# CHECK-NEXT: sltiu $4, $5, -0x8000 # encoding: [0x00,0x80,0xa4,0x2c]
sltu $4, $5, 0
# CHECK-NEXT: sltiu $4, $5, 0x0 # encoding: [0x00,0x00,0xa4,0x2c]
sltu $4, $5, 0xFFFF
# CHECK-NEXT: ori $4, $zero, 0xffff # encoding: [0xff,0xff,0x04,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0x10000
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
# FIXME: should this be sign extended or not???
sltu $4, $5, 0xFFFFFFFF
# CHECK-NOT: sltiu $4, $5, -0x1 # encoding: [0xff,0xff,0xa4,0x2c]

View File

@ -413,3 +413,329 @@ text_label:
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff0f # encoding: [0x0f,0xff,0x84,0x34]
# CHECK-NEXT: xor $4, $4, $5 # encoding: [0x26,0x20,0x85,0x00]
nor $4, 0
# CHECK: addiu $1, $zero, 0x0 # encoding: [0x00,0x00,0x01,0x24]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 1
# CHECK-NEXT: addiu $1, $zero, 0x1 # encoding: [0x01,0x00,0x01,0x24]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0x8000
# CHECK-NEXT: ori $1, $zero, 0x8000 # encoding: [0x00,0x80,0x01,0x34]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, -0x8000
# CHECK-NEXT: addiu $1, $zero, -0x8000 # encoding: [0x00,0x80,0x01,0x24]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0x10000
# CHECK-NEXT: lui $1, 0x1 # encoding: [0x01,0x00,0x01,0x3c]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0x1a5a5
# CHECK-NEXT: lui $1, 0x1 # encoding: [0x01,0x00,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xa5a5 # encoding: [0xa5,0xa5,0x21,0x34]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0xFFFFFFFF
# CHECK-NEXT: lui $1, 0xffff # encoding: [0xff,0xff,0x01,0x3c]
# CHECK-NEXT: dsrl32 $1, $1, 0x0 # encoding: [0x3e,0x08,0x01,0x00]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0xF0000000
# CHECK-NEXT: ori $1, $zero, 0xf000 # encoding: [0x00,0xf0,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0x7FFFFFFF
# CHECK-NEXT: lui $1, 0x7fff # encoding: [0xff,0x7f,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0x7FFFFFFFFFFFFFF
# CHECK-NEXT: lui $1, 0x7ff # encoding: [0xff,0x07,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: addiu $1, $zero, -0x1 # encoding: [0xff,0xff,0x01,0x24]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0xF000000000000000
# CHECK-NEXT: ori $1, $zero, 0xf000 # encoding: [0x00,0xf0,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x30 # encoding: [0x3c,0x0c,0x01,0x00]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $1, $zero, -0x1 # encoding: [0xff,0xff,0x01,0x24]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff # encoding: [0xff,0x00,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff0f # encoding: [0x0f,0xff,0x21,0x34]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, 0xff00ff00
# CHECK-NEXT: ori $1, $zero, 0xff00 # encoding: [0x00,0xff,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff00 # encoding: [0x00,0xff,0x21,0x34]
# CHECK-NEXT: nor $4, $4, $1 # encoding: [0x27,0x20,0x81,0x00]
nor $4, $5, 0
# CHECK: addiu $4, $zero, 0x0 # encoding: [0x00,0x00,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 1
# CHECK-NEXT: addiu $4, $zero, 0x1 # encoding: [0x01,0x00,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x8000
# CHECK-NEXT: ori $4, $zero, 0x8000 # encoding: [0x00,0x80,0x04,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, -0x8000
# CHECK-NEXT: addiu $4, $zero, -0x8000 # encoding: [0x00,0x80,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x10000
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x1a5a5
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xa5a5 # encoding: [0xa5,0xa5,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xFFFFFFFF
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: dsrl32 $4, $4, 0x0 # encoding: [0x3e,0x20,0x04,0x00]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xF0000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x7FFFFFFF
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0x7FFFFFFFFFFFFFFF
# FIXME: this is awfully inefficient...
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: addiu $4, $zero, -0x1 # encoding: [0xff,0xff,0x04,0x24]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xF000000000000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x30 # encoding: [0x3c,0x24,0x04,0x00]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $4, $zero, -0x1 # encoding: [0xff,0xff,0x04,0x24]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff # encoding: [0xff,0x00,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff0f # encoding: [0x0f,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
nor $4, $5, 0xff00ff00
# CHECK-NEXT: ori $4, $zero, 0xff00 # encoding: [0x00,0xff,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff00 # encoding: [0x00,0xff,0x84,0x34]
# CHECK-NEXT: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00]
slt $4, -0x80000000
# CHECK: lui $1, 0x8000 # encoding: [0x00,0x80,0x01,0x3c]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, -0x8001
# CHECK-NEXT: lui $1, 0xffff # encoding: [0xff,0xff,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0x7fff # encoding: [0xff,0x7f,0x21,0x34]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, -0x8000
# CHECK-NEXT: slti $4, $4, -0x8000 # encoding: [0x00,0x80,0x84,0x28]
slt $4, 0
# CHECK-NEXT: slti $4, $4, 0x0 # encoding: [0x00,0x00,0x84,0x28]
slt $4, 0xFFFF
# CHECK-NEXT: ori $1, $zero, 0xffff # encoding: [0xff,0xff,0x01,0x34]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, 0x10000
# CHECK-NEXT: lui $1, 0x1 # encoding: [0x01,0x00,0x01,0x3c]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, 0xFFFFFFFF
# CHECK-NEXT: lui $1, 0xffff # encoding: [0xff,0xff,0x01,0x3c]
# CHECK-NEXT: dsrl32 $1, $1, 0x0 # encoding: [0x3e,0x08,0x01,0x00]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, 0xF0000000
# CHECK-NEXT: ori $1, $zero, 0xf000 # encoding: [0x00,0xf0,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, 0x7FFFFFFF
# CHECK-NEXT: lui $1, 0x7fff # encoding: [0xff,0x7f,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, 0x7FFFFFFFFFFFFFFF
# CHECK-NEXT: lui $1, 0x7fff # encoding: [0xff,0x7f,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: slti $4, $4, -0x1 # encoding: [0xff,0xff,0x84,0x28]
slt $4, 0xF000000000000000
# CHECK-NEXT: ori $1, $zero, 0xf000 # encoding: [0x00,0xf0,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x30 # encoding: [0x3c,0x0c,0x01,0x00]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $1, $zero, -0x1 # encoding: [0xff,0xff,0x01,0x24]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff # encoding: [0xff,0x00,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff0f # encoding: [0x0f,0xff,0x21,0x34]
# CHECK-NEXT: slt $4, $4, $1 # encoding: [0x2a,0x20,0x81,0x00]
slt $4, $5, -0x80000000
# CHECK: lui $4, 0x8000 # encoding: [0x00,0x80,0x04,0x3c]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, -0x8001
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0x7fff # encoding: [0xff,0x7f,0x84,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, -0x8000
# CHECK-NEXT: slti $4, $5, -0x8000 # encoding: [0x00,0x80,0xa4,0x28]
slt $4, $5, 0
# CHECK-NEXT: slti $4, $5, 0x0 # encoding: [0x00,0x00,0xa4,0x28]
slt $4, $5, 0xFFFF
# CHECK-NEXT: ori $4, $zero, 0xffff # encoding: [0xff,0xff,0x04,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0x10000
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0xFFFFFFFF
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: dsrl32 $4, $4, 0x0 # encoding: [0x3e,0x20,0x04,0x00]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0xF0000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0x7FFFFFFF
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0x7FFFFFFFFFFFFFFF
# FIXME: this is awfully inefficient...
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: slti $4, $5, -0x1 # encoding: [0xff,0xff,0xa4,0x28]
slt $4, $5, 0xF000000000000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x30 # encoding: [0x3c,0x24,0x04,0x00]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
slt $4, $5, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $4, $zero, -0x1 # encoding: [0xff,0xff,0x04,0x24]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff # encoding: [0xff,0x00,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff0f # encoding: [0x0f,0xff,0x84,0x34]
# CHECK-NEXT: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00]
sltu $4, -0x80000000
# CHECK: lui $1, 0x8000 # encoding: [0x00,0x80,0x01,0x3c]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, -0x8001
# CHECK-NEXT: lui $1, 0xffff # encoding: [0xff,0xff,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0x7fff # encoding: [0xff,0x7f,0x21,0x34]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, -0x8000
# CHECK-NEXT: sltiu $4, $4, -0x8000 # encoding: [0x00,0x80,0x84,0x2c]
sltu $4, 0
# CHECK-NEXT: sltiu $4, $4, 0x0 # encoding: [0x00,0x00,0x84,0x2c]
sltu $4, 0xFFFF
# CHECK-NEXT: ori $1, $zero, 0xffff # encoding: [0xff,0xff,0x01,0x34]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, 0x10000
# CHECK-NEXT: lui $1, 0x1 # encoding: [0x01,0x00,0x01,0x3c]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, 0xFFFFFFFF
# CHECK-NEXT: lui $1, 0xffff # encoding: [0xff,0xff,0x01,0x3c]
# CHECK-NEXT: dsrl32 $1, $1, 0x0 # encoding: [0x3e,0x08,0x01,0x00]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, 0xF0000000
# CHECK-NEXT: ori $1, $zero, 0xf000 # encoding: [0x00,0xf0,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, 0x7FFFFFFF
# CHECK-NEXT: lui $1, 0x7fff # encoding: [0xff,0x7f,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, 0x7FFFFFFFFFFFFFFF
# CHECK-NEXT: lui $1, 0x7fff # encoding: [0xff,0x7f,0x01,0x3c]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xffff # encoding: [0xff,0xff,0x21,0x34]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: sltiu $4, $4, -0x1 # encoding: [0xff,0xff,0x84,0x2c]
sltu $4, 0xF000000000000000
# CHECK-NEXT: ori $1, $zero, 0xf000 # encoding: [0x00,0xf0,0x01,0x34]
# CHECK-NEXT: dsll $1, $1, 0x30 # encoding: [0x3c,0x0c,0x01,0x00]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $1, $zero, -0x1 # encoding: [0xff,0xff,0x01,0x24]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff # encoding: [0xff,0x00,0x21,0x34]
# CHECK-NEXT: dsll $1, $1, 0x10 # encoding: [0x38,0x0c,0x01,0x00]
# CHECK-NEXT: ori $1, $1, 0xff0f # encoding: [0x0f,0xff,0x21,0x34]
# CHECK-NEXT: sltu $4, $4, $1 # encoding: [0x2b,0x20,0x81,0x00]
sltu $4, $5, -0x80000000
# CHECK: lui $4, 0x8000 # encoding: [0x00,0x80,0x04,0x3c]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, -0x8001
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0x7fff # encoding: [0xff,0x7f,0x84,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, -0x8000
# CHECK-NEXT: sltiu $4, $5, -0x8000 # encoding: [0x00,0x80,0xa4,0x2c]
sltu $4, $5, 0
# CHECK-NEXT: sltiu $4, $5, 0x0 # encoding: [0x00,0x00,0xa4,0x2c]
sltu $4, $5, 0xFFFF
# CHECK-NEXT: ori $4, $zero, 0xffff # encoding: [0xff,0xff,0x04,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0x10000
# CHECK-NEXT: lui $4, 0x1 # encoding: [0x01,0x00,0x04,0x3c]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0xFFFFFFFF
# CHECK-NEXT: lui $4, 0xffff # encoding: [0xff,0xff,0x04,0x3c]
# CHECK-NEXT: dsrl32 $4, $4, 0x0 # encoding: [0x3e,0x20,0x04,0x00]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0xF0000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0x7FFFFFFF
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0x7FFFFFFFFFFFFFFF
# FIXME: this is awfully inefficient...
# CHECK-NEXT: lui $4, 0x7fff # encoding: [0xff,0x7f,0x04,0x3c]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xffff # encoding: [0xff,0xff,0x84,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, 0xFFFFFFFFFFFFFFFF
# CHECK-NEXT: sltiu $4, $5, -0x1 # encoding: [0xff,0xff,0xa4,0x2c]
sltu $4, $5, 0xF000000000000000
# CHECK-NEXT: ori $4, $zero, 0xf000 # encoding: [0x00,0xf0,0x04,0x34]
# CHECK-NEXT: dsll $4, $4, 0x30 # encoding: [0x3c,0x24,0x04,0x00]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]
sltu $4, $5, ~(0xf0000000|0x0f000000|0x000000f0)
# CHECK-NEXT: addiu $4, $zero, -0x1 # encoding: [0xff,0xff,0x04,0x24]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff # encoding: [0xff,0x00,0x84,0x34]
# CHECK-NEXT: dsll $4, $4, 0x10 # encoding: [0x38,0x24,0x04,0x00]
# CHECK-NEXT: ori $4, $4, 0xff0f # encoding: [0x0f,0xff,0x84,0x34]
# CHECK-NEXT: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00]