1 /* { dg-options "-Ofast -mlow-precision-sqrt" } */ 2 3 #define DEF_LOOP(TYPE, FN) \ 4 void \ 5 test_##TYPE (TYPE *x, int n) \ 6 { \ 7 for (int i = 0; i < n; ++i) \ 8 x[i] = FN (x[i]); \ 9 } 10 11 #define TEST_ALL(T) \ 12 T (_Float16, __builtin_sqrtf16) \ 13 T (float, __builtin_sqrtf) \ 14 T (double, __builtin_sqrt) 15 16 TEST_ALL (DEF_LOOP) 17 18 /* { dg-final { scan-assembler {\tfsqrt\tz[0-9]+\.h} } } */ 19 /* { dg-final { scan-assembler-not {\tfrsqrte\tz[0-9]+\.h} } } */ 20 /* { dg-final { scan-assembler-not {\tfrsqrts\tz[0-9]+\.h} } } */ 21 22 /* { dg-final { scan-assembler-times {\tmovprfx\tz[0-9]+\.s, p[0-7]/z} 1 } } */ 23 /* { dg-final { scan-assembler-times {\tfmul\tz[0-9]+\.s} 3 } } */ 24 /* { dg-final { scan-assembler-times {\tfrsqrte\tz[0-9]+\.s} 1 } } */ 25 /* { dg-final { scan-assembler-times {\tfrsqrts\tz[0-9]+\.s} 1 } } */ 26 27 /* { dg-final { scan-assembler-times {\tmovprfx\tz[0-9]+\.d, p[0-7]/z} 1 } } */ 28 /* { dg-final { scan-assembler-times {\tfmul\tz[0-9]+\.d} 5 } } */ 29 /* { dg-final { scan-assembler-times {\tfrsqrte\tz[0-9]+\.d} 1 } } */ 30 /* { dg-final { scan-assembler-times {\tfrsqrts\tz[0-9]+\.d} 2 } } */ 31