1 /* Check that the rotcl instruction is generated. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
4 /* { dg-final { scan-assembler-times "rotcl" 28 } } */
15 test_01 (unsigned int a
, int b
, int c
)
18 return ((a
<< 1) | r
);
22 test_02 (unsigned int a
, int b
, int c
)
25 return ((a
<< 2) | r
);
29 test_03 (unsigned int a
, int b
, int c
)
32 return ((a
<< 3) | r
);
36 test_04 (unsigned int a
, int b
, int c
)
39 return ((a
<< 4) | r
);
43 test_05 (unsigned int a
, int b
, int c
)
46 return ((a
<< 5) | r
);
50 test_06 (unsigned int a
, int b
, int c
)
53 return ((a
<< 6) | r
);
57 test_07 (unsigned int a
, int b
, int c
)
60 return ((a
<< 7) | r
);
64 test_08 (unsigned int a
, int b
, int c
)
67 return ((a
<< 8) | r
);
71 test_09 (unsigned int a
, int b
, int c
)
74 return ((a
<< 31) | r
);
78 test_10 (unsigned int a
, int b
)
80 /* 1x shlr, 1x rotcl */
81 return (a
<< 1) | (b
& 1);
85 test_11 (unsigned int a
, int b
)
87 /* 1x shlr, 1x rotcl (+1x add as shll) */
88 return (a
<< 2) | (b
& 1);
92 test_12 (unsigned int a
, int b
)
94 /* 1x shlr, 1x shll2, 1x rotcl */
95 return (a
<< 3) | (b
& 1);
99 test_13 (unsigned int a
, int b
)
101 /* 1x shll, 1x rotcl */
107 test_14 (unsigned int a
, int b
, int c
)
110 return ((a
<< 1) | r
);
114 test_15 (unsigned int a
, int b
, int c
)
117 return ((a
<< 11) | r
);
121 test_16 (unsigned int a
, int b
, int c
)
124 return ((a
<< 3) | r
);
128 test_17 (unsigned int a
, int b
, int c
)
131 return ((a
<< 4) | r
);
135 test_18 (unsigned int a
, int b
, int c
)
138 return ((a
<< 5) | r
);
142 test_19 (unsigned int a
, int b
, int c
)
145 return ((a
<< 6) | r
);
149 test_20 (unsigned int a
, int b
, int c
)
152 return ((a
<< 7) | r
);
156 test_21 (unsigned int a
, int b
, int c
)
159 return ((a
<< 8) | r
);
163 test_22 (unsigned int a
, int b
, int c
)
166 return ((a
<< 31) | r
);
170 test_23 (unsigned int a
, int b
, int c
)
172 /* 1x shll, 1x rotcl */
173 return (a
>> 31) | (b
<< 13);
177 test_24 (unsigned int a
, unsigned int b
)
179 /* 1x shll, 1x rotcl */
180 return (a
>> 31) | (b
<< 1);
184 test_25 (unsigned int a
, unsigned int b
)
186 /* 1x shll, 1x rotcl */
187 return (a
>> 31) | (b
<< 3);
191 test_26 (unsigned int a
, unsigned int b
)
193 /* 1x shll, 1x rotcl */
194 return (b
<< 3) | (a
>> 31);
198 test_27 (unsigned int a
, unsigned int b
)
200 /* 1x shlr, 1x rotcl */
201 return (a
<< 1) | ((b
>> 4) & 1);