[ARM32] Display wrong register number for double registers
For ARM32, double register number is not shown correctly in JitDump, JitDisasm and etc.
-
An example from coreclr unit test.
$ COMPlus_JitDisasm=DblAdd COMPlus_JitDump=DblAdd ./corerun tests/JIT/CodeGenBringUpTests/DblAdd/DblAdd.exe ...(omitted)... IN0001: 000006 EE30 0B01 vadd d0, d0, d2 ...(omitted)... IN0001: 000006 vadd d0, d0, d2However above instruction encoding
EE30 0B01meansvadd d0, d0, d1. -
Another example from recent PR for ryujit/arm32. I was confused with below example (https://github.com/dotnet/coreclr/pull/11643#issuecomment-301755496) in the PR.
IN0074: 000180 EEB8 4BC4 vcvt.i2d d8, s8This encoding
EEB8 4BC4meansvcvt.i2d d4, s8, i.e. single-float register number is correct, but double register number is incorrectly displayed.
Both LegacyJIT and RyuJIT have same problem.
category:implementation theme:debug-dumps skill-level:intermediate cost:medium
My appologies, I moved the wrong bug by accident, reopening ...
It seems to be not a trivial job to make it print out double registers for ARM32 correctly, because there are different paths to get a name of ARM32 double registers.
- COMPlus_JitDump
- Each phase use different method to print out register name.
- COMPlus_JitDisasm
For example, each phase of JIT compiler use different way to print out double registers, i.e. calling getRegNameFloat(), getRegName(), compRegVarName(), emitRegName() and etc.
In addition, I've a concern that if I changed this, then it will introduce a lot of differences in jit-diff for ARM32 codegen.
Do you have any idea ?
I think for arm32 legacy_backend, we just lived with it, since while it is confusing, once you understand it, there is no ambiguity. It would be nice to fix it, though.
I've a concern that if I changed this, then it will introduce a lot of differences in jit-diff for ARM32 codegen.
That is true, but would be a one-time, temporary thing.
I think for arm32 legacy_backend, we just lived with it, since while it is confusing, once you understand it, there is no ambiguity.
Right, if we are aware of it, there is no problem.
Because there are other urgent issues in ryujit/arm32, I'm going to leave it as future task and just notify it to other arm32 contributors.
@dotnet/arm32-contrib Please be aware that double register number in JitDump and JitDisam is not correct for ARM32 in both LegacyJIT and RyuJIT.
Since this isn't required to ship RyuJIT/ARM32, I'm removing it from the RyuJIT/ARM32 project.
@BruceForstall seems like this should be moved to Future...?
Yes. Done.
I can confirm the problem still exists.
; Method getChars.MyXMLNodeWriter:DblAdd(double,double):double
G_M34776_IG01: ;; offset=0000H
000000 E92D 4800 push {r11,lr}
000004 46EB mov r11, sp
;; size=6 bbWeight=1 PerfScore 2.00
G_M34776_IG02: ;; offset=0006H
000006 EE30 0B01 vadd d0, d0, d2
;; size=4 bbWeight=1 PerfScore 1.00
G_M34776_IG03: ;; offset=000AH
00000A E8BD 8800 pop {r11,pc}
;; size=4 bbWeight=1 PerfScore 1.00
; Total bytes of code: 14