-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
hex number format in .net 7 jit assembly #81329
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
.net 6: using decimal recognized by masm, clang, gcc, nasm, ptx etc. and their users .intel_syntax noprefix
x:
mov [rsp+16], rdi
mov rdi, [rsp+9] .net 7: using hex with h suffix (instead of 0x prefix) recognized only by masm and its users .intel_syntax noprefix
x:
mov [rsp+10H], rdi
mov rdi, [rsp+09H] |
Overall JitDisam is not a real asm code, e.g. it contains pseudo instructions like cc @BruceForstall on hex formatting |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue Detailsjitdisasm in .net 7 is printing h suffix for hex numbers. h suffix may be allowed by intel assembly spec and normal for microsoft assemblers, but clang/gcc don't support it. it's unfamiliar to users and their disassemblers (which don't print h suffix) and their assemblers (which don't recognize the h suffix). please replace
|
Correct. This was changed in .NET 7 in #73816 to ease the search of given address offset displayed in local variables table. |
#73816 (comment) |
@BruceForstall feedback about reverting to well known 0x prefix was from the user when i enabled dotnet daily build on https://godbolt.org public website (compiler-explorer/compiler-workflows@226373d). this feedback echoes your comment: #73816 (comment). i think it should be changed |
Agree. I will revert the format of disassembly, and instead make changes in local variables table to make search easier. |
I was looking into this and the original change done in xarch was to make it consistent regardless of how much is the displacement. Prior to my change, it was showing a mixed of decimal and hexadecimal and some of them also included runtime/src/coreclr/jit/emitxarch.cpp Lines 10311 to 10326 in c240ade
This makes me feel that we should retain the original change or update all the above references to eliminate |
There is no "official" format for x86 assembly and what exactly is supported can differ based on assembler. That being said, most assemblers support |
Thanks @tannergooding . A follow-up question, do they distinguish between displaying the address that is less than |
There isn't really a standard there either and which is "better" depends on context. If you're doing something like "field offsets" then decimal may be better. If you're doing arbitrary addresses or displacements, then hex may be better. The same goes for practically any immediate value. For |
@jakobbotsch - can you please take a look? |
@kunalspathak What is the work item here? To update the places in the xarch backend where we print hex numbers with "H" suffix to instead print with "0x" prefix? |
jitdisasm in .net 7 is printing h suffix for hex numbers. h suffix may be allowed by intel assembly spec and normal for microsoft assemblers, but clang/gcc don't support it. it's unfamiliar to users and their disassemblers (which don't print h suffix) and their assemblers (which don't recognize the h suffix). please replace
%02XH
with0x%02x
or keep it readable decimal as it was before .net 7.The text was updated successfully, but these errors were encountered: