Skip to content
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

thumb_load_store_single_reg_imm12_32 caculate wrong instruction whem imm12 is less than 0x40 #35

Closed
sundalin0512 opened this issue Feb 19, 2019 · 4 comments

Comments

@sundalin0512
Copy link

if imm12 < 0x40,
the instruction generated by thumb_load_store_single_reg_imm12_32 is ldr Rt, [Rn, Rm, LSL imm],
rather than ldr Rt, [Rn, imm]

such as
if we want to generate ldr R1, [R1],
but actually ldr R1, [R1, R0] generated.

@lgeek
Copy link
Member

lgeek commented Feb 19, 2019

Hi. Could you show me how you're calling thumb_load_store_single_reg_imm12_32? In any case, you probably should use thumb_ldrwi32() instead.

@sundalin0512
Copy link
Author

In my case, the instruction is ldr.w r1, [pc, #-80], the opcode is f85f 1050,
generated ldr R1, [R1, R0], but shoule be ldr R1, [R1].
But for ldr.w r1, [pc, #936], opcode is f8df 13a8, the generated instruction is correct.

@sundalin0512
Copy link
Author

When upwards == 0 && imm < 0x40, this function generates ldr Rt, [Rn, Rm, LSL imm];
When upwards == 0 && imm >= 0x40 && imm < 0x800, this function generates illegal instruction.

@IgWod
Copy link
Collaborator

IgWod commented Feb 7, 2024

Since it's an old issue and I have no way of testing it at the moment, I'm going to close it in the effort to clean up the repo. If anyone still requires this fix, please re-open the issue and I can look into it.

@IgWod IgWod closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants