Move runtime check into a separate function and guard it with target ("no-avx")
The patch can avoid SIGILL on non-AVX512 machine due to kmovd is generated in dynamic check. gcc/testsuite/ChangeLog: PR target/115748 * gcc.target/i386/avx512-check.h: Move runtime check into a separate function and guard it with target ("no-avx").
This commit is contained in:
parent
ab3e3d2f05
commit
239ad907b1
1 changed files with 13 additions and 1 deletions
|
@ -34,8 +34,9 @@ check_osxsave (void)
|
|||
return (ecx & bit_OSXSAVE) != 0;
|
||||
}
|
||||
|
||||
__attribute__((noipa,target("no-avx")))
|
||||
int
|
||||
main ()
|
||||
avx512_runtime_support_p ()
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
|
||||
|
@ -100,6 +101,17 @@ main ()
|
|||
&& (edx & bit_AVX512VP2INTERSECT)
|
||||
#endif
|
||||
&& avx512f_os_support ())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (avx512_runtime_support_p ())
|
||||
{
|
||||
DO_TEST ();
|
||||
#ifdef DEBUG
|
||||
|
|
Loading…
Add table
Reference in a new issue