Index: lib/Target/Mips/AsmParser/MipsAsmParser.cpp =================================================================== --- lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -194,6 +194,10 @@ bool expandLoadImm(MCInst &Inst, bool Is32BitImm, SMLoc IDLoc, MCStreamer &Out, const MCSubtargetInfo *STI); + + bool expandLoadImmReal(MCInst &Inst, bool IsSingle, bool IsGPR, bool Is64FPU, + SMLoc IDLoc, MCStreamer &Out, + const MCSubtargetInfo *STI); bool expandLoadAddress(unsigned DstReg, unsigned BaseReg, const MCOperand &Offset, bool Is32BitAddress, @@ -914,6 +918,16 @@ assert(N == 1 && "Invalid number of operands!"); Inst.addOperand(MCOperand::createReg(getAFGR64Reg())); } + + void addStrictlyAFGR64AsmRegOperands(MCInst &Inst, unsigned N) const { + assert(N == 1 && "Invalid number of operands!"); + Inst.addOperand(MCOperand::createReg(getAFGR64Reg())); + } + + void addStrictlyFGR64AsmRegOperands(MCInst &Inst, unsigned N) const { + assert(N == 1 && "Invalid number of operands!"); + Inst.addOperand(MCOperand::createReg(getFGR64Reg())); + } void addFGR64AsmRegOperands(MCInst &Inst, unsigned N) const { assert(N == 1 && "Invalid number of operands!"); @@ -931,6 +945,15 @@ "registers"); } + void addStrictlyFGR32AsmRegOperands(MCInst &Inst, unsigned N) const { + assert(N == 1 && "Invalid number of operands!"); + Inst.addOperand(MCOperand::createReg(getFGR32Reg())); + // FIXME: We ought to do this for -integrated-as without -via-file-asm too. + if (!AsmParser.useOddSPReg() && RegIdx.Index & 1) + AsmParser.Error(StartLoc, "-mno-odd-spreg prohibits the use of odd FPU " + "registers"); + } + void addFGRH32AsmRegOperands(MCInst &Inst, unsigned N) const { assert(N == 1 && "Invalid number of operands!"); Inst.addOperand(MCOperand::createReg(getFGRH32Reg())); @@ -1439,6 +1462,10 @@ // AFGR64 is $0-$15 but we handle this in getAFGR64() return isRegIdx() && RegIdx.Kind & RegKind_FGR && RegIdx.Index <= 31; } + bool isStrictlyFGRAsmReg() const { + // AFGR64 is $0-$15 but we handle this in getAFGR64() + return isRegIdx() && RegIdx.Kind == RegKind_FGR && RegIdx.Index <= 31; + } bool isHWRegsAsmReg() const { return isRegIdx() && RegIdx.Kind & RegKind_HWRegs && RegIdx.Index <= 31; } @@ -2166,6 +2193,27 @@ case Mips::PseudoTRUNC_W_D: return expandTrunc(Inst, true, true, IDLoc, Out, STI) ? MER_Fail : MER_Success; + + case Mips::LoadImmSingleGPR: + return expandLoadImmReal(Inst, true, true, false, IDLoc, Out, STI) + ? MER_Fail + : MER_Success; + case Mips::LoadImmSingleFGR: + return expandLoadImmReal(Inst, true, false, false, IDLoc, Out, STI) + ? MER_Fail + : MER_Success; + case Mips::LoadImmDoubleGPR: + return expandLoadImmReal(Inst, false, true, false, IDLoc, Out, STI) + ? MER_Fail + : MER_Success; + case Mips::LoadImmDoubleFGR: + return expandLoadImmReal(Inst, false, false, true, IDLoc, Out, STI) + ? MER_Fail + : MER_Success; + case Mips::LoadImmDoubleFGR_32: + return expandLoadImmReal(Inst, false, false, false, IDLoc, Out, STI) + ? MER_Fail + : MER_Success; case Mips::Ulh: return expandUlh(Inst, true, IDLoc, Out, STI) ? MER_Fail : MER_Success; case Mips::Ulhu: @@ -2674,6 +2722,216 @@ return false; } +bool MipsAsmParser::expandLoadImmReal(MCInst &Inst, bool IsSingle, bool IsGPR, + bool Is64FPU, SMLoc IDLoc, + MCStreamer &Out, + const MCSubtargetInfo *STI) { + MipsTargetStreamer &TOut = getTargetStreamer(); + assert(Inst.getNumOperands() == 2 && "Invalid operand count"); + assert(Inst.getOperand(0).isReg() && Inst.getOperand(1).isImm() && + "Invalid instruction operand."); + + unsigned FirstReg = Inst.getOperand(0).getReg(); + uint64_t ImmOp64 = Inst.getOperand(1).getImm(); + + uint64_t HiImmOp64 = (ImmOp64 & 0xffffffff00000000) >> 32; + // If ImmOp64 is AsmToken::Integer type (all bits set to zero in the + // exponent field), convert it to double (e.g. 1 to 1.0) + if ((HiImmOp64 & 0x7ff00000) == 0) { + APFloat RealVal(APFloat::IEEEdouble, ImmOp64); + ImmOp64 = RealVal.bitcastToAPInt().getZExtValue(); + } + + uint64_t LoImmOp64 = ImmOp64 & 0xffffffff; + HiImmOp64 = (ImmOp64 & 0xffffffff00000000) >> 32; + + if (IsSingle) { + uint32_t ImmOp32; + // Convert double ImmOp64 into single ImmOp32 + void *void_pt = static_cast(&ImmOp64); + double *double_pt = static_cast(void_pt); + float tmp_float = static_cast(*double_pt); + void_pt = &tmp_float; + uint32_t *uint32_pt = static_cast(void_pt); + ImmOp32 = *uint32_pt; + + if (IsGPR) { + if (loadImmediate(ImmOp32, FirstReg, Mips::NoRegister, true, true, IDLoc, + Out, STI)) + return true; + return false; + } else { + if (LoImmOp64 == 0) { + unsigned ATReg = getATReg(IDLoc); + if (!ATReg) + return true; + + if (loadImmediate(ImmOp32, ATReg, Mips::NoRegister, true, true, IDLoc, + Out, STI)) + return true; + TOut.emitRR(Mips::MTC1, FirstReg, ATReg, IDLoc, STI); + return false; + } + + MCSection *CS = getStreamer().getCurrentSectionOnly(); + MCSection *Lit4Section = getContext().getELFSection( + ".lit4", ELF::SHT_PROGBITS, + ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_MIPS_GPREL); + getStreamer().SwitchSection(Lit4Section); + getStreamer().EmitIntValue(ImmOp32, 4); + getStreamer().SwitchSection(CS); + + MCSymbolELF *Sym = getContext().getOrCreateSectionSymbol( + *(dyn_cast(Lit4Section))); + + const MCExpr *LitSym = + MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext()); + + const MipsMCExpr *LitExpr = + MipsMCExpr::create(MipsMCExpr::MEK_LITERAL, LitSym, getContext()); + + int32_t size_data_fragment = 0; + MCSection::FragmentListType &FragList = Lit4Section->getFragmentList(); + if (!FragList.empty()) { + MCDataFragment *DF = + &cast(Lit4Section->getFragmentList().back()); + size_data_fragment = DF->getContents().size(); + } + + const MCExpr *FixupAddr = MCBinaryExpr::createAdd( + LitExpr, MCConstantExpr::create(size_data_fragment - 4, getContext()), + getContext()); + + TOut.emitRRX(Mips::LWC1, FirstReg, Mips::GP, + MCOperand::createExpr(FixupAddr), IDLoc, STI); + + return false; + } + return false; + } + + // if(!IsSingle) + if (IsGPR) { + unsigned ATReg = getATReg(IDLoc); + if (!ATReg) + return true; + + if (LoImmOp64 == 0) { + if (loadImmediate(HiImmOp64, FirstReg, Mips::NoRegister, true, true, + IDLoc, Out, STI)) + return true; + + if (loadImmediate(0, FirstReg + 1, Mips::NoRegister, true, true, IDLoc, + Out, STI)) + return true; + return false; + } + + MCSection *CS = getStreamer().getCurrentSectionOnly(); + MCSection *ReadOnlySection = getContext().getELFSection( + ".rodata", ELF::SHT_PROGBITS, ELF::SHF_ALLOC); + getStreamer().SwitchSection(ReadOnlySection); + getStreamer().EmitIntValue(HiImmOp64, 4); + getStreamer().EmitIntValue(LoImmOp64, 4); + getStreamer().SwitchSection(CS); + + int32_t size_data_fragment = 0; + MCSection::FragmentListType &FragList = ReadOnlySection->getFragmentList(); + if (!FragList.empty()) { + MCDataFragment *DF = + &cast(ReadOnlySection->getFragmentList().back()); + size_data_fragment = DF->getContents().size(); + } + + MCSymbolELF *Sym = getContext().getOrCreateSectionSymbol( + *(dyn_cast(ReadOnlySection))); + + const MCExpr *HiSym = + MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext()); + + const MipsMCExpr *HiExpr = + MipsMCExpr::create(MipsMCExpr::MEK_HI, HiSym, getContext()); + + const MCExpr *LoSym = + MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext()); + + const MipsMCExpr *LoExpr = + MipsMCExpr::create(MipsMCExpr::MEK_LO, LoSym, getContext()); + + TOut.emitRX(Mips::LUi, ATReg, MCOperand::createExpr(HiExpr), IDLoc, STI); + + const MCExpr *FixupAddr = MCBinaryExpr::createAdd( + LoExpr, MCConstantExpr::create(size_data_fragment - 8, getContext()), + getContext()); + + TOut.emitRRX(Mips::LW, FirstReg, ATReg, MCOperand::createExpr(FixupAddr), + IDLoc, STI); + + FixupAddr = MCBinaryExpr::createAdd( + LoExpr, MCConstantExpr::create(size_data_fragment - 4, getContext()), + getContext()); + + TOut.emitRRX(Mips::LW, FirstReg + 1, ATReg, + MCOperand::createExpr(FixupAddr), IDLoc, STI); + + return false; + } else { // if(!IsGPR && !IsSingle) + + if (LoImmOp64 == 0) { + unsigned ATReg = getATReg(IDLoc); + if (!ATReg) + return true; + if (!Is64FPU) { + if (loadImmediate(HiImmOp64, ATReg, Mips::NoRegister, true, true, IDLoc, + Out, STI)) + return true; + + TOut.emitRRR(Mips::MTHC1_D32, FirstReg, FirstReg, ATReg, IDLoc, STI); + TOut.emitRR(Mips::MTC1, FirstReg, Mips::ZERO, IDLoc, STI); + + // TOut.emitRR(Mips::MTC1, FirstReg + 1, ATReg, IDLoc, STI); + // TOut.emitRR(Mips::MTC1, FirstReg, Mips::ZERO, IDLoc, STI); + return false; + } + } + + MCSection *CS = getStreamer().getCurrentSectionOnly(); + MCSection *Lit8Section = getContext().getELFSection( + ".lit8", ELF::SHT_PROGBITS, + ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_MIPS_GPREL); + + getStreamer().SwitchSection(Lit8Section); + getStreamer().EmitIntValue(HiImmOp64, 4); + getStreamer().EmitIntValue(LoImmOp64, 4); + getStreamer().SwitchSection(CS); + + int32_t size_data_fragment = 0; + MCSection::FragmentListType &FragList = Lit8Section->getFragmentList(); + if (!FragList.empty()) { + MCDataFragment *DF = + &cast(Lit8Section->getFragmentList().back()); + size_data_fragment = DF->getContents().size(); + } + + MCSymbolELF *Sym = getContext().getOrCreateSectionSymbol( + *(dyn_cast(Lit8Section))); + + const MCExpr *LitSym = + MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, getContext()); + + const MipsMCExpr *LitExpr = + MipsMCExpr::create(MipsMCExpr::MEK_LITERAL, LitSym, getContext()); + + const MCExpr *FixupAddr = MCBinaryExpr::createAdd( + LitExpr, MCConstantExpr::create(size_data_fragment - 8, getContext()), + getContext()); + + TOut.emitRRX(Mips::LDC1, FirstReg, Mips::GP, + MCOperand::createExpr(FixupAddr), IDLoc, STI); + } + return false; +} + bool MipsAsmParser::expandUncondBranchMMPseudo(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out, const MCSubtargetInfo *STI) { Index: lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp =================================================================== --- lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp +++ lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp @@ -287,6 +287,8 @@ return Type; } return ELF::R_MIPS_GPREL32; + case Mips::fixup_Mips_LITERAL: + return ELF::R_MIPS_LITERAL; case Mips::fixup_Mips_GPREL16: return ELF::R_MIPS_GPREL16; case Mips::fixup_Mips_26: Index: lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp =================================================================== --- lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp +++ lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp @@ -711,6 +711,7 @@ case MipsMCExpr::MEK_GPREL: FixupKind = Mips::fixup_Mips_GPREL16; break; + case MipsMCExpr::MEK_LO: { // Check for %lo(%neg(%gp_rel(X))) if (MipsExpr->isGpOff()) { @@ -721,6 +722,9 @@ : Mips::fixup_Mips_LO16; break; } + case MipsMCExpr::MEK_LITERAL: + FixupKind = Mips::fixup_Mips_LITERAL; + break; case MipsMCExpr::MEK_HIGHEST: FixupKind = Mips::fixup_Mips_HIGHEST; break; Index: lib/Target/Mips/MCTargetDesc/MipsMCExpr.h =================================================================== --- lib/Target/Mips/MCTargetDesc/MipsMCExpr.h +++ lib/Target/Mips/MCTargetDesc/MipsMCExpr.h @@ -36,6 +36,7 @@ MEK_HI, MEK_HIGHER, MEK_HIGHEST, + MEK_LITERAL, MEK_LO, MEK_NEG, MEK_PCREL_HI16, Index: lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp =================================================================== --- lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp +++ lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp @@ -85,6 +85,9 @@ case MEK_HIGHEST: OS << "%highest"; break; + case MEK_LITERAL: + OS << "%lit4"; + break; case MEK_LO: OS << "%lo"; break; @@ -166,6 +169,7 @@ case MEK_PCREL_LO16: case MEK_TLSGD: case MEK_TLSLDM: + case MEK_LITERAL: case MEK_TPREL_HI: case MEK_TPREL_LO: return false; @@ -253,6 +257,7 @@ case MEK_HI: case MEK_HIGHER: case MEK_HIGHEST: + case MEK_LITERAL: case MEK_LO: case MEK_NEG: case MEK_PCREL_HI16: Index: lib/Target/Mips/MipsInstrFPU.td =================================================================== --- lib/Target/Mips/MipsInstrFPU.td +++ lib/Target/Mips/MipsInstrFPU.td @@ -599,6 +599,28 @@ "trunc.w.d\t$fd, $fs, $rs">, FGR_64, HARDFLOAT; +def LoadImmSingleGPR : MipsAsmPseudoInst<(outs GPR32Opnd:$rd), + (ins imm64:$fpimm), + "li.s\t$rd, $fpimm">; + +def LoadImmSingleFGR : MipsAsmPseudoInst<(outs StrictlyFGR32Opnd:$rd), + (ins imm64:$fpimm), + "li.s\t$rd, $fpimm">; + +def LoadImmDoubleGPR : MipsAsmPseudoInst<(outs GPR32Opnd:$rd), + (ins imm64:$fpimm), + "li.d\t$rd, $fpimm">; + +def LoadImmDoubleFGR_32 : MipsAsmPseudoInst<(outs StrictlyAFGR64Opnd:$rd), + (ins imm64:$fpimm), + "li.d\t$rd, $fpimm">, + FGR_32, HARDFLOAT; + +def LoadImmDoubleFGR : MipsAsmPseudoInst<(outs StrictlyFGR64Opnd:$rd), + (ins imm64:$fpimm), + "li.d\t$rd, $fpimm">, + FGR_64, HARDFLOAT; + //===----------------------------------------------------------------------===// // InstAliases. //===----------------------------------------------------------------------===// Index: lib/Target/Mips/MipsRegisterInfo.td =================================================================== --- lib/Target/Mips/MipsRegisterInfo.td +++ lib/Target/Mips/MipsRegisterInfo.td @@ -521,16 +521,31 @@ let PredicateMethod = "isFGRAsmReg"; } +def StrictlyAFGR64AsmOperand : MipsAsmRegOperand { + let Name = "StrictlyAFGR64AsmReg"; + let PredicateMethod = "isStrictlyFGRAsmReg"; +} + def FGR64AsmOperand : MipsAsmRegOperand { let Name = "FGR64AsmReg"; let PredicateMethod = "isFGRAsmReg"; } +def StrictlyFGR64AsmOperand : MipsAsmRegOperand { + let Name = "StrictlyFGR64AsmReg"; + let PredicateMethod = "isStrictlyFGRAsmReg"; +} + def FGR32AsmOperand : MipsAsmRegOperand { let Name = "FGR32AsmReg"; let PredicateMethod = "isFGRAsmReg"; } +def StrictlyFGR32AsmOperand : MipsAsmRegOperand { + let Name = "StrictlyFGR32AsmReg"; + let PredicateMethod = "isStrictlyFGRAsmReg"; +} + def FGRH32AsmOperand : MipsAsmRegOperand { let Name = "FGRH32AsmReg"; let PredicateMethod = "isFGRAsmReg"; @@ -600,14 +615,26 @@ let ParserMatchClass = AFGR64AsmOperand; } +def StrictlyAFGR64Opnd : RegisterOperand { + let ParserMatchClass = StrictlyAFGR64AsmOperand; +} + def FGR64Opnd : RegisterOperand { let ParserMatchClass = FGR64AsmOperand; } +def StrictlyFGR64Opnd : RegisterOperand { + let ParserMatchClass = StrictlyFGR64AsmOperand; +} + def FGR32Opnd : RegisterOperand { let ParserMatchClass = FGR32AsmOperand; } +def StrictlyFGR32Opnd : RegisterOperand { + let ParserMatchClass = StrictlyFGR32AsmOperand; +} + def FGRCCOpnd : RegisterOperand { // The assembler doesn't use register classes so we can re-use // FGR32AsmOperand. Index: test/MC/Mips/macro-li.d.s =================================================================== --- /dev/null +++ test/MC/Mips/macro-li.d.s @@ -0,0 +1,305 @@ +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips32 -show-encoding | FileCheck %s --check-prefix=CHECK-MIPS32 +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips64 -show-encoding | FileCheck %s --check-prefix=CHECK-MIPS64 + +li.d $4, 0 +# CHECK-MIPS32: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] +# CHECK-MIPS32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] +# CHECK-MIPS64: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] +# CHECK-MIPS64: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] + +li.d $4, 0.0 +# CHECK-MIPS32: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] +# CHECK-MIPS32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] +# CHECK-MIPS64: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] +# CHECK-MIPS64: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] + +li.d $4, 1.12345 +# CHECK-MIPS32: .section .rodata,"a",@progbits +# CHECK-MIPS32: .4byte 1072822694 +# CHECK-MIPS32: .4byte 3037400872 +# CHECK-MIPS32: .text +# CHECK-MIPS32: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS32: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS32: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: .section .rodata,"a",@progbits +# CHECK-MIPS64: .4byte 1072822694 +# CHECK-MIPS64: .4byte 3037400872 +# CHECK-MIPS64: .text +# CHECK-MIPS64: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS64: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 + +li.d $4, 1 +# CHECK-MIPS32: lui $4, 16368 # encoding: [0xf0,0x3f,0x04,0x3c] +# CHECK-MIPS32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] +# CHECK-MIPS64: lui $4, 16368 # encoding: [0xf0,0x3f,0x04,0x3c] +# CHECK-MIPS64: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] + +li.d $4, 1.0 +# CHECK-MIPS32: lui $4, 16368 # encoding: [0xf0,0x3f,0x04,0x3c] +# CHECK-MIPS32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] +# CHECK-MIPS64: lui $4, 16368 # encoding: [0xf0,0x3f,0x04,0x3c] +# CHECK-MIPS64: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] + +li.d $4, 12345678910 +# CHECK-MIPS32: .section .rodata,"a",@progbits +# CHECK-MIPS32: .4byte 1107754720 +# CHECK-MIPS32: .4byte 3790602240 +# CHECK-MIPS32: .text +# CHECK-MIPS32: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS32: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS32: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: .section .rodata,"a",@progbits +# CHECK-MIPS64: .4byte 1107754720 +# CHECK-MIPS64: .4byte 3790602240 +# CHECK-MIPS64: .text +# CHECK-MIPS64: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS64: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 + +li.d $4, 12345678910.0 +# CHECK-MIPS32: .section .rodata,"a",@progbits +# CHECK-MIPS32: .4byte 1107754720 +# CHECK-MIPS32: .4byte 3790602240 +# CHECK-MIPS32: .text +# CHECK-MIPS32: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS32: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS32: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: .section .rodata,"a",@progbits +# CHECK-MIPS64: .4byte 1107754720 +# CHECK-MIPS64: .4byte 3790602240 +# CHECK-MIPS64: .text +# CHECK-MIPS64: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS64: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 + +li.d $4, 0.4 +# CHECK-MIPS32: .section .rodata,"a",@progbits +# CHECK-MIPS32: .4byte 1071225241 +# CHECK-MIPS32: .4byte 2576980378 +# CHECK-MIPS32: .text +# CHECK-MIPS32: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS32: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS32: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: .section .rodata,"a",@progbits +# CHECK-MIPS64: .4byte 1071225241 +# CHECK-MIPS64: .4byte 2576980378 +# CHECK-MIPS64: .text +# CHECK-MIPS64: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS64: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 + +li.d $4, 1.5 +# CHECK-MIPS32: lui $4, 16376 # encoding: [0xf8,0x3f,0x04,0x3c] +# CHECK-MIPS32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] +# CHECK-MIPS64: lui $4, 16376 # encoding: [0xf8,0x3f,0x04,0x3c] +# CHECK-MIPS64: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] + +li.d $4, 12345678910.12345678910 +# CHECK-MIPS32: .section .rodata,"a",@progbits +# CHECK-MIPS32: .4byte 1107754720 +# CHECK-MIPS32: .4byte 3790666967 +# CHECK-MIPS32: .text +# CHECK-MIPS32: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS32: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS32: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: .section .rodata,"a",@progbits +# CHECK-MIPS64: .4byte 1107754720 +# CHECK-MIPS64: .4byte 3790666967 +# CHECK-MIPS64: .text +# CHECK-MIPS64: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS64: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 + +li.d $4, 12345678910123456789.12345678910 +# CHECK-MIPS32: .section .rodata,"a",@progbits +# CHECK-MIPS32: .4byte 1139108501 +# CHECK-MIPS32: .4byte 836738583 +# CHECK-MIPS32: .text +# CHECK-MIPS32: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS32: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS32: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: .section .rodata,"a",@progbits +# CHECK-MIPS64: .4byte 1139108501 +# CHECK-MIPS64: .4byte 836738583 +# CHECK-MIPS64: .text +# CHECK-MIPS64: lui $1, %hi(.rodata) # encoding: [A,A,0x01,0x3c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %hi(.rodata), kind: fixup_Mips_HI16 +# CHECK-MIPS64: lw $4, (%lo(.rodata))-8($1) # encoding: [0xf8'A',0xff'A',0x24,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 +# CHECK-MIPS64: lw $5, (%lo(.rodata))-4($1) # encoding: [0xfc'A',0xff'A',0x25,0x8c] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lo(.rodata), kind: fixup_Mips_LO16 + +li.d $f4, 0 +# CHECK-MIPS32: addiu $1, $zero, 0 # encoding: [0x00,0x00,0x01,0x24] +# CHECK-MIPS32: mthc1 $1, $f4 # encoding: [0x00,0x20,0xe1,0x44] +# CHECK-MIPS32: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44] +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + + +li.d $f4, 0.0 +# CHECK-MIPS32: addiu $1, $zero, 0 # encoding: [0x00,0x00,0x01,0x24] +# CHECK-MIPS32: mthc1 $1, $f4 # encoding: [0x00,0x20,0xe1,0x44] +# CHECK-MIPS32: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44] +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + + +li.d $f4, 1.12345 +# CHECK-MIPS32: .section .lit8,"aw",@progbits +# CHECK-MIPS32: .4byte 1072822694 +# CHECK-MIPS32: .4byte 3037400872 +# CHECK-MIPS32: .text +# CHECK-MIPS32: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1072822694 +# CHECK-MIPS64: .4byte 3037400872 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 1 +# CHECK-MIPS32: lui $1, 16368 # encoding: [0xf0,0x3f,0x01,0x3c] +# CHECK-MIPS32: mthc1 $1, $f4 # encoding: [0x00,0x20,0xe1,0x44] +# CHECK-MIPS32: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44] +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1072693248 +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 1.0 +# CHECK-MIPS32: lui $1, 16368 # encoding: [0xf0,0x3f,0x01,0x3c] +# CHECK-MIPS32: mthc1 $1, $f4 # encoding: [0x00,0x20,0xe1,0x44] +# CHECK-MIPS32: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44] +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1072693248 +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 12345678910 +# CHECK-MIPS32: .section .lit8,"aw",@progbits +# CHECK-MIPS32: .4byte 1107754720 +# CHECK-MIPS32: .4byte 3790602240 +# CHECK-MIPS32: .text +# CHECK-MIPS32: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1107754720 +# CHECK-MIPS64: .4byte 3790602240 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 12345678910.0 +# CHECK-MIPS32: .section .lit8,"aw",@progbits +# CHECK-MIPS32: .4byte 1107754720 +# CHECK-MIPS32: .4byte 3790602240 +# CHECK-MIPS32: .text +# CHECK-MIPS32: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1107754720 +# CHECK-MIPS64: .4byte 3790602240 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 0.4 +# CHECK-MIPS32: .section .lit8,"aw",@progbits +# CHECK-MIPS32: .4byte 1071225241 +# CHECK-MIPS32: .4byte 2576980378 +# CHECK-MIPS32: .text +# CHECK-MIPS32: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1071225241 +# CHECK-MIPS64: .4byte 2576980378 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 1.5 +# CHECK-MIPS32: lui $1, 16376 # encoding: [0xf8,0x3f,0x01,0x3c] +# CHECK-MIPS32: mthc1 $1, $f4 # encoding: [0x00,0x20,0xe1,0x44] +# CHECK-MIPS32: mtc1 $zero, $f4 # encoding: [0x00,0x20,0x80,0x44] +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1073217536 +# CHECK-MIPS64: .4byte 0 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 12345678910.12345678910 +# CHECK-MIPS32: .section .lit8,"aw",@progbits +# CHECK-MIPS32: .4byte 1107754720 +# CHECK-MIPS32: .4byte 3790666967 +# CHECK-MIPS32: .text +# CHECK-MIPS32: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1107754720 +# CHECK-MIPS64: .4byte 3790666967 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL + +li.d $f4, 12345678910123456789.12345678910 +# CHECK-MIPS32: .section .lit8,"aw",@progbits +# CHECK-MIPS32: .4byte 1139108501 +# CHECK-MIPS32: .4byte 836738583 +# CHECK-MIPS32: .text +# CHECK-MIPS32: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS32: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL +# CHECK-MIPS64: .section .lit8,"aw",@progbits +# CHECK-MIPS64: .4byte 1139108501 +# CHECK-MIPS64: .4byte 836738583 +# CHECK-MIPS64: .text +# CHECK-MIPS64: ldc1 $f4, (%lit4(.lit8))-8($gp) # encoding: [0xf8'A',0xff'A',0x84,0xd7] +# CHECK-MIPS64: # fixup A - offset: 0, value: %lit4(.lit8), kind: fixup_Mips_LITERAL Index: test/MC/Mips/macro-li.s.s =================================================================== --- /dev/null +++ test/MC/Mips/macro-li.s.s @@ -0,0 +1,102 @@ +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips32 -show-encoding | FileCheck %s +# RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips64 -show-encoding | FileCheck %s + +li.s $4, 0 +# CHECK: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] + +li.s $4, 0.0 +# CHECK: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] + +li.s $4, 1.12345 +# CHECK: lui $4, 16271 # encoding: [0x8f,0x3f,0x04,0x3c] +# CHECK: ori $4, $4, 52534 # encoding: [0x36,0xcd,0x84,0x34] + +li.s $4, 1 +# CHECK: lui $4, 16256 # encoding: [0x80,0x3f,0x04,0x3c] + +li.s $4, 1.0 +# CHECK: lui $4, 16256 # encoding: [0x80,0x3f,0x04,0x3c] + +li.s $4, 12345678910 +# CHECK: lui $4, 20535 # encoding: [0x37,0x50,0x04,0x3c] +# CHECK: ori $4, $4, 63239 # encoding: [0x07,0xf7,0x84,0x34] + +li.s $4, 12345678910.0 +# CHECK: lui $4, 20535 # encoding: [0x37,0x50,0x04,0x3c] +# CHECK: ori $4, $4, 63239 # encoding: [0x07,0xf7,0x84,0x34] + +li.s $4, 0.4 +# CHECK: lui $4, 16076 # encoding: [0xcc,0x3e,0x04,0x3c] +# CHECK: ori $4, $4, 52429 # encoding: [0xcd,0xcc,0x84,0x34] + +li.s $4, 1.5 +# CHECK: lui $4, 16320 # encoding: [0xc0,0x3f,0x04,0x3c] + +li.s $4, 12345678910.12345678910 +# CHECK: lui $4, 20535 # encoding: [0x37,0x50,0x04,0x3c] +# CHECK: ori $4, $4, 63239 # encoding: [0x07,0xf7,0x84,0x34] + +li.s $4, 12345678910123456789.12345678910 +# CHECK: lui $4, 24363 # encoding: [0x2b,0x5f,0x04,0x3c] +# CHECK: ori $4, $4, 21674 # encoding: [0xaa,0x54,0x84,0x34] + +li.s $f4, 0 +# CHECK: addiu $1, $zero, 0 # encoding: [0x00,0x00,0x01,0x24] +# CHECK: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44] + +li.s $f4, 0.0 +# CHECK: addiu $1, $zero, 0 # encoding: [0x00,0x00,0x01,0x24] +# CHECK: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44] + +li.s $f4, 1.12345 +# CHECK: .section .lit4,"aw",@progbits +# CHECK: .4byte 1066388790 +# CHECK: .text +# CHECK: lwc1 $f4, (%lit4(.lit4))-4($gp) # encoding: [0xfc'A',0xff'A',0x84,0xc7] +# CHECK: # fixup A - offset: 0, value: %lit4(.lit4), kind: fixup_Mips_LITERAL +li.s $f4, 1 +# CHECK: lui $1, 16256 # encoding: [0x80,0x3f,0x01,0x3c] +# CHECK: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44] + +li.s $f4, 1.0 +# CHECK: lui $1, 16256 # encoding: [0x80,0x3f,0x01,0x3c] +# CHECK: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44] + +li.s $f4, 12345678910 +# CHECK: .section .lit4,"aw",@progbits +# CHECK: .4byte 1345844999 +# CHECK: .text +# CHECK: lwc1 $f4, (%lit4(.lit4))-4($gp) # encoding: [0xfc'A',0xff'A',0x84,0xc7] +# CHECK: # fixup A - offset: 0, value: %lit4(.lit4), kind: fixup_Mips_LITERAL + +li.s $f4, 12345678910.0 +# CHECK: .section .lit4,"aw",@progbits +# CHECK: .4byte 1345844999 +# CHECK: .text +# CHECK: lwc1 $f4, (%lit4(.lit4))-4($gp) # encoding: [0xfc'A',0xff'A',0x84,0xc7] +# CHECK: # fixup A - offset: 0, value: %lit4(.lit4), kind: fixup_Mips_LITERAL + +li.s $f4, 0.4 +# CHECK: .section .lit4,"aw",@progbits +# CHECK: .4byte 1053609165 +# CHECK: .text +# CHECK: lwc1 $f4, (%lit4(.lit4))-4($gp) # encoding: [0xfc'A',0xff'A',0x84,0xc7] +# CHECK: # fixup A - offset: 0, value: %lit4(.lit4), kind: fixup_Mips_LITERAL + +li.s $f4, 1.5 +# CHECK: lui $1, 16320 # encoding: [0xc0,0x3f,0x01,0x3c] +# CHECK: mtc1 $1, $f4 # encoding: [0x00,0x20,0x81,0x44] + +li.s $f4, 12345678910.12345678910 +# CHECK: .section .lit4,"aw",@progbits +# CHECK: .4byte 1345844999 +# CHECK: .text +# CHECK: lwc1 $f4, (%lit4(.lit4))-4($gp) # encoding: [0xfc'A',0xff'A',0x84,0xc7] +# CHECK: # fixup A - offset: 0, value: %lit4(.lit4), kind: fixup_Mips_LITERAL + +li.s $f4, 12345678910123456789.12345678910 +# CHECK: .section .lit4,"aw",@progbits +# CHECK: .4byte 1596675242 +# CHECK: .text +# CHECK: lwc1 $f4, (%lit4(.lit4))-4($gp) # encoding: [0xfc'A',0xff'A',0x84,0xc7] +# CHECK: # fixup A - offset: 0, value: %lit4(.lit4), kind: fixup_Mips_LITERAL