gcc/testsuite/g++.dg/vect/simd-bool-comparison-1.cc
raw| 1 | // { dg-do compile } |
| 2 | // { dg-additional-options "-mavx512bw -mavx512dq" { target { i?86-*-* x86_64-*-* } } } |
| 3 | |
| 4 | #define N 1024 |
| 5 | |
| 6 | double a[N]; |
| 7 | bool b[N]; |
| 8 | bool c; |
| 9 | |
| 10 | void test () |
| 11 | { |
| 12 | int i; |
| 13 | |
| 14 | for (i = 0; i < N; i++) |
| 15 | if (b[i] != c) |
| 16 | a[i] = 0.0; |
| 17 | else |
| 18 | a[i] = 1.0; |
| 19 | } |
| 20 | |
| 21 | // { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { i?86-*-* x86_64-*-* } } } } |