aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-03-31 08:21:05 +0200
committerJan Beulich <jbeulich@suse.com>2023-03-31 08:21:05 +0200
commit0ff3b7d0c70274a916c21eb8fb5e040ee17af9f8 (patch)
treed95febde6ae5fe425f1080438b9525504722549d /gas/testsuite
parent393fbe8d81ed4e26c66493bba5ac98b0bdae5f27 (diff)
downloadgdb-0ff3b7d0c70274a916c21eb8fb5e040ee17af9f8.zip
gdb-0ff3b7d0c70274a916c21eb8fb5e040ee17af9f8.tar.gz
gdb-0ff3b7d0c70274a916c21eb8fb5e040ee17af9f8.tar.bz2
x86: process instruction operands for .insn
Deal with register and memory operands; immediate operands will follow later, as will the handling of EVEX embedded broadcast and EVEX Disp8 scaling. Note that because we can't really know how to encode their use, %cr8 and up cannot be used with .insn outside of 64-bit mode. Users would need to specify an explicit LOCK prefix in combination with %cr0 etc.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/insn-32.d18
-rw-r--r--gas/testsuite/gas/i386/insn-32.s36
-rw-r--r--gas/testsuite/gas/i386/insn-64.d29
-rw-r--r--gas/testsuite/gas/i386/insn-64.s47
4 files changed, 130 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/insn-32.d b/gas/testsuite/gas/i386/insn-32.d
index 77c6fc0..fdd9ae7 100644
--- a/gas/testsuite/gas/i386/insn-32.d
+++ b/gas/testsuite/gas/i386/insn-32.d
@@ -11,6 +11,24 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f3 90[ ]+pause
[ ]*[a-f0-9]+: d9 ee[ ]+fldz
[ ]*[a-f0-9]+: f3 0f 01 e8[ ]+setssbsy
+[ ]*[a-f0-9]+: 8b c1[ ]+mov %ecx,%eax
+[ ]*[a-f0-9]+: 66 8b c8[ ]+mov %ax,%cx
+[ ]*[a-f0-9]+: 89 48 04[ ]+mov %ecx,0x4\(%eax\)
+[ ]*[a-f0-9]+: 8b 0c 05 44 44 00 00[ ]+mov 0x4444\(,%eax,1\),%ecx
+[ ]*[a-f0-9]+: 66 0f b6 cc[ ]+movzbw %ah,%cx
+[ ]*[a-f0-9]+: 0f b7 c8[ ]+movzwl %ax,%ecx
+[ ]*[a-f0-9]+: 0f ca[ ]+bswap %edx
[ ]*[a-f0-9]+: c5 fc 77[ ]+vzeroall
[ ]*[a-f0-9]+: c4 e1 7c 77[ ]+vzeroall
+[ ]*[a-f0-9]+: c5 f1 58 d0[ ]+vaddpd %xmm0,%xmm1,%xmm2
+[ ]*[a-f0-9]+: c5 f5 58 d0[ ]+vaddpd %ymm0,%ymm1,%ymm2
+[ ]*[a-f0-9]+: c5 f2 58 d0[ ]+vaddss %xmm0,%xmm1,%xmm2
+[ ]*[a-f0-9]+: c4 e3 69 68 19 00[ ]+vfmaddps %xmm0,\(%ecx\),%xmm2,%xmm3
+[ ]*[a-f0-9]+: c4 e3 e9 68 19 00[ ]+vfmaddps \(%ecx\),%xmm0,%xmm2,%xmm3
+[ ]*[a-f0-9]+: c4 e3 e9 68 18 10[ ]+vfmaddps \(%eax\),%xmm1,%xmm2,%xmm3
+[ ]*[a-f0-9]+: c5 f8 92 c8[ ]+kmovw %eax,%k1
+[ ]*[a-f0-9]+: c5 f8 93 c1[ ]+kmovw %k1,%eax
+[ ]*[a-f0-9]+: 62 f1 74 18 58 d0[ ]+vaddps \{rn-sae\},%zmm0,%zmm1,%zmm2
+[ ]*[a-f0-9]+: c4 e2 79 92 1c 48[ ]+vgatherdps %xmm0,\(%eax,%xmm1,2\),%xmm3
+[ ]*[a-f0-9]+: 62 f2 fd 0c 93 1c 48[ ]+vgatherqpd \(%eax,%xmm1,2\),%xmm3\{%k4\}
#pass
diff --git a/gas/testsuite/gas/i386/insn-32.s b/gas/testsuite/gas/i386/insn-32.s
index db0ddb7..73491e4 100644
--- a/gas/testsuite/gas/i386/insn-32.s
+++ b/gas/testsuite/gas/i386/insn-32.s
@@ -13,6 +13,42 @@ insn:
# setssbsy
.insn 0xf30f01e8
+ # mov
+ .insn 0x8b, %ecx, %eax
+ .insn 0x8b, %ax, %cx
+ .insn 0x89, %ecx, 4(%eax)
+ .insn 0x8b, 0x4444(,%eax), %ecx
+
+ # movzx
+ .insn 0x0fb6, %ah, %cx
+ .insn 0x0fb7, %eax, %ecx
+
+ # bswap
+ .insn 0x0fc8+r, %edx
+
# vzeroall
.insn VEX.256.0F.WIG 0x77
.insn {vex3} VEX.L1 0x0f77
+
+ # vaddpd
+ .insn VEX.66.0F 0x58, %xmm0, %xmm1, %xmm2
+ .insn VEX.66 0x0f58, %ymm0, %ymm1, %ymm2
+
+ # vaddss
+ .insn VEX.LIG.F3.0F 0x58, %xmm0, %xmm1, %xmm2
+
+ # vfmaddps
+ .insn VEX.66.0F3A.W0 0x68, %xmm0, (%ecx), %xmm2, %xmm3
+ .insn VEX.66.0F3A.W1 0x68, %xmm0, (%ecx), %xmm2, %xmm3
+ .insn VEX.66.0F3A.W1 0x68, (%eax), %xmm1, %xmm2, %xmm3
+
+ # kmovw
+ .insn VEX.L0.0F.W0 0x92, %eax, %k1
+ .insn VEX.L0.0F.W0 0x93, %k1, %eax
+
+ # vaddps
+ .insn EVEX.NP.0F.W0 0x58, {rn-sae}, %zmm0, %zmm1, %zmm2
+
+ # vgather...
+ .insn VEX.66.0f38.W0 0x92, %xmm0, (%eax, %xmm1, 2), %xmm3
+ .insn EVEX.66.0f38.W1 0x93, (%eax, %xmm1, 2), %xmm3{%k4}
diff --git a/gas/testsuite/gas/i386/insn-64.d b/gas/testsuite/gas/i386/insn-64.d
index 6c61989..229960f 100644
--- a/gas/testsuite/gas/i386/insn-64.d
+++ b/gas/testsuite/gas/i386/insn-64.d
@@ -11,6 +11,35 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f3 90[ ]+pause
[ ]*[a-f0-9]+: d9 ee[ ]+fldz
[ ]*[a-f0-9]+: f3 0f 01 e8[ ]+setssbsy
+[ ]*[a-f0-9]+: 44 8b c1[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+: 62 e1 74 58 58 d0[ ]+vaddps \{ru-sae\},%zmm0,%zmm1,%zmm18
+[ ]*[a-f0-9]+: c4 e2 39 92 1c 48[ ]+vgatherdps %xmm8,\(%rax,%xmm1,2\),%xmm3
+[ ]*[a-f0-9]+: c4 c2 79 92 1c 48[ ]+vgatherdps %xmm0,\(%r8,%xmm1,2\),%xmm3
+[ ]*[a-f0-9]+: c4 a2 79 92 1c 48[ ]+vgatherdps %xmm0,\(%rax,%xmm9,2\),%xmm3
+[ ]*[a-f0-9]+: c4 62 79 92 1c 48[ ]+vgatherdps %xmm0,\(%rax,%xmm1,2\),%xmm11
+[ ]*[a-f0-9]+: 62 d2 fd 0c 93 1c 48[ ]+vgatherqpd \(%r8,%xmm1,2\),%xmm3\{%k4\}
+[ ]*[a-f0-9]+: 62 b2 fd 0c 93 1c 48[ ]+vgatherqpd \(%rax,%xmm9,2\),%xmm3\{%k4\}
+[ ]*[a-f0-9]+: 62 f2 fd 04 93 1c 48[ ]+vgatherqpd \(%rax,%xmm17,2\),%xmm3\{%k4\}
+[ ]*[a-f0-9]+: 62 72 fd 0c 93 1c 48[ ]+vgatherqpd \(%rax,%xmm1,2\),%xmm11\{%k4\}
+[ ]*[a-f0-9]+: 62 e2 fd 0c 93 1c 48[ ]+vgatherqpd \(%rax,%xmm1,2\),%xmm19\{%k4\}
#pass
diff --git a/gas/testsuite/gas/i386/insn-64.s b/gas/testsuite/gas/i386/insn-64.s
index db0ddb7..b8f5ede 100644
--- a/gas/testsuite/gas/i386/insn-64.s
+++ b/gas/testsuite/gas/i386/insn-64.s
@@ -13,6 +13,53 @@ insn:
# setssbsy
.insn 0xf30f01e8
+ # mov
+ .insn 0x8b, %ecx, %r8d
+ .insn 0x8b, %rax, %rcx
+ .insn 0x89, %ecx, 8(%r8)
+ .insn 0x8b, 0x8080(,%r8), %ecx
+
+ # movsx
+ .insn 0x0fbe, %ah, %cx
+ .insn 0x0fbf, %eax, %ecx
+ .insn 0x63, %rax, %rcx
+
+ # bswap
+ .insn 0x0fc8+r, %rdx
+ .insn 0x0fc8+r, %r8d
+
# vzeroall
.insn VEX.256.0F.WIG 0x77
.insn {vex3} VEX.L1 0x0f77
+
+ # vaddpd
+ .insn VEX.66.0F 0x58, %xmm8, %xmm1, %xmm2
+ .insn VEX.66 0x0f58, %ymm0, %ymm9, %ymm2
+
+ # vaddss
+ .insn VEX.LIG.F3.0F 0x58, %xmm0, %xmm1, %xmm10
+
+ # vfmaddps
+ .insn VEX.66.0F3A.W0 0x68, %xmm8, (%rcx), %xmm2, %xmm3
+ .insn VEX.66.0F3A.W1 0x68, %xmm0, (%ecx), %xmm2, %xmm3
+ .insn VEX.66.0F3A.W1 0x68, (%r8), %xmm1, %xmm2, %xmm3
+
+ # kmovw
+ .insn VEX.L0.0F.W0 0x92, %r8d, %k1
+ .insn VEX.L0.0F.W0 0x93, %k1, %r8d
+
+ # vaddps
+ .insn EVEX.NP.0F.W0 0x58, {rd-sae}, %zmm16, %zmm1, %zmm2
+ .insn EVEX.NP.0F.W0 0x58, {rn-sae}, %zmm0, %zmm17, %zmm2
+ .insn EVEX.NP.0F.W0 0x58, {ru-sae}, %zmm0, %zmm1, %zmm18
+
+ # vgather...
+ .insn VEX.66.0f38.W0 0x92, %xmm8, (%rax, %xmm1, 2), %xmm3
+ .insn VEX.66.0f38.W0 0x92, %xmm0, (%r8, %xmm1, 2), %xmm3
+ .insn VEX.66.0f38.W0 0x92, %xmm0, (%rax, %xmm9, 2), %xmm3
+ .insn VEX.66.0f38.W0 0x92, %xmm0, (%rax, %xmm1, 2), %xmm11
+ .insn EVEX.66.0f38.W1 0x93, (%r8, %xmm1, 2), %xmm3{%k4}
+ .insn EVEX.66.0f38.W1 0x93, (%rax, %xmm9, 2), %xmm3{%k4}
+ .insn EVEX.66.0f38.W1 0x93, (%rax, %xmm17, 2), %xmm3{%k4}
+ .insn EVEX.66.0f38.W1 0x93, (%rax, %xmm1, 2), %xmm11{%k4}
+ .insn EVEX.66.0f38.W1 0x93, (%rax, %xmm1, 2), %xmm19{%k4}