This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Allow setting CpuVRex bit in .arch directive


Hi!

I've tried today to check for the various AVX512* ISA issues in GCC
using assembly .arch support.  Seems by default all flags (but l10m/k10m)
are set, but if I want to allow all insns but say AVX512DQ ISA instructions
or something similar, there is no way to do it - there is no way except
for explicit no* flags to remove ISA bits from the default, so one has to
set some CPU and then add all the ISA flags one wants.  Seems most of them
can be added, except for one very important one - the CpuVRex bit.

Here is a patch to add support for .arch .vrex to set that, another option
might be to set CpuVRex whenever CpuAVX512F is set in 64-bit mode.
Any preferences?

Attached is then the hack I've been using on the GCC side, plus another hack
to try to use XMM16+ regs more often.

2016-05-21  Jakub Jelinek  <jakub@redhat.com>

	* config/tc-i386.c (cpu_arch): Add .vrex entry.

	* i386-gen.c (cpu_flag_init): Add CPU_VREX_FLAGS.
	* i386-init.h: Regenerated.

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 8a4d987..212796a 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -963,6 +963,8 @@ static const arch_entry cpu_arch[] =
     CPU_OSPKE_FLAGS, 0, 0 },
   { STRING_COMMA_LEN (".rdpid"), PROCESSOR_UNKNOWN,
     CPU_RDPID_FLAGS, 0, 0 },
+  { STRING_COMMA_LEN (".vrex"), PROCESSOR_UNKNOWN,
+    CPU_VREX_FLAGS, 0, 0 }
 };
 
 #ifdef I386COFF
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index 5b997f9..8042bee 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -258,7 +258,9 @@ static initializer cpu_flag_init[] =
   { "CPU_OSPKE_FLAGS",
     "CpuOSPKE" },
   { "CPU_RDPID_FLAGS",
-    "CpuRDPID" }
+    "CpuRDPID" },
+  { "CPU_VREX_FLAGS",
+    "CpuVRex" }
 };
 
 static initializer operand_type_init[] =
diff --git a/opcodes/i386-init.h b/opcodes/i386-init.h
index de68c22..f5d6c64 100644
--- a/opcodes/i386-init.h
+++ b/opcodes/i386-init.h
@@ -781,6 +781,13 @@
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
       0, 0, 0, 0, 1, 0, 0, 0, 0, 0 } }
 
+#define CPU_VREX_FLAGS \
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, \
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+
 
 #define OPERAND_TYPE_NONE \
   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \

	Jakub

Attachment: P2
Description: Text document

Attachment: P3
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]