RFC: Define GNU_PROPERTY_X86_ISA_1_AVX512_BF16

Message ID CAMe9rOoEq7wN+VWmL9MaVXsQPve6AQuBYYm=6gZe151NpQ_1Mw@mail.gmail.com
State New
Headers show
Series
  • RFC: Define GNU_PROPERTY_X86_ISA_1_AVX512_BF16
Related show

Commit Message

H.J. Lu April 5, 2019, 7:59 p.m.
I'd like to add

#define GNU_PROPERTY_X86_ISA_1_AVX512_BF16  (1U << 24)

for AVX512_BF16.   I am enclosing a binutils patch.

-- 
H.J.

Patch

From 5c69cc50d247d3b5ec44f133676fb8fe72389464 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 5 Apr 2019 12:50:46 -0700
Subject: [PATCH] x86: Define GNU_PROPERTY_X86_ISA_1_AVX512_BF16

Update assembler and readelf to support

 #define GNU_PROPERTY_X86_ISA_1_AVX512_BF16  (1U << 24)

for AVX512_BF16.

binutils/

	* readelf.c (decode_x86_isa): Handle
	GNU_PROPERTY_X86_ISA_1_AVX512_BF16.
	* testsuite/binutils-all/i386/pr21231b.d: Updated.
	* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.

gas/

	* config/tc-i386.c (output_insn): Support
	GNU_PROPERTY_X86_ISA_1_AVX512_BF16.
	* testsuite/gas/i386/property-2.s: Add AVX512_BF16 test.
	* testsuite/gas/i386/property-2.d: Updated.
	* testsuite/gas/i386/x86-64-property-2.d: Likewise.

include/

	* elf/common.h (GNU_PROPERTY_X86_ISA_1_AVX512_BF16): New.
---
 binutils/readelf.c                                | 3 +++
 binutils/testsuite/binutils-all/i386/pr21231b.d   | 2 +-
 binutils/testsuite/binutils-all/x86-64/pr21231b.d | 2 +-
 gas/config/tc-i386.c                              | 2 ++
 gas/testsuite/gas/i386/property-2.d               | 2 +-
 gas/testsuite/gas/i386/property-2.s               | 1 +
 gas/testsuite/gas/i386/x86-64-property-2.d        | 2 +-
 include/elf/common.h                              | 1 +
 8 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 5a9d9ff433..701ab05461 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -17279,6 +17279,9 @@  decode_x86_isa (unsigned int bitmask)
 	case GNU_PROPERTY_X86_ISA_1_AVX512_VNNI:
 	  printf ("AVX512_VNNI");
 	  break;
+	case GNU_PROPERTY_X86_ISA_1_AVX512_BF16:
+	  printf ("AVX512_BF16");
+	  break;
 	default:
 	  printf (_("<unknown: %x>"), bit);
 	  break;
diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.d b/binutils/testsuite/binutils-all/i386/pr21231b.d
index 044a596cd7..0576ce8b75 100644
--- a/binutils/testsuite/binutils-all/i386/pr21231b.d
+++ b/binutils/testsuite/binutils-all/i386/pr21231b.d
@@ -8,7 +8,7 @@  Displaying notes found in: .note.gnu.property
   GNU                  0x0000002c	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
 	no copy on protected 
-	x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>
+	x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>
 	x86 ISA needed: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ
   GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.d b/binutils/testsuite/binutils-all/x86-64/pr21231b.d
index 7ee42d5dd1..d4891c2380 100644
--- a/binutils/testsuite/binutils-all/x86-64/pr21231b.d
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.d
@@ -8,7 +8,7 @@  Displaying notes found in: .note.gnu.property
   GNU                  0x00000038	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
 	no copy on protected 
-	x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>
+	x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>
 	x86 ISA needed: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ
   GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 ISA used: <None>
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index ed8cfe1ad3..4816b54f93 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -8144,6 +8144,8 @@  output_insn (void)
 	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2;
       if (i.tm.cpu_flags.bitfield.cpuavx512_vnni)
 	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_VNNI;
+      if (i.tm.cpu_flags.bitfield.cpuavx512_bf16)
+	x86_isa_1_used |= GNU_PROPERTY_X86_ISA_1_AVX512_BF16;
 
       if (i.tm.cpu_flags.bitfield.cpu8087
 	  || i.tm.cpu_flags.bitfield.cpu287
diff --git a/gas/testsuite/gas/i386/property-2.d b/gas/testsuite/gas/i386/property-2.d
index 4803a0a7dc..c7e321dd91 100644
--- a/gas/testsuite/gas/i386/property-2.d
+++ b/gas/testsuite/gas/i386/property-2.d
@@ -5,5 +5,5 @@ 
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI
+      Properties: x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16
 	x86 feature used: x86, x87, MMX, XMM, YMM, ZMM, FXSR, XSAVE, XSAVEOPT, XSAVEC
diff --git a/gas/testsuite/gas/i386/property-2.s b/gas/testsuite/gas/i386/property-2.s
index ca73cb8ced..15281872bc 100644
--- a/gas/testsuite/gas/i386/property-2.s
+++ b/gas/testsuite/gas/i386/property-2.s
@@ -29,3 +29,4 @@ 
 	vpermt2b	(%ecx), %zmm0, %zmm1
 	vpcompressb	%zmm0, %zmm1
 	vpdpwssds	(%ecx), %zmm0, %zmm1
+	vcvtne2ps2bf16	(%ecx), %zmm0, %zmm1
diff --git a/gas/testsuite/gas/i386/x86-64-property-2.d b/gas/testsuite/gas/i386/x86-64-property-2.d
index 6ac3d59b23..72e2131995 100644
--- a/gas/testsuite/gas/i386/x86-64-property-2.d
+++ b/gas/testsuite/gas/i386/x86-64-property-2.d
@@ -6,5 +6,5 @@ 
 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI
+      Properties: x86 ISA used: CMOV, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, FMA, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, AVX512_4FMAPS, AVX512_4VNNIW, AVX512_BITALG, AVX512_IFMA, AVX512_VBMI, AVX512_VBMI2, AVX512_VNNI, AVX512_BF16
 	x86 feature used: x86, x87, MMX, XMM, YMM, ZMM, FXSR, XSAVE, XSAVEOPT, XSAVEC
diff --git a/include/elf/common.h b/include/elf/common.h
index ebdb8212d1..75c4fb7e9d 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -829,6 +829,7 @@ 
 #define GNU_PROPERTY_X86_ISA_1_AVX512_VBMI	(1U << 21)
 #define GNU_PROPERTY_X86_ISA_1_AVX512_VBMI2	(1U << 22)
 #define GNU_PROPERTY_X86_ISA_1_AVX512_VNNI	(1U << 23)
+#define GNU_PROPERTY_X86_ISA_1_AVX512_BF16	(1U << 24)
 
 #define GNU_PROPERTY_X86_FEATURE_2_X86		(1U << 0)
 #define GNU_PROPERTY_X86_FEATURE_2_X87		(1U << 1)
-- 
2.20.1