-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arm thumb: addw
identified as add
#1630
Comments
There is a very similar issue, I think, with |
In this particular case, since the $ echo "addw r0, pc, #0x2a" | llvm-mc --assemble --show-encoding --show-inst-operands --show-inst --triple thumbv8
.text
<stdin>:1:1: note: parsed instruction: ['addw', <ARMCC::al>, <register r0>, <register pc>, 42]
addw r0, pc, #0x2a
^
addw r0, pc, #42 @ encoding: [0x0f,0xf2,0x2a,0x00]
@ <MCInst #3747 t2ADDri12
@ <MCOperand Reg:72>
@ <MCOperand Reg:14>
@ <MCOperand Imm:42>
@ <MCOperand Imm:14>
@ <MCOperand Reg:0>>
$ echo "0x0f 0xf2 0x2a 0x00" | llvm-mc --disassemble --show-encoding --show-inst-operands --show-inst --triple thumbv8
.text
adr.w r0, #42 @ encoding: [0x0f,0xf2,0x2a,0x00]
@ <MCInst #3752 t2ADR
@ <MCOperand Reg:72>
@ <MCOperand Imm:42>
@ <MCOperand Imm:14>
@ <MCOperand Reg:0>>
$ echo "adr.w r0, #42" | llvm-mc --assemble --show-encoding --show-inst-operands --show-inst --triple thumbv8
.text
<stdin>:1:1: note: parsed instruction: ['adr', <ARMCC::al>, '.w', <register r0>, 42]
adr.w r0, #42
^
adr.w r0, #42 @ encoding: [0x0f,0xf2,0x2a,0x00]
@ <MCInst #3752 t2ADR
@ <MCOperand Reg:72>
@ <MCOperand Imm:42>
@ <MCOperand Imm:14>
@ <MCOperand Reg:0>> LLVM-10
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0041c/Babcjaii.html |
This answer comes a little late but: LLVM groups together several The Capstone mappings (LLVM instructions to its Capstone representation) are simplified in a way. Don't ask me why, but If it is still relevant to you, please take a look at the LLVM code (https://github.com/llvm/llvm-project/blob/fa95f20f98c8dfd4d35590a724eb0eb7df64146a/llvm/utils/TableGen/AsmMatcherEmitter.cpp#L7-L96). |
On next branch (f7efa08),
addw
has an ID to that ofADD
, but it should be its own ID, since there is a comment indicating a difference https://github.com/aquynh/capstone/blob/f7efa08ecaacf9adfbef7c8bd85b02b256a66adc/arch/ARM/ARMMappingInsnName.inc#L6-L7I also don't see any entries related to
addw
(ARM_INS_ADDW
) in https://github.com/aquynh/capstone/blob/f7efa08ecaacf9adfbef7c8bd85b02b256a66adc/arch/ARM/ARMMappingInsn.incThe text was updated successfully, but these errors were encountered: