diff options
author | Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com> | 2020-10-20 23:56:58 +0530 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-10-20 13:58:04 -0700 |
commit | 646cc3e0109e4a45a232af8354feafc36c3249ee (patch) | |
tree | e883bae3df2bdce5f5849c2cf43452d2c838e5ad /gas/testsuite | |
parent | c4464adef2d7909cd45542690b5d3fd6ab1910c6 (diff) | |
download | gdb-646cc3e0109e4a45a232af8354feafc36c3249ee.zip gdb-646cc3e0109e4a45a232af8354feafc36c3249ee.tar.gz gdb-646cc3e0109e4a45a232af8354feafc36c3249ee.tar.bz2 |
Add AMD znver3 processor support
gas/
* config/tc-i386.c (cpu_arch): Add CPU_ZNVER3_FLAGS flags.
(i386_align_code): Add PROCESSOR_ZNVER cases.
* doc/c-i386.texi: Add znver3, snp, invlpgb and tlbsync.
* gas/i386/i386.exp: Add new znver3 test cases.
* gas/i386/arch-14-znver3.d: New.
* gas/i386/arch-14.d: New.
* gas/i386/arch-14.s: New.
* gas/i386/invlpgb.d: New.
* gas/i386/invlpgb64.d: New.
* gas/i386/invlpgb.s: New.
* gas/i386/snp.d: New.
* gas/i386/snp64.d: New.
* gas/i386/snp.s: New.
* gas/i386/tlbsync.d: New.
* gas/i386/tlbsync.s: New.
* gas/i386/x86-64-arch-4-znver3.d: New.
* gas/i386/x86-64-arch-4.d: New.
* gas/i386/x86-64-arch-4.s: New.
opcodes/
* i386-dis.c (rm_table): Add tlbsync, snp, invlpgb.
* i386-gen.c (cpu_flag_init): Add new CPU_INVLPGB_FLAGS,
CPU_TLBSYNC_FLAGS, and CPU_SNP_FLAGS.
Add CPU_ZNVER3_FLAGS.
(cpu_flags): Add CpuINVLPGB, CpuTLBSYNC, CpuSNP.
* i386-opc.h: Add CpuINVLPGB, CpuTLBSYNC, CpuSNP.
* i386-opc.tbl: Add invlpgb, tlbsync, psmash, pvalidate,
rmpupdate, rmpadjust.
* i386-init.h: Re-generated.
* i386-tbl.h: Re-generated.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/arch-14-znver3.d | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-14.d | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-14.s | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/invlpgb.d | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/invlpgb.s | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/invlpgb64.d | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/snp.d | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/snp.s | 23 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/snp64.d | 23 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/tlbsync.d | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/tlbsync.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-arch-4-znver3.d | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-arch-4.d | 33 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-arch-4.s | 34 |
15 files changed, 232 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/arch-14-znver3.d b/gas/testsuite/gas/i386/arch-14-znver3.d new file mode 100644 index 0000000..29686df --- /dev/null +++ b/gas/testsuite/gas/i386/arch-14-znver3.d @@ -0,0 +1,5 @@ +#source: arch-14.s +#as: -march=znver3 +#objdump: -dw +#name: i386 arch 14 (znver3) +#dump: arch-14.d diff --git a/gas/testsuite/gas/i386/arch-14.d b/gas/testsuite/gas/i386/arch-14.d new file mode 100644 index 0000000..55edf27 --- /dev/null +++ b/gas/testsuite/gas/i386/arch-14.d @@ -0,0 +1,14 @@ +#objdump: -dw +#name: i386 arch 14 + +.*: file format .* + +Disassembly of section .text: + +0+ <.text>: +[ ]*[0-9a-f]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[ ]*[0-9a-f]+:[ ]+0f 01 ff[ ]+tlbsync[ ]* +[ ]*[a-f0-9]+:[ ]*f2 0f 01 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]*0f 01 ee[ ]+rdpkru[ ]* +[ ]*[a-f0-9]+:[ ]*0f 01 ef[ ]+wrpkru[ ]* +#pass diff --git a/gas/testsuite/gas/i386/arch-14.s b/gas/testsuite/gas/i386/arch-14.s new file mode 100644 index 0000000..e853666 --- /dev/null +++ b/gas/testsuite/gas/i386/arch-14.s @@ -0,0 +1,12 @@ +# Test -march= + .text + +#INVLPGB + invlpgb +#TLBSYNC + tlbsync +#SNP - Secure Nested Paging support + pvalidate +#OSPKE + rdpkru + wrpkru diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index edb053c..1e761e9 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -183,6 +183,7 @@ if [gas_32_check] then { run_dump_test "arch-10-bdver4" run_dump_test "arch-13-znver1" run_dump_test "arch-13-znver2" + run_dump_test "arch-14-znver3" run_dump_test "arch-10-btver1" run_dump_test "arch-10-btver2" run_list_test "arch-10-1" "-march=generic32 -I${srcdir}/$subdir -al" @@ -192,6 +193,7 @@ if [gas_32_check] then { run_dump_test "arch-11" run_dump_test "arch-12" run_dump_test "arch-13" + run_dump_test "arch-14" run_dump_test "8087" run_dump_test "287" run_dump_test "387" @@ -462,6 +464,9 @@ if [gas_32_check] then { run_list_test "avx-vnni-inval" run_list_test "sg" run_dump_test "clzero" + run_dump_test "invlpgb" + run_dump_test "tlbsync" + run_dump_test "snp" run_dump_test "disassem" run_dump_test "mwaitx-bdver4" run_list_test "mwaitx-reg" @@ -755,6 +760,8 @@ if [gas_64_check] then { run_dump_test "movz64" run_dump_test "x86-64-relax-1" run_dump_test "svme64" + run_dump_test "snp64" + run_dump_test "invlpgb64" run_dump_test "x86-64-amdfam10" run_dump_test "x86-64-vmx" run_dump_test "x86-64-vmfunc" @@ -843,6 +850,7 @@ if [gas_64_check] then { run_dump_test "x86-64-arch-1" run_dump_test "x86-64-arch-2" run_dump_test "x86-64-arch-3" + run_dump_test "x86-64-arch-4" run_dump_test "x86-64-arch-2-lzcnt" run_dump_test "x86-64-arch-2-prefetchw" run_dump_test "x86-64-arch-2-bdver1" @@ -851,6 +859,7 @@ if [gas_64_check] then { run_dump_test "x86-64-arch-2-bdver4" run_dump_test "x86-64-arch-3-znver1" run_dump_test "x86-64-arch-3-znver2" + run_dump_test "x86-64-arch-4-znver3" run_dump_test "x86-64-arch-2-btver1" run_dump_test "x86-64-arch-2-btver2" run_list_test "x86-64-arch-2-1" "-march=generic64 -I${srcdir}/$subdir -al" diff --git a/gas/testsuite/gas/i386/invlpgb.d b/gas/testsuite/gas/i386/invlpgb.d new file mode 100644 index 0000000..34e62d1 --- /dev/null +++ b/gas/testsuite/gas/i386/invlpgb.d @@ -0,0 +1,14 @@ +#objdump: -dw +#name: 32-bit INVLPGB insn + +.*: +file format .* + +Disassembly of section \.text: + +00000000 <_start>: +[ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[0-9a-f]+ <att32>: +[ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[0-9a-f]+ <att16>: +[ ]*[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 new file mode 100644 index 0000000..52b75b7 --- /dev/null +++ b/gas/testsuite/gas/i386/invlpgb.s @@ -0,0 +1,15 @@ +# Check INVLPGB instructions + + .text +_start: + invlpgb +.ifdef __amd64__ +att64: + invlpgb %rax, %edx +.endif +att32: + invlpgb %eax, %edx +.ifndef __amd64__ +att16: + invlpgb %ax, %edx +.endif diff --git a/gas/testsuite/gas/i386/invlpgb64.d b/gas/testsuite/gas/i386/invlpgb64.d new file mode 100644 index 0000000..025bdff --- /dev/null +++ b/gas/testsuite/gas/i386/invlpgb64.d @@ -0,0 +1,16 @@ +#as: --defsym __amd64__=1 +#objdump: -dw +#name: 64-bit INVLPGB insn +#source: invlpgb.s + +.*: +file format .* + +Disassembly of section \.text: + +0+000 <_start>: +[ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[0-9a-f]+ <att64>: +[ ]*[a-f0-9]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[0-9a-f]+ <att32>: +[ ]*[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 new file mode 100644 index 0000000..0bf0d02 --- /dev/null +++ b/gas/testsuite/gas/i386/snp.d @@ -0,0 +1,13 @@ +#objdump: -dw +#name: 32-bit SNP insn + +.*: +file format .* + + +Disassembly of section \.text: + +00000000 <att32>: +[ ]*[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[ ]* +#pass diff --git a/gas/testsuite/gas/i386/snp.s b/gas/testsuite/gas/i386/snp.s new file mode 100644 index 0000000..197d053 --- /dev/null +++ b/gas/testsuite/gas/i386/snp.s @@ -0,0 +1,23 @@ +# Check SNP instructions + + .text +.ifdef __amd64__ +att64: + psmash %rax + psmash + psmash %eax + pvalidate %rax + pvalidate %eax + rmpupdate %rax + rmpupdate + rmpupdate %eax + rmpadjust %rax + rmpadjust + rmpadjust %eax +.endif +.ifndef __amd64__ +att32: + pvalidate + pvalidate %eax + pvalidate %ax +.endif diff --git a/gas/testsuite/gas/i386/snp64.d b/gas/testsuite/gas/i386/snp64.d new file mode 100644 index 0000000..1f78367 --- /dev/null +++ b/gas/testsuite/gas/i386/snp64.d @@ -0,0 +1,23 @@ +#as: --defsym __amd64__=1 +#objdump: -dw +#name: 64-bit SNP insn +#source: snp.s + +.*: +file format .* + + +Disassembly of section \.text: + +0+000 <att64>: +[ ]*[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 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+:[ ]+67 f2 0f 01 ff[ ]+addr32 pvalidate[ ]* +[ ]*[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[ ]* +#pass diff --git a/gas/testsuite/gas/i386/tlbsync.d b/gas/testsuite/gas/i386/tlbsync.d new file mode 100644 index 0000000..3c3c57f --- /dev/null +++ b/gas/testsuite/gas/i386/tlbsync.d @@ -0,0 +1,11 @@ +#objdump: -dw +#name: i386 TLBSYNC insn + +.*: +file format .* + + +Disassembly of section \.text: + +00000000 <_start>: +[ ]*[a-f0-9]+: 0f 01 ff tlbsync[ ]* +#pass diff --git a/gas/testsuite/gas/i386/tlbsync.s b/gas/testsuite/gas/i386/tlbsync.s new file mode 100644 index 0000000..fddd4ef --- /dev/null +++ b/gas/testsuite/gas/i386/tlbsync.s @@ -0,0 +1,5 @@ +# Check TLBSYNC instructions + + .text +_start: + tlbsync diff --git a/gas/testsuite/gas/i386/x86-64-arch-4-znver3.d b/gas/testsuite/gas/i386/x86-64-arch-4-znver3.d new file mode 100644 index 0000000..0d3a865 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-arch-4-znver3.d @@ -0,0 +1,5 @@ +#source: x86-64-arch-4.s +#as: -march=znver3 +#objdump: -dw +#name: x86-64 arch 4 (znver3) +#dump: x86-64-arch-4.d diff --git a/gas/testsuite/gas/i386/x86-64-arch-4.d b/gas/testsuite/gas/i386/x86-64-arch-4.d new file mode 100644 index 0000000..f5373d5 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-arch-4.d @@ -0,0 +1,33 @@ +#objdump: -dw +#name: x86-64 arch 4 + +.*: file format .* + +Disassembly of section .text: + +0+ <.text>: +[ ]*[0-9a-f]+:[ ]+0f 01 fe[ ]+invlpgb[ ]* +[ ]*[0-9a-f]+:[ ]+0f 01 ff[ ]+tlbsync[ ]* +[ ]*[a-f0-9]+:[ ]*c4 43 35 44 d0 ab[ ]*vpclmulqdq \$0xab,%ymm8,%ymm9,%ymm10 +[ ]*[a-f0-9]+:[ ]*c4 23 35 44 94 f0 24 01 00 00 7b[ ]*vpclmulqdq \$0x7b,0x124\(%rax,%r14,8\),%ymm9,%ymm10 +[ ]*[a-f0-9]+:[ ]*c4 63 35 44 92 e0 0f 00 00 7b[ ]*vpclmulqdq \$0x7b,0xfe0\(%rdx\),%ymm9,%ymm10 +[ ]*[a-f0-9]+:[ ]*c4 43 25 44 e2 11[ ]*vpclmulhqhqdq %ymm10,%ymm11,%ymm12 +[ ]*[a-f0-9]+:[ ]*c4 43 1d 44 eb 01[ ]*vpclmulhqlqdq %ymm11,%ymm12,%ymm13 +[ ]*[a-f0-9]+:[ ]*c4 43 15 44 f4 10[ ]*vpclmullqhqdq %ymm12,%ymm13,%ymm14 +[ ]*[a-f0-9]+:[ ]*c4 43 0d 44 fd 00[ ]*vpclmullqlqdq %ymm13,%ymm14,%ymm15 +[ ]*[a-f0-9]+: c4 e2 4d dc d4[ ]+vaesenc %ymm4,%ymm6,%ymm2 +[ ]*[a-f0-9]+: c4 e2 4d dc 39[ ]+vaesenc \(%rcx\),%ymm6,%ymm7 +[ ]*[a-f0-9]+: c4 e2 4d dd d4[ ]+vaesenclast %ymm4,%ymm6,%ymm2 +[ ]*[a-f0-9]+: c4 e2 4d dd 39[ ]+vaesenclast \(%rcx\),%ymm6,%ymm7 +[ ]*[a-f0-9]+: c4 e2 4d de d4[ ]+vaesdec %ymm4,%ymm6,%ymm2 +[ ]*[a-f0-9]+: c4 e2 4d de 39[ ]+vaesdec \(%rcx\),%ymm6,%ymm7 +[ ]*[a-f0-9]+: c4 e2 4d df d4[ ]+vaesdeclast %ymm4,%ymm6,%ymm2 +[ ]*[a-f0-9]+: c4 e2 4d df 39[ ]+vaesdeclast \(%rcx\),%ymm6,%ymm7 +[ ]*[a-f0-9]+: f3 0f 01 ff[ ]+psmash[ ]* +[ ]*[a-f0-9]+: f2 0f 01 ff[ ]+pvalidate[ ]* +[ ]*[a-f0-9]+: f2 0f 01 fe[ ]+rmpupdate[ ]* +[ ]*[a-f0-9]+: f3 0f 01 fe[ ]+rmpadjust[ ]* +[ ]*[a-f0-9]+: 66 0f 38 82 10[ ]+invpcid \(%rax\),%rdx +[ ]*[a-f0-9]+: 0f 01 ee[ ]+rdpkru[ ]* +[ ]*[a-f0-9]+: 0f 01 ef[ ]+wrpkru[ ]* +#pass diff --git a/gas/testsuite/gas/i386/x86-64-arch-4.s b/gas/testsuite/gas/i386/x86-64-arch-4.s new file mode 100644 index 0000000..4b2dc81 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-arch-4.s @@ -0,0 +1,34 @@ +# Test -march= + .text +#INVLPGB + invlpgb +#TLBSYNC + tlbsync +#VPCLMUL 256 datapath + vpclmulqdq $0xab, %ymm8, %ymm9, %ymm10 + vpclmulqdq $123, 0x124(%rax,%r14,8), %ymm9, %ymm10 + vpclmulqdq $123, 4064(%rdx), %ymm9, %ymm10 + + vpclmulhqhqdq %ymm10, %ymm11, %ymm12 + vpclmulhqlqdq %ymm11, %ymm12, %ymm13 + vpclmullqhqdq %ymm12, %ymm13, %ymm14 + vpclmullqlqdq %ymm13, %ymm14, %ymm15 +#VAES + vaesenc %ymm4,%ymm6,%ymm2 + vaesenc (%rcx),%ymm6,%ymm7 + vaesenclast %ymm4,%ymm6,%ymm2 + vaesenclast (%rcx),%ymm6,%ymm7 + vaesdec %ymm4,%ymm6,%ymm2 + vaesdec (%rcx),%ymm6,%ymm7 + vaesdeclast %ymm4,%ymm6,%ymm2 + vaesdeclast (%rcx),%ymm6,%ymm7 +#SNP - Secure Nested Paging support + psmash + pvalidate + rmpupdate + rmpadjust +#INVPCID + invpcid (%rax), %rdx +#OSPKE + rdpkru + wrpkru |