public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	"Jiang, Haochen" <haochen.jiang@intel.com>
Subject: [PATCH RFC v2 14/14] x86: .insn example - VEX-encoded instructions of original Xeon Phi
Date: Fri, 10 Mar 2023 11:27:47 +0100	[thread overview]
Message-ID: <df8e84be-1e77-07ee-aff6-d457e9b0f818@suse.com> (raw)
In-Reply-To: <b3625235-faf6-00ad-69c2-82583531fe43@suse.com>

While obviously the otherwise unknown to gas MVEX encoded insns cannot
be expressed (for now gas simply doesn't know to keep clear the bit
distinguishing it from EVEX, and of course Phi-specific operand forms
also aren't known to it), the VEX ones can be.

Since the disassembler produces utter rubbish, have expectations - at
least for the time being - in raw hex dump form. (I've verified with my
own disassembler that generated code is correct.)
---
RFC: Do we want this as a new testcase?
---
v2: Pass --divide. Xfail test for Darwin.

--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -875,6 +875,7 @@ if [gas_64_check] then {
     run_dump_test "x86-64-sysenter-amd"
     run_list_test "x86-64-sysenter-amd" "-mamd64"
     run_dump_test "insn-64"
+    run_dump_test "insn-Phi"
     run_dump_test "noreg64"
     run_list_test "noreg64"
     run_dump_test "noreg64-data16"
--- /dev/null
+++ b/gas/testsuite/gas/i386/insn-Phi.d
@@ -0,0 +1,21 @@
+#as: --divide
+#objdump: -sj.text
+#name: .insn (Xeon Phi)
+#xfail: *-*-darwin*
+
+.*: +file format .*
+
+Contents of section .text:
+ 0000 c5fbae78 40c5faae 7840c4c1 7aaef0c4  .*
+ 0010 e1faaef1 c4e06074 e7c5d885 e0ffffff  .*
+ 0020 c5f841d1 c5f842d1 c5f843d1 c56895c1  .*
+ 0030 c5e897f9 c4c3783e d103c5f8 48d1c5f8  .*
+ 0040 49d1c5f8 90d1c578 93d1c4c1 7892d1c5  .*
+ 0050 f844d1c5 f845d1c5 f898d1c5 f846d1c5  .*
+ 0060 f847d1c4 c17abdc8 c461fabd c1c57ab8  .*
+ 0070 c1c4c1fa b8c8c5fb aef1c4c1 fbaef0c4  .*
+ 0080 c17abcc8 c461fabc c1c57bbc c1c4c1fb  .*
+ 0090 bcc8c5f8 184f40c4 c1781850 40c4c178  .*
+ 00a0 185f40c5 f8182d55 ffffffc4 a1781834  .*
+ 00b0 41c4c178 183c88c5 f81824c5 00000000  .*
+ 00c0 c5f81840 40.*
--- /dev/null
+++ b/gas/testsuite/gas/i386/insn-Phi.s
@@ -0,0 +1,44 @@
+	.text
+Phi:
+	.insn VEX.L0.f2.0f 0xae/7, 0x40(%rax)		# clevict0 0x40(%rax)
+	.insn VEX.L0.f3.0f 0xae/7, 0x40(%rax)		# clevict1 0x40(%rax)
+	.insn VEX.L0.f3.0f 0xae/6, %r8d			# delay %r8d
+	.insn VEX.L0.f3.0f 0xae/6, %rcx			# delay %rcx
+	.insn VEX.L0.W0 0x74, $Phi-1f{:s8}, %k3		# jkzd Phi, %k3
+1:
+	.insn VEX.L0.0f.W0 0x85, $Phi-2f{:s32}, %k4	# jknzd Phi, %k4
+2:
+	.insn VEX.L0.0f.W0 0x41, %k1, %k2		# kand %k1, %k2
+	.insn VEX.L0.0f.W0 0x42, %k1, %k2		# kandn %k1, %k2
+	.insn VEX.L0.0f.W0 0x43, %k1, %k2		# kandnr %k1, %k2
+	.insn VEX.L0.0f.W0 0x95, %k1, %k2, %r8		# kconcath %k1, %k2, %r8
+	.insn VEX.L0.0f.W0 0x97, %k1, %k2, %rdi		# kconcatl %k1, %k2, %rdi
+	.insn VEX.L0.0f3a.W0 0x3e, $3, %r9, %k2		# kextract $3, %r9, %k2
+	.insn VEX.L0.0f.W0 0x48, %k1, %k2		# kmergel1h %k1, %k2
+	.insn VEX.L0.0f.W0 0x49, %k1, %k2		# kmergel1l %k1, %k2
+	.insn VEX.L0.0f.W0 0x90, %k1, %k2		# kmov %k1, %k2
+	.insn VEX.L0.0f.W0 0x93, %k1, %r10d		# kmov %k1, %r10d
+	.insn VEX.L0.0f.W0 0x92, %r9d, %k2		# kmov %r9d, %k2
+	.insn VEX.L0.0f.W0 0x44, %k1, %k2		# knot %k1, %k2
+	.insn VEX.L0.0f.W0 0x45, %k1, %k2		# kor %k1, %k2
+	.insn VEX.L0.0f.W0 0x98, %k1, %k2		# kortest %k1, %k2
+	.insn VEX.L0.0f.W0 0x46, %k1, %k2		# kxnor %k1, %k2
+	.insn VEX.L0.0f.W0 0x47, %k1, %k2		# kxor %k1, %k2
+	.insn VEX.L0.f3.0f 0xbd, %r8d, %ecx		# lzcnt %r8d, %ecx
+	.insn VEX.L0.f3.0f 0xbd, %rcx, %r8		# lzcnt %rcx, %r8
+	.insn VEX.L0.f3.0f 0xb8, %ecx, %r8d		# popcnt %ecx, %r8d
+	.insn VEX.L0.f3.0f 0xb8, %r8, %rcx		# popcnt %r8, %rcx
+	.insn VEX.L0.f2.0f 0xae/6, %ecx			# spflt %ecx
+	.insn VEX.L0.f2.0f 0xae/6, %r8			# spflt %r8
+	.insn VEX.L0.f3.0f 0xbc, %r8d, %ecx		# tzcnt %r8d, %ecx
+	.insn VEX.L0.f3.0f 0xbc, %rcx, %r8		# tzcnt %rcx, %r8
+	.insn VEX.L0.f2.0f 0xbc, %ecx, %r8d		# tzcnti %ecx, %r8d
+	.insn VEX.L0.f2.0f 0xbc, %r8, %rcx		# tzcnti %r8, %rcx
+	.insn VEX.L0.0f 0x18/1, 0x40(%rdi)		# vprefetch0 0x40(%rdi)
+	.insn VEX.L0.0f 0x18/2, 0x40(%r8)		# vprefetch1 0x40(%r8)
+	.insn VEX.L0.0f 0x18/3, 0x40(%r15)		# vprefetch2 0x40(%r15)
+	.insn VEX.L0.0f 0x18/5, Phi(%rip)		# vprefetche0 Phi(%rip)
+	.insn VEX.L0.0f 0x18/6, (%rcx,%r8,2)		# vprefetche1 (%rcx,%r8,2)
+	.insn VEX.L0.0f 0x18/7, (%r8,%rcx,4)		# vprefetche2 (%r8,%rcx,4)
+	.insn VEX.L0.0f 0x18/4, (,%rax,8)		# vprefetchenta (,%rax,8)
+	.insn VEX.L0.0f 0x18/0, 0x40(%rax)		# vprefetchnta 0x40(%rax)


  parent reply	other threads:[~2023-03-10 10:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 10:17 [PATCH v2 00/14] x86: new .insn directive Jan Beulich
2023-03-10 10:19 ` [PATCH v2 01/14] x86: introduce " Jan Beulich
2023-03-10 10:19 ` [PATCH v2 02/14] x86: parse VEX and alike specifiers for .insn Jan Beulich
2023-03-10 10:20 ` [PATCH v2 03/14] x86: parse special opcode modifiers " Jan Beulich
2023-03-10 10:21 ` [PATCH v2 04/14] x86: re-work build_modrm_byte()'s register assignment Jan Beulich
2023-03-10 10:21 ` [PATCH v2 05/14] x86: VexVVVV is now merely a boolean Jan Beulich
2023-03-10 10:22 ` [PATCH v2 06/14] x86: drop "shimm" special case template expansions Jan Beulich
2023-03-10 10:22 ` [PATCH v2 07/14] x86/AT&T: restrict recognition of the "absolute branch" prefix character Jan Beulich
2023-03-10 10:23 ` [PATCH v2 08/14] x86: process instruction operands for .insn Jan Beulich
2023-03-10 10:24 ` [PATCH v2 09/14] x86: handle EVEX Disp8 " Jan Beulich
2023-03-10 10:24 ` [PATCH v2 10/14] x86: allow for multiple immediates in output_disp() Jan Beulich
2023-03-10 10:25 ` [PATCH v2 11/14] x86: handle immediate operands for .insn Jan Beulich
2023-03-10 10:26 ` [PATCH v2 12/14] x86: document .insn Jan Beulich
2023-03-10 10:26 ` [PATCH v2 13/14] x86: convert testcases to use .insn Jan Beulich
2023-04-20  8:56   ` Clément Chigot
2023-04-20  9:01     ` Jan Beulich
2023-04-20  9:09       ` Clément Chigot
2023-04-20  9:19         ` Jan Beulich
2023-04-20  9:22           ` Clément Chigot
2023-03-10 10:27 ` Jan Beulich [this message]
2023-03-24  9:51 ` [PATCH v2 00/14] x86: new .insn directive Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df8e84be-1e77-07ee-aff6-d457e9b0f818@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=haochen.jiang@intel.com \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).