diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-03-25 08:18:41 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-03-25 08:18:41 +0100 |
commit | c0e54661f755b1eb1cbf745bc4eb4a068cd5ada2 (patch) | |
tree | 15a8fd41581bb0ac66ff93e9b22f947a022ebf0d /gas/testsuite | |
parent | 829f3fe1f0230798c776b9c7039fa7be778a7b43 (diff) | |
download | gdb-c0e54661f755b1eb1cbf745bc4eb4a068cd5ada2.zip gdb-c0e54661f755b1eb1cbf745bc4eb4a068cd5ada2.tar.gz gdb-c0e54661f755b1eb1cbf745bc4eb4a068cd5ada2.tar.bz2 |
x86: fix AMD Zen3 insns
For INVLPGB the operand count was wrong (besides %edx there's also %ecx
which is an input to the insn). In this case I see little sense in
retaining the bogus 2-operand template. Plus swapping of the operands
wasn't properly suppressed for Intel syntax.
For PVALIDATE, RMPADJUST, and RMPUPDATE bogus single operand templates
were specified. These get retained, as the address operand is the only
one really needed to expressed non-default address size, but only for
compatibility reasons. Proper multi-operand insn get introduced and the
testcases get adjusted / extended accordingly.
While at it also drop the redundant definition of __amd64__ - we already
have x86_64 defined (or not) to distinguish 64-bit and non-64-bit cases.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/invlpgb.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/invlpgb.s | 22 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/invlpgb64.d | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/snp.d | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/snp.s | 44 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/snp64.d | 18 |
6 files changed, 77 insertions, 23 deletions
diff --git a/gas/testsuite/gas/i386/invlpgb.d b/gas/testsuite/gas/i386/invlpgb.d index 34e62d1..e645364 100644 --- a/gas/testsuite/gas/i386/invlpgb.d +++ b/gas/testsuite/gas/i386/invlpgb.d @@ -11,4 +11,8 @@ Disassembly of section \.text: [ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* [0-9a-f]+ <att16>: [ ]*[a-f0-9]+:[ ]+67 0f 01 fe[ ]+addr16 invlpgb[ ]* +[0-9a-f]+ <intel32>: +[ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[0-9a-f]+ <intel16>: +[ ]*[a-f0-9]+:[ ]+67 0f 01 fe[ ]+addr16 invlpgb[ ]* #pass diff --git a/gas/testsuite/gas/i386/invlpgb.s b/gas/testsuite/gas/i386/invlpgb.s index 52b75b7..cc85e73 100644 --- a/gas/testsuite/gas/i386/invlpgb.s +++ b/gas/testsuite/gas/i386/invlpgb.s @@ -3,13 +3,25 @@ .text _start: invlpgb -.ifdef __amd64__ +.ifdef x86_64 att64: - invlpgb %rax, %edx + invlpgb %rax, %ecx, %edx .endif att32: - invlpgb %eax, %edx -.ifndef __amd64__ + invlpgb %eax, %ecx, %edx +.ifndef x86_64 att16: - invlpgb %ax, %edx + invlpgb %ax, %ecx, %edx +.endif + + .intel_syntax noprefix +.ifdef x86_64 +intel64: + invlpgb rax, ecx, edx +.endif +intel32: + invlpgb eax, ecx, edx +.ifndef x86_64 +intel16: + invlpgb ax, ecx, edx .endif diff --git a/gas/testsuite/gas/i386/invlpgb64.d b/gas/testsuite/gas/i386/invlpgb64.d index 025bdff..2582481 100644 --- a/gas/testsuite/gas/i386/invlpgb64.d +++ b/gas/testsuite/gas/i386/invlpgb64.d @@ -1,4 +1,3 @@ -#as: --defsym __amd64__=1 #objdump: -dw #name: 64-bit INVLPGB insn #source: invlpgb.s @@ -13,4 +12,8 @@ Disassembly of section \.text: [ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* [0-9a-f]+ <att32>: [ ]*[a-f0-9]+:[ ]+67 0f 01 fe[ ]+addr32 invlpgb[ ]* +[0-9a-f]+ <intel64>: +[ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[0-9a-f]+ <intel32>: +[ ]*[a-f0-9]+:[ ]+67 0f 01 fe[ ]+addr32 invlpgb[ ]* #pass diff --git a/gas/testsuite/gas/i386/snp.d b/gas/testsuite/gas/i386/snp.d index 0bf0d02..81d386c 100644 --- a/gas/testsuite/gas/i386/snp.d +++ b/gas/testsuite/gas/i386/snp.d @@ -6,7 +6,12 @@ Disassembly of section \.text: -00000000 <att32>: +0+ <att>: +[ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+67 f2 0f 01 ff[ ]+addr16 pvalidate[ ]* + +[0-9a-f]+ <intel>: [ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* [ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* [ ]*[a-f0-9]+:[ ]+67 f2 0f 01 ff[ ]+addr16 pvalidate[ ]* diff --git a/gas/testsuite/gas/i386/snp.s b/gas/testsuite/gas/i386/snp.s index 197d053..0ac0dfc 100644 --- a/gas/testsuite/gas/i386/snp.s +++ b/gas/testsuite/gas/i386/snp.s @@ -1,23 +1,39 @@ # Check SNP instructions .text -.ifdef __amd64__ -att64: - psmash %rax +att: + pvalidate + pvalidate %eax, %ecx, %edx +.ifdef x86_64 + pvalidate %rax, %ecx, %edx psmash - psmash %eax - pvalidate %rax - pvalidate %eax - rmpupdate %rax + psmash %rax + psmash %eax rmpupdate - rmpupdate %eax - rmpadjust %rax + rmpupdate %rax, %rcx + rmpupdate %eax, %rcx rmpadjust - rmpadjust %eax + rmpadjust %rax, %rcx, %rdx + rmpadjust %eax, %rcx, %rdx +.else + pvalidate %ax, %ecx, %edx .endif -.ifndef __amd64__ -att32: + + .intel_syntax noprefix +intel: pvalidate - pvalidate %eax - pvalidate %ax + pvalidate eax, ecx, edx +.ifdef x86_64 + pvalidate rax, ecx, edx + psmash + psmash rax + psmash eax + rmpupdate + rmpupdate rax, rcx + rmpupdate eax, rcx + rmpadjust + rmpadjust rax, rcx, rdx + rmpadjust eax, rcx, rdx +.else + pvalidate ax, ecx, edx .endif diff --git a/gas/testsuite/gas/i386/snp64.d b/gas/testsuite/gas/i386/snp64.d index 1f78367..2b3e9ee 100644 --- a/gas/testsuite/gas/i386/snp64.d +++ b/gas/testsuite/gas/i386/snp64.d @@ -1,4 +1,3 @@ -#as: --defsym __amd64__=1 #objdump: -dw #name: 64-bit SNP insn #source: snp.s @@ -8,12 +7,27 @@ Disassembly of section \.text: -0+000 <att64>: +0+ <att>: +[ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+67 f2 0f 01 ff[ ]+addr32 pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* [ ]*[a-f0-9]+:[ ]+f3 0f 01 ff[ ]+psmash[ ]* [ ]*[a-f0-9]+:[ ]+f3 0f 01 ff[ ]+psmash[ ]* [ ]*[a-f0-9]+:[ ]+67 f3 0f 01 ff[ ]+addr32 psmash[ ]* +[ ]*[a-f0-9]+:[ ]+f2 0f 01 fe[ ]+rmpupdate[ ]* +[ ]*[a-f0-9]+:[ ]+f2 0f 01 fe[ ]+rmpupdate[ ]* +[ ]*[a-f0-9]+:[ ]+67 f2 0f 01 fe[ ]+addr32 rmpupdate[ ]* +[ ]*[a-f0-9]+:[ ]+f3 0f 01 fe[ ]+rmpadjust[ ]* +[ ]*[a-f0-9]+:[ ]+f3 0f 01 fe[ ]+rmpadjust[ ]* +[ ]*[a-f0-9]+:[ ]+67 f3 0f 01 fe[ ]+addr32 rmpadjust[ ]* + +[0-9a-f]+ <intel>: [ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* [ ]*[a-f0-9]+:[ ]+67 f2 0f 01 ff[ ]+addr32 pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+f2 0f 01 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+f3 0f 01 ff[ ]+psmash[ ]* +[ ]*[a-f0-9]+:[ ]+f3 0f 01 ff[ ]+psmash[ ]* +[ ]*[a-f0-9]+:[ ]+67 f3 0f 01 ff[ ]+addr32 psmash[ ]* [ ]*[a-f0-9]+:[ ]+f2 0f 01 fe[ ]+rmpupdate[ ]* [ ]*[a-f0-9]+:[ ]+f2 0f 01 fe[ ]+rmpupdate[ ]* [ ]*[a-f0-9]+:[ ]+67 f2 0f 01 fe[ ]+addr32 rmpupdate[ ]* |