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
arch-x86: bug in movss instruction #893
Comments
@Nils-TUD, your proposed change sounds good. Please feel free to submit that change to the gem5 repo. Thank you. |
@Nils-TUD, this is a friendly reminder to create a PR with your proposed change. Thanks. |
Thanks for the reminder! I still have that on my todo list, but have to find the time. That might still take a few weeks, I'm afraid. |
Hello, my name is Emily and I’m working with my partner Lukas on a final project for our Virtualization class. We are Computer Science at the University of Texas at Austin and currently enrolled in CS360V Virtualization, taught by Dr. Chidambaram (VJ). As part of our coursework, we are required to contribute to a few issues within an open-source repository relevant to the class. After reviewing the gem5 repository, we believe that this particular issue aligns well with our objectives and skill set and were wondering if we may be assigned to this issue. If that's possible, before proceeding, we wanted to ask if there are any additional details or considerations regarding this issue that we should be aware of. We are committed to completing all three issues by May 6th to the best of our abilities. Thank you for considering our request, |
That's more than fine from my side! :) Thanks a lot! I haven't looked deeper into this issue and therefore don't have more information than already given above. |
Describe the bug
According to c9x.me the
movss
instruction (F3 0F 10) copies the lowest 32-bit of one XMM register to the lowest 32-bit of another XMM register. However, gem5 copies to lower 64-bit, producing wrong results.Affects version
Current stable version (v23.1)
gem5 Modifications
None
To Reproduce
Let's consider the following program in
test.S
:Build it:
Run it on gem5:
Terminal Output
The relevant part of
log.txt
is:Expected behavior
According to the spec, the result in
$xmm0
should be0x1122334412345678
instead of0x12345678
. And that's also what I get when running it natively via$ gdb ./test
:Host Operating System
Ubuntu 22.04
Host ISA
x86-64
Compiler used
gcc 11.4.0
Additional information
The current implementation of
movss
looks like this:I think the fix should be to make
movfp
only access the lower 32-bit of both XMM register. However, AFAICS there is currently no infrastructure to access the lower 32-bit part of an XMM register (onlyxmml
andxmmh
for the lower and higher 64-bit, respectively). Am I missing something or is the way to go here adding a new symbol likexmmll
or so and a corresponding accessor function tofloat_reg
?The text was updated successfully, but these errors were encountered: