summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py')
-rw-r--r--src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py b/src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py
index dbb6c34c4..87e9ef03a 100644
--- a/src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py
+++ b/src/arch/x86/isa/insts/general_purpose/flags/push_and_pop.py
@@ -53,18 +53,22 @@
#
# Authors: Gabe Black
-microcode = ""
-#let {{
-# class POPF(Inst):
-# "GenFault ${new UnimpInstFault}"
-# class POPFD(Inst):
-# "GenFault ${new UnimpInstFault}"
-# class POPFQ(Inst):
-# "GenFault ${new UnimpInstFault}"
-# class PUSHF(Inst):
-# "GenFault ${new UnimpInstFault}"
-# class PUSHFD(Inst):
-# "GenFault ${new UnimpInstFault}"
-# class pushfq(Inst):
-# "GenFault ${new UnimpInstFault}"
-#}};
+microcode = '''
+def macroop PUSHF {
+ .adjust_env oszIn64Override
+
+ # This should really read the whole flags register, not just user flags.
+ ruflags t1
+ st t1, ss, [1, t0, rsp], "-env.dataSize"
+ subi rsp, rsp, dsz
+};
+
+def macroop POPF {
+ .adjust_env oszIn64Override
+
+ ld t1, ss, [1, t0, rsp]
+ addi rsp, rsp, dsz
+ # This should really write the whole flags register, not just user flags.
+ wruflags t1, t0
+};
+'''