Debian Codegraph @

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