Debian Codegraph @

gcc/testsuite/gcc.target/riscv/cpymem-64-ooo.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target rv64 } */
3 /* { dg-options "-march=rv64gc -mabi=lp64d -mtune=generic-ooo" } */
4 /* { dg-skip-if "" { *-*-* } {"-O0" "-Os" "-Og" "-Oz" "-flto" } } */
5 /* { dg-final { check-function-bodies "**" "" } } */
6 /* { dg-allow-blank-lines-in-output 1 } */
7
8 #define COPY_N(N) \
9 void copy_##N (void *to, void *from) \
10 { \
11 __builtin_memcpy (to, from, N); \
12 }
13
14 #define COPY_ALIGNED_N(N) \
15 void copy_aligned_##N (void *to, void *from) \
16 { \
17 to = __builtin_assume_aligned(to, sizeof(long)); \
18 from = __builtin_assume_aligned(from, sizeof(long)); \
19 __builtin_memcpy (to, from, N); \
20 }
21
22 /*
23 **copy_7:
24 ** ...
25 ** lw\t[at][0-9],0\([at][0-9]\)
26 ** sw\t[at][0-9],0\([at][0-9]\)
27 ** lw\t[at][0-9],3\([at][0-9]\)
28 ** sw\t[at][0-9],3\([at][0-9]\)
29 ** ...
30 */
31 COPY_N(7)
32
33 /*
34 **copy_aligned_7:
35 ** ...
36 ** lw\t[at][0-9],0\([at][0-9]\)
37 ** sw\t[at][0-9],0\([at][0-9]\)
38 ** lw\t[at][0-9],3\([at][0-9]\)
39 ** sw\t[at][0-9],3\([at][0-9]\)
40 ** ...
41 */
42 COPY_ALIGNED_N(7)
43
44 /*
45 **copy_8:
46 ** ...
47 ** ld\ta[0-9],0\(a[0-9]\)
48 ** sd\ta[0-9],0\(a[0-9]\)
49 ** ...
50 */
51 COPY_N(8)
52
53 /*
54 **copy_aligned_8:
55 ** ...
56 ** ld\ta[0-9],0\(a[0-9]\)
57 ** sd\ta[0-9],0\(a[0-9]\)
58 ** ...
59 */
60 COPY_ALIGNED_N(8)
61
62 /*
63 **copy_11:
64 ** ...
65 ** ld\t[at][0-9],0\([at][0-9]\)
66 ** sd\t[at][0-9],0\([at][0-9]\)
67 ** lw\t[at][0-9],7\([at][0-9]\)
68 ** sw\t[at][0-9],7\([at][0-9]\)
69 ** ...
70 */
71 COPY_N(11)
72
73 /*
74 **copy_aligned_11:
75 ** ...
76 ** ld\t[at][0-9],0\([at][0-9]\)
77 ** sd\t[at][0-9],0\([at][0-9]\)
78 ** lw\t[at][0-9],7\([at][0-9]\)
79 ** sw\t[at][0-9],7\([at][0-9]\)
80 ** ...
81 */
82 COPY_ALIGNED_N(11)
83
84 /*
85 **copy_15:
86 ** ...
87 ** ld\t[at][0-9],0\([at][0-9]\)
88 ** sd\t[at][0-9],0\([at][0-9]\)
89 ** ld\t[at][0-9],7\([at][0-9]\)
90 ** sd\t[at][0-9],7\([at][0-9]\)
91 ** ...
92 */
93 COPY_N(15)
94
95 /*
96 **copy_aligned_15:
97 ** ...
98 ** ld\t[at][0-9],0\([at][0-9]\)
99 ** sd\t[at][0-9],0\([at][0-9]\)
100 ** ld\t[at][0-9],7\([at][0-9]\)
101 ** sd\t[at][0-9],7\([at][0-9]\)
102 ** ...
103 */
104 COPY_ALIGNED_N(15)
105
106 /*
107 **copy_27:
108 ** ...
109 ** ld\t[at][0-9],16\([at][0-9]\)
110 ** ...
111 ** sd\t[at][0-9],16\([at][0-9]\)
112 ** ...
113 ** lw\t[at][0-9],23\([at][0-9]\)
114 ** sw\t[at][0-9],23\([at][0-9]\)
115 ** ...
116 */
117 COPY_N(27)
118
119 /*
120 **copy_aligned_27:
121 ** ...
122 ** ld\t[at][0-9],16\([at][0-9]\)
123 ** ...
124 ** sd\t[at][0-9],16\([at][0-9]\)
125 ** ...
126 ** lw\t[at][0-9],23\([at][0-9]\)
127 ** sw\t[at][0-9],23\([at][0-9]\)
128 ** ...
129 */
130 COPY_ALIGNED_N(27)