Index: lib/Target/Mips/AsmParser/MipsAsmParser.cpp =================================================================== --- lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -209,6 +209,9 @@ bool expandUlhu(MCInst &Inst, SMLoc IDLoc, SmallVectorImpl &Instructions); + bool expandUlw(MCInst &Inst, SMLoc IDLoc, + SmallVectorImpl &Instructions); + void createNop(bool hasShortDelaySlot, SMLoc IDLoc, SmallVectorImpl &Instructions); @@ -1624,6 +1627,7 @@ case Mips::JalOneReg: case Mips::JalTwoReg: case Mips::Ulhu: + case Mips::Ulw: return true; default: return false; @@ -1652,6 +1656,8 @@ return expandJalWithRegs(Inst, IDLoc, Instructions); case Mips::Ulhu: return expandUlhu(Inst, IDLoc, Instructions); + case Mips::Ulw: + return expandUlw(Inst, IDLoc, Instructions); } } @@ -2274,6 +2280,77 @@ return false; } +bool MipsAsmParser::expandUlw(MCInst &Inst, SMLoc IDLoc, + SmallVectorImpl &Instructions) { + if (hasMips32r6() || hasMips64r6()) { + Error(IDLoc, "instruction not supported on mips32r6 or mips64r6"); + return false; + } + + const MCOperand &DstRegOp = Inst.getOperand(0); + assert(DstRegOp.isReg() && "expected register operand kind"); + + const MCOperand &SrcRegOp = Inst.getOperand(1); + assert(SrcRegOp.isReg() && "expected register operand kind"); + + const MCOperand &OffsetImmOp = Inst.getOperand(2); + assert(OffsetImmOp.isImm() && "expected immediate operand kind"); + + unsigned SrcReg = SrcRegOp.getReg(); + int64_t OffsetValue = OffsetImmOp.getImm(); + bool UseAT = false; + unsigned ATReg = 0; + + // When the offset does not fit in 16 bits, we have to load it in AT, + // (D)ADDu the original source register (if there was one), and then use AT as + // the source register for the generated LWL and LWR. + if (!isInt<16>(OffsetValue + 3) || !isInt<16>(OffsetValue)) { + ATReg = getATReg(IDLoc); + if (!ATReg) + return true; + UseAT = true; + + warnIfNoMacro(IDLoc); + + if (loadImmediate(OffsetValue, ATReg, Mips::NoRegister, !isGP64bit(), IDLoc, + Instructions)) + return true; + + // NOTE: We do this (D)ADDu here instead of doing it in loadImmediate() + // because it will make our output more similar to GAS'. + // NOTE: If there is no source register specified in the ULW, the parser + // will interpret it as $0. + if (SrcReg != Mips::ZERO && SrcReg != Mips::ZERO_64) + createAddu(ATReg, ATReg, SrcReg, Instructions); + } + + unsigned FinalSrcReg = UseAT ? ATReg : SrcReg; + int64_t LeftLoadOffset = 0, RightLoadOffset = 0; + if (isLittle()) { + LeftLoadOffset = UseAT ? 3 : (OffsetValue + 3); + RightLoadOffset = UseAT ? 0 : OffsetValue; + } else { + LeftLoadOffset = UseAT ? 0 : OffsetValue; + RightLoadOffset = UseAT ? 3 : (OffsetValue + 3); + } + + MCInst LeftLoadInst; + LeftLoadInst.setOpcode(Mips::LWL); + LeftLoadInst.addOperand(DstRegOp); + LeftLoadInst.addOperand(MCOperand::createReg(FinalSrcReg)); + LeftLoadInst.addOperand(MCOperand::createImm(LeftLoadOffset)); + Instructions.push_back(LeftLoadInst); + + MCInst RightLoadInst; + RightLoadInst.setOpcode(Mips::LWR); + RightLoadInst.addOperand(DstRegOp); + RightLoadInst.addOperand(MCOperand::createReg(FinalSrcReg)); + RightLoadInst.addOperand(MCOperand::createImm(RightLoadOffset)); + Instructions.push_back(RightLoadInst); + + return false; +} + void MipsAsmParser::createNop(bool hasShortDelaySlot, SMLoc IDLoc, SmallVectorImpl &Instructions) { MCInst NopInst; Index: lib/Target/Mips/MipsInstrInfo.td =================================================================== --- lib/Target/Mips/MipsInstrInfo.td +++ lib/Target/Mips/MipsInstrInfo.td @@ -1675,6 +1675,9 @@ def Ulhu : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins mem:$addr), "ulhu\t$rt, $addr">, ISA_MIPS1_NOT_32R6_64R6; +def Ulw : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins mem:$addr), + "ulw\t$rt, $addr">, ISA_MIPS1_NOT_32R6_64R6; + //===----------------------------------------------------------------------===// // Arbitrary patterns that map to one or more instructions //===----------------------------------------------------------------------===// Index: test/MC/Mips/mips-expansions-bad.s =================================================================== --- test/MC/Mips/mips-expansions-bad.s +++ test/MC/Mips/mips-expansions-bad.s @@ -33,3 +33,16 @@ ulhu $5, 2 # 32-BIT: :[[@LINE-1]]:3: error: instruction not supported on mips32r6 or mips64r6 # 64-BIT: :[[@LINE-2]]:3: error: instruction not supported on mips32r6 or mips64r6 + + .set mips32r6 + ulw $5, 0 + # 32-BIT: :[[@LINE-1]]:3: error: instruction not supported on mips32r6 or mips64r6 + # 64-BIT: :[[@LINE-2]]:3: error: instruction not supported on mips32r6 or mips64r6 + .set mips32 + ulw $5, 1 + # 32-BIT-NOT: :[[@LINE-1]]:3: error: instruction not supported on mips32r6 or mips64r6 + # 64-BIT-NOT: :[[@LINE-2]]:3: error: instruction not supported on mips32r6 or mips64r6 + .set mips64r6 + ulw $5, 2 + # 32-BIT: :[[@LINE-1]]:3: error: instruction not supported on mips32r6 or mips64r6 + # 64-BIT: :[[@LINE-2]]:3: error: instruction not supported on mips32r6 or mips64r6 Index: test/MC/Mips/mips-expansions.s =================================================================== --- test/MC/Mips/mips-expansions.s +++ test/MC/Mips/mips-expansions.s @@ -231,6 +231,112 @@ # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00] # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01] +# CHECK-BE: lwl $8, 0($zero) # encoding: [0x88,0x08,0x00,0x00] +# CHECK-BE: lwr $8, 3($zero) # encoding: [0x98,0x08,0x00,0x03] +# CHECK-BE: lwl $8, 2($zero) # encoding: [0x88,0x08,0x00,0x02] +# CHECK-BE: lwr $8, 5($zero) # encoding: [0x98,0x08,0x00,0x05] +# CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: lwl $8, -32768($zero) # encoding: [0x88,0x08,0x80,0x00] +# CHECK-BE: lwr $8, -32765($zero) # encoding: [0x98,0x08,0x80,0x03] +# CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01] +# CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff] +# CHECK-BE: ori $1, $1, 32765 # encoding: [0x34,0x21,0x7f,0xfd] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: ori $1, $zero, 32765 # encoding: [0x34,0x01,0x7f,0xfd] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] + +# CHECK-BE: lwl $8, 0($9) # encoding: [0x89,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($9) # encoding: [0x99,0x28,0x00,0x03] +# CHECK-BE: lwl $8, 2($9) # encoding: [0x89,0x28,0x00,0x02] +# CHECK-BE: lwr $8, 5($9) # encoding: [0x99,0x28,0x00,0x05] +# CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00] +# CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: lwl $8, -32768($9) # encoding: [0x89,0x28,0x80,0x00] +# CHECK-BE: lwr $8, -32765($9) # encoding: [0x99,0x28,0x80,0x03] +# CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01] +# CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01] +# CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88] +# CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff] +# CHECK-BE: ori $1, $1, 32765 # encoding: [0x34,0x21,0x7f,0xfd] +# CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] +# CHECK-BE: ori $1, $zero, 32765 # encoding: [0x34,0x01,0x7f,0xfd] +# CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21] +# CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00] +# CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03] + +# CHECK-LE: lwl $8, 3($zero) # encoding: [0x03,0x00,0x08,0x88] +# CHECK-LE: lwr $8, 0($zero) # encoding: [0x00,0x00,0x08,0x98] +# CHECK-LE: lwl $8, 5($zero) # encoding: [0x05,0x00,0x08,0x88] +# CHECK-LE: lwr $8, 2($zero) # encoding: [0x02,0x00,0x08,0x98] +# CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: lwl $8, -32765($zero) # encoding: [0x03,0x80,0x08,0x88] +# CHECK-LE: lwr $8, -32768($zero) # encoding: [0x00,0x80,0x08,0x98] +# CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] +# CHECK-LE: ori $1, $1, 32765 # encoding: [0xfd,0x7f,0x21,0x34] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: ori $1, $zero, 32765 # encoding: [0xfd,0x7f,0x01,0x34] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + +# CHECK-LE: lwl $8, 3($9) # encoding: [0x03,0x00,0x28,0x89] +# CHECK-LE: lwr $8, 0($9) # encoding: [0x00,0x00,0x28,0x99] +# CHECK-LE: lwl $8, 5($9) # encoding: [0x05,0x00,0x28,0x89] +# CHECK-LE: lwr $8, 2($9) # encoding: [0x02,0x00,0x28,0x99] +# CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34] +# CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: lwl $8, -32765($9) # encoding: [0x03,0x80,0x28,0x89] +# CHECK-LE: lwr $8, -32768($9) # encoding: [0x00,0x80,0x28,0x99] +# CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34] +# CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] +# CHECK-LE: ori $1, $1, 32765 # encoding: [0xfd,0x7f,0x21,0x34] +# CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] +# CHECK-LE: ori $1, $zero, 32765 # encoding: [0xfd,0x7f,0x01,0x34] +# CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00] +# CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + li $5,123 li $6,-2345 li $7,65538 @@ -275,3 +381,21 @@ ulhu $8, 0x18888($9) ulhu $8, -32769($9) ulhu $8, 32767($9) + + ulw $8, 0 + ulw $8, 2 + ulw $8, 0x8000 + ulw $8, -0x8000 + ulw $8, 0x10000 + ulw $8, 0x18888 + ulw $8, -32771 + ulw $8, 32765 + + ulw $8, 0($9) + ulw $8, 2($9) + ulw $8, 0x8000($9) + ulw $8, -0x8000($9) + ulw $8, 0x10000($9) + ulw $8, 0x18888($9) + ulw $8, -32771($9) + ulw $8, 32765($9) Index: test/MC/Mips/mips64-expansions.s =================================================================== --- test/MC/Mips/mips64-expansions.s +++ test/MC/Mips/mips64-expansions.s @@ -293,3 +293,85 @@ # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90] # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00] # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01] + +# Test ulw with 64-bit immediate addresses. + ulw $8, 0x100010001 +# CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + + ulw $8, 0x1000100010001 +# CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + + ulw $8, -0x100010001 +# CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + + ulw $8, -0x1000100010001 +# CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + +# Test ulw with source register and 64-bit immediate offset. + ulw $8, 0x100010001($9) +# CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + + ulw $8, 0x1000100010001($9) +# CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34] +# CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + + ulw $8, -0x100010001($9) +# CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34] +# CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] + + ulw $8, -0x1000100010001($9) +# CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34] +# CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00] +# CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34] +# CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00] +# CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88] +# CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98] Index: test/MC/Mips/set-nomacro.s =================================================================== --- test/MC/Mips/set-nomacro.s +++ test/MC/Mips/set-nomacro.s @@ -17,6 +17,11 @@ ulhu $5, 0 + ulw $8, 2 + ulw $8, 0x8000 + ulw $8, 2($9) + ulw $8, 0x8000($9) + add $4, $5, $6 .set noreorder @@ -47,5 +52,14 @@ ulhu $5, 0 # CHECK: [[@LINE-1]]:3: warning: macro instruction expanded into multiple instructions + ulw $8, 2 +# CHECK-NOT: [[@LINE-1]]:3: warning: macro instruction expanded into multiple instructions + ulw $8, 0x8000 +# CHECK: [[@LINE-1]]:3: warning: macro instruction expanded into multiple instructions + ulw $8, 2($9) +# CHECK-NOT: [[@LINE-1]]:3: warning: macro instruction expanded into multiple instructions + ulw $8, 0x8000($9) +# CHECK: [[@LINE-1]]:3: warning: macro instruction expanded into multiple instructions + add $4, $5, $6 # CHECK-NOT: [[@LINE-1]]:3: warning: macro instruction expanded into multiple instructions