| 1 |
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ |
| 2 |
|
| 3 |
#include "test_sve_acle.h" |
| 4 |
|
| 5 |
/* |
| 6 |
** cntb_1: |
| 7 |
** cntb x0 |
| 8 |
** ret |
| 9 |
*/ |
| 10 |
PROTO (cntb_1, uint64_t, ()) { return svcntb (); } |
| 11 |
|
| 12 |
/* |
| 13 |
** cntb_2: |
| 14 |
** cntb x0, all, mul #2 |
| 15 |
** ret |
| 16 |
*/ |
| 17 |
PROTO (cntb_2, uint64_t, ()) { return svcntb () * 2; } |
| 18 |
|
| 19 |
/* |
| 20 |
** cntb_3: |
| 21 |
** cntb x0, all, mul #3 |
| 22 |
** ret |
| 23 |
*/ |
| 24 |
PROTO (cntb_3, uint64_t, ()) { return svcntb () * 3; } |
| 25 |
|
| 26 |
/* |
| 27 |
** cntb_4: |
| 28 |
** cntb x0, all, mul #4 |
| 29 |
** ret |
| 30 |
*/ |
| 31 |
PROTO (cntb_4, uint64_t, ()) { return svcntb () * 4; } |
| 32 |
|
| 33 |
/* |
| 34 |
** cntb_8: |
| 35 |
** cntb x0, all, mul #8 |
| 36 |
** ret |
| 37 |
*/ |
| 38 |
PROTO (cntb_8, uint64_t, ()) { return svcntb () * 8; } |
| 39 |
|
| 40 |
/* |
| 41 |
** cntb_15: |
| 42 |
** cntb x0, all, mul #15 |
| 43 |
** ret |
| 44 |
*/ |
| 45 |
PROTO (cntb_15, uint64_t, ()) { return svcntb () * 15; } |
| 46 |
|
| 47 |
/* |
| 48 |
** cntb_16: |
| 49 |
** cntb x0, all, mul #16 |
| 50 |
** ret |
| 51 |
*/ |
| 52 |
PROTO (cntb_16, uint64_t, ()) { return svcntb () * 16; } |
| 53 |
|
| 54 |
/* |
| 55 |
** cntb_17: |
| 56 |
** rdvl x0, #17 |
| 57 |
** ret |
| 58 |
*/ |
| 59 |
PROTO (cntb_17, uint64_t, ()) { return svcntb () * 17; } |
| 60 |
|
| 61 |
/* |
| 62 |
** cntb_31: |
| 63 |
** rdvl x0, #31 |
| 64 |
** ret |
| 65 |
*/ |
| 66 |
PROTO (cntb_31, uint64_t, ()) { return svcntb () * 31; } |
| 67 |
|
| 68 |
/* |
| 69 |
** cntb_32: |
| 70 |
** cntb (x[0-9]+) |
| 71 |
** lsl x0, \1, 5 |
| 72 |
** ret |
| 73 |
*/ |
| 74 |
PROTO (cntb_32, uint64_t, ()) { return svcntb () * 32; } |
| 75 |
|
| 76 |
/* Other sequences would be OK. */ |
| 77 |
/* |
| 78 |
** cntb_33: |
| 79 |
** cntb (x[0-9]+) |
| 80 |
** lsl x0, \1, 5 |
| 81 |
** incb x0 |
| 82 |
** ret |
| 83 |
*/ |
| 84 |
PROTO (cntb_33, uint64_t, ()) { return svcntb () * 33; } |
| 85 |
|
| 86 |
/* |
| 87 |
** cntb_64: |
| 88 |
** cntb (x[0-9]+) |
| 89 |
** lsl x0, \1, 6 |
| 90 |
** ret |
| 91 |
*/ |
| 92 |
PROTO (cntb_64, uint64_t, ()) { return svcntb () * 64; } |
| 93 |
|
| 94 |
/* |
| 95 |
** cntb_128: |
| 96 |
** cntb (x[0-9]+) |
| 97 |
** lsl x0, \1, 7 |
| 98 |
** ret |
| 99 |
*/ |
| 100 |
PROTO (cntb_128, uint64_t, ()) { return svcntb () * 128; } |
| 101 |
|
| 102 |
/* Other sequences would be OK. */ |
| 103 |
/* |
| 104 |
** cntb_129: |
| 105 |
** cntb (x[0-9]+) |
| 106 |
** lsl x0, \1, 7 |
| 107 |
** incb x0 |
| 108 |
** ret |
| 109 |
*/ |
| 110 |
PROTO (cntb_129, uint64_t, ()) { return svcntb () * 129; } |
| 111 |
|
| 112 |
/* |
| 113 |
** cntb_m1: |
| 114 |
** rdvl x0, #-1 |
| 115 |
** ret |
| 116 |
*/ |
| 117 |
PROTO (cntb_m1, uint64_t, ()) { return -svcntb (); } |
| 118 |
|
| 119 |
/* |
| 120 |
** cntb_m13: |
| 121 |
** rdvl x0, #-13 |
| 122 |
** ret |
| 123 |
*/ |
| 124 |
PROTO (cntb_m13, uint64_t, ()) { return -svcntb () * 13; } |
| 125 |
|
| 126 |
/* |
| 127 |
** cntb_m15: |
| 128 |
** rdvl x0, #-15 |
| 129 |
** ret |
| 130 |
*/ |
| 131 |
PROTO (cntb_m15, uint64_t, ()) { return -svcntb () * 15; } |
| 132 |
|
| 133 |
/* |
| 134 |
** cntb_m16: |
| 135 |
** rdvl x0, #-16 |
| 136 |
** ret |
| 137 |
*/ |
| 138 |
PROTO (cntb_m16, uint64_t, ()) { return -svcntb () * 16; } |
| 139 |
|
| 140 |
/* |
| 141 |
** cntb_m17: |
| 142 |
** rdvl x0, #-17 |
| 143 |
** ret |
| 144 |
*/ |
| 145 |
PROTO (cntb_m17, uint64_t, ()) { return -svcntb () * 17; } |
| 146 |
|
| 147 |
/* |
| 148 |
** cntb_m32: |
| 149 |
** rdvl x0, #-32 |
| 150 |
** ret |
| 151 |
*/ |
| 152 |
PROTO (cntb_m32, uint64_t, ()) { return -svcntb () * 32; } |
| 153 |
|
| 154 |
/* |
| 155 |
** cntb_m33: |
| 156 |
** rdvl x0, #-32 |
| 157 |
** decb x0 |
| 158 |
** ret |
| 159 |
*/ |
| 160 |
PROTO (cntb_m33, uint64_t, ()) { return -svcntb () * 33; } |
| 161 |
|
| 162 |
/* |
| 163 |
** cntb_m34: |
| 164 |
** rdvl (x[0-9]+), #-17 |
| 165 |
** lsl x0, \1, #?1 |
| 166 |
** ret |
| 167 |
*/ |
| 168 |
PROTO (cntb_m34, uint64_t, ()) { return -svcntb () * 34; } |
| 169 |
|
| 170 |
/* |
| 171 |
** cntb_m64: |
| 172 |
** rdvl (x[0-9]+), #-1 |
| 173 |
** lsl x0, \1, #?6 |
| 174 |
** ret |
| 175 |
*/ |
| 176 |
PROTO (cntb_m64, uint64_t, ()) { return -svcntb () * 64; } |
| 177 |
|
| 178 |
/* |
| 179 |
** incb_1: |
| 180 |
** incb x0 |
| 181 |
** ret |
| 182 |
*/ |
| 183 |
PROTO (incb_1, uint64_t, (uint64_t x0)) { return x0 + svcntb (); } |
| 184 |
|
| 185 |
/* |
| 186 |
** incb_2: |
| 187 |
** incb x0, all, mul #2 |
| 188 |
** ret |
| 189 |
*/ |
| 190 |
PROTO (incb_2, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 2; } |
| 191 |
|
| 192 |
/* |
| 193 |
** incb_3: |
| 194 |
** incb x0, all, mul #3 |
| 195 |
** ret |
| 196 |
*/ |
| 197 |
PROTO (incb_3, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 3; } |
| 198 |
|
| 199 |
/* |
| 200 |
** incb_4: |
| 201 |
** incb x0, all, mul #4 |
| 202 |
** ret |
| 203 |
*/ |
| 204 |
PROTO (incb_4, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 4; } |
| 205 |
|
| 206 |
/* |
| 207 |
** incb_8: |
| 208 |
** incb x0, all, mul #8 |
| 209 |
** ret |
| 210 |
*/ |
| 211 |
PROTO (incb_8, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 8; } |
| 212 |
|
| 213 |
/* |
| 214 |
** incb_15: |
| 215 |
** incb x0, all, mul #15 |
| 216 |
** ret |
| 217 |
*/ |
| 218 |
PROTO (incb_15, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 15; } |
| 219 |
|
| 220 |
/* |
| 221 |
** incb_16: |
| 222 |
** incb x0, all, mul #16 |
| 223 |
** ret |
| 224 |
*/ |
| 225 |
PROTO (incb_16, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 16; } |
| 226 |
|
| 227 |
/* |
| 228 |
** incb_17: |
| 229 |
** addvl x0, x0, #17 |
| 230 |
** ret |
| 231 |
*/ |
| 232 |
PROTO (incb_17, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 17; } |
| 233 |
|
| 234 |
/* |
| 235 |
** incb_31: |
| 236 |
** addvl x0, x0, #31 |
| 237 |
** ret |
| 238 |
*/ |
| 239 |
PROTO (incb_31, uint64_t, (uint64_t x0)) { return x0 + svcntb () * 31; } |
| 240 |
|
| 241 |
/* |
| 242 |
** decb_1: |
| 243 |
** decb x0 |
| 244 |
** ret |
| 245 |
*/ |
| 246 |
PROTO (decb_1, uint64_t, (uint64_t x0)) { return x0 - svcntb (); } |
| 247 |
|
| 248 |
/* |
| 249 |
** decb_2: |
| 250 |
** decb x0, all, mul #2 |
| 251 |
** ret |
| 252 |
*/ |
| 253 |
PROTO (decb_2, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 2; } |
| 254 |
|
| 255 |
/* |
| 256 |
** decb_3: |
| 257 |
** decb x0, all, mul #3 |
| 258 |
** ret |
| 259 |
*/ |
| 260 |
PROTO (decb_3, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 3; } |
| 261 |
|
| 262 |
/* |
| 263 |
** decb_4: |
| 264 |
** decb x0, all, mul #4 |
| 265 |
** ret |
| 266 |
*/ |
| 267 |
PROTO (decb_4, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 4; } |
| 268 |
|
| 269 |
/* |
| 270 |
** decb_8: |
| 271 |
** decb x0, all, mul #8 |
| 272 |
** ret |
| 273 |
*/ |
| 274 |
PROTO (decb_8, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 8; } |
| 275 |
|
| 276 |
/* |
| 277 |
** decb_15: |
| 278 |
** decb x0, all, mul #15 |
| 279 |
** ret |
| 280 |
*/ |
| 281 |
PROTO (decb_15, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 15; } |
| 282 |
|
| 283 |
/* |
| 284 |
** decb_16: |
| 285 |
** decb x0, all, mul #16 |
| 286 |
** ret |
| 287 |
*/ |
| 288 |
PROTO (decb_16, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 16; } |
| 289 |
|
| 290 |
/* |
| 291 |
** decb_17: |
| 292 |
** addvl x0, x0, #-17 |
| 293 |
** ret |
| 294 |
*/ |
| 295 |
PROTO (decb_17, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 17; } |
| 296 |
|
| 297 |
/* |
| 298 |
** decb_31: |
| 299 |
** addvl x0, x0, #-31 |
| 300 |
** ret |
| 301 |
*/ |
| 302 |
PROTO (decb_31, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 31; } |
| 303 |
|
| 304 |
/* |
| 305 |
** decb_32: |
| 306 |
** addvl x0, x0, #-32 |
| 307 |
** ret |
| 308 |
*/ |
| 309 |
PROTO (decb_32, uint64_t, (uint64_t x0)) { return x0 - svcntb () * 32; } |