• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Instructions that are valid
2#
3# Branches have some unusual encoding rules in MIPS32r6 so we need to test:
4#   rs == 0
5#   rs != 0
6#   rt == 0
7#   rt != 0
8#   rs < rt
9#   rs == rt
10#   rs > rt
11# appropriately for each branch instruction
12#
13# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -show-inst -mcpu=mips32r6 2> %t0 | FileCheck %s
14# RUN: FileCheck %s -check-prefix=WARNING < %t0
15a:
16        .set noat
17        # FIXME: Add the instructions carried forward from older ISA's
18        and     $2,4             # CHECK: andi $2, $2, 4      # encoding: [0x30,0x42,0x00,0x04]
19        addiupc $4, 100          # CHECK: lapc $4, 100        # encoding: [0xec,0x80,0x00,0x19]
20        addu    $9,10            # CHECK: addiu $9, $9, 10    # encoding: [0x25,0x29,0x00,0x0a]
21        align   $4, $2, $3, 2    # CHECK: align $4, $2, $3, 2 # encoding: [0x7c,0x43,0x22,0xa0]
22        aluipc  $3, 56           # CHECK: aluipc $3, 56       # encoding: [0xec,0x7f,0x00,0x38]
23        aui     $3, $2, 23       # CHECK: aui $3, $2, 23      # encoding: [0x3c,0x43,0x00,0x17]
24        auipc   $3, -1           # CHECK: auipc $3, -1        # encoding: [0xec,0x7e,0xff,0xff]
25        bal     21100            # CHECK: bal 21100           # encoding: [0x04,0x11,0x14,0x9b]
26        balc 14572256            # CHECK: balc 14572256       # encoding: [0xe8,0x37,0x96,0xb8]
27        bc 14572256              # CHECK: bc 14572256         # encoding: [0xc8,0x37,0x96,0xb8]
28                                 # CHECK-NEXT:                # <MCInst #{{[0-9]+}} BC
29        bc1eqz  $f0,4            # CHECK: bc1eqz $f0, 4       # encoding: [0x45,0x20,0x00,0x01]
30        bc1eqz  $f31,4           # CHECK: bc1eqz $f31, 4      # encoding: [0x45,0x3f,0x00,0x01]
31        bc1nez  $f0,4            # CHECK: bc1nez $f0, 4       # encoding: [0x45,0xa0,0x00,0x01]
32        bc1nez  $f31,4           # CHECK: bc1nez $f31, 4      # encoding: [0x45,0xbf,0x00,0x01]
33        bc2eqz  $0,8             # CHECK: bc2eqz $0, 8        # encoding: [0x49,0x20,0x00,0x02]
34        bc2eqz  $31,8            # CHECK: bc2eqz $31, 8       # encoding: [0x49,0x3f,0x00,0x02]
35        bc2nez  $0,8             # CHECK: bc2nez $0, 8        # encoding: [0x49,0xa0,0x00,0x02]
36        bc2nez  $31,8            # CHECK: bc2nez $31, 8       # encoding: [0x49,0xbf,0x00,0x02]
37        # beqc requires rs < rt && rs != 0 but we accept this and fix it. See also bovc.
38        beqc    $5, $6, 256      # CHECK: beqc $5, $6, 256    # encoding: [0x20,0xa6,0x00,0x40]
39        beqc    $6, $5, 256      # CHECK: beqc $6, $5, 256    # encoding: [0x20,0xa6,0x00,0x40]
40        beqzalc $2, 1332         # CHECK: beqzalc $2, 1332    # encoding: [0x20,0x02,0x01,0x4d]
41        # bnec requires rs < rt && rs != 0 but we accept this and fix it. See also bnvc.
42        bnec $5, $6, 256         # CHECK: bnec $5, $6, 256    # encoding: [0x60,0xa6,0x00,0x40]
43        bnec $6, $5, 256         # CHECK: bnec $6, $5, 256    # encoding: [0x60,0xa6,0x00,0x40]
44        bnezalc $2, 1332         # CHECK: bnezalc $2, 1332    # encoding: [0x60,0x02,0x01,0x4d]
45        beqzc $5, 72256          # CHECK: beqzc $5, 72256     # encoding: [0xd8,0xa0,0x46,0x90]
46        bgec $2, $3, 256         # CHECK: bgec $2, $3, 256    # encoding: [0x58,0x43,0x00,0x40]
47        bgeuc $2, $3, 256        # CHECK: bgeuc $2, $3, 256   # encoding: [0x18,0x43,0x00,0x40]
48        bgezalc $2, 1332         # CHECK: bgezalc $2, 1332    # encoding: [0x18,0x42,0x01,0x4d]
49        bnezc $5, 72256          # CHECK: bnezc $5, 72256     # encoding: [0xf8,0xa0,0x46,0x90]
50        bltzc $5, 256            # CHECK: bltzc $5, 256       # encoding: [0x5c,0xa5,0x00,0x40]
51        bgezc $5, 256            # CHECK: bgezc $5, 256       # encoding: [0x58,0xa5,0x00,0x40]
52        bgtzalc $2, 1332         # CHECK: bgtzalc $2, 1332    # encoding: [0x1c,0x02,0x01,0x4d]
53        blezc $5, 256            # CHECK: blezc $5, 256       # encoding: [0x58,0x05,0x00,0x40]
54        bltzalc $2, 1332         # CHECK: bltzalc $2, 1332    # encoding: [0x1c,0x42,0x01,0x4d]
55        bgtzc $5, 256            # CHECK: bgtzc $5, 256       # encoding: [0x5c,0x05,0x00,0x40]
56        bitswap $4, $2           # CHECK: bitswap $4, $2      # encoding: [0x7c,0x02,0x20,0x20]
57        blezalc $2, 1332         # CHECK: blezalc $2, 1332    # encoding: [0x18,0x02,0x01,0x4d]
58        bltc $5, $6, 256         # CHECK: bltc $5, $6, 256    # encoding: [0x5c,0xa6,0x00,0x40]
59        bltuc $5, $6, 256        # CHECK: bltuc $5, $6, 256   # encoding: [0x1c,0xa6,0x00,0x40]
60        # bnvc requires that rs >= rt but we accept both and fix this. See also bnec.
61        bnvc     $0, $0, 4       # CHECK: bnvc $zero, $zero, 4 # encoding: [0x60,0x00,0x00,0x01]
62        bnvc     $2, $0, 4       # CHECK: bnvc $2, $zero, 4    # encoding: [0x60,0x40,0x00,0x01]
63        bnvc     $2, $4, 4       # CHECK: bnvc $2, $4, 4      # encoding: [0x60,0x82,0x00,0x01]
64        # bovc requires that rs >= rt but we accept both and fix this. See also beqc.
65        bovc     $0, $0, 4       # CHECK: bovc $zero, $zero, 4 # encoding: [0x20,0x00,0x00,0x01]
66        bovc     $2, $0, 4       # CHECK: bovc $2, $zero, 4    # encoding: [0x20,0x40,0x00,0x01]
67        bovc     $2, $4, 4       # CHECK: bovc $2, $4, 4      # encoding: [0x20,0x82,0x00,0x01]
68        cache      1, 8($5)         # CHECK: cache 1, 8($5)          # encoding: [0x7c,0xa1,0x04,0x25]
69                                    # CHECK-NEXT:                    # <MCInst #{{.*}} CACHE_R6
70        ceil.w.d  $f11,$f24         # CHECK: ceil.w.d  $f11, $f24 # encoding: [0x46,0x20,0xc2,0xce]
71                                    # CHECK:                      # <MCInst #{{.*}} CEIL_W_D64
72        ceil.w.s  $f6,$f20          # CHECK: ceil.w.s  $f6, $f20  # encoding: [0x46,0x00,0xa1,0x8e]
73                                    # CHECK:                      # <MCInst #{{.*}} CEIL_W_S
74        cmp.af.s   $f2,$f3,$f4      # CHECK: cmp.af.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x80]
75        cmp.af.d   $f2,$f3,$f4      # CHECK: cmp.af.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x80]
76        cmp.un.s   $f2,$f3,$f4      # CHECK: cmp.un.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x81]
77        cmp.un.d   $f2,$f3,$f4      # CHECK: cmp.un.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x81]
78        cmp.eq.s   $f2,$f3,$f4      # CHECK: cmp.eq.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x82]
79        cmp.eq.d   $f2,$f3,$f4      # CHECK: cmp.eq.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x82]
80        cmp.ueq.s  $f2,$f3,$f4      # CHECK: cmp.ueq.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x83]
81        cmp.ueq.d  $f2,$f3,$f4      # CHECK: cmp.ueq.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x83]
82        cmp.lt.s   $f2,$f3,$f4      # CHECK: cmp.lt.s  $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x84]
83        cmp.lt.d   $f2,$f3,$f4      # CHECK: cmp.lt.d  $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x84]
84        cmp.ult.s  $f2,$f3,$f4      # CHECK: cmp.ult.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x85]
85        cmp.ult.d  $f2,$f3,$f4      # CHECK: cmp.ult.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x85]
86        cmp.le.s   $f2,$f3,$f4      # CHECK: cmp.le.s  $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x86]
87        cmp.le.d   $f2,$f3,$f4      # CHECK: cmp.le.d  $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x86]
88        cmp.ule.s  $f2,$f3,$f4      # CHECK: cmp.ule.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x87]
89        cmp.ule.d  $f2,$f3,$f4      # CHECK: cmp.ule.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x87]
90        cmp.saf.s  $f2,$f3,$f4      # CHECK: cmp.saf.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x88]
91        cmp.saf.d  $f2,$f3,$f4      # CHECK: cmp.saf.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x88]
92        cmp.sun.s  $f2,$f3,$f4      # CHECK: cmp.sun.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x89]
93        cmp.sun.d  $f2,$f3,$f4      # CHECK: cmp.sun.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x89]
94        cmp.seq.s  $f2,$f3,$f4      # CHECK: cmp.seq.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x8a]
95        cmp.seq.d  $f2,$f3,$f4      # CHECK: cmp.seq.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x8a]
96        cmp.sueq.s $f2,$f3,$f4      # CHECK: cmp.sueq.s $f2, $f3, $f4 # encoding: [0x46,0x84,0x18,0x8b]
97        cmp.sueq.d $f2,$f3,$f4      # CHECK: cmp.sueq.d $f2, $f3, $f4 # encoding: [0x46,0xa4,0x18,0x8b]
98        cmp.slt.s  $f2,$f3,$f4      # CHECK: cmp.slt.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x8c]
99        cmp.slt.d  $f2,$f3,$f4      # CHECK: cmp.slt.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x8c]
100        cmp.sult.s $f2,$f3,$f4      # CHECK: cmp.sult.s $f2, $f3, $f4 # encoding: [0x46,0x84,0x18,0x8d]
101        cmp.sult.d $f2,$f3,$f4      # CHECK: cmp.sult.d $f2, $f3, $f4 # encoding: [0x46,0xa4,0x18,0x8d]
102        cmp.sle.s  $f2,$f3,$f4      # CHECK: cmp.sle.s $f2, $f3, $f4  # encoding: [0x46,0x84,0x18,0x8e]
103        cmp.sle.d  $f2,$f3,$f4      # CHECK: cmp.sle.d $f2, $f3, $f4  # encoding: [0x46,0xa4,0x18,0x8e]
104        cmp.sule.s $f2,$f3,$f4      # CHECK: cmp.sule.s $f2, $f3, $f4 # encoding: [0x46,0x84,0x18,0x8f]
105        cmp.sule.d $f2,$f3,$f4      # CHECK: cmp.sule.d $f2, $f3, $f4 # encoding: [0x46,0xa4,0x18,0x8f]
106        di      $s8              # CHECK: di  $fp          # encoding: [0x41,0x7e,0x60,0x00]
107        di                       # CHECK: di               # encoding: [0x41,0x60,0x60,0x00]
108        div     $2,$3,$4         # CHECK: div $2, $3, $4   # encoding: [0x00,0x64,0x10,0x9a]
109        divu    $2,$3,$4         # CHECK: divu $2, $3, $4  # encoding: [0x00,0x64,0x10,0x9b]
110        dvp     $4               # CHECK: dvp $4           # encoding: [0x41,0x64,0x00,0x24]
111        dvp                      # CHECK: dvp $zero        # encoding: [0x41,0x60,0x00,0x24]
112        ei      $14              # CHECK: ei  $14          # encoding: [0x41,0x6e,0x60,0x20]
113        ei                       # CHECK: ei               # encoding: [0x41,0x60,0x60,0x20]
114        eret
115        eretnc                   # CHECK: eretnc           # encoding: [0x42,0x00,0x00,0x58]
116        evp     $5               # CHECK: evp $5           # encoding: [0x41,0x65,0x00,0x04]
117        evp                      # CHECK: evp $zero        # encoding: [0x41,0x60,0x00,0x04]
118        floor.w.d $f14,$f11      # CHECK: floor.w.d $f14, $f11      # encoding: [0x46,0x20,0x5b,0x8f]
119                                 # CHECK:                           # <MCInst #{{.*}} FLOOR_W_D64
120        floor.w.s $f8,$f9        # CHECK: floor.w.s $f8, $f9        # encoding: [0x46,0x00,0x4a,0x0f]
121                                 # CHECK:                           # <MCInst #{{.*}} FLOOR_W_S
122        jialc   $5, 256          # CHECK: jialc $5, 256    # encoding: [0xf8,0x05,0x01,0x00]
123        jic     $5, 256          # CHECK: jic $5, 256      # encoding: [0xd8,0x05,0x01,0x00]
124        l.s     $f2, 8($3)       # CHECK: lwc1 $f2, 8($3)  # encoding: [0xc4,0x62,0x00,0x08]
125        l.d     $f2, 8($3)       # CHECK: ldc1 $f2, 8($3)  # encoding: [0xd4,0x62,0x00,0x08]
126        lapc    $4, 100          # CHECK: lapc $4, 100     # encoding: [0xec,0x80,0x00,0x19]
127        lsa     $2, $3, $4, 3    # CHECK: lsa  $2, $3, $4, 3 # encoding: [0x00,0x64,0x10,0x85]
128        lwpc    $2,268           # CHECK: lwpc $2, 268     # encoding: [0xec,0x48,0x00,0x43]
129        mfc0    $8,$15,1         # CHECK: mfc0 $8, $15, 1  # encoding: [0x40,0x08,0x78,0x01]
130        mod     $2,$3,$4         # CHECK: mod $2, $3, $4   # encoding: [0x00,0x64,0x10,0xda]
131        modu    $2,$3,$4         # CHECK: modu $2, $3, $4  # encoding: [0x00,0x64,0x10,0xdb]
132        move    $a0,$a3          # CHECK: move $4, $7      # encoding: [0x00,0xe0,0x20,0x25]
133        move    $s5,$a0          # CHECK: move $21, $4     # encoding: [0x00,0x80,0xa8,0x25]
134        move    $s8,$a0          # CHECK: move $fp, $4     # encoding: [0x00,0x80,0xf0,0x25]
135        move    $25,$a2          # CHECK: move $25, $6     # encoding: [0x00,0xc0,0xc8,0x25]
136        mtc0    $9,$15,1         # CHECK: mtc0 $9, $15, 1  # encoding: [0x40,0x89,0x78,0x01]
137        mul     $2,$3,$4         # CHECK: mul $2, $3, $4   # encoding: [0x00,0x64,0x10,0x98]
138        muh     $2,$3,$4         # CHECK: muh $2, $3, $4   # encoding: [0x00,0x64,0x10,0xd8]
139        mulu    $2,$3,$4         # CHECK: mulu $2, $3, $4  # encoding: [0x00,0x64,0x10,0x99]
140        muhu    $2,$3,$4         # CHECK: muhu $2, $3, $4  # encoding: [0x00,0x64,0x10,0xd9]
141        maddf.s $f2,$f3,$f4      # CHECK: maddf.s $f2, $f3, $f4  # encoding: [0x46,0x04,0x18,0x98]
142        maddf.d $f2,$f3,$f4      # CHECK: maddf.d $f2, $f3, $f4  # encoding: [0x46,0x24,0x18,0x98]
143        msubf.s $f2,$f3,$f4      # CHECK: msubf.s $f2, $f3, $f4  # encoding: [0x46,0x04,0x18,0x99]
144        msubf.d $f2,$f3,$f4      # CHECK: msubf.d $f2, $f3, $f4  # encoding: [0x46,0x24,0x18,0x99]
145        neg       $2             # CHECK: neg  $2, $2            # encoding: [0x00,0x02,0x10,0x22]
146        neg       $2, $3         # CHECK: neg  $2, $3            # encoding: [0x00,0x03,0x10,0x22]
147        negu      $2             # CHECK: negu $2, $2            # encoding: [0x00,0x02,0x10,0x23]
148        negu      $2,$3          # CHECK: negu $2, $3            # encoding: [0x00,0x03,0x10,0x23]
149        not       $3, $4         # CHECK: not $3, $4             # encoding: [0x00,0x80,0x18,0x27]
150        not       $3             # CHECK: not $3, $3             # encoding: [0x00,0x60,0x18,0x27]
151        pause                    # CHECK: pause                  # encoding:  [0x00,0x00,0x01,0x40]
152                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} PAUSE>
153        pref    1, 8($5)         # CHECK: pref 1, 8($5)          # encoding: [0x7c,0xa1,0x04,0x35]
154                                 # CHECK-NEXT:                   # <MCInst #{{.*}} PREF_R6
155        # FIXME: Use the code generator in order to print the .set directives
156        #        instead of the instruction printer.
157        rdhwr   $sp,$11          # CHECK:      .set  push
158                                 # CHECK-NEXT: .set  mips32r2
159                                 # CHECK-NEXT: rdhwr $sp, $11
160                                 # CHECK-NEXT: .set  pop      # encoding: [0x7c,0x1d,0x58,0x3b]
161        round.w.d $f6, $f4       # CHECK: round.w.d $f6, $f4     # encoding: [0x46,0x20,0x21,0x8c]
162                                 # CHECK:                        # <MCInst #{{.*}} ROUND_W_D64
163        round.w.s $f27,$f28      # CHECK: round.w.s $f27, $f28   # encoding: [0x46,0x00,0xe6,0xcc]
164                                 # CHECK:                        # <MCInst #{{.*}} ROUND_W_S
165        recip.d $f19,$f6         # CHECK: recip.d $f19, $f6   # encoding: [0x46,0x20,0x34,0xd5]
166        recip.s $f3,$f30         # CHECK: recip.s $f3, $f30   # encoding: [0x46,0x00,0xf0,0xd5]
167        s.s    $f2, 8($3)        # CHECK: swc1 $f2, 8($3)     # encoding: [0xe4,0x62,0x00,0x08]
168        s.d    $f2, 8($3)        # CHECK: sdc1 $f2, 8($3)     # encoding: [0xf4,0x62,0x00,0x08]
169        sel.d   $f0,$f1,$f2      # CHECK: sel.d $f0, $f1, $f2 # encoding: [0x46,0x22,0x08,0x10]
170        sel.s   $f0,$f1,$f2      # CHECK: sel.s $f0, $f1, $f2 # encoding: [0x46,0x02,0x08,0x10]
171        seleqz  $2,$3,$4         # CHECK: seleqz $2, $3, $4 # encoding: [0x00,0x64,0x10,0x35]
172        selnez  $2,$3,$4         # CHECK: selnez $2, $3, $4 # encoding: [0x00,0x64,0x10,0x37]
173        max.s   $f0, $f2, $f4    # CHECK: max.s $f0, $f2, $f4 # encoding: [0x46,0x04,0x10,0x1d]
174        max.d   $f0, $f2, $f4    # CHECK: max.d $f0, $f2, $f4 # encoding: [0x46,0x24,0x10,0x1d]
175        min.s   $f0, $f2, $f4    # CHECK: min.s $f0, $f2, $f4 # encoding: [0x46,0x04,0x10,0x1c]
176        min.d   $f0, $f2, $f4    # CHECK: min.d $f0, $f2, $f4 # encoding: [0x46,0x24,0x10,0x1c]
177        maxa.s  $f0, $f2, $f4    # CHECK: maxa.s $f0, $f2, $f4 # encoding: [0x46,0x04,0x10,0x1f]
178        maxa.d  $f0, $f2, $f4    # CHECK: maxa.d $f0, $f2, $f4 # encoding: [0x46,0x24,0x10,0x1f]
179        mina.s  $f0, $f2, $f4    # CHECK: mina.s $f0, $f2, $f4 # encoding: [0x46,0x04,0x10,0x1e]
180        mina.d  $f0, $f2, $f4    # CHECK: mina.d $f0, $f2, $f4 # encoding: [0x46,0x24,0x10,0x1e]
181        or      $2, 4            # CHECK: ori $2, $2, 4          # encoding: [0x34,0x42,0x00,0x04]
182        seleqz.s $f0, $f2, $f4   # CHECK: seleqz.s $f0, $f2, $f4 # encoding: [0x46,0x04,0x10,0x14]
183        seleqz.d $f0, $f2, $f4   # CHECK: seleqz.d $f0, $f2, $f4 # encoding: [0x46,0x24,0x10,0x14]
184        selnez.s $f0, $f2, $f4   # CHECK: selnez.s $f0, $f2, $f4 # encoding: [0x46,0x04,0x10,0x17]
185        selnez.d $f0, $f2, $f4   # CHECK: selnez.d $f0, $f2, $f4 # encoding: [0x46,0x24,0x10,0x17]
186        rint.s $f2, $f4          # CHECK: rint.s $f2, $f4        # encoding: [0x46,0x00,0x20,0x9a]
187        rint.d $f2, $f4          # CHECK: rint.d $f2, $f4        # encoding: [0x46,0x20,0x20,0x9a]
188        class.s $f2, $f4         # CHECK: class.s $f2, $f4       # encoding: [0x46,0x00,0x20,0x9b]
189        class.d $f2, $f4         # CHECK: class.d $f2, $f4       # encoding: [0x46,0x20,0x20,0x9b]
190        j       1f               # CHECK: j $tmp0                # encoding: [0b000010AA,A,A,A]
191                                 # CHECK:                        #   fixup A - offset: 0, value: ($tmp0), kind: fixup_Mips_26
192        j       a                # CHECK: j a                    # encoding: [0b000010AA,A,A,A]
193                                 # CHECK:                        #   fixup A - offset: 0, value: a, kind: fixup_Mips_26
194        j       1328             # CHECK: j 1328                 # encoding: [0x08,0x00,0x01,0x4c]
195        jal       21100                # CHECK: jal 21100     # encoding: [0x0c,0x00,0x14,0x9b]
196        jr.hb   $4               # CHECK: jr.hb $4               # encoding: [0x00,0x80,0x04,0x09]
197        jr      $ra              # CHECK: jr $ra                 # encoding: [0x03,0xe0,0x00,0x09]
198        jr      $25              # CHECK: jr $25                 # encoding: [0x03,0x20,0x00,0x09]
199        jrc     $27              # CHECK: jrc $27                # encoding: [0xd8,0x1b,0x00,0x00]
200        jalr.hb $4               # CHECK: jalr.hb $4             # encoding: [0x00,0x80,0xfc,0x09]
201        jalr.hb $4, $5           # CHECK: jalr.hb $4, $5         # encoding: [0x00,0xa0,0x24,0x09]
202        jalrc   $25              # CHECK: jalrc $25              # encoding: [0xf8,0x19,0x00,0x00]
203        jialc   $15, 16161       # CHECK: jialc $15, 16161       # encoding: [0xf8,0x0f,0x3f,0x21]
204        jic     $12, -3920       # CHECK: jic $12, -3920         # encoding: [0xd8,0x0c,0xf0,0xb0]
205        ldc2    $8, -701($at)    # CHECK: ldc2 $8, -701($1)      # encoding: [0x49,0xc8,0x0d,0x43]
206        lwc2    $18,-841($a2)    # CHECK: lwc2 $18, -841($6)     # encoding: [0x49,0x52,0x34,0xb7]
207        sdc2    $20,629($s2)     # CHECK: sdc2 $20, 629($18)     # encoding: [0x49,0xf4,0x92,0x75]
208        swc2    $25,304($s0)     # CHECK: swc2 $25, 304($16)     # encoding: [0x49,0x79,0x81,0x30]
209        ll      $v0,-153($s2)    # CHECK: ll $2, -153($18)       # encoding: [0x7e,0x42,0xb3,0xb6]
210        sc      $15,-40($s3)     # CHECK: sc $15, -40($19)       # encoding: [0x7e,0x6f,0xec,0x26]
211        clo     $11,$a1          # CHECK: clo $11, $5            # encoding: [0x00,0xa0,0x58,0x51]
212                                 # CHECK-NEXT:                   # <MCInst #{{.*}} CLO
213        clz     $sp,$gp          # CHECK: clz $sp, $gp           # encoding: [0x03,0x80,0xe8,0x50]
214                                 # CHECK-NEXT:                   # <MCInst #{{.*}} CLZ
215        rsqrt.s $f0,$f4          # CHECK: rsqrt.s $f0, $f4       # encoding: [0x46,0x00,0x20,0x16]
216        rsqrt.d $f2,$f6          # CHECK: rsqrt.d $f2, $f6       # encoding: [0x46,0x20,0x30,0x96]
217        seb       $25, $15       # CHECK: seb $25, $15           # encoding: [0x7c,0x0f,0xcc,0x20]
218                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SEB_MM
219        seb       $25            # CHECK: seb $25, $25           # encoding: [0x7c,0x19,0xcc,0x20]
220                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SEB_MM
221        seh       $3, $12        # CHECK: seh $3, $12            # encoding: [0x7c,0x0c,0x1e,0x20]
222                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SEH_MM
223        seh       $3             # CHECK: seh $3, $3             # encoding: [0x7c,0x03,0x1e,0x20]
224                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SEH_MM
225        sgt     $4, $5           # CHECK: slt $4, $5, $4         # encoding: [0x00,0xa4,0x20,0x2a]
226        sgt     $4, $5, $6       # CHECK: slt $4, $6, $5         # encoding: [0x00,0xc5,0x20,0x2a]
227        sgtu    $4, $5           # CHECK: sltu $4, $5, $4        # encoding: [0x00,0xa4,0x20,0x2b]
228        sgtu    $4, $5, $6       # CHECK: sltu $4, $6, $5        # encoding: [0x00,0xc5,0x20,0x2b]
229        sll       $4, $5         # CHECK: sllv $4, $4, $5        # encoding: [0x00,0xa4,0x20,0x04]
230                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SLL
231                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SLL_MM
232        sll       $a3,18         # CHECK: sll $7, $7, 18         # encoding: [0x00,0x07,0x3c,0x80]
233                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SLL
234                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SLL_MM
235        sll       $a3,$zero,18   # CHECK: sll $7, $zero, 18      # encoding: [0x00,0x00,0x3c,0x80]
236                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SLL
237                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SLL_MM
238        sll       $a3,$zero,$9   # CHECK: sllv $7, $zero, $9     # encoding: [0x01,0x20,0x38,0x04]
239                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SLL
240                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SLL_MM
241        sllv      $a3,$zero,$9   # CHECK: sllv $7, $zero, $9     # encoding: [0x01,0x20,0x38,0x04]
242                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SLLV
243                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SLLV_MM
244        sra       $4, $5         # CHECK: srav $4, $4, $5        # encoding: [0x00,0xa4,0x20,0x07]
245                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRA
246                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRA_MM
247        sra       $s1,15         # CHECK: sra $17, $17, 15       # encoding: [0x00,0x11,0x8b,0xc3]
248                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRA
249                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRA_MM
250        sra       $s1,$s7,15     # CHECK: sra $17, $23, 15       # encoding: [0x00,0x17,0x8b,0xc3]
251                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRA
252                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRA_MM
253        sra       $s1,$s7,$sp    # CHECK: srav $17, $23, $sp     # encoding: [0x03,0xb7,0x88,0x07]
254                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRA
255                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRA_MM
256        srav      $s1,$s7,$sp    # CHECK: srav $17, $23, $sp     # encoding: [0x03,0xb7,0x88,0x07]
257                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRAV
258                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRAV_MM
259        srl       $4, $5         # CHECK: srlv $4, $4, $5        # encoding: [0x00,0xa4,0x20,0x06]
260                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRL
261                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRL_MM
262        srl       $2,7           # CHECK: srl $2, $2, 7          # encoding: [0x00,0x02,0x11,0xc2]
263                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRL
264                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRL_MM
265        srl       $2,$2,7        # CHECK: srl $2, $2, 7          # encoding: [0x00,0x02,0x11,0xc2]
266                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRL
267                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRL_MM
268        srl       $25,$s4,$a0    # CHECK: srlv $25, $20, $4      # encoding: [0x00,0x94,0xc8,0x06]
269                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRL
270                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRL_MM
271        srlv      $25,$s4,$a0    # CHECK: srlv $25, $20, $4      # encoding: [0x00,0x94,0xc8,0x06]
272                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SRLV
273                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SRLV_MM
274        ssnop                    # WARNING: [[@LINE]]:9: warning: ssnop is deprecated for MIPS32r6 and is equivalent to a nop instruction
275        ssnop                    # CHECK: ssnop                  # encoding: [0x00,0x00,0x00,0x40]
276        sdbbp                    # CHECK: sdbbp                  # encoding: [0x00,0x00,0x00,0x0e]
277                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SDBBP
278                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SDBBP_MM
279        sdbbp     34             # CHECK: sdbbp 34               # encoding: [0x00,0x00,0x08,0x8e]
280                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SDBBP
281                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} SDBBP_MM
282        sigrie                   # CHECK: sigrie                 # encoding: [0x04,0x17,0x00,0x00]
283                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SIGRIE
284        sigrie    257            # CHECK: sigrie 257             # encoding: [0x04,0x17,0x01,0x01]
285                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SIGRIE
286        sync                     # CHECK: sync                   # encoding: [0x00,0x00,0x00,0x0f]
287                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SYNC
288        sync    1                # CHECK: sync 1                 # encoding: [0x00,0x00,0x00,0x4f]
289                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SYNC
290        syscall                  # CHECK: syscall                # encoding: [0x00,0x00,0x00,0x0c]
291        syscall   256            # CHECK: syscall 256            # encoding: [0x00,0x00,0x40,0x0c]
292        tlbp                     # CHECK: tlbp                   # encoding: [0x42,0x00,0x00,0x08]
293                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} TLBP
294                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} TLBP_MM
295        tlbr                     # CHECK: tlbr                   # encoding: [0x42,0x00,0x00,0x01]
296                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} TLBR
297                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} TLBR_MM
298        tlbwi                    # CHECK: tlbwi                  # encoding: [0x42,0x00,0x00,0x02]
299                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} TLBWI
300                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} TLBWI_MM
301        tlbwr                    # CHECK: tlbwr                  # encoding: [0x42,0x00,0x00,0x06]
302                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} TLBWR
303                                 # CHECK-NOT:                    # <MCInst #{{[0-9]+}} TLBWR_MM
304        teq     $0,$3            # CHECK: teq $zero, $3          # encoding: [0x00,0x03,0x00,0x34]
305        teq     $5,$7,620        # CHECK: teq $5, $7, 620        # encoding: [0x00,0xa7,0x9b,0x34]
306        tge     $7,$10           # CHECK: tge $7, $10            # encoding: [0x00,0xea,0x00,0x30]
307        tge     $5,$19,340       # CHECK: tge $5, $19, 340       # encoding: [0x00,0xb3,0x55,0x30]
308        tgeu    $22,$28          # CHECK: tgeu $22, $gp          # encoding: [0x02,0xdc,0x00,0x31]
309        tgeu    $20,$14,379      # CHECK: tgeu $20, $14, 379     # encoding: [0x02,0x8e,0x5e,0xf1]
310        tlt     $15,$13          # CHECK: tlt $15, $13           # encoding: [0x01,0xed,0x00,0x32]
311        tlt     $2,$19,133       # CHECK: tlt $2, $19, 133       # encoding: [0x00,0x53,0x21,0x72]
312        tltu    $11,$16          # CHECK: tltu $11, $16          # encoding: [0x01,0x70,0x00,0x33]
313        tltu    $16,$29,1016     # CHECK: tltu $16, $sp, 1016    # encoding: [0x02,0x1d,0xfe,0x33]
314        tne     $6,$17           # CHECK: tne $6, $17            # encoding: [0x00,0xd1,0x00,0x36]
315        tne     $7,$8,885        # CHECK: tne $7, $8, 885        # encoding: [0x00,0xe8,0xdd,0x76]
316        xor     $2, 4            # CHECK: xori $2, $2, 4         # encoding: [0x38,0x42,0x00,0x04]
317        synci     -15842($a2)    # CHECK: synci -15842($6)       # encoding: [0x04,0xdf,0xc2,0x1e]
318                                 # CHECK-NEXT:                   # <MCInst #{{[0-9]+}} SYNCI
319
3201:
321
322        # Check that we accept traditional %relocation(symbol) offsets for stores
323        # and loads, not just a sign 16 bit offset.
324
325        lui     $2, %hi(g_8)            # CHECK:  encoding: [0x3c,0x02,A,A]
326        lb      $3, %lo(g_8)($2)        # CHECK:  encoding: [0x80,0x43,A,A]
327        lh      $3, %lo(g_8)($2)        # CHECK:  encoding: [0x84,0x43,A,A]
328        lhu     $3, %lo(g_8)($2)        # CHECK:  encoding: [0x94,0x43,A,A]
329        lw      $3, %lo(g_8)($2)        # CHECK:  encoding: [0x8c,0x43,A,A]
330        sb      $3, %lo(g_8)($2)        # CHECK:  encoding: [0xa0,0x43,A,A]
331        sh      $3, %lo(g_8)($2)        # CHECK:  encoding: [0xa4,0x43,A,A]
332        sw      $3, %lo(g_8)($2)        # CHECK:  encoding: [0xac,0x43,A,A]
333
334        lwc1    $f0, %lo(g_8)($2)       # CHECK:  encoding: [0xc4,0x40,A,A]
335        ldc1    $f0, %lo(g_8)($2)       # CHECK:  encoding: [0xd4,0x40,A,A]
336        swc1    $f0, %lo(g_8)($2)       # CHECK:  encoding: [0xe4,0x40,A,A]
337        sdc1    $f0, %lo(g_8)($2)       # CHECK:  encoding: [0xf4,0x40,A,A]
338        .type   g_8,@object
339        .comm   g_8,16,16
340