[gem5-dev] Change in gem5/gem5[develop]: arch-x86: Fix the SAHF and LAHF instructions.

2022-03-14 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/55824 )


 (

10 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.

 )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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55824
Reviewed-by: Matthew Poremba 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M src/arch/x86/isa/insts/general_purpose/flags/load_and_store.py
1 file changed, 22 insertions(+), 2 deletions(-)

Approvals:
  Matthew Poremba: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




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: 12
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Bradford Beckmann 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Matt Sinclair 
Gerrit-Reviewer: Matthew Poremba 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
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

[gem5-dev] Change in gem5/gem5[develop]: arch-x86: Fix the SAHF and LAHF instructions.

2022-01-23 Thread Gabe Black (Gerrit) via gem5-dev
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 
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