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