* [PATCH] Follow-up patch on enabling new AVX512 instructions
@ 2016-11-15 21:50 Andrew Senkevich
2016-11-16 20:45 ` Uros Bizjak
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Senkevich @ 2016-11-15 21:50 UTC (permalink / raw)
To: gcc-patches, Uros Bizjak
[-- Attachment #1: Type: text/plain, Size: 4462 bytes --]
Hi,
this is follow-up with tests for new __target__ attributes and
__builtin_cpu_supports update.
gcc/
* config/i386/i386.c (processor_features): Add
F_AVX5124VNNIW, F_AVX5124FMAPS.
(isa_names_table): Handle new features.
libgcc/
* config/i386/cpuinfo.c (processor_features): Add
FEATURE_AVX5124VNNIW, FEATURE_AVX5124FMAPS.
gcc/testsuite/
* gcc.target/i386/builtin_target.c: Handle new "avx5124vnniw",
"avx5124fmaps".
* gcc.target/i386/funcspec-56.inc: Test new attributes.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1da1abc..823930d
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -33205,6 +33205,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
F_AVX512PF,
F_AVX512VBMI,
F_AVX512IFMA,
+ F_AVX5124VNNIW,
+ F_AVX5124FMAPS,
F_MAX
};
@@ -33317,6 +33319,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
{"avx512pf",F_AVX512PF},
{"avx512vbmi",F_AVX512VBMI},
{"avx512ifma",F_AVX512IFMA},
+ {"avx5124vnniw",F_AVX5124VNNIW},
+ {"avx5124fmaps",F_AVX5124FMAPS},
};
tree __processor_model_type = build_processor_model_struct ();
diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c
b/gcc/testsuite/gcc.target/i386/builtin_target.c
index 8d45d83..c620a74
--- a/gcc/testsuite/gcc.target/i386/builtin_target.c
+++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
@@ -213,6 +213,10 @@ check_features (unsigned int ecx, unsigned int edx,
assert (__builtin_cpu_supports ("avx512ifma"));
if (ecx & bit_AVX512VBMI)
assert (__builtin_cpu_supports ("avx512vbmi"));
+ if (edx & bit_AVX5124VNNIW)
+ assert (__builtin_cpu_supports ("avx5124vnniw"));
+ if (edx & bit_AVX5124FMAPS)
+ assert (__builtin_cpu_supports ("avx5124fmaps"));
}
}
@@ -311,6 +315,10 @@ quick_check ()
assert (__builtin_cpu_supports ("avx512f") >= 0);
+ assert (__builtin_cpu_supports ("avx5124vnniw") >= 0);
+
+ assert (__builtin_cpu_supports ("avx5124fmaps") >= 0);
+
/* Check CPU type. */
assert (__builtin_cpu_is ("amd") >= 0);
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index af203f2..4a0ad25
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -115,7 +115,9 @@ enum processor_features
FEATURE_AVX512ER,
FEATURE_AVX512PF,
FEATURE_AVX512VBMI,
- FEATURE_AVX512IFMA
+ FEATURE_AVX512IFMA,
+ FEATURE_AVX5124VNNIW,
+ FEATURE_AVX5124FMAPS
};
struct __processor_model
@@ -359,6 +361,10 @@ get_available_features (unsigned int ecx, unsigned int edx,
features |= (1 << FEATURE_AVX512IFMA);
if (ecx & bit_AVX512VBMI)
features |= (1 << FEATURE_AVX512VBMI);
+ if (edx & bit_AVX5124VNNIW)
+ features |= (1 << FEATURE_AVX5124VNNIW);
+ if (edx & bit_AVX5124FMAPS)
+ features |= (1 << FEATURE_AVX5124FMAPS);
}
unsigned int ext_level;
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
index 521ac8a..9334e9e 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
+++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
@@ -28,6 +28,8 @@ extern void test_avx512dq(void)
__attribute__((__target__("avx512dq")));
extern void test_avx512er(void)
__attribute__((__target__("avx512er")));
extern void test_avx512pf(void)
__attribute__((__target__("avx512pf")));
extern void test_avx512cd(void)
__attribute__((__target__("avx512cd")));
+extern void test_avx5124fmaps(void)
__attribute__((__target__("avx5124fmaps")));
+extern void test_avx5124vnniw(void)
__attribute__((__target__("avx5124vnniw")));
extern void test_bmi (void)
__attribute__((__target__("bmi")));
extern void test_bmi2 (void)
__attribute__((__target__("bmi2")));
@@ -59,6 +61,8 @@ extern void test_no_avx512dq(void)
__attribute__((__target__("no-avx512dq")));
extern void test_no_avx512er(void)
__attribute__((__target__("no-avx512er")));
extern void test_bo_avx512pf(void)
__attribute__((__target__("no-avx512pf")));
extern void test_no_avx512cd(void)
__attribute__((__target__("no-avx512cd")));
+extern void test_no_avx5124fmaps(void)
__attribute__((__target__("no-avx5124fmaps")));
+extern void test_no_avx5124vnniw(void)
__attribute__((__target__("no-avx5124vnniw")));
extern void test_no_bmi (void)
__attribute__((__target__("no-bmi")));
extern void test_no_bmi2 (void)
__attribute__((__target__("no-bmi2")));
--
WBR,
Andrew
[-- Attachment #2: followup_tests.patch --]
[-- Type: application/octet-stream, Size: 3928 bytes --]
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1da1abc..823930d
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -33205,6 +33205,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
F_AVX512PF,
F_AVX512VBMI,
F_AVX512IFMA,
+ F_AVX5124VNNIW,
+ F_AVX5124FMAPS,
F_MAX
};
@@ -33317,6 +33319,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
{"avx512pf",F_AVX512PF},
{"avx512vbmi",F_AVX512VBMI},
{"avx512ifma",F_AVX512IFMA},
+ {"avx5124vnniw",F_AVX5124VNNIW},
+ {"avx5124fmaps",F_AVX5124FMAPS},
};
tree __processor_model_type = build_processor_model_struct ();
diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c
index 8d45d83..c620a74
--- a/gcc/testsuite/gcc.target/i386/builtin_target.c
+++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
@@ -213,6 +213,10 @@ check_features (unsigned int ecx, unsigned int edx,
assert (__builtin_cpu_supports ("avx512ifma"));
if (ecx & bit_AVX512VBMI)
assert (__builtin_cpu_supports ("avx512vbmi"));
+ if (edx & bit_AVX5124VNNIW)
+ assert (__builtin_cpu_supports ("avx5124vnniw"));
+ if (edx & bit_AVX5124FMAPS)
+ assert (__builtin_cpu_supports ("avx5124fmaps"));
}
}
@@ -311,6 +315,10 @@ quick_check ()
assert (__builtin_cpu_supports ("avx512f") >= 0);
+ assert (__builtin_cpu_supports ("avx5124vnniw") >= 0);
+
+ assert (__builtin_cpu_supports ("avx5124fmaps") >= 0);
+
/* Check CPU type. */
assert (__builtin_cpu_is ("amd") >= 0);
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index af203f2..4a0ad25
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -115,7 +115,9 @@ enum processor_features
FEATURE_AVX512ER,
FEATURE_AVX512PF,
FEATURE_AVX512VBMI,
- FEATURE_AVX512IFMA
+ FEATURE_AVX512IFMA,
+ FEATURE_AVX5124VNNIW,
+ FEATURE_AVX5124FMAPS
};
struct __processor_model
@@ -359,6 +361,10 @@ get_available_features (unsigned int ecx, unsigned int edx,
features |= (1 << FEATURE_AVX512IFMA);
if (ecx & bit_AVX512VBMI)
features |= (1 << FEATURE_AVX512VBMI);
+ if (edx & bit_AVX5124VNNIW)
+ features |= (1 << FEATURE_AVX5124VNNIW);
+ if (edx & bit_AVX5124FMAPS)
+ features |= (1 << FEATURE_AVX5124FMAPS);
}
unsigned int ext_level;
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
index 521ac8a..9334e9e 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
+++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
@@ -28,6 +28,8 @@ extern void test_avx512dq(void) __attribute__((__target__("avx512dq")));
extern void test_avx512er(void) __attribute__((__target__("avx512er")));
extern void test_avx512pf(void) __attribute__((__target__("avx512pf")));
extern void test_avx512cd(void) __attribute__((__target__("avx512cd")));
+extern void test_avx5124fmaps(void) __attribute__((__target__("avx5124fmaps")));
+extern void test_avx5124vnniw(void) __attribute__((__target__("avx5124vnniw")));
extern void test_bmi (void) __attribute__((__target__("bmi")));
extern void test_bmi2 (void) __attribute__((__target__("bmi2")));
@@ -59,6 +61,8 @@ extern void test_no_avx512dq(void) __attribute__((__target__("no-avx512dq")));
extern void test_no_avx512er(void) __attribute__((__target__("no-avx512er")));
extern void test_bo_avx512pf(void) __attribute__((__target__("no-avx512pf")));
extern void test_no_avx512cd(void) __attribute__((__target__("no-avx512cd")));
+extern void test_no_avx5124fmaps(void) __attribute__((__target__("no-avx5124fmaps")));
+extern void test_no_avx5124vnniw(void) __attribute__((__target__("no-avx5124vnniw")));
extern void test_no_bmi (void) __attribute__((__target__("no-bmi")));
extern void test_no_bmi2 (void) __attribute__((__target__("no-bmi2")));
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Follow-up patch on enabling new AVX512 instructions
2016-11-15 21:50 [PATCH] Follow-up patch on enabling new AVX512 instructions Andrew Senkevich
@ 2016-11-16 20:45 ` Uros Bizjak
[not found] ` <CAMXFM3sbkJ9b=8CDxJYfG_t2Xw4UO3Wa-HB3dxfBNN6LGYhc_Q@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2016-11-16 20:45 UTC (permalink / raw)
To: Andrew Senkevich; +Cc: gcc-patches
On Tue, Nov 15, 2016 at 10:50 PM, Andrew Senkevich
<andrew.n.senkevich@gmail.com> wrote:
> Hi,
>
> this is follow-up with tests for new __target__ attributes and
> __builtin_cpu_supports update.
>
> gcc/
> * config/i386/i386.c (processor_features): Add
> F_AVX5124VNNIW, F_AVX5124FMAPS.
> (isa_names_table): Handle new features.
> libgcc/
> * config/i386/cpuinfo.c (processor_features): Add
> FEATURE_AVX5124VNNIW, FEATURE_AVX5124FMAPS.
> gcc/testsuite/
> * gcc.target/i386/builtin_target.c: Handle new "avx5124vnniw",
> "avx5124fmaps".
> * gcc.target/i386/funcspec-56.inc: Test new attributes.
OK.
Thanks,
Uros.
> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> index 1da1abc..823930d
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -33205,6 +33205,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
> F_AVX512PF,
> F_AVX512VBMI,
> F_AVX512IFMA,
> + F_AVX5124VNNIW,
> + F_AVX5124FMAPS,
> F_MAX
> };
>
> @@ -33317,6 +33319,8 @@ fold_builtin_cpu (tree fndecl, tree *args)
> {"avx512pf",F_AVX512PF},
> {"avx512vbmi",F_AVX512VBMI},
> {"avx512ifma",F_AVX512IFMA},
> + {"avx5124vnniw",F_AVX5124VNNIW},
> + {"avx5124fmaps",F_AVX5124FMAPS},
> };
>
> tree __processor_model_type = build_processor_model_struct ();
> diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c
> b/gcc/testsuite/gcc.target/i386/builtin_target.c
> index 8d45d83..c620a74
> --- a/gcc/testsuite/gcc.target/i386/builtin_target.c
> +++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
> @@ -213,6 +213,10 @@ check_features (unsigned int ecx, unsigned int edx,
> assert (__builtin_cpu_supports ("avx512ifma"));
> if (ecx & bit_AVX512VBMI)
> assert (__builtin_cpu_supports ("avx512vbmi"));
> + if (edx & bit_AVX5124VNNIW)
> + assert (__builtin_cpu_supports ("avx5124vnniw"));
> + if (edx & bit_AVX5124FMAPS)
> + assert (__builtin_cpu_supports ("avx5124fmaps"));
> }
> }
>
> @@ -311,6 +315,10 @@ quick_check ()
>
> assert (__builtin_cpu_supports ("avx512f") >= 0);
>
> + assert (__builtin_cpu_supports ("avx5124vnniw") >= 0);
> +
> + assert (__builtin_cpu_supports ("avx5124fmaps") >= 0);
> +
> /* Check CPU type. */
> assert (__builtin_cpu_is ("amd") >= 0);
>
> diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
> index af203f2..4a0ad25
> --- a/libgcc/config/i386/cpuinfo.c
> +++ b/libgcc/config/i386/cpuinfo.c
> @@ -115,7 +115,9 @@ enum processor_features
> FEATURE_AVX512ER,
> FEATURE_AVX512PF,
> FEATURE_AVX512VBMI,
> - FEATURE_AVX512IFMA
> + FEATURE_AVX512IFMA,
> + FEATURE_AVX5124VNNIW,
> + FEATURE_AVX5124FMAPS
> };
>
> struct __processor_model
> @@ -359,6 +361,10 @@ get_available_features (unsigned int ecx, unsigned int edx,
> features |= (1 << FEATURE_AVX512IFMA);
> if (ecx & bit_AVX512VBMI)
> features |= (1 << FEATURE_AVX512VBMI);
> + if (edx & bit_AVX5124VNNIW)
> + features |= (1 << FEATURE_AVX5124VNNIW);
> + if (edx & bit_AVX5124FMAPS)
> + features |= (1 << FEATURE_AVX5124FMAPS);
> }
>
> unsigned int ext_level;
> diff --git a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> index 521ac8a..9334e9e 100644
> --- a/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> +++ b/gcc/testsuite/gcc.target/i386/funcspec-56.inc
> @@ -28,6 +28,8 @@ extern void test_avx512dq(void)
> __attribute__((__target__("avx512dq")));
> extern void test_avx512er(void)
> __attribute__((__target__("avx512er")));
> extern void test_avx512pf(void)
> __attribute__((__target__("avx512pf")));
> extern void test_avx512cd(void)
> __attribute__((__target__("avx512cd")));
> +extern void test_avx5124fmaps(void)
> __attribute__((__target__("avx5124fmaps")));
> +extern void test_avx5124vnniw(void)
> __attribute__((__target__("avx5124vnniw")));
> extern void test_bmi (void)
> __attribute__((__target__("bmi")));
> extern void test_bmi2 (void)
> __attribute__((__target__("bmi2")));
>
> @@ -59,6 +61,8 @@ extern void test_no_avx512dq(void)
> __attribute__((__target__("no-avx512dq")));
> extern void test_no_avx512er(void)
> __attribute__((__target__("no-avx512er")));
> extern void test_bo_avx512pf(void)
> __attribute__((__target__("no-avx512pf")));
> extern void test_no_avx512cd(void)
> __attribute__((__target__("no-avx512cd")));
> +extern void test_no_avx5124fmaps(void)
> __attribute__((__target__("no-avx5124fmaps")));
> +extern void test_no_avx5124vnniw(void)
> __attribute__((__target__("no-avx5124vnniw")));
> extern void test_no_bmi (void)
> __attribute__((__target__("no-bmi")));
> extern void test_no_bmi2 (void)
> __attribute__((__target__("no-bmi2")));
>
>
> --
> WBR,
> Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Follow-up patch on enabling new AVX512 instructions
[not found] ` <CAMXFM3sbkJ9b=8CDxJYfG_t2Xw4UO3Wa-HB3dxfBNN6LGYhc_Q@mail.gmail.com>
@ 2016-11-17 22:18 ` H.J. Lu
0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2016-11-17 22:18 UTC (permalink / raw)
To: Andrew Senkevich; +Cc: GCC Patches
On Thu, Nov 17, 2016 at 4:26 AM, Andrew Senkevich
<andrew.n.senkevich@gmail.com> wrote:
> 16 Ноя 2016 г. 23:45 пользователь "Uros Bizjak" <ubizjak@gmail.com> написал:
>>
>> On Tue, Nov 15, 2016 at 10:50 PM, Andrew Senkevich
>> <andrew.n.senkevich@gmail.com> wrote:
>> > Hi,
>> >
>> > this is follow-up with tests for new __target__ attributes and
>> > __builtin_cpu_supports update.
>> >
>> > gcc/
>> > * config/i386/i386.c (processor_features): Add
>> > F_AVX5124VNNIW, F_AVX5124FMAPS.
>> > (isa_names_table): Handle new features.
>> > libgcc/
>> > * config/i386/cpuinfo.c (processor_features): Add
>> > FEATURE_AVX5124VNNIW, FEATURE_AVX5124FMAPS.
>> > gcc/testsuite/
>> > * gcc.target/i386/builtin_target.c: Handle new "avx5124vnniw",
>> > "avx5124fmaps".
>> > * gcc.target/i386/funcspec-56.inc: Test new attributes.
>>
>> OK.
>>
>> Thanks,
>> Uros.
>
> HJ, could you please commit this patch also?
Done.
--
H.J.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-17 22:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 21:50 [PATCH] Follow-up patch on enabling new AVX512 instructions Andrew Senkevich
2016-11-16 20:45 ` Uros Bizjak
[not found] ` <CAMXFM3sbkJ9b=8CDxJYfG_t2Xw4UO3Wa-HB3dxfBNN6LGYhc_Q@mail.gmail.com>
2016-11-17 22:18 ` H.J. Lu
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).