From 178e197078e105ba4fc1b40a0bb6d7384098128e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 21 Jul 2023 08:57:24 +0200 Subject: [PATCH] x86: adjust disassembly of insns operating on selector values Bring disassembly back in line with what the assembler accepts, thus also making it self-consistent (with, in particular selector load/store insns). While there further add D to all affected insns except ARPL (where S is used, matching LAR/LSL), to also behave correctly in suffix- always mode. While there also hook up the Intel variant of the LKGS test. --- gas/testsuite/gas/i386/i386-intel.d | 52 +++++++++++----------- gas/testsuite/gas/i386/i386.d | 52 +++++++++++----------- gas/testsuite/gas/i386/intel-intel.d | 2 +- gas/testsuite/gas/i386/intel.d | 2 +- gas/testsuite/gas/i386/opcode-intel.d | 2 +- gas/testsuite/gas/i386/opcode-suffix.d | 4 +- gas/testsuite/gas/i386/opcode.d | 2 +- gas/testsuite/gas/i386/x86-64-lkgs-intel.d | 12 ++--- gas/testsuite/gas/i386/x86-64-lkgs.d | 12 ++--- gas/testsuite/gas/i386/x86-64.exp | 1 + gas/testsuite/gas/i386/x86_64-intel.d | 48 ++++++++++---------- gas/testsuite/gas/i386/x86_64.d | 48 ++++++++++---------- opcodes/i386-dis.c | 12 ++--- 13 files changed, 125 insertions(+), 124 deletions(-) diff --git a/gas/testsuite/gas/i386/i386-intel.d b/gas/testsuite/gas/i386/i386-intel.d index a65c12e3edf..12c0500b1d3 100644 --- a/gas/testsuite/gas/i386/i386-intel.d +++ b/gas/testsuite/gas/i386/i386-intel.d @@ -62,45 +62,45 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f b6 00 movzx eax,BYTE PTR \[eax\] [ ]*[a-f0-9]+: 0f b7 00 movzx eax,WORD PTR \[eax\] [ ]*[a-f0-9]+: 0f c3 00 movnti DWORD PTR \[eax\],eax -[ ]*[a-f0-9]+: 63 ca arpl dx,cx -[ ]*[a-f0-9]+: 63 ca arpl dx,cx -[ ]*[a-f0-9]+: 63 0a arpl (WORD PTR )?\[edx\],cx -[ ]*[a-f0-9]+: 63 0a arpl (WORD PTR )?\[edx\],cx +[ ]*[a-f0-9]+: 63 ca arpl edx,ecx +[ ]*[a-f0-9]+: 63 ca arpl edx,ecx +[ ]*[a-f0-9]+: 63 0a arpl (WORD PTR )?\[edx\],ecx +[ ]*[a-f0-9]+: 63 0a arpl (WORD PTR )?\[edx\],ecx [ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx [ ]*[a-f0-9]+: 0f 02 d2 lar edx,edx [ ]*[a-f0-9]+: 0f 02 d2 lar edx,edx [ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[edx\] [ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[edx\] -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx [ ]*[a-f0-9]+: 0f 00 12 lldt (WORD PTR )?\[edx\] [ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx [ ]*[a-f0-9]+: 0f 03 d2 lsl edx,edx [ ]*[a-f0-9]+: 0f 03 d2 lsl edx,edx [ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[edx\] [ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[edx\] -[ ]*[a-f0-9]+: 0f 00 da ltr dx -[ ]*[a-f0-9]+: 0f 00 da ltr dx +[ ]*[a-f0-9]+: 0f 00 da ltr edx +[ ]*[a-f0-9]+: 0f 00 da ltr edx [ ]*[a-f0-9]+: 0f 00 1a ltr (WORD PTR )?\[edx\] -[ ]*[a-f0-9]+: 0f 00 e2 verr dx -[ ]*[a-f0-9]+: 0f 00 e2 verr dx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx [ ]*[a-f0-9]+: 0f 00 22 verr (WORD PTR )?\[edx\] -[ ]*[a-f0-9]+: 0f 00 ea verw dx -[ ]*[a-f0-9]+: 0f 00 ea verw dx +[ ]*[a-f0-9]+: 0f 00 ea verw edx +[ ]*[a-f0-9]+: 0f 00 ea verw edx [ ]*[a-f0-9]+: 0f 00 2a verw (WORD PTR )?\[edx\] -[ ]*[a-f0-9]+: 63 d1 arpl cx,dx -[ ]*[a-f0-9]+: 63 d1 arpl cx,dx -[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],dx -[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],dx -[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],dx -[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],dx +[ ]*[a-f0-9]+: 63 d1 arpl ecx,edx +[ ]*[a-f0-9]+: 63 d1 arpl ecx,edx +[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],edx +[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],edx +[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],edx +[ ]*[a-f0-9]+: 63 11 arpl (WORD PTR )?\[ecx],edx [ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx [ ]*[a-f0-9]+: 0f 02 d2 lar edx,edx [ ]*[a-f0-9]+: 0f 02 d2 lar edx,edx [ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[edx\] [ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[edx\] -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx [ ]*[a-f0-9]+: 0f 00 12 lldt (WORD PTR )?\[edx\] [ ]*[a-f0-9]+: 0f 00 12 lldt (WORD PTR )?\[edx\] [ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx @@ -108,16 +108,16 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 03 d2 lsl edx,edx [ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[edx\] [ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[edx\] -[ ]*[a-f0-9]+: 0f 00 da ltr dx -[ ]*[a-f0-9]+: 0f 00 da ltr dx +[ ]*[a-f0-9]+: 0f 00 da ltr edx +[ ]*[a-f0-9]+: 0f 00 da ltr edx [ ]*[a-f0-9]+: 0f 00 1a ltr (WORD PTR )?\[edx\] [ ]*[a-f0-9]+: 0f 00 1a ltr (WORD PTR )?\[edx\] -[ ]*[a-f0-9]+: 0f 00 e2 verr dx -[ ]*[a-f0-9]+: 0f 00 e2 verr dx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx [ ]*[a-f0-9]+: 0f 00 22 verr (WORD PTR )?\[edx\] [ ]*[a-f0-9]+: 0f 00 22 verr (WORD PTR )?\[edx\] -[ ]*[a-f0-9]+: 0f 00 ea verw dx -[ ]*[a-f0-9]+: 0f 00 ea verw dx +[ ]*[a-f0-9]+: 0f 00 ea verw edx +[ ]*[a-f0-9]+: 0f 00 ea verw edx [ ]*[a-f0-9]+: 0f 00 2a verw (WORD PTR )?\[edx\] [ ]*[a-f0-9]+: 0f 00 2a verw (WORD PTR )?\[edx\] #pass diff --git a/gas/testsuite/gas/i386/i386.d b/gas/testsuite/gas/i386/i386.d index 54e19e87641..a77d9f4f37b 100644 --- a/gas/testsuite/gas/i386/i386.d +++ b/gas/testsuite/gas/i386/i386.d @@ -61,45 +61,45 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f b6 00 movzbl \(%eax\),%eax [ ]*[a-f0-9]+: 0f b7 00 movzwl \(%eax\),%eax [ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%eax\) -[ ]*[a-f0-9]+: 63 ca arpl %cx,%dx -[ ]*[a-f0-9]+: 63 ca arpl %cx,%dx -[ ]*[a-f0-9]+: 63 0a arpl %cx,\(%edx\) -[ ]*[a-f0-9]+: 63 0a arpl %cx,\(%edx\) +[ ]*[a-f0-9]+: 63 ca arpl %ecx,%edx +[ ]*[a-f0-9]+: 63 ca arpl %ecx,%edx +[ ]*[a-f0-9]+: 63 0a arpl %ecx,\(%edx\) +[ ]*[a-f0-9]+: 63 0a arpl %ecx,\(%edx\) [ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx [ ]*[a-f0-9]+: 0f 02 d2 lar %edx,%edx [ ]*[a-f0-9]+: 0f 02 d2 lar %edx,%edx [ ]*[a-f0-9]+: 66 0f 02 12 lar \(%edx\),%dx [ ]*[a-f0-9]+: 0f 02 12 lar \(%edx\),%edx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx [ ]*[a-f0-9]+: 0f 00 12 lldt \(%edx\) [ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx [ ]*[a-f0-9]+: 0f 03 d2 lsl %edx,%edx [ ]*[a-f0-9]+: 0f 03 d2 lsl %edx,%edx [ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%edx\),%dx [ ]*[a-f0-9]+: 0f 03 12 lsl \(%edx\),%edx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx [ ]*[a-f0-9]+: 0f 00 1a ltr \(%edx\) -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx [ ]*[a-f0-9]+: 0f 00 22 verr \(%edx\) -[ ]*[a-f0-9]+: 0f 00 ea verw %dx -[ ]*[a-f0-9]+: 0f 00 ea verw %dx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx [ ]*[a-f0-9]+: 0f 00 2a verw \(%edx\) -[ ]*[a-f0-9]+: 63 d1 arpl %dx,%cx -[ ]*[a-f0-9]+: 63 d1 arpl %dx,%cx -[ ]*[a-f0-9]+: 63 11 arpl %dx,\(%ecx\) -[ ]*[a-f0-9]+: 63 11 arpl %dx,\(%ecx\) -[ ]*[a-f0-9]+: 63 11 arpl %dx,\(%ecx\) -[ ]*[a-f0-9]+: 63 11 arpl %dx,\(%ecx\) +[ ]*[a-f0-9]+: 63 d1 arpl %edx,%ecx +[ ]*[a-f0-9]+: 63 d1 arpl %edx,%ecx +[ ]*[a-f0-9]+: 63 11 arpl %edx,\(%ecx\) +[ ]*[a-f0-9]+: 63 11 arpl %edx,\(%ecx\) +[ ]*[a-f0-9]+: 63 11 arpl %edx,\(%ecx\) +[ ]*[a-f0-9]+: 63 11 arpl %edx,\(%ecx\) [ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx [ ]*[a-f0-9]+: 0f 02 d2 lar %edx,%edx [ ]*[a-f0-9]+: 0f 02 d2 lar %edx,%edx [ ]*[a-f0-9]+: 66 0f 02 12 lar \(%edx\),%dx [ ]*[a-f0-9]+: 0f 02 12 lar \(%edx\),%edx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx [ ]*[a-f0-9]+: 0f 00 12 lldt \(%edx\) [ ]*[a-f0-9]+: 0f 00 12 lldt \(%edx\) [ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx @@ -107,16 +107,16 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 03 d2 lsl %edx,%edx [ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%edx\),%dx [ ]*[a-f0-9]+: 0f 03 12 lsl \(%edx\),%edx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx [ ]*[a-f0-9]+: 0f 00 1a ltr \(%edx\) [ ]*[a-f0-9]+: 0f 00 1a ltr \(%edx\) -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx [ ]*[a-f0-9]+: 0f 00 22 verr \(%edx\) [ ]*[a-f0-9]+: 0f 00 22 verr \(%edx\) -[ ]*[a-f0-9]+: 0f 00 ea verw %dx -[ ]*[a-f0-9]+: 0f 00 ea verw %dx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx [ ]*[a-f0-9]+: 0f 00 2a verw \(%edx\) [ ]*[a-f0-9]+: 0f 00 2a verw \(%edx\) #pass diff --git a/gas/testsuite/gas/i386/intel-intel.d b/gas/testsuite/gas/i386/intel-intel.d index 73fbdf89c1c..4e96969436a 100644 --- a/gas/testsuite/gas/i386/intel-intel.d +++ b/gas/testsuite/gas/i386/intel-intel.d @@ -103,7 +103,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 60 + pusha [ ]*[a-f0-9]+: 61 + popa [ ]*[a-f0-9]+: 62 90 90 90 90 90 + bound edx,QWORD PTR \[eax-0x6f6f6f70\] -[ ]*[a-f0-9]+: 63 90 90 90 90 90 + arpl WORD PTR \[eax-0x6f6f6f70\],dx +[ ]*[a-f0-9]+: 63 90 90 90 90 90 + arpl WORD PTR \[eax-0x6f6f6f70\],edx [ ]*[a-f0-9]+: 68 90 90 90 90 + push 0x90909090 [ ]*[a-f0-9]+: 69 90 90 90 90 90 90 90 90 90 imul edx,DWORD PTR \[eax-0x6f6f6f70\],0x90909090 [ ]*[a-f0-9]+: 6a 90 + push 0xffffff90 diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d index 374f8753396..bc212893853 100644 --- a/gas/testsuite/gas/i386/intel.d +++ b/gas/testsuite/gas/i386/intel.d @@ -102,7 +102,7 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 60 [ ]*pusha [ ]*[a-f0-9]+: 61 [ ]*popa [ ]*[a-f0-9]+: 62 90 90 90 90 90 [ ]*bound %edx,-0x6f6f6f70\(%eax\) -[ ]*[a-f0-9]+: 63 90 90 90 90 90 [ ]*arpl %dx,-0x6f6f6f70\(%eax\) +[ ]*[a-f0-9]+: 63 90 90 90 90 90 [ ]*arpl %edx,-0x6f6f6f70\(%eax\) [ ]*[a-f0-9]+: 68 90 90 90 90 [ ]*push \$0x90909090 [ ]*[a-f0-9]+: 69 90 90 90 90 90 90 90 90 90 [ ]*imul \$0x90909090,-0x6f6f6f70\(%eax\),%edx [ ]*[a-f0-9]+: 6a 90 [ ]*push \$0xffffff90 diff --git a/gas/testsuite/gas/i386/opcode-intel.d b/gas/testsuite/gas/i386/opcode-intel.d index 7f641db2892..c3c920f25e3 100644 --- a/gas/testsuite/gas/i386/opcode-intel.d +++ b/gas/testsuite/gas/i386/opcode-intel.d @@ -102,7 +102,7 @@ Disassembly of section .text: *[0-9a-f]+: 60[ ]+pusha *[0-9a-f]+: 61[ ]+popa *[0-9a-f]+: 62 90 90 90 90 90[ ]+bound[ ]+edx,(QWORD PTR )?\[eax-0x6f6f6f70\] - *[0-9a-f]+: 63 90 90 90 90 90[ ]+arpl[ ]+(WORD PTR )?\[eax-0x6f6f6f70\],dx + *[0-9a-f]+: 63 90 90 90 90 90[ ]+arpl[ ]+(WORD PTR )?\[eax-0x6f6f6f70\],edx *[0-9a-f]+: 68 90 90 90 90[ ]+push[ ]+0x90909090 *[0-9a-f]+: 69 90 90 90 90 90 90 90 90 90[ ]+imul[ ]+edx,(DWORD PTR )?\[eax-0x6f6f6f70\],0x90909090 *[0-9a-f]+: 6a 90[ ]+push[ ]+0xffffff90 diff --git a/gas/testsuite/gas/i386/opcode-suffix.d b/gas/testsuite/gas/i386/opcode-suffix.d index 152c3b865a0..946a0a4d7a0 100644 --- a/gas/testsuite/gas/i386/opcode-suffix.d +++ b/gas/testsuite/gas/i386/opcode-suffix.d @@ -102,7 +102,7 @@ Disassembly of section .text: *[0-9a-f]+: 60[ ]+pushal *[0-9a-f]+: 61[ ]+popal *[0-9a-f]+: 62 90 90 90 90 90[ ]+boundl %edx,-0x6f6f6f70\(%eax\) - *[0-9a-f]+: 63 90 90 90 90 90[ ]+arpl[ ]+%dx,-0x6f6f6f70\(%eax\) + *[0-9a-f]+: 63 90 90 90 90 90[ ]+arpll[ ]+%edx,-0x6f6f6f70\(%eax\) *[0-9a-f]+: 68 90 90 90 90[ ]+pushl[ ]+\$0x90909090 *[0-9a-f]+: 69 90 90 90 90 90 90 90 90 90[ ]+imull[ ]+\$0x90909090,-0x6f6f6f70\(%eax\),%edx *[0-9a-f]+: 6a 90[ ]+pushl[ ]+\$0xffffff90 @@ -248,7 +248,7 @@ Disassembly of section .text: *[0-9a-f]+: fc[ ]+cld *[0-9a-f]+: fd[ ]+std *[0-9a-f]+: ff 90 90 90 90 90[ ]+calll[ ]+\*-0x6f6f6f70\(%eax\) - *[0-9a-f]+: 0f 00 90 90 90 90 90[ ]+lldt[ ]+-0x6f6f6f70\(%eax\) + *[0-9a-f]+: 0f 00 90 90 90 90 90[ ]+lldtw[ ]+-0x6f6f6f70\(%eax\) *[0-9a-f]+: 0f 01 90 90 90 90 90[ ]+lgdtl[ ]+-0x6f6f6f70\(%eax\) *[0-9a-f]+: 0f 02 90 90 90 90 90[ ]+larl[ ]+-0x6f6f6f70\(%eax\),%edx *[0-9a-f]+: 0f 03 90 90 90 90 90[ ]+lsll[ ]+-0x6f6f6f70\(%eax\),%edx diff --git a/gas/testsuite/gas/i386/opcode.d b/gas/testsuite/gas/i386/opcode.d index c6ffb018a19..7631195d8d4 100644 --- a/gas/testsuite/gas/i386/opcode.d +++ b/gas/testsuite/gas/i386/opcode.d @@ -101,7 +101,7 @@ Disassembly of section .text: 123: 60 [ ]*pusha 124: 61 [ ]*popa 125: 62 90 90 90 90 90 [ ]*bound %edx,-0x6f6f6f70\(%eax\) - 12b: 63 90 90 90 90 90 [ ]*arpl %dx,-0x6f6f6f70\(%eax\) + 12b: 63 90 90 90 90 90 [ ]*arpl %edx,-0x6f6f6f70\(%eax\) 131: 68 90 90 90 90 [ ]*push \$0x90909090 136: 69 90 90 90 90 90 90 90 90 90 [ ]*imul \$0x90909090,-0x6f6f6f70\(%eax\),%edx 140: 6a 90 [ ]*push \$0xffffff90 diff --git a/gas/testsuite/gas/i386/x86-64-lkgs-intel.d b/gas/testsuite/gas/i386/x86-64-lkgs-intel.d index 0f4a6fba6d3..b981ad502c2 100644 --- a/gas/testsuite/gas/i386/x86-64-lkgs-intel.d +++ b/gas/testsuite/gas/i386/x86-64-lkgs-intel.d @@ -8,16 +8,16 @@ Disassembly of section \.text: 0+ <_start>: -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12w +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12d \s*[a-f0-9]+:\s*f2 42 0f 00 b4 f5 00 00 00 10\s+lkgs WORD PTR \[rbp\+r14\*8\+0x10000000\] \s*[a-f0-9]+:\s*f2 41 0f 00 31\s+lkgs WORD PTR \[r9\] \s*[a-f0-9]+:\s*f2 0f 00 b1 fe 00 00 00\s+lkgs WORD PTR \[rcx\+0xfe\] \s*[a-f0-9]+:\s*f2 0f 00 b2 00 ff ff ff\s+lkgs WORD PTR \[rdx-0x100\] -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12w +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs r12d \s*[a-f0-9]+:\s*f2 42 0f 00 b4 f5 00 00 00 10\s+lkgs WORD PTR \[rbp\+r14\*8\+0x10000000\] \s*[a-f0-9]+:\s*f2 41 0f 00 31\s+lkgs WORD PTR \[r9\] \s*[a-f0-9]+:\s*f2 0f 00 b1 fe 00 00 00\s+lkgs WORD PTR \[rcx\+0xfe\] diff --git a/gas/testsuite/gas/i386/x86-64-lkgs.d b/gas/testsuite/gas/i386/x86-64-lkgs.d index 207143da574..60af3c451d7 100644 --- a/gas/testsuite/gas/i386/x86-64-lkgs.d +++ b/gas/testsuite/gas/i386/x86-64-lkgs.d @@ -8,16 +8,16 @@ Disassembly of section \.text: 0+ <_start>: -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12w +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12d \s*[a-f0-9]+:\s*f2 42 0f 00 b4 f5 00 00 00 10\s+lkgs 0x10000000\(%rbp,%r14,8\) \s*[a-f0-9]+:\s*f2 41 0f 00 31\s+lkgs \(%r9\) \s*[a-f0-9]+:\s*f2 0f 00 b1 fe 00 00 00\s+lkgs 0xfe\(%rcx\) \s*[a-f0-9]+:\s*f2 0f 00 b2 00 ff ff ff\s+lkgs -0x100\(%rdx\) -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12w -\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12w +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12d +\s*[a-f0-9]+:\s*f2 41 0f 00 f4\s+lkgs %r12d \s*[a-f0-9]+:\s*f2 42 0f 00 b4 f5 00 00 00 10\s+lkgs 0x10000000\(%rbp,%r14,8\) \s*[a-f0-9]+:\s*f2 41 0f 00 31\s+lkgs \(%r9\) \s*[a-f0-9]+:\s*f2 0f 00 b1 fe 00 00 00\s+lkgs 0xfe\(%rcx\) diff --git a/gas/testsuite/gas/i386/x86-64.exp b/gas/testsuite/gas/i386/x86-64.exp index 49205f9b996..eee2f47b9ca 100644 --- a/gas/testsuite/gas/i386/x86-64.exp +++ b/gas/testsuite/gas/i386/x86-64.exp @@ -437,6 +437,7 @@ run_dump_test "x86-64-amx-complex-bad" run_list_test "x86-64-amx-complex-inval" run_dump_test "x86-64-fred" run_dump_test "x86-64-lkgs" +run_dump_test "x86-64-lkgs-intel" run_list_test "x86-64-lkgs-inval" run_dump_test "x86-64-clzero" run_dump_test "x86-64-mwaitx-bdver4" diff --git a/gas/testsuite/gas/i386/x86_64-intel.d b/gas/testsuite/gas/i386/x86_64-intel.d index 6b74ae68f96..2a9b7d422ac 100644 --- a/gas/testsuite/gas/i386/x86_64-intel.d +++ b/gas/testsuite/gas/i386/x86_64-intel.d @@ -266,9 +266,9 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[rdx\] -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx [ ]*[a-f0-9]+: 0f 00 12 lldt (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx [ ]*[a-f0-9]+: 0f 03 d2 lsl edx,edx @@ -278,17 +278,17 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[rdx\] -[ ]*[a-f0-9]+: 0f 00 da ltr dx -[ ]*[a-f0-9]+: 0f 00 da ltr dx -[ ]*[a-f0-9]+: 0f 00 da ltr dx +[ ]*[a-f0-9]+: 0f 00 da ltr edx +[ ]*[a-f0-9]+: 0f 00 da ltr edx +[ ]*[a-f0-9]+: 0f 00 da ltr edx [ ]*[a-f0-9]+: 0f 00 1a ltr (WORD PTR )?\[rdx\] -[ ]*[a-f0-9]+: 0f 00 e2 verr dx -[ ]*[a-f0-9]+: 0f 00 e2 verr dx -[ ]*[a-f0-9]+: 0f 00 e2 verr dx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx [ ]*[a-f0-9]+: 0f 00 22 verr (WORD PTR )?\[rdx\] -[ ]*[a-f0-9]+: 0f 00 ea verw dx -[ ]*[a-f0-9]+: 0f 00 ea verw dx -[ ]*[a-f0-9]+: 0f 00 ea verw dx +[ ]*[a-f0-9]+: 0f 00 ea verw edx +[ ]*[a-f0-9]+: 0f 00 ea verw edx +[ ]*[a-f0-9]+: 0f 00 ea verw edx [ ]*[a-f0-9]+: 0f 00 2a verw (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 66 0f 02 d2 lar dx,dx [ ]*[a-f0-9]+: 0f 02 d2 lar edx,edx @@ -298,9 +298,9 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 02 12 lar dx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 02 12 lar edx,WORD PTR \[rdx\] -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt edx [ ]*[a-f0-9]+: 0f 00 12 lldt (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 0f 00 12 lldt (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 66 0f 03 d2 lsl dx,dx @@ -311,19 +311,19 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 03 12 lsl dx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[rdx\] [ ]*[a-f0-9]+: 0f 03 12 lsl edx,WORD PTR \[rdx\] -[ ]*[a-f0-9]+: 0f 00 da ltr dx -[ ]*[a-f0-9]+: 0f 00 da ltr dx -[ ]*[a-f0-9]+: 0f 00 da ltr dx +[ ]*[a-f0-9]+: 0f 00 da ltr edx +[ ]*[a-f0-9]+: 0f 00 da ltr edx +[ ]*[a-f0-9]+: 0f 00 da ltr edx [ ]*[a-f0-9]+: 0f 00 1a ltr (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 0f 00 1a ltr (WORD PTR )?\[rdx\] -[ ]*[a-f0-9]+: 0f 00 e2 verr dx -[ ]*[a-f0-9]+: 0f 00 e2 verr dx -[ ]*[a-f0-9]+: 0f 00 e2 verr dx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx +[ ]*[a-f0-9]+: 0f 00 e2 verr edx [ ]*[a-f0-9]+: 0f 00 22 verr (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 0f 00 22 verr (WORD PTR )?\[rdx\] -[ ]*[a-f0-9]+: 0f 00 ea verw dx -[ ]*[a-f0-9]+: 0f 00 ea verw dx -[ ]*[a-f0-9]+: 0f 00 ea verw dx +[ ]*[a-f0-9]+: 0f 00 ea verw edx +[ ]*[a-f0-9]+: 0f 00 ea verw edx +[ ]*[a-f0-9]+: 0f 00 ea verw edx [ ]*[a-f0-9]+: 0f 00 2a verw (WORD PTR )?\[rdx\] [ ]*[a-f0-9]+: 0f 00 2a verw (WORD PTR )?\[rdx\] #pass diff --git a/gas/testsuite/gas/i386/x86_64.d b/gas/testsuite/gas/i386/x86_64.d index cdfe12ebdb7..aa3866191ba 100644 --- a/gas/testsuite/gas/i386/x86_64.d +++ b/gas/testsuite/gas/i386/x86_64.d @@ -266,9 +266,9 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 02 12 lar \(%rdx\),%dx [ ]*[a-f0-9]+: 0f 02 12 lar \(%rdx\),%edx [ ]*[a-f0-9]+: 0f 02 12 lar \(%rdx\),%edx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx [ ]*[a-f0-9]+: 0f 00 12 lldt \(%rdx\) [ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx [ ]*[a-f0-9]+: 0f 03 d2 lsl %edx,%edx @@ -278,17 +278,17 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%rdx\),%dx [ ]*[a-f0-9]+: 0f 03 12 lsl \(%rdx\),%edx [ ]*[a-f0-9]+: 0f 03 12 lsl \(%rdx\),%edx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx [ ]*[a-f0-9]+: 0f 00 1a ltr \(%rdx\) -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx [ ]*[a-f0-9]+: 0f 00 22 verr \(%rdx\) -[ ]*[a-f0-9]+: 0f 00 ea verw %dx -[ ]*[a-f0-9]+: 0f 00 ea verw %dx -[ ]*[a-f0-9]+: 0f 00 ea verw %dx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx [ ]*[a-f0-9]+: 0f 00 2a verw \(%rdx\) [ ]*[a-f0-9]+: 66 0f 02 d2 lar %dx,%dx [ ]*[a-f0-9]+: 0f 02 d2 lar %edx,%edx @@ -298,9 +298,9 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 02 12 lar \(%rdx\),%dx [ ]*[a-f0-9]+: 0f 02 12 lar \(%rdx\),%edx [ ]*[a-f0-9]+: 0f 02 12 lar \(%rdx\),%edx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx -[ ]*[a-f0-9]+: 0f 00 d2 lldt %dx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx +[ ]*[a-f0-9]+: 0f 00 d2 lldt %edx [ ]*[a-f0-9]+: 0f 00 12 lldt \(%rdx\) [ ]*[a-f0-9]+: 0f 00 12 lldt \(%rdx\) [ ]*[a-f0-9]+: 66 0f 03 d2 lsl %dx,%dx @@ -311,19 +311,19 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 66 0f 03 12 lsl \(%rdx\),%dx [ ]*[a-f0-9]+: 0f 03 12 lsl \(%rdx\),%edx [ ]*[a-f0-9]+: 0f 03 12 lsl \(%rdx\),%edx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx -[ ]*[a-f0-9]+: 0f 00 da ltr %dx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx +[ ]*[a-f0-9]+: 0f 00 da ltr %edx [ ]*[a-f0-9]+: 0f 00 1a ltr \(%rdx\) [ ]*[a-f0-9]+: 0f 00 1a ltr \(%rdx\) -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx -[ ]*[a-f0-9]+: 0f 00 e2 verr %dx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx +[ ]*[a-f0-9]+: 0f 00 e2 verr %edx [ ]*[a-f0-9]+: 0f 00 22 verr \(%rdx\) [ ]*[a-f0-9]+: 0f 00 22 verr \(%rdx\) -[ ]*[a-f0-9]+: 0f 00 ea verw %dx -[ ]*[a-f0-9]+: 0f 00 ea verw %dx -[ ]*[a-f0-9]+: 0f 00 ea verw %dx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx +[ ]*[a-f0-9]+: 0f 00 ea verw %edx [ ]*[a-f0-9]+: 0f 00 2a verw \(%rdx\) [ ]*[a-f0-9]+: 0f 00 2a verw \(%rdx\) #pass diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 179612ff0ac..beabe4aa37b 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -2625,10 +2625,10 @@ static const struct dis386 reg_table[][8] = { { { "sldtD", { Sv }, 0 }, { "strD", { Sv }, 0 }, - { "lldt", { Ew }, 0 }, - { "ltr", { Ew }, 0 }, - { "verr", { Ew }, 0 }, - { "verw", { Ew }, 0 }, + { "lldtD", { Sv }, 0 }, + { "ltrD", { Sv }, 0 }, + { "verrD", { Sv }, 0 }, + { "verwD", { Sv }, 0 }, { X86_64_TABLE (X86_64_0F00_REG_6) }, { Bad_Opcode }, }, @@ -2875,7 +2875,7 @@ static const struct dis386 prefix_table[][4] = { { Bad_Opcode }, { Bad_Opcode }, { Bad_Opcode }, - { "lkgs", { Ew }, 0 }, + { "lkgsD", { Sv }, 0 }, }, /* PREFIX_0F01_REG_0_MOD_3_RM_6 */ @@ -4017,7 +4017,7 @@ static const struct dis386 x86_64_table[][2] = { /* X86_64_63 */ { - { "arpl", { Ew, Gw }, 0 }, + { "arplS", { Sv, Gv }, 0 }, { "movs", { Gv, { MOVSXD_Fixup, movsxd_mode } }, 0 }, }, -- 2.30.2