1 # RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips | \
2 # RUN: FileCheck -check-prefix=CHECK-EL %s
3 # RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips | \
4 # RUN: FileCheck -check-prefix=CHECK-EB %s
5 # Check that the assembler can handle the documented syntax
6 # for arithmetic and logical instructions.
7 #------------------------------------------------------------------------------
8 # MicroMIPS 16-bit Instructions
9 #------------------------------------------------------------------------------
11 #------------------------------------------------------------------------------
12 # CHECK-EL: addu16 $6, $17, $4 # encoding: [0x42,0x07]
13 # CHECK-EL: subu16 $5, $16, $3 # encoding: [0xb1,0x06]
14 # CHECK-EL: and16 $16, $2 # encoding: [0x82,0x44]
15 # CHECK-EL: not16 $17, $3 # encoding: [0x0b,0x44]
16 # CHECK-EL: or16 $16, $4 # encoding: [0xc4,0x44]
17 # CHECK-EL: xor16 $17, $5 # encoding: [0x4d,0x44]
18 # CHECK-EL: sll16 $3, $16, 5 # encoding: [0x8a,0x25]
19 # CHECK-EL: srl16 $4, $17, 6 # encoding: [0x1d,0x26]
20 # CHECK-EL: addius5 $7, -2 # encoding: [0xfc,0x4c]
21 # CHECK-EL: addiusp -16 # encoding: [0xf9,0x4f]
22 # CHECK-EL: mfhi $9 # encoding: [0x09,0x46]
23 # CHECK-EL: mflo $9 # encoding: [0x49,0x46]
24 # CHECK-EL: move $25, $1 # encoding: [0x21,0x0f]
25 # CHECK-EL: jrc $9 # encoding: [0xa9,0x45]
26 # CHECK-NEXT: jalr $9 # encoding: [0xc9,0x45]
27 # CHECK-EL: jraddiusp 20 # encoding: [0x05,0x47]
28 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
29 # CHECK-EL: jalrs16 $9 # encoding: [0xe9,0x45]
30 # CHECK-EL: move $zero, $zero # encoding: [0x00,0x0c]
31 # CHECK-EL: jr16 $9 # encoding: [0x89,0x45]
32 # CHECK-EL: nop # encoding: [0x00,0x00,0x00,0x00]
33 #------------------------------------------------------------------------------
35 #------------------------------------------------------------------------------
36 # CHECK-EB: addu16 $6, $17, $4 # encoding: [0x07,0x42]
37 # CHECK-EB: subu16 $5, $16, $3 # encoding: [0x06,0xb1]
38 # CHECK-EB: and16 $16, $2 # encoding: [0x44,0x82]
39 # CHECK-EB: not16 $17, $3 # encoding: [0x44,0x0b]
40 # CHECK-EB: or16 $16, $4 # encoding: [0x44,0xc4]
41 # CHECK-EB: xor16 $17, $5 # encoding: [0x44,0x4d]
42 # CHECK-EB: sll16 $3, $16, 5 # encoding: [0x25,0x8a]
43 # CHECK-EB: srl16 $4, $17, 6 # encoding: [0x26,0x1d]
44 # CHECK-EB: addius5 $7, -2 # encoding: [0x4c,0xfc]
45 # CHECK-EB: addiusp -16 # encoding: [0x4f,0xf9]
46 # CHECK-EB: mfhi $9 # encoding: [0x46,0x09]
47 # CHECK-EB: mflo $9 # encoding: [0x46,0x49]
48 # CHECK-EB: move $25, $1 # encoding: [0x0f,0x21]
49 # CHECK-EB: jrc $9 # encoding: [0x45,0xa9]
50 # CHECK-NEXT: jalr $9 # encoding: [0x45,0xc9]
51 # CHECK-EB: jraddiusp 20 # encoding: [0x47,0x05]
52 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]
53 # CHECK-EB: jalrs16 $9 # encoding: [0x45,0xe9]
54 # CHECK-EB: move $zero, $zero # encoding: [0x0c,0x00]
55 # CHECK-EB: jr16 $9 # encoding: [0x45,0x89]
56 # CHECK-EB: nop # encoding: [0x00,0x00,0x00,0x00]