From 4a46af845f6753b33d7c943ae4cc1f945b5ea211 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Sat, 12 Oct 2019 07:42:44 +0000 Subject: [PATCH] [mips] Fix `loadImmediate` calls when load non-address values. llvm-svn: 374640 --- llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 10 +++++----- llvm/test/MC/Mips/macro-li.d.s | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 86f5018..5ce8694 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -3324,7 +3324,7 @@ bool MipsAsmParser::expandLoadSingleImmToGPR(MCInst &Inst, SMLoc IDLoc, uint32_t ImmOp32 = covertDoubleImmToSingleImm(convertIntToDoubleImm(ImmOp64)); - return loadImmediate(ImmOp32, FirstReg, Mips::NoRegister, true, true, IDLoc, + return loadImmediate(ImmOp32, FirstReg, Mips::NoRegister, true, false, IDLoc, Out, STI); } @@ -3397,15 +3397,15 @@ bool MipsAsmParser::expandLoadDoubleImmToGPR(MCInst &Inst, SMLoc IDLoc, if (Lo_32(ImmOp64) == 0) { if (isABI_N32() || isABI_N64()) { - if (loadImmediate(ImmOp64, FirstReg, Mips::NoRegister, false, true, IDLoc, - Out, STI)) + if (loadImmediate(ImmOp64, FirstReg, Mips::NoRegister, false, false, + IDLoc, Out, STI)) return true; } else { - if (loadImmediate(Hi_32(ImmOp64), FirstReg, Mips::NoRegister, true, true, + if (loadImmediate(Hi_32(ImmOp64), FirstReg, Mips::NoRegister, true, false, IDLoc, Out, STI)) return true; - if (loadImmediate(0, nextReg(FirstReg), Mips::NoRegister, true, true, + if (loadImmediate(0, nextReg(FirstReg), Mips::NoRegister, true, false, IDLoc, Out, STI)) return true; } diff --git a/llvm/test/MC/Mips/macro-li.d.s b/llvm/test/MC/Mips/macro-li.d.s index 20cc88e..fae5b3d 100644 --- a/llvm/test/MC/Mips/macro-li.d.s +++ b/llvm/test/MC/Mips/macro-li.d.s @@ -9,12 +9,12 @@ li.d $4, 0 # O32: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] # O32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] -# N32-N64: daddiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x64] +# N32-N64: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] li.d $4, 0.0 # O32: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] # O32: addiu $5, $zero, 0 # encoding: [0x00,0x00,0x05,0x24] -# N32-N64: daddiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x64] +# N32-N64: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] li.d $4, 1.12345 # ALL: .section .rodata,"a",@progbits -- 2.7.4