For some branches, GAS accepts an immediate instead of the 2nd register operand.
We only implement this for BNE and BEQ for now. Other branch instructions can be added later, if needed.
Details
Diff Detail
Event Timeline
Replied to inline comment.
lib/Target/Mips/MipsInstrInfo.td | ||
---|---|---|
1676 ↗ | (On Diff #25476) | I'm not sure what to put here. I chose uimm5 because that's what LoadImm32 and LoadAddrImm32 use. |
lib/Target/Mips/MipsInstrInfo.td | ||
---|---|---|
1676 ↗ | (On Diff #25476) | They will need correcting too at some point. At the moment we get away with a fair bit because we don't do range checking on assembly immediates. For 32-bit immediates, you need to define a simm32 and use that. If this accepts 64-bit immediates as well then define simm64 instead. |
lib/Target/Mips/MipsInstrInfo.td | ||
---|---|---|
1676 ↗ | (On Diff #25476) | AFAICT simm32 or simm64 are not defined anywhere. Also, I forgot to add a test case in mips-expansions-bad.s for using these with 64-bit immediates on 32-bit archs. |
lib/Target/Mips/MipsInstrInfo.td | ||
---|---|---|
1676 ↗ | (On Diff #25476) |
That's correct, you'll need to define them. |
Switched to using (the already defined) imm64 in TableGen definitions.
Added test case for the 64-bit immediates on 32-bit architectures warning.
Added .set nomacro warning & test case.
Rebased.
Please review again.
lib/Target/Mips/Mips64InstrInfo.td | ||
---|---|---|
639–646 | I'm not sure why you moved this to Mips64InstrInfo.td and changed the GPR32's to GPR64's. You only needed to change uimm5 to imm64. It will LGTM with this put back in MipsInstrInfo.td and the GPR64's reverted to GPR32's. |
I'm not sure why you moved this to Mips64InstrInfo.td and changed the GPR32's to GPR64's. You only needed to change uimm5 to imm64.
It will LGTM with this put back in MipsInstrInfo.td and the GPR64's reverted to GPR32's.