| 1 |
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ |
| 2 |
|
| 3 |
#include "test_sve_acle.h" |
| 4 |
|
| 5 |
/* |
| 6 |
** cntw_1: |
| 7 |
** cntw x0 |
| 8 |
** ret |
| 9 |
*/ |
| 10 |
PROTO (cntw_1, uint64_t, ()) { return svcntw (); } |
| 11 |
|
| 12 |
/* |
| 13 |
** cntw_2: |
| 14 |
** cnth x0 |
| 15 |
** ret |
| 16 |
*/ |
| 17 |
PROTO (cntw_2, uint64_t, ()) { return svcntw () * 2; } |
| 18 |
|
| 19 |
/* |
| 20 |
** cntw_3: |
| 21 |
** cntw x0, all, mul #3 |
| 22 |
** ret |
| 23 |
*/ |
| 24 |
PROTO (cntw_3, uint64_t, ()) { return svcntw () * 3; } |
| 25 |
|
| 26 |
/* |
| 27 |
** cntw_4: |
| 28 |
** cntb x0 |
| 29 |
** ret |
| 30 |
*/ |
| 31 |
PROTO (cntw_4, uint64_t, ()) { return svcntw () * 4; } |
| 32 |
|
| 33 |
/* |
| 34 |
** cntw_8: |
| 35 |
** cntb x0, all, mul #2 |
| 36 |
** ret |
| 37 |
*/ |
| 38 |
PROTO (cntw_8, uint64_t, ()) { return svcntw () * 8; } |
| 39 |
|
| 40 |
/* |
| 41 |
** cntw_15: |
| 42 |
** cntw x0, all, mul #15 |
| 43 |
** ret |
| 44 |
*/ |
| 45 |
PROTO (cntw_15, uint64_t, ()) { return svcntw () * 15; } |
| 46 |
|
| 47 |
/* |
| 48 |
** cntw_16: |
| 49 |
** cntb x0, all, mul #4 |
| 50 |
** ret |
| 51 |
*/ |
| 52 |
PROTO (cntw_16, uint64_t, ()) { return svcntw () * 16; } |
| 53 |
|
| 54 |
/* Other sequences would be OK. */ |
| 55 |
/* |
| 56 |
** cntw_17: |
| 57 |
** rdvl (x[0-9]+), #17 |
| 58 |
** asr x0, \1, 2 |
| 59 |
** ret |
| 60 |
*/ |
| 61 |
PROTO (cntw_17, uint64_t, ()) { return svcntw () * 17; } |
| 62 |
|
| 63 |
/* |
| 64 |
** cntw_32: |
| 65 |
** cntb x0, all, mul #8 |
| 66 |
** ret |
| 67 |
*/ |
| 68 |
PROTO (cntw_32, uint64_t, ()) { return svcntw () * 32; } |
| 69 |
|
| 70 |
/* |
| 71 |
** cntw_64: |
| 72 |
** cntb x0, all, mul #16 |
| 73 |
** ret |
| 74 |
*/ |
| 75 |
PROTO (cntw_64, uint64_t, ()) { return svcntw () * 64; } |
| 76 |
|
| 77 |
/* |
| 78 |
** cntw_128: |
| 79 |
** cntb (x[0-9]+) |
| 80 |
** lsl x0, \1, 5 |
| 81 |
** ret |
| 82 |
*/ |
| 83 |
PROTO (cntw_128, uint64_t, ()) { return svcntw () * 128; } |
| 84 |
|
| 85 |
/* |
| 86 |
** cntw_m1: |
| 87 |
** cntw (x[0-9]+) |
| 88 |
** neg x0, \1 |
| 89 |
** ret |
| 90 |
*/ |
| 91 |
PROTO (cntw_m1, uint64_t, ()) { return -svcntw (); } |
| 92 |
|
| 93 |
/* |
| 94 |
** cntw_m13: |
| 95 |
** cntw (x[0-9]+), all, mul #13 |
| 96 |
** neg x0, \1 |
| 97 |
** ret |
| 98 |
*/ |
| 99 |
PROTO (cntw_m13, uint64_t, ()) { return -svcntw () * 13; } |
| 100 |
|
| 101 |
/* |
| 102 |
** cntw_m15: |
| 103 |
** cntw (x[0-9]+), all, mul #15 |
| 104 |
** neg x0, \1 |
| 105 |
** ret |
| 106 |
*/ |
| 107 |
PROTO (cntw_m15, uint64_t, ()) { return -svcntw () * 15; } |
| 108 |
|
| 109 |
/* |
| 110 |
** cntw_m16: |
| 111 |
** rdvl (x[0-9]+), #-4 |
| 112 |
** ret |
| 113 |
*/ |
| 114 |
PROTO (cntw_m16, uint64_t, ()) { return -svcntw () * 16; } |
| 115 |
|
| 116 |
/* Other sequences would be OK. */ |
| 117 |
/* |
| 118 |
** cntw_m17: |
| 119 |
** rdvl (x[0-9]+), #-17 |
| 120 |
** asr x0, \1, 2 |
| 121 |
** ret |
| 122 |
*/ |
| 123 |
PROTO (cntw_m17, uint64_t, ()) { return -svcntw () * 17; } |
| 124 |
|
| 125 |
/* |
| 126 |
** incw_1: |
| 127 |
** incw x0 |
| 128 |
** ret |
| 129 |
*/ |
| 130 |
PROTO (incw_1, uint64_t, (uint64_t x0)) { return x0 + svcntw (); } |
| 131 |
|
| 132 |
/* |
| 133 |
** incw_2: |
| 134 |
** inch x0 |
| 135 |
** ret |
| 136 |
*/ |
| 137 |
PROTO (incw_2, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 2; } |
| 138 |
|
| 139 |
/* |
| 140 |
** incw_3: |
| 141 |
** incw x0, all, mul #3 |
| 142 |
** ret |
| 143 |
*/ |
| 144 |
PROTO (incw_3, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 3; } |
| 145 |
|
| 146 |
/* |
| 147 |
** incw_4: |
| 148 |
** incb x0 |
| 149 |
** ret |
| 150 |
*/ |
| 151 |
PROTO (incw_4, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 4; } |
| 152 |
|
| 153 |
/* |
| 154 |
** incw_7: |
| 155 |
** incw x0, all, mul #7 |
| 156 |
** ret |
| 157 |
*/ |
| 158 |
PROTO (incw_7, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 7; } |
| 159 |
|
| 160 |
/* |
| 161 |
** incw_8: |
| 162 |
** incb x0, all, mul #2 |
| 163 |
** ret |
| 164 |
*/ |
| 165 |
PROTO (incw_8, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 8; } |
| 166 |
|
| 167 |
/* |
| 168 |
** incw_9: |
| 169 |
** incw x0, all, mul #9 |
| 170 |
** ret |
| 171 |
*/ |
| 172 |
PROTO (incw_9, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 9; } |
| 173 |
|
| 174 |
/* |
| 175 |
** incw_15: |
| 176 |
** incw x0, all, mul #15 |
| 177 |
** ret |
| 178 |
*/ |
| 179 |
PROTO (incw_15, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 15; } |
| 180 |
|
| 181 |
/* |
| 182 |
** incw_16: |
| 183 |
** incb x0, all, mul #4 |
| 184 |
** ret |
| 185 |
*/ |
| 186 |
PROTO (incw_16, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 16; } |
| 187 |
|
| 188 |
/* |
| 189 |
** incw_18: |
| 190 |
** inch x0, all, mul #9 |
| 191 |
** ret |
| 192 |
*/ |
| 193 |
PROTO (incw_18, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 18; } |
| 194 |
|
| 195 |
/* |
| 196 |
** incw_30: |
| 197 |
** inch x0, all, mul #15 |
| 198 |
** ret |
| 199 |
*/ |
| 200 |
PROTO (incw_30, uint64_t, (uint64_t x0)) { return x0 + svcntw () * 30; } |
| 201 |
|
| 202 |
/* |
| 203 |
** decw_1: |
| 204 |
** decw x0 |
| 205 |
** ret |
| 206 |
*/ |
| 207 |
PROTO (decw_1, uint64_t, (uint64_t x0)) { return x0 - svcntw (); } |
| 208 |
|
| 209 |
/* |
| 210 |
** decw_2: |
| 211 |
** dech x0 |
| 212 |
** ret |
| 213 |
*/ |
| 214 |
PROTO (decw_2, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 2; } |
| 215 |
|
| 216 |
/* |
| 217 |
** decw_3: |
| 218 |
** decw x0, all, mul #3 |
| 219 |
** ret |
| 220 |
*/ |
| 221 |
PROTO (decw_3, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 3; } |
| 222 |
|
| 223 |
/* |
| 224 |
** decw_4: |
| 225 |
** decb x0 |
| 226 |
** ret |
| 227 |
*/ |
| 228 |
PROTO (decw_4, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 4; } |
| 229 |
|
| 230 |
/* |
| 231 |
** decw_7: |
| 232 |
** decw x0, all, mul #7 |
| 233 |
** ret |
| 234 |
*/ |
| 235 |
PROTO (decw_7, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 7; } |
| 236 |
|
| 237 |
/* |
| 238 |
** decw_8: |
| 239 |
** decb x0, all, mul #2 |
| 240 |
** ret |
| 241 |
*/ |
| 242 |
PROTO (decw_8, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 8; } |
| 243 |
|
| 244 |
/* |
| 245 |
** decw_9: |
| 246 |
** decw x0, all, mul #9 |
| 247 |
** ret |
| 248 |
*/ |
| 249 |
PROTO (decw_9, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 9; } |
| 250 |
|
| 251 |
/* |
| 252 |
** decw_15: |
| 253 |
** decw x0, all, mul #15 |
| 254 |
** ret |
| 255 |
*/ |
| 256 |
PROTO (decw_15, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 15; } |
| 257 |
|
| 258 |
/* |
| 259 |
** decw_16: |
| 260 |
** decb x0, all, mul #4 |
| 261 |
** ret |
| 262 |
*/ |
| 263 |
PROTO (decw_16, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 16; } |
| 264 |
|
| 265 |
/* |
| 266 |
** decw_18: |
| 267 |
** dech x0, all, mul #9 |
| 268 |
** ret |
| 269 |
*/ |
| 270 |
PROTO (decw_18, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 18; } |
| 271 |
|
| 272 |
/* |
| 273 |
** decw_30: |
| 274 |
** dech x0, all, mul #15 |
| 275 |
** ret |
| 276 |
*/ |
| 277 |
PROTO (decw_30, uint64_t, (uint64_t x0)) { return x0 - svcntw () * 30; } |