/* { dg-do run { target *-*-linux* *-*-gnu* } } */ /* { dg-options "-O2 -mavx512er" } */ /* { dg-require-effective-target avx512er } */ #include "avx512er-check.h" #include #include #include static int counter; void handler (int i) { counter++; } static void avx512er_test (void) { struct sigaction s; sigemptyset (&s.sa_mask); s.sa_handler = handler; s.sa_flags = 0; sigaction (SIGFPE, &s, NULL); __m512 a = _mm512_set1_ps (-1.f); _mm_setcsr ( _MM_MASK_MASK & ~_MM_MASK_INVALID ); volatile __m512 r1 = _mm512_rsqrt28_round_ps (a, _MM_FROUND_NO_EXC); volatile __m512 r2 = _mm512_rsqrt28_round_ps (a, _MM_FROUND_CUR_DIRECTION); if (counter != 1) abort (); }