1

Why doesn't rax get loaded from xmm0 here? radare2 bug?

GitHub issue `movq rax, xmm0` doesn't work in native debugger filed.

[0x0003b0e0]> drr
role reg    value            ref
――――――――――――――――――――――――――――――――
SN   rax    0                 0 R 0x3010102464c457f
     rbx    0                 0 R 0x3010102464c457f
A3   rcx    0                 0 R 0x3010102464c457f
A2   rdx    7ff0000000000000 
A1   rsi    0                 0 R 0x3010102464c457f
A0   rdi    0                 0 R 0x3010102464c457f
A4   r8     0                 0 R 0x3010102464c457f
A5   r9     0                 0 R 0x3010102464c457f
A6   r10    0                 0 R 0x3010102464c457f
A7   r11    0                 0 R 0x3010102464c457f
     r12    0                 0 R 0x3010102464c457f
     r13    0                 0 R 0x3010102464c457f
     r14    0                 0 R 0x3010102464c457f
     r15    0                 0 R 0x3010102464c457f
PC   rip    3b0ee             241902 (.text) sym.finite R X 'movq rax, xmm0'
BP   rbp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
     rflags 0                 0 R 0x3010102464c457f
SP   rsp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
[0x0003b0e0]> dr xmm0
0xaaaaaaaaaaaaaaaa5555555555555555
[0x0003b0e0]> ds
[0x0003b0e0]> drr
role reg    value            ref
――――――――――――――――――――――――――――――――
SN   rax    8000000000000000 
     rbx    0                 0 R 0x3010102464c457f
A3   rcx    0                 0 R 0x3010102464c457f
A2   rdx    7ff0000000000000 
A1   rsi    0                 0 R 0x3010102464c457f
A0   rdi    0                 0 R 0x3010102464c457f
A4   r8     0                 0 R 0x3010102464c457f
A5   r9     0                 0 R 0x3010102464c457f
A6   r10    0                 0 R 0x3010102464c457f
A7   r11    0                 0 R 0x3010102464c457f
     r12    0                 0 R 0x3010102464c457f
     r13    0                 0 R 0x3010102464c457f
     r14    0                 0 R 0x3010102464c457f
     r15    0                 0 R 0x3010102464c457f
PC   rip    3b0f3             241907 (.text) sym.finite R X 'and rax, rdx'
BP   rbp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
     rflags 0                 0 R 0x3010102464c457f
SP   rsp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
[0x0003b0e0]> 
  • can you share the binary? – Paweł Łukasik May 2 at 20:26
  • @PawełŁukasik It's the finite function in /lib64/libm-2.28.so. – rickhg12hs May 2 at 20:32
  • 2
    Please add an answer with the resolution. – Igor Skochinsky May 6 at 12:48
  • @IgorSkochinsky Done! I'll wait a day to accept it in case somebody else writes a better answer. – rickhg12hs May 6 at 14:21
1

Is movq rax, xmm0 buggy in Radare2?

No, it's just not fully implemented in all debuggers yet.

Native Debugger Works!

This instruction works fine using the native debugger. The native debugger is launched with r2 -d yourFileGoesHere. Alternatively, if you are already in r2 looking at the file, but r2 wasn't launched with the -d switch, the file can be reopened in debug mode with the r2 command ood (o_pen o_penned file with the d_ebugger ?).

ESIL Emulator doesn't fully support SIMD yet.

See Github issues #4327 and #11421

The "bug" noted in the question was actually demonstrating that the ESIL Emulator doesn't fully support the xmm0 register yet.

Summary

The native debugger accurately executes the movq rax, xmm0 instruction. The ESIL Emulator does not accurately emulate the movq rax, xmm0 instruction yet.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.