From d79df4c74a933729d86140dcb585c9307351c530 Mon Sep 17 00:00:00 2001
From: peter <peter@freepascal.org>
Date: Sun, 3 Sep 2006 08:56:10 +0000
Subject: [PATCH]   * 64bit support for shrd

git-svn-id: trunk@4541 -
---
 compiler/i386/i386nop.inc    |   2 +-
 compiler/i386/i386tab.inc    | 100 +++--------------------------------
 compiler/x86/x86ins.dat      |  20 ++-----
 compiler/x86_64/x8664nop.inc |   2 +-
 compiler/x86_64/x8664tab.inc | 100 +++--------------------------------
 5 files changed, 22 insertions(+), 202 deletions(-)

diff --git a/compiler/i386/i386nop.inc b/compiler/i386/i386nop.inc
index 5fe2125afc..50db0e5a9e 100644
--- a/compiler/i386/i386nop.inc
+++ b/compiler/i386/i386nop.inc
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-1380;
+1368;
diff --git a/compiler/i386/i386tab.inc b/compiler/i386/i386tab.inc
index f91ac2e7cc..073a4fdc8a 100644
--- a/compiler/i386/i386tab.inc
+++ b/compiler/i386/i386tab.inc
@@ -6009,59 +6009,17 @@
   (
     opcode  : A_SHLD;
     ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#164#65#22;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_immediate);
+    code    : #192#209#2#15#164#65#22;
     flags   : if_386 or if_sm2 or if_sb or if_ar2
   ),
   (
     opcode  : A_SHLD;
     ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#164#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#164#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#164#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#165#65;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_reg_cl);
+    code    : #192#209#2#15#165#65;
     flags   : if_386 or if_sm
   ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#165#65;
-    flags   : if_386
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#165#65;
-    flags   : if_386 or if_sm
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#165#65;
-    flags   : if_386
-  ),
   (
     opcode  : A_SHR;
     ops     : 2;
@@ -6107,59 +6065,17 @@
   (
     opcode  : A_SHRD;
     ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#172#65#22;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_immediate);
+    code    : #192#209#2#15#172#65#22;
     flags   : if_386 or if_sm2 or if_sb or if_ar2
   ),
   (
     opcode  : A_SHRD;
     ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#172#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#172#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#172#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#173#65;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_reg_cl);
+    code    : #192#209#2#15#173#65;
     flags   : if_386 or if_sm
   ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#173#65;
-    flags   : if_386
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#173#65;
-    flags   : if_386 or if_sm
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#173#65;
-    flags   : if_386
-  ),
   (
     opcode  : A_SIDT;
     ops     : 1;
diff --git a/compiler/x86/x86ins.dat b/compiler/x86/x86ins.dat
index 0dd6f844d5..c34b58a349 100644
--- a/compiler/x86/x86ins.dat
+++ b/compiler/x86/x86ins.dat
@@ -1900,14 +1900,8 @@ rm8,imm               \300\323\1\xC0\204\25           186,SB
 
 [SHLD,shldX]
 (Ch_MOp3, Ch_RWFlags, Ch_Rop2)
-mem,reg16,imm         \300\324\2\x0F\xA4\101\26       386,SM2,SB,AR2
-reg16,reg16,imm       \300\324\2\x0F\xA4\101\26       386,SM2,SB,AR2
-mem,reg32,imm         \300\325\2\x0F\xA4\101\26       386,SM2,SB,AR2
-reg32,reg32,imm       \300\325\2\x0F\xA4\101\26       386,SM2,SB,AR2
-mem,reg16,reg_cl      \300\324\2\x0F\xA5\101          386,SM
-reg16,reg16,reg_cl    \300\324\2\x0F\xA5\101          386
-mem,reg32,reg_cl      \300\325\2\x0F\xA5\101          386,SM
-reg32,reg32,reg_cl    \300\325\2\x0F\xA5\101          386
+rm16|32|64,reg16|32|64,imm    \300\321\2\x0F\xA4\101\26       386,SM2,SB,AR2
+rm16|32|64,reg16|32|64,reg_cl \300\321\2\x0F\xA5\101          386,SM
 
 [SHR,shrX]
 (Ch_Mop2, Ch_Rop1, Ch_WFlags)
@@ -1920,14 +1914,8 @@ rm8,imm               \300\323\1\xC0\205\25           186,SB
 
 [SHRD,shrdX]
 (Ch_MOp3, Ch_RWFlags, Ch_Rop2)
-mem,reg16,imm         \300\324\2\x0F\xAC\101\26       386,SM2,SB,AR2
-reg16,reg16,imm       \300\324\2\x0F\xAC\101\26       386,SM2,SB,AR2
-mem,reg32,imm         \300\325\2\x0F\xAC\101\26       386,SM2,SB,AR2
-reg32,reg32,imm       \300\325\2\x0F\xAC\101\26       386,SM2,SB,AR2
-mem,reg16,reg_cl      \300\324\2\x0F\xAD\101          386,SM
-reg16,reg16,reg_cl    \300\324\2\x0F\xAD\101          386
-mem,reg32,reg_cl      \300\325\2\x0F\xAD\101          386,SM
-reg32,reg32,reg_cl    \300\325\2\x0F\xAD\101          386
+rm16|32|64,reg16|32|64,imm    \300\321\2\x0F\xAC\101\26       386,SM2,SB,AR2
+rm16|32|64,reg16|32|64,reg_cl \300\321\2\x0F\xAD\101          386,SM
 
 [SIDT,sidtX]
 (Ch_Wop1, Ch_None, Ch_None)
diff --git a/compiler/x86_64/x8664nop.inc b/compiler/x86_64/x8664nop.inc
index 38b54b54d2..3ee72ff963 100644
--- a/compiler/x86_64/x8664nop.inc
+++ b/compiler/x86_64/x8664nop.inc
@@ -1,2 +1,2 @@
 { don't edit, this file is generated from x86ins.dat }
-1378;
+1366;
diff --git a/compiler/x86_64/x8664tab.inc b/compiler/x86_64/x8664tab.inc
index 7a4aac2889..8adfc82102 100644
--- a/compiler/x86_64/x8664tab.inc
+++ b/compiler/x86_64/x8664tab.inc
@@ -5953,59 +5953,17 @@
   (
     opcode  : A_SHLD;
     ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#164#65#22;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_immediate);
+    code    : #192#209#2#15#164#65#22;
     flags   : if_386 or if_sm2 or if_sb or if_ar2
   ),
   (
     opcode  : A_SHLD;
     ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#164#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#164#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#164#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#165#65;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_reg_cl);
+    code    : #192#209#2#15#165#65;
     flags   : if_386 or if_sm
   ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#165#65;
-    flags   : if_386
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#165#65;
-    flags   : if_386 or if_sm
-  ),
-  (
-    opcode  : A_SHLD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#165#65;
-    flags   : if_386
-  ),
   (
     opcode  : A_SHR;
     ops     : 2;
@@ -6051,59 +6009,17 @@
   (
     opcode  : A_SHRD;
     ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#172#65#22;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_immediate);
+    code    : #192#209#2#15#172#65#22;
     flags   : if_386 or if_sm2 or if_sb or if_ar2
   ),
   (
     opcode  : A_SHRD;
     ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_immediate);
-    code    : #192#212#2#15#172#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#172#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_immediate);
-    code    : #192#213#2#15#172#65#22;
-    flags   : if_386 or if_sm2 or if_sb or if_ar2
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#173#65;
+    optypes : (ot_regmem or ot_bits16 or ot_bits32 or ot_bits64,ot_reg16 or ot_bits32 or ot_bits64,ot_reg_cl);
+    code    : #192#209#2#15#173#65;
     flags   : if_386 or if_sm
   ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_reg16,ot_reg16,ot_reg_cl);
-    code    : #192#212#2#15#173#65;
-    flags   : if_386
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_memory,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#173#65;
-    flags   : if_386 or if_sm
-  ),
-  (
-    opcode  : A_SHRD;
-    ops     : 3;
-    optypes : (ot_reg32,ot_reg32,ot_reg_cl);
-    code    : #192#213#2#15#173#65;
-    flags   : if_386
-  ),
   (
     opcode  : A_SIDT;
     ops     : 1;