- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the gnu assembler with intel syntax for the MIC and I am encountering a bug in its store addressing.
I want to move an interger from the FPU to the eax register and I am doing it by the following sequence of source:
sub rsp,8
fistp dword ptr [rsp]
mov eax,dword [rsp]
add rsp,8
I move the rsp in increments of 8 to ensure that alignment is maintained for the stack. The code assembles ok
The code that is generated by the assembler can be seen by gdb on the MIC
0x0000000000401037 <+65>: sub $0x8,%rsp
0x000000000040103b <+69>: fistpl (%rsp)
=> 0x000000000040103e <+72>: mov 0x4(%rsp),%eax
0x0000000000401042 <+76>: add $0x8,%rsp
it is now loading the eax register 4 on from the rsp
I was able to fix this by changing the source to
sub rsp,8
fistp dword ptr [rsp]
mov eax,dword ptr [rsp]
add rsp,8
but the assembler should either flag the absence of 'ptr' as an error or it should assemble it correctly.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul,
Apologies for taking so long to answer this issue, but it got lost. This case is unrelated to the coprocessor. You can report the bug at www.sourceware.org/bugzilla. By the way, our expert doesn't think this is a bug and is done intentionally.
Regards
--
Taylor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page