|
From: <sv...@va...> - 2011-08-19 16:11:40
|
Author: tom
Date: 2011-08-19 17:06:52 +0100 (Fri, 19 Aug 2011)
New Revision: 2196
Log:
Support alternate (C0 /6) encoding of SHL on x86 and amd64. Fixes #209995.
Modified:
trunk/priv/guest_amd64_toIR.c
trunk/priv/guest_x86_toIR.c
Modified: trunk/priv/guest_amd64_toIR.c
===================================================================
--- trunk/priv/guest_amd64_toIR.c 2011-08-19 02:58:51 UTC (rev 2195)
+++ trunk/priv/guest_amd64_toIR.c 2011-08-19 16:06:52 UTC (rev 2196)
@@ -3278,7 +3278,7 @@
}
isShift = False;
- switch (gregLO3ofRM(modrm)) { case 4: case 5: case 7: isShift = True; }
+ switch (gregLO3ofRM(modrm)) { case 4: case 5: case 6: case 7: isShift = True; }
isRotate = False;
switch (gregLO3ofRM(modrm)) { case 0: case 1: isRotate = True; }
@@ -3286,11 +3286,6 @@
isRotateC = False;
switch (gregLO3ofRM(modrm)) { case 2: case 3: isRotateC = True; }
- if (gregLO3ofRM(modrm) == 6) {
- *decode_OK = False;
- return delta;
- }
-
if (!isShift && !isRotate && !isRotateC) {
/*NOTREACHED*/
vpanic("dis_Grp2(Reg): unhandled case(amd64)");
@@ -3365,6 +3360,7 @@
switch (gregLO3ofRM(modrm)) {
case 4: op64 = Iop_Shl64; break;
case 5: op64 = Iop_Shr64; break;
+ case 6: op64 = Iop_Shl64; break;
case 7: op64 = Iop_Sar64; break;
/*NOTREACHED*/
default: vpanic("dis_Grp2:shift"); break;
Modified: trunk/priv/guest_x86_toIR.c
===================================================================
--- trunk/priv/guest_x86_toIR.c 2011-08-19 02:58:51 UTC (rev 2195)
+++ trunk/priv/guest_x86_toIR.c 2011-08-19 16:06:52 UTC (rev 2196)
@@ -2392,7 +2392,7 @@
}
isShift = False;
- switch (gregOfRM(modrm)) { case 4: case 5: case 7: isShift = True; }
+ switch (gregOfRM(modrm)) { case 4: case 5: case 6: case 7: isShift = True; }
isRotate = False;
switch (gregOfRM(modrm)) { case 0: case 1: isRotate = True; }
@@ -2400,11 +2400,6 @@
isRotateC = False;
switch (gregOfRM(modrm)) { case 2: case 3: isRotateC = True; }
- if (gregOfRM(modrm) == 6) {
- *decode_OK = False;
- return delta;
- }
-
if (!isShift && !isRotate && !isRotateC) {
/*NOTREACHED*/
vpanic("dis_Grp2(Reg): unhandled case(x86)");
@@ -2449,6 +2444,7 @@
switch (gregOfRM(modrm)) {
case 4: op32 = Iop_Shl32; break;
case 5: op32 = Iop_Shr32; break;
+ case 6: op32 = Iop_Shl32; break;
case 7: op32 = Iop_Sar32; break;
/*NOTREACHED*/
default: vpanic("dis_Grp2:shift"); break;
|