Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-17.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv_zvfh_zvl4096b -mabi=lp64d -O3 -mrvv-max-lmul=m8 -fdump-tree-optimized-details" } */
3
4 #include "def.h"
5
6 DEF_REDUC_BITWISE (int32_t, and, &=, 4)
7 DEF_REDUC_BITWISE (int32_t, and, &=, 8)
8 DEF_REDUC_BITWISE (int32_t, and, &=, 16)
9 DEF_REDUC_BITWISE (int32_t, and, &=, 32)
10 DEF_REDUC_BITWISE (int32_t, and, &=, 64)
11 DEF_REDUC_BITWISE (int32_t, and, &=, 128)
12 DEF_REDUC_BITWISE (int32_t, and, &=, 256)
13 DEF_REDUC_BITWISE (int32_t, and, &=, 512)
14 DEF_REDUC_BITWISE (int32_t, and, &=, 1024)
15
16 DEF_REDUC_BITWISE (uint32_t, and, &=, 4)
17 DEF_REDUC_BITWISE (uint32_t, and, &=, 8)
18 DEF_REDUC_BITWISE (uint32_t, and, &=, 16)
19 DEF_REDUC_BITWISE (uint32_t, and, &=, 32)
20 DEF_REDUC_BITWISE (uint32_t, and, &=, 64)
21 DEF_REDUC_BITWISE (uint32_t, and, &=, 128)
22 DEF_REDUC_BITWISE (uint32_t, and, &=, 256)
23 DEF_REDUC_BITWISE (uint32_t, and, &=, 512)
24 DEF_REDUC_BITWISE (uint32_t, and, &=, 1024)
25
26 DEF_REDUC_BITWISE (int32_t, ior, |=, 4)
27 DEF_REDUC_BITWISE (int32_t, ior, |=, 8)
28 DEF_REDUC_BITWISE (int32_t, ior, |=, 16)
29 DEF_REDUC_BITWISE (int32_t, ior, |=, 32)
30 DEF_REDUC_BITWISE (int32_t, ior, |=, 64)
31 DEF_REDUC_BITWISE (int32_t, ior, |=, 128)
32 DEF_REDUC_BITWISE (int32_t, ior, |=, 256)
33 DEF_REDUC_BITWISE (int32_t, ior, |=, 512)
34 DEF_REDUC_BITWISE (int32_t, ior, |=, 1024)
35
36 DEF_REDUC_BITWISE (uint32_t, ior, |=, 4)
37 DEF_REDUC_BITWISE (uint32_t, ior, |=, 8)
38 DEF_REDUC_BITWISE (uint32_t, ior, |=, 16)
39 DEF_REDUC_BITWISE (uint32_t, ior, |=, 32)
40 DEF_REDUC_BITWISE (uint32_t, ior, |=, 64)
41 DEF_REDUC_BITWISE (uint32_t, ior, |=, 128)
42 DEF_REDUC_BITWISE (uint32_t, ior, |=, 256)
43 DEF_REDUC_BITWISE (uint32_t, ior, |=, 512)
44 DEF_REDUC_BITWISE (uint32_t, ior, |=, 1024)
45
46 DEF_REDUC_BITWISE (int32_t, xor, ^=, 4)
47 DEF_REDUC_BITWISE (int32_t, xor, ^=, 8)
48 DEF_REDUC_BITWISE (int32_t, xor, ^=, 16)
49 DEF_REDUC_BITWISE (int32_t, xor, ^=, 32)
50 DEF_REDUC_BITWISE (int32_t, xor, ^=, 64)
51 DEF_REDUC_BITWISE (int32_t, xor, ^=, 128)
52 DEF_REDUC_BITWISE (int32_t, xor, ^=, 256)
53 DEF_REDUC_BITWISE (int32_t, xor, ^=, 512)
54 DEF_REDUC_BITWISE (int32_t, xor, ^=, 1024)
55
56 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 4)
57 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 8)
58 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 16)
59 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 32)
60 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 64)
61 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 128)
62 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 256)
63 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 512)
64 DEF_REDUC_BITWISE (uint32_t, xor, ^=, 1024)
65
66 /* { dg-final { scan-assembler-times {vredand\.vs} 18 } } */
67 /* { dg-final { scan-assembler-times {vredor\.vs} 18 } } */
68 /* { dg-final { scan-assembler-times {vredxor\.vs} 18 } } */
69 /* { dg-final { scan-assembler-not {csrr} } } */
70 /* { dg-final { scan-tree-dump-not "1,1" "optimized" } } */
71 /* { dg-final { scan-tree-dump-not "2,2" "optimized" } } */
72 /* { dg-final { scan-tree-dump-not "4,4" "optimized" } } */
73 /* { dg-final { scan-tree-dump-not "16,16" "optimized" } } */
74 /* { dg-final { scan-tree-dump-not "32,32" "optimized" } } */
75 /* { dg-final { scan-tree-dump-not "64,64" "optimized" } } */
76 /* { dg-final { scan-tree-dump-not "128,128" "optimized" } } */
77 /* { dg-final { scan-tree-dump-not "256,256" "optimized" } } */
78 /* { dg-final { scan-tree-dump-not "512,512" "optimized" } } */
79 /* { dg-final { scan-tree-dump-not "1024,1024" "optimized" } } */
80 /* { dg-final { scan-tree-dump-not "2048,2048" "optimized" } } */
81 /* { dg-final { scan-tree-dump-not "4096,4096" "optimized" } } */