Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/55503 )

Change subject: arch-x86: Use 16 bit modRM encoding if address size is 16 bit.
......................................................................

arch-x86: Use 16 bit modRM encoding if address size is 16 bit.

The modRM byte should be interpretted with 16 bit rules if the address
size is 16 bits, whether that's because the address size is that by
default, or because it was overridden. It should not be based on the
operand size in any case.

Change-Id: I8827abe1eea8905b0404f7402fb9531804d63fae
---
M src/arch/x86/decoder.cc
1 file changed, 15 insertions(+), 1 deletion(-)



diff --git a/src/arch/x86/decoder.cc b/src/arch/x86/decoder.cc
index 842e0ad..4c79872 100644
--- a/src/arch/x86/decoder.cc
+++ b/src/arch/x86/decoder.cc
@@ -515,7 +515,7 @@
     State nextState = ErrorState;
     ModRM modRM = nextByte;
     DPRINTF(Decoder, "Found modrm byte %#x.\n", nextByte);
-    if (defOp == 1) {
+    if (emi.addrSize == 2) {
         // Figure out 16 bit displacement size.
         if ((modRM.mod == 0 && modRM.rm == 6) || modRM.mod == 2)
             displacementSize = 2;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55503
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: I8827abe1eea8905b0404f7402fb9531804d63fae
Gerrit-Change-Number: 55503
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to