Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/reduc-15.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 (int8_t, and, &=, 4)
7 DEF_REDUC_BITWISE (int8_t, and, &=, 8)
8 DEF_REDUC_BITWISE (int8_t, and, &=, 16)
9 DEF_REDUC_BITWISE (int8_t, and, &=, 32)
10 DEF_REDUC_BITWISE (int8_t, and, &=, 64)
11 DEF_REDUC_BITWISE (int8_t, and, &=, 128)
12 DEF_REDUC_BITWISE (int8_t, and, &=, 256)
13 DEF_REDUC_BITWISE (int8_t, and, &=, 512)
14 DEF_REDUC_BITWISE (int8_t, and, &=, 1024)
15 DEF_REDUC_BITWISE (int8_t, and, &=, 2048)
16 DEF_REDUC_BITWISE (int8_t, and, &=, 4096)
17
18 DEF_REDUC_BITWISE (uint8_t, and, &=, 4)
19 DEF_REDUC_BITWISE (uint8_t, and, &=, 8)
20 DEF_REDUC_BITWISE (uint8_t, and, &=, 16)
21 DEF_REDUC_BITWISE (uint8_t, and, &=, 32)
22 DEF_REDUC_BITWISE (uint8_t, and, &=, 64)
23 DEF_REDUC_BITWISE (uint8_t, and, &=, 128)
24 DEF_REDUC_BITWISE (uint8_t, and, &=, 256)
25 DEF_REDUC_BITWISE (uint8_t, and, &=, 512)
26 DEF_REDUC_BITWISE (uint8_t, and, &=, 1024)
27 DEF_REDUC_BITWISE (uint8_t, and, &=, 2048)
28 DEF_REDUC_BITWISE (uint8_t, and, &=, 4096)
29
30 DEF_REDUC_BITWISE (int8_t, ior, |=, 4)
31 DEF_REDUC_BITWISE (int8_t, ior, |=, 8)
32 DEF_REDUC_BITWISE (int8_t, ior, |=, 16)
33 DEF_REDUC_BITWISE (int8_t, ior, |=, 32)
34 DEF_REDUC_BITWISE (int8_t, ior, |=, 64)
35 DEF_REDUC_BITWISE (int8_t, ior, |=, 128)
36 DEF_REDUC_BITWISE (int8_t, ior, |=, 256)
37 DEF_REDUC_BITWISE (int8_t, ior, |=, 512)
38 DEF_REDUC_BITWISE (int8_t, ior, |=, 1024)
39 DEF_REDUC_BITWISE (int8_t, ior, |=, 2048)
40 DEF_REDUC_BITWISE (int8_t, ior, |=, 4096)
41
42 DEF_REDUC_BITWISE (uint8_t, ior, |=, 4)
43 DEF_REDUC_BITWISE (uint8_t, ior, |=, 8)
44 DEF_REDUC_BITWISE (uint8_t, ior, |=, 16)
45 DEF_REDUC_BITWISE (uint8_t, ior, |=, 32)
46 DEF_REDUC_BITWISE (uint8_t, ior, |=, 64)
47 DEF_REDUC_BITWISE (uint8_t, ior, |=, 128)
48 DEF_REDUC_BITWISE (uint8_t, ior, |=, 256)
49 DEF_REDUC_BITWISE (uint8_t, ior, |=, 512)
50 DEF_REDUC_BITWISE (uint8_t, ior, |=, 1024)
51 DEF_REDUC_BITWISE (uint8_t, ior, |=, 2048)
52 DEF_REDUC_BITWISE (uint8_t, ior, |=, 4096)
53
54 DEF_REDUC_BITWISE (int8_t, xor, ^=, 4)
55 DEF_REDUC_BITWISE (int8_t, xor, ^=, 8)
56 DEF_REDUC_BITWISE (int8_t, xor, ^=, 16)
57 DEF_REDUC_BITWISE (int8_t, xor, ^=, 32)
58 DEF_REDUC_BITWISE (int8_t, xor, ^=, 64)
59 DEF_REDUC_BITWISE (int8_t, xor, ^=, 128)
60 DEF_REDUC_BITWISE (int8_t, xor, ^=, 256)
61 DEF_REDUC_BITWISE (int8_t, xor, ^=, 512)
62 DEF_REDUC_BITWISE (int8_t, xor, ^=, 1024)
63 DEF_REDUC_BITWISE (int8_t, xor, ^=, 2048)
64 DEF_REDUC_BITWISE (int8_t, xor, ^=, 4096)
65
66 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 4)
67 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 8)
68 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 16)
69 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 32)
70 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 64)
71 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 128)
72 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 256)
73 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 512)
74 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 1024)
75 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 2048)
76 DEF_REDUC_BITWISE (uint8_t, xor, ^=, 4096)
77
78 /* { dg-final { scan-assembler-times {vredand\.vs} 22 } } */
79 /* { dg-final { scan-assembler-times {vredor\.vs} 22 } } */
80 /* { dg-final { scan-assembler-times {vredxor\.vs} 22 } } */
81 /* { dg-final { scan-assembler-not {csrr} } } */
82 /* { dg-final { scan-tree-dump-not "1,1" "optimized" } } */
83 /* { dg-final { scan-tree-dump-not "2,2" "optimized" } } */
84 /* { dg-final { scan-tree-dump-not "4,4" "optimized" } } */
85 /* { dg-final { scan-tree-dump-not "16,16" "optimized" } } */
86 /* { dg-final { scan-tree-dump-not "32,32" "optimized" } } */
87 /* { dg-final { scan-tree-dump-not "64,64" "optimized" } } */
88 /* { dg-final { scan-tree-dump-not "128,128" "optimized" } } */
89 /* { dg-final { scan-tree-dump-not "256,256" "optimized" } } */
90 /* { dg-final { scan-tree-dump-not "512,512" "optimized" } } */
91 /* { dg-final { scan-tree-dump-not "1024,1024" "optimized" } } */
92 /* { dg-final { scan-tree-dump-not "2048,2048" "optimized" } } */
93 /* { dg-final { scan-tree-dump-not "4096,4096" "optimized" } } */