Displaying 3 results from an estimated 3 matches for "taddi8".
2019 Apr 14
2
[A bug?] Failed to use BuildMI to add R7 - R12 registers for tADDi8 and tPUSH of ARM
...mb.td but couldn’t find it.
Thanks,
- Jie
On Apr 14, 2019, at 15:28, Craig Topper <craig.topper at gmail.com<mailto:craig.topper at gmail.com>> wrote:
I believe there is probably a separate instruction in LLVM for thumb2 add. Probably starting with t2 instead of t.
The definition of tADDi8 looks like this. Where tGPR specifically means R0-R7.
def tADDi8 : // A8.6.4 T2
T1sItGenEncodeImm<{1,1,0,?,?}, (outs tGPR:$Rdn),
(ins tGPR:$Rn, imm0_255:$imm8), IIC_iALUi,
"add", "\t$Rdn, $imm8",...
2019 Apr 14
2
[A bug?] Failed to use BuildMI to add R7 - R12 registers for tADDi8 and tPUSH of ARM
...e them arbitrarily. The fact that we can use it to generate mov instructions but
not add/sub and push/pop confuses me.
- Jie
On Apr 14, 2019, at 14:55, Craig Topper <craig.topper at gmail.com<mailto:craig.topper at gmail.com>> wrote:
I don't know much about ARM. But it looks like tADDi8 is a Thumb instruction and it can only use R0-R7.
tPUSH probably as a similar issue. But it's also a store instruction and doesn't produce a register output. So you should use the form of BuildMI that doesn't take a register as its last argument.
~Craig
On Sun, Apr 14, 2019 at 11:17...
2019 Apr 14
3
[A bug?] Failed to use BuildMI to add R7 - R12 registers for tADDi8 and tPUSH of ARM
Hi all,
I’m trying to insert some add/sub and push/pop instructions in a MachineFunction pass for ARMv7-M. However, I encountered something weird.
For an add, when I use
BuildMI(….., TII->get(ARM::tADDi8), reg).addReg(reg).addReg(reg).addImm(imm).
if reg is R0 - R7, everything is fine: I would get something like
adds r1, 4
But if I use R8 - R12 as the reg in the BuildMI, I wouldn’t get the correct register in the assembly code. For example, when I pass R8 to it, I would get
adds r0, 4
rathe...