gcc/testsuite/gcc.target/i386/avx-cvtsd-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-require-effective-target avx } */ |
| 3 | /* { dg-options "-O2 -mavx" } */ |
| 4 | |
| 5 | #include "avx-check.h" |
| 6 | |
| 7 | __attribute__((noinline, noclone)) double |
| 8 | foo (__m256d x) |
| 9 | { |
| 10 | return _mm256_cvtsd_f64 (x); |
| 11 | } |
| 12 | |
| 13 | static void |
| 14 | avx_test (void) |
| 15 | { |
| 16 | if (_mm256_cvtsd_f64 (_mm256_set_pd (13.5, 24.5, 23.0, 22.5)) != 22.5) |
| 17 | __builtin_abort (); |
| 18 | |
| 19 | if (foo (_mm256_set_pd (24.25, 23.75, 22.0, 12.25)) != 12.25) |
| 20 | __builtin_abort (); |
| 21 | } |