[PATCH] [mips] [IAS] Add support for LAReg with identical source and destination register operands.
Toma Tabacu
toma.tabacu at imgtec.com
Thu Jun 11 09:37:32 PDT 2015
================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:1738-1739
@@ -1737,1 +1737,4 @@
+ bool UseAT = false;
+ unsigned ATReg = 0;
+ if (UseSrcReg && (DstReg == SrcReg)) {
----------------
dsanders wrote:
> There's no need for UseAT. It's equivalent to ATReg == 0
Fixed.
================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:1786
@@ -1774,3 +1785,3 @@
tmpInst.setOpcode(Mips::ORi);
- tmpInst.addOperand(MCOperand::createReg(DstReg));
+ tmpInst.addOperand(MCOperand::createReg(UseAT ? ATReg : DstReg));
tmpInst.addOperand(MCOperand::createReg(Mips::ZERO));
----------------
dsanders wrote:
> The 'UseAT ? ATReg : DstReg' is repeated a number of times. Please use a variable to represent the temporary register.
Fixed.
================
Comment at: test/MC/Mips/mips-expansions.s:153
@@ -152,1 +152,3 @@
+# CHECK: ori $8, $8, 20 # encoding: [0x14,0x00,0x08,0x35]
+# CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
----------------
dsanders wrote:
> I think this should be:
> addiu $8, $8, 20
I thought this was reported as a bug to the GAS developers and they said that they would switch to also use ORi.
Even if we decide to change it, it should be in a separate patch.
http://reviews.llvm.org/D9367
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list