1# RUN: llvm-mc -triple mblaze-unknown-unknown -show-encoding %s | FileCheck %s 2 3# Test to ensure that all register and immediate operands can be parsed by 4# the assembly parser correctly. Testing the parsing of FSL immediate 5# values is done in a different test. 6 7# TYPE A: OPCODE RD RA RB FLAGS 8# BINARY: 000000 00000 00000 00000 00000000000 9 10# CHECK: add 11# BINARY: 000000 00000 00000 00000 00000000000 12# CHECK: encoding: [0x00,0x00,0x00,0x00] 13 add r0, r0, r0 14 15# CHECK: add 16# BINARY: 000000 00001 00001 00001 00000000000 17# CHECK: encoding: [0x00,0x21,0x08,0x00] 18 add r1, r1, r1 19 20# CHECK: add 21# BINARY: 000000 00010 00010 00010 00000000000 22# CHECK: encoding: [0x00,0x42,0x10,0x00] 23 add r2, r2, r2 24 25# CHECK: add 26# BINARY: 000000 00011 00011 00011 00000000000 27# CHECK: encoding: [0x00,0x63,0x18,0x00] 28 add r3, r3, r3 29 30# CHECK: add 31# BINARY: 000000 00100 00100 00100 00000000000 32# CHECK: encoding: [0x00,0x84,0x20,0x00] 33 add r4, r4, r4 34 35# CHECK: add 36# BINARY: 000000 00101 00101 00101 00000000000 37# CHECK: encoding: [0x00,0xa5,0x28,0x00] 38 add r5, r5, r5 39 40# CHECK: add 41# BINARY: 000000 00110 00110 00110 00000000000 42# CHECK: encoding: [0x00,0xc6,0x30,0x00] 43 add r6, r6, r6 44 45# CHECK: add 46# BINARY: 000000 00111 00111 00111 00000000000 47# CHECK: encoding: [0x00,0xe7,0x38,0x00] 48 add r7, r7, r7 49 50# CHECK: add 51# BINARY: 000000 01000 01000 01000 00000000000 52# CHECK: encoding: [0x01,0x08,0x40,0x00] 53 add r8, r8, r8 54 55# CHECK: add 56# BINARY: 000000 01001 01001 01001 00000000000 57# CHECK: encoding: [0x01,0x29,0x48,0x00] 58 add r9, r9, r9 59 60# CHECK: add 61# BINARY: 000000 01010 01010 01010 00000000000 62# CHECK: encoding: [0x01,0x4a,0x50,0x00] 63 add r10, r10, r10 64 65# CHECK: add 66# BINARY: 000000 01011 01011 01011 00000000000 67# CHECK: encoding: [0x01,0x6b,0x58,0x00] 68 add r11, r11, r11 69 70# CHECK: add 71# BINARY: 000000 01100 01100 01100 00000000000 72# CHECK: encoding: [0x01,0x8c,0x60,0x00] 73 add r12, r12, r12 74 75# CHECK: add 76# BINARY: 000000 01101 01101 01101 00000000000 77# CHECK: encoding: [0x01,0xad,0x68,0x00] 78 add r13, r13, r13 79 80# CHECK: add 81# BINARY: 000000 01110 01110 01110 00000000000 82# CHECK: encoding: [0x01,0xce,0x70,0x00] 83 add r14, r14, r14 84 85# CHECK: add 86# BINARY: 000000 01111 01111 01111 00000000000 87# CHECK: encoding: [0x01,0xef,0x78,0x00] 88 add r15, r15, r15 89 90# CHECK: add 91# BINARY: 000000 10000 10000 10000 00000000000 92# CHECK: encoding: [0x02,0x10,0x80,0x00] 93 add r16, r16, r16 94 95# CHECK: add 96# BINARY: 000000 10001 10001 10001 00000000000 97# CHECK: encoding: [0x02,0x31,0x88,0x00] 98 add r17, r17, r17 99 100# CHECK: add 101# BINARY: 000000 10010 10010 10010 00000000000 102# CHECK: encoding: [0x02,0x52,0x90,0x00] 103 add r18, r18, r18 104 105# CHECK: add 106# BINARY: 000000 10011 10011 10011 00000000000 107# CHECK: encoding: [0x02,0x73,0x98,0x00] 108 add r19, r19, r19 109 110# CHECK: add 111# BINARY: 000000 10100 10100 10100 00000000000 112# CHECK: encoding: [0x02,0x94,0xa0,0x00] 113 add r20, r20, r20 114 115# CHECK: add 116# BINARY: 000000 10101 10101 10101 00000000000 117# CHECK: encoding: [0x02,0xb5,0xa8,0x00] 118 add r21, r21, r21 119 120# CHECK: add 121# BINARY: 000000 10110 10110 10110 00000000000 122# CHECK: encoding: [0x02,0xd6,0xb0,0x00] 123 add r22, r22, r22 124 125# CHECK: add 126# BINARY: 000000 10111 10111 10111 00000000000 127# CHECK: encoding: [0x02,0xf7,0xb8,0x00] 128 add r23, r23, r23 129 130# CHECK: add 131# BINARY: 000000 11000 11000 11000 00000000000 132# CHECK: encoding: [0x03,0x18,0xc0,0x00] 133 add r24, r24, r24 134 135# CHECK: add 136# BINARY: 000000 11001 11001 11001 00000000000 137# CHECK: encoding: [0x03,0x39,0xc8,0x00] 138 add r25, r25, r25 139 140# CHECK: add 141# BINARY: 000000 11010 11010 11010 00000000000 142# CHECK: encoding: [0x03,0x5a,0xd0,0x00] 143 add r26, r26, r26 144 145# CHECK: add 146# BINARY: 000000 11011 11011 11011 00000000000 147# CHECK: encoding: [0x03,0x7b,0xd8,0x00] 148 add r27, r27, r27 149 150# CHECK: add 151# BINARY: 000000 11100 11100 11100 00000000000 152# CHECK: encoding: [0x03,0x9c,0xe0,0x00] 153 add r28, r28, r28 154 155# CHECK: add 156# BINARY: 000000 11101 11101 11101 00000000000 157# CHECK: encoding: [0x03,0xbd,0xe8,0x00] 158 add r29, r29, r29 159 160# CHECK: add 161# BINARY: 000000 11110 11110 11110 00000000000 162# CHECK: encoding: [0x03,0xde,0xf0,0x00] 163 add r30, r30, r30 164 165# CHECK: add 166# BINARY: 000000 11111 11111 11111 00000000000 167# CHECK: encoding: [0x03,0xff,0xf8,0x00] 168 add r31, r31, r31 169 170# CHECK: addi 171# BINARY: 001000 00000 00000 0000000000000000 172# CHECK: encoding: [0x20,0x00,0x00,0x00] 173 addi r0, r0, 0 174 175# CHECK: addi 176# BINARY: 001000 00000 00000 0000000000000001 177# CHECK: encoding: [0x20,0x00,0x00,0x01] 178 addi r0, r0, 1 179 180# CHECK: addi 181# BINARY: 001000 00000 00000 0000000000000010 182# CHECK: encoding: [0x20,0x00,0x00,0x02] 183 addi r0, r0, 2 184 185# CHECK: addi 186# BINARY: 001000 00000 00000 0000000000000100 187# CHECK: encoding: [0x20,0x00,0x00,0x04] 188 addi r0, r0, 4 189 190# CHECK: addi 191# BINARY: 001000 00000 00000 0000000000001000 192# CHECK: encoding: [0x20,0x00,0x00,0x08] 193 addi r0, r0, 8 194 195# CHECK: addi 196# BINARY: 001000 00000 00000 0000000000010000 197# CHECK: encoding: [0x20,0x00,0x00,0x10] 198 addi r0, r0, 16 199 200# CHECK: addi 201# BINARY: 001000 00000 00000 0000000000100000 202# CHECK: encoding: [0x20,0x00,0x00,0x20] 203 addi r0, r0, 32 204 205# CHECK: addi 206# BINARY: 001000 00000 00000 0000000001000000 207# CHECK: encoding: [0x20,0x00,0x00,0x40] 208 addi r0, r0, 64 209 210# CHECK: addi 211# BINARY: 001000 00000 00000 0000000010000000 212# CHECK: encoding: [0x20,0x00,0x00,0x80] 213 addi r0, r0, 128 214 215# CHECK: addi 216# BINARY: 001000 00000 00000 0000000100000000 217# CHECK: encoding: [0x20,0x00,0x01,0x00] 218 addi r0, r0, 256 219 220# CHECK: addi 221# BINARY: 001000 00000 00000 0000001000000000 222# CHECK: encoding: [0x20,0x00,0x02,0x00] 223 addi r0, r0, 512 224 225# CHECK: addi 226# BINARY: 001000 00000 00000 0000010000000000 227# CHECK: encoding: [0x20,0x00,0x04,0x00] 228 addi r0, r0, 1024 229 230# CHECK: addi 231# BINARY: 001000 00000 00000 0000100000000000 232# CHECK: encoding: [0x20,0x00,0x08,0x00] 233 addi r0, r0, 2048 234 235# CHECK: addi 236# BINARY: 001000 00000 00000 0001000000000000 237# CHECK: encoding: [0x20,0x00,0x10,0x00] 238 addi r0, r0, 4096 239 240# CHECK: addi 241# BINARY: 001000 00000 00000 0010000000000000 242# CHECK: encoding: [0x20,0x00,0x20,0x00] 243 addi r0, r0, 8192 244 245# CHECK: addi 246# BINARY: 001000 00000 00000 0100000000000000 247# CHECK: encoding: [0x20,0x00,0x40,0x00] 248 addi r0, r0, 16384 249 250# CHECK: addi 251# BINARY: 001000 00000 00000 1111111111111111 252# CHECK: encoding: [0x20,0x00,0xff,0xff] 253 addi r0, r0, -1 254 255# CHECK: addi 256# BINARY: 001000 00000 00000 1111111111111110 257# CHECK: encoding: [0x20,0x00,0xff,0xfe] 258 addi r0, r0, -2 259 260# CHECK: addi 261# BINARY: 001000 00000 00000 1111111111111100 262# CHECK: encoding: [0x20,0x00,0xff,0xfc] 263 addi r0, r0, -4 264 265# CHECK: addi 266# BINARY: 001000 00000 00000 1111111111111000 267# CHECK: encoding: [0x20,0x00,0xff,0xf8] 268 addi r0, r0, -8 269 270# CHECK: addi 271# BINARY: 001000 00000 00000 1111111111110000 272# CHECK: encoding: [0x20,0x00,0xff,0xf0] 273 addi r0, r0, -16 274 275# CHECK: addi 276# BINARY: 001000 00000 00000 1111111111100000 277# CHECK: encoding: [0x20,0x00,0xff,0xe0] 278 addi r0, r0, -32 279 280# CHECK: addi 281# BINARY: 001000 00000 00000 1111111111000000 282# CHECK: encoding: [0x20,0x00,0xff,0xc0] 283 addi r0, r0, -64 284 285# CHECK: addi 286# BINARY: 001000 00000 00000 1111111110000000 287# CHECK: encoding: [0x20,0x00,0xff,0x80] 288 addi r0, r0, -128 289 290# CHECK: addi 291# BINARY: 001000 00000 00000 1111111100000000 292# CHECK: encoding: [0x20,0x00,0xff,0x00] 293 addi r0, r0, -256 294 295# CHECK: addi 296# BINARY: 001000 00000 00000 1111111000000000 297# CHECK: encoding: [0x20,0x00,0xfe,0x00] 298 addi r0, r0, -512 299 300# CHECK: addi 301# BINARY: 001000 00000 00000 1111110000000000 302# CHECK: encoding: [0x20,0x00,0xfc,0x00] 303 addi r0, r0, -1024 304 305# CHECK: addi 306# BINARY: 001000 00000 00000 1111100000000000 307# CHECK: encoding: [0x20,0x00,0xf8,0x00] 308 addi r0, r0, -2048 309 310# CHECK: addi 311# BINARY: 001000 00000 00000 1111000000000000 312# CHECK: encoding: [0x20,0x00,0xf0,0x00] 313 addi r0, r0, -4096 314 315# CHECK: addi 316# BINARY: 001000 00000 00000 1110000000000000 317# CHECK: encoding: [0x20,0x00,0xe0,0x00] 318 addi r0, r0, -8192 319 320# CHECK: addi 321# BINARY: 001000 00000 00000 1100000000000000 322# CHECK: encoding: [0x20,0x00,0xc0,0x00] 323 addi r0, r0, -16384 324 325# CHECK: addi 326# BINARY: 001000 00000 00000 1000000000000000 327# CHECK: encoding: [0x20,0x00,0x80,0x00] 328 addi r0, r0, -32768 329