]> granicus.if.org Git - yasm/commitdiff
Fix handling of svdc, rsdc, wrshr, and rdshr Cyrix opcodes.
authorPeter Johnson <peter@tortall.net>
Sat, 28 Oct 2006 18:44:21 +0000 (18:44 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 28 Oct 2006 18:44:21 +0000 (18:44 -0000)
Reported by: Danny Reeves <danny_reeves@hotmail.com>

svn path=/trunk/yasm/; revision=1667

modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/cyrix.asm [new file with mode: 0644]
modules/arch/x86/tests/cyrix.hex [new file with mode: 0644]
modules/arch/x86/x86id.c
modules/arch/x86/x86parse.gap

index cf3be932005d9b7fda436071787a7fc43f903127..f0933824d2f65c041aaff99152049af9863e3a43 100644 (file)
@@ -22,6 +22,8 @@ EXTRA_DIST += modules/arch/x86/tests/cmpxchg.asm
 EXTRA_DIST += modules/arch/x86/tests/cmpxchg.hex
 EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.asm
 EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.errwarn
+EXTRA_DIST += modules/arch/x86/tests/cyrix.asm
+EXTRA_DIST += modules/arch/x86/tests/cyrix.hex
 EXTRA_DIST += modules/arch/x86/tests/div-err.asm
 EXTRA_DIST += modules/arch/x86/tests/div-err.errwarn
 EXTRA_DIST += modules/arch/x86/tests/ea-nonzero.asm
diff --git a/modules/arch/x86/tests/cyrix.asm b/modules/arch/x86/tests/cyrix.asm
new file mode 100644 (file)
index 0000000..44ced81
--- /dev/null
@@ -0,0 +1,17 @@
+[bits 32]
+        svdc    tword [2*eax+esi+12345678h],cs
+        svdc    tword [2*eax+esi+12345678h],ds
+        svdc    [2*eax+esi+12345678h],es
+
+        rsdc    cs,tword [2*eax+esi+12345678h]
+        rsdc    ds,tword [2*eax+esi+12345678h]
+        rsdc    es,[2*eax+esi+12345678h]
+
+        wrshr   eax
+        wrshr   dword [4*edx+esi+12345678h]
+        wrshr   [4*edx+esi+12345678h]
+
+        rdshr   eax
+        rdshr   dword [4*edx+esi+12345678h]
+        rdshr   [4*edx+esi+12345678h]
+
diff --git a/modules/arch/x86/tests/cyrix.hex b/modules/arch/x86/tests/cyrix.hex
new file mode 100644 (file)
index 0000000..1d1c07a
--- /dev/null
@@ -0,0 +1,86 @@
+0f 
+78 
+8c 
+46 
+78 
+56 
+34 
+12 
+0f 
+78 
+9c 
+46 
+78 
+56 
+34 
+12 
+0f 
+78 
+84 
+46 
+78 
+56 
+34 
+12 
+0f 
+79 
+8c 
+46 
+78 
+56 
+34 
+12 
+0f 
+79 
+9c 
+46 
+78 
+56 
+34 
+12 
+0f 
+79 
+84 
+46 
+78 
+56 
+34 
+12 
+0f 
+37 
+c0 
+0f 
+37 
+84 
+96 
+78 
+56 
+34 
+12 
+0f 
+37 
+84 
+96 
+78 
+56 
+34 
+12 
+0f 
+36 
+c0 
+0f 
+36 
+84 
+96 
+78 
+56 
+34 
+12 
+0f 
+36 
+84 
+96 
+78 
+56 
+34 
+12 
index b9aba1c93d1f0f269f3222334e58a16f2d599af9..3482fdaaf33bc07f896a60791ec280d66d3d0c98 100644 (file)
@@ -2055,9 +2055,14 @@ static const x86_insn_info pmachriw_insn[] = {
 };
 
 /* Cyrix extensions */
+static const x86_insn_info rdwrshr_insn[] = {
+    { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x36, 0}, 0, 1,
+      {OPT_RM|OPS_32|OPS_Relaxed|OPA_EA, 0} }
+};
 static const x86_insn_info rsdc_insn[] = {
     { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x79, 0}, 0, 2,
-      {OPT_SegReg|OPS_16|OPA_Spare, OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0} }
+      {OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare,
+       OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, 0} }
 };
 static const x86_insn_info cyrixsmm_insn[] = {
     { CPU_486|CPU_Cyrix|CPU_SMM, MOD_Op1Add, 0, 0, 0, 2, {0x0F, 0x00, 0}, 0, 1,
@@ -2065,7 +2070,8 @@ static const x86_insn_info cyrixsmm_insn[] = {
 };
 static const x86_insn_info svdc_insn[] = {
     { CPU_486|CPU_Cyrix|CPU_SMM, 0, 0, 0, 0, 2, {0x0F, 0x78, 0}, 0, 2,
-      {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA, OPT_SegReg|OPS_16|OPA_Spare, 0} }
+      {OPT_Mem|OPS_80|OPS_Relaxed|OPA_EA,
+       OPT_SegReg|OPS_16|OPS_Relaxed|OPA_Spare, 0} }
 };
 
 /* Obsolete/undocumented instructions */
index 6060bf1091d22b35ea9fa4ee13c60511faa41805..e457274b79d45e6fdd5e9db16b0092eec477aabb 100644 (file)
@@ -802,7 +802,7 @@ INSN        -       pmvnzb  NONE    cyrixmmx    0x5A        CPU_Cyrix|CPU_MMX
 INSN   -       pmvzb   NONE    cyrixmmx    0x58        CPU_Cyrix|CPU_MMX
 INSN   -       psubsiw NONE    cyrixmmx    0x55        CPU_Cyrix|CPU_MMX
 # Cyrix extensions
-INSN   -       rdshr   NONE    twobyte     0x0F36      CPU_686|CPU_Cyrix|CPU_SMM
+INSN   -       rdshr   NONE    rdwrshr     0x00        CPU_686|CPU_Cyrix|CPU_SMM
 INSN   -       rsdc    NONE    rsdc        0           CPU_486|CPU_Cyrix|CPU_SMM
 INSN   -       rsldt   NONE    cyrixsmm    0x7B        CPU_486|CPU_Cyrix|CPU_SMM
 INSN   -       rsts    NONE    cyrixsmm    0x7D        CPU_486|CPU_Cyrix|CPU_SMM
@@ -811,7 +811,7 @@ INSN        -       svldt   NONE    cyrixsmm    0x7A        CPU_486|CPU_Cyrix|CPU_SMM
 INSN   -       svts    NONE    cyrixsmm    0x7C        CPU_486|CPU_Cyrix|CPU_SMM
 INSN   -       smint   NONE    twobyte     0x0F38      CPU_686|CPU_Cyrix
 INSN   -       smintold NONE   twobyte     0x0F7E      CPU_486|CPU_Cyrix|CPU_Obs
-INSN   -       wrshr   NONE    twobyte     0x0F37      CPU_686|CPU_Cyrix|CPU_SMM
+INSN   -       wrshr   NONE    rdwrshr     0x01        CPU_686|CPU_Cyrix|CPU_SMM
 # Obsolete/undocumented instructions
 INSN   -       fsetpm  NONE    twobyte 0xDBE4          CPU_286|CPU_FPU|CPU_Obs
 INSN   -       ibts    NONE    ibts    0               CPU_386|CPU_Undoc|CPU_Obs