-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix #16433 - Use MOV opcode B8+ for MOV r64, <0x80000000 to 0xffffffff> #16572
Conversation
Please resolve the conflict, the tests has been moved to test/db |
libr/asm/p/asm_x86_nz.c
Outdated
((!(op->operands[0].type & OT_QWORD) && (op->operands[1].type & OT_QWORD) && | ||
immediate < UT32_MAX) || | ||
((op->operands[0].type & OT_QWORD) && | ||
(immediate <= ST32_MAX || immediate >= 0xffffffff80000000 /* -0x80000000 */)))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use LL suffix on those 64bit numbers, some compilers may complain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the test pls
…0xffffffff> radareorg#16572 ##asm Detailed description I've confirmed radareorg#16433 (comment) (including the nasm rax -> eax bug) and thus this pr makes the x86_64 assembler use the MOV B8+ encoding (MOV r64, imm64) when the immediate is between 0x80000000 and 0xffffffff for both: Consistency with GNU assembler. It actually does seem to be the expected encoding. This does mean that mov eax, 0xffffffff and mov rax, 0xffffffff will have very different semantics.
i did it |
thanks! |
…0xffffffff> radareorg#16572 ##asm Detailed description I've confirmed radareorg#16433 (comment) (including the nasm rax -> eax bug) and thus this pr makes the x86_64 assembler use the MOV B8+ encoding (MOV r64, imm64) when the immediate is between 0x80000000 and 0xffffffff for both: Consistency with GNU assembler. It actually does seem to be the expected encoding. This does mean that mov eax, 0xffffffff and mov rax, 0xffffffff will have very different semantics.
Your checklist for this pull request
Detailed description
I've confirmed #16433 (comment) (including the nasm
rax
->eax
bug) and thus this pr makes the x86_64 assembler use the MOV B8+ encoding (MOV r64, imm64) when the immediate is between 0x80000000 and 0xffffffff for both:This does mean that
mov eax, 0xffffffff
andmov rax, 0xffffffff
will have very different semantics.Test plan
GitHub Actions and AppVeyor are green.
Closing issues
Closes #16433.