Alignment should account for long instruction names
See original GitHub issueUsually, the assembly output is aligned using spaces on the first argument, e.g.:
mov rcx, qword ptr [r8 + rax + 32]
imul rcx, qword ptr [rdx + rax + 32]
add rcx, qword ptr [rsi + rax + 32]
However, when the compilers generate instructions with very long names, the alignment is not pushed rightwards to accommodate for these, and we get, for example:
vmovsd xmm0, qword ptr [rdx + rax + 32] # xmm0 = mem[0],zero
vmovsd xmm1, qword ptr [rcx + rax + 32] # xmm1 = mem[0],zero
vfmadd213sd xmm1, xmm0, qword ptr [rsi + rax + 32]
vmovsd qword ptr [rdi + rax + 32], xmm1
which is kind of ugly and less readable. Now, assuming the user has not enabled \s+
, I believe the arguments should be aligned by ensuring there’s enough space.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Align Assessments, Objectives, Instructional Strategies
Why should assessments, learning objectives, and instructional strategies be aligned? ... Assessments should reveal how well students have learned what we want ...
Read more >Data structure alignment
Data structure alignment is the way data is arranged and accessed in computer memory. It consists of three separate but related issues: data...
Read more >Structure Member Alignment, Padding and Data Packing
Data Alignment: Every data type in C/C++ will have alignment requirement (infact it is mandated by processor architecture, not by language). A ...
Read more >Assembly - Do instructions have to be aligned even in ...
Instructions always need to be word aligned for addressing reasons. Therefore, instructions that are half, quarter, double or triple the actual ...
Read more >Alignment Requirement - an overview | ScienceDirect Topics
There are three types of alignment requirements, which are given as follows: •. transmitter alignment. •. receiver alignment. •. receiver-to-transmitter ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree it’d be lovely to fix this. GCC and clang only put a single tab between instructions and their operands, which means as soon as an instruction is 8 or more characters long, the indent doesn’t work. We can of course parse the instructions, and re-flow them, but then all instructions would be super-indented to account for a single very long instructions. I think this is why the compilers stick to a single tab character, instead of using two or more. I guess we could treat tabs as being (say) 12 characters long which I think covers all current x86 instructions…
Thanks for taking the time to check this issue, let us know if you find any other problem where we can help 😃