Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/6603

Change subject: x86: Use operand size 4 when it would be 2 for cmpxchg8b.
......................................................................

x86: Use operand size 4 when it would be 2 for cmpxchg8b.

This means the instruction is treated as cmpxchg8b when the effective
operand size is 16 bits.

Change-Id: I4d9bb295f96097e1746a9bbccb2c579d14738fab
---
M src/arch/x86/isa/insts/general_purpose/semaphores.py
M src/arch/x86/isa/microasm.isa
2 files changed, 6 insertions(+), 0 deletions(-)



diff --git a/src/arch/x86/isa/insts/general_purpose/semaphores.py b/src/arch/x86/isa/insts/general_purpose/semaphores.py
index 9f751b3..bb46c42 100644
--- a/src/arch/x86/isa/insts/general_purpose/semaphores.py
+++ b/src/arch/x86/isa/insts/general_purpose/semaphores.py
@@ -132,6 +132,7 @@
 # of dataSize.
 cmpxchg8bCode = '''
 def macroop CMPXCHG8B_%(suffix)s {
+    .adjust_env clampOsz
     %(rdip)s
     lea t1, seg, %(sib)s, disp, dataSize=asz
     ldsplit%(l)s (t2, t3), seg, [1, t0, t1], disp=0
diff --git a/src/arch/x86/isa/microasm.isa b/src/arch/x86/isa/microasm.isa
index 3ceaf9b..2ee2750 100644
--- a/src/arch/x86/isa/microasm.isa
+++ b/src/arch/x86/isa/microasm.isa
@@ -180,6 +180,11 @@
         env.dataSize = 4;
     '''

+    assembler.symbols["clampOsz"] = '''
+    if (env.dataSize == 2)
+        env.dataSize = 4;
+    '''
+
     def trimImm(width):
         return "adjustedImm = adjustedImm & mask(%s);" % width


--
To view, visit https://gem5-review.googlesource.com/6603
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d9bb295f96097e1746a9bbccb2c579d14738fab
Gerrit-Change-Number: 6603
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to