Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/55824 )
Change subject: arch-x86: Fix the SAHF and LAHF instructions.
......................................................................
arch-x86: Fix the SAHF and LAHF instructions.
These had been transposed with each other, and had other problems having
to do with data truncation and old bits leaking through into other
registers.
Change-Id: Ib46eaa201d4b8273a683ebcb0060e8d49c447d96
---
M src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
b/src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
index 76f81c1..31723b3 100644
--- a/src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
+++ b/src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
@@ -35,10 +35,13 @@
microcode = '''
def macroop SAHF {
- ruflags ah, dataSize=1
+ ruflags t1, dataSize=8
+ mov t1, t1, ah, dataSize=1
+ wruflags t1, t0, dataSize=8
};
def macroop LAHF {
- wruflags ah, t0, dataSize=1
+ rflags t1, dataSize=8
+ andi ah, t1, "CFBit | PFBit | AFBit | ZFBit | SFBit | (1 << 1)",
dataSize=1
};
'''
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55824
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib46eaa201d4b8273a683ebcb0060e8d49c447d96
Gerrit-Change-Number: 55824
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s