1# RUN: llvm-mc  %s -arch=mips -mcpu=mips64 -show-encoding | FileCheck %s -check-prefix=CHECK-64
2# RUN: llvm-mc  %s -arch=mips -mcpu=mips64r2 -show-encoding | FileCheck %s -check-prefix=CHECK-64R
3# RUN: llvm-mc  %s -arch=mips -mcpu=mips64r3 -show-encoding | FileCheck %s -check-prefix=CHECK-64R
4# RUN: llvm-mc  %s -arch=mips -mcpu=mips64r5 -show-encoding | FileCheck %s -check-prefix=CHECK-64R
5# RUN: llvm-mc  %s -arch=mips -mcpu=mips64r6 -show-encoding | FileCheck %s -check-prefix=CHECK-64R
6
7  .text
8foo:
9  rol $4,$5
10# CHECK-64:     subu    $1, $zero, $5       # encoding: [0x00,0x05,0x08,0x23]
11# CHECK-64:     srlv    $1, $4, $1          # encoding: [0x00,0x24,0x08,0x06]
12# CHECK-64:     sllv    $4, $4, $5          # encoding: [0x00,0xa4,0x20,0x04]
13# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
14# CHECK-64R:    subu    $1, $zero, $5       # encoding: [0x00,0x05,0x08,0x23]
15# CHECK-64R:    rotrv   $4, $4, $1          # encoding: [0x00,0x24,0x20,0x46]
16  rol $4,$5,$6
17# CHECK-64:     subu    $1, $zero, $6       # encoding: [0x00,0x06,0x08,0x23]
18# CHECK-64:     srlv    $1, $5, $1          # encoding: [0x00,0x25,0x08,0x06]
19# CHECK-64:     sllv    $4, $5, $6          # encoding: [0x00,0xc5,0x20,0x04]
20# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
21# CHECK-64R:    negu    $4, $6              # encoding: [0x00,0x06,0x20,0x23]
22# CHECK-64R:    rotrv   $4, $5, $4          # encoding: [0x00,0x85,0x20,0x46]
23  rol $4,0
24# CHECK-64:     srl     $4, $4, 0           # encoding: [0x00,0x04,0x20,0x02]
25# CHECK-64R:    rotr    $4, $4, 0           # encoding: [0x00,0x24,0x20,0x02]
26  rol $4,$5,0
27# CHECK-64:     srl     $4, $5, 0           # encoding: [0x00,0x05,0x20,0x02]
28# CHECK-64R:    rotr    $4, $5, 0           # encoding: [0x00,0x25,0x20,0x02]
29  rol $4,1
30# CHECK-64:     sll     $1, $4, 1           # encoding: [0x00,0x04,0x08,0x40]
31# CHECK-64:     srl     $4, $4, 31          # encoding: [0x00,0x04,0x27,0xc2]
32# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
33# CHECK-64R:    rotr    $4, $4, 31          # encoding: [0x00,0x24,0x27,0xc2]
34  rol $4,$5,1
35# CHECK-64:     sll     $1, $5, 1           # encoding: [0x00,0x05,0x08,0x40]
36# CHECK-64:     srl     $4, $5, 31          # encoding: [0x00,0x05,0x27,0xc2]
37# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
38# CHECK-64R:    rotr    $4, $5, 31          # encoding: [0x00,0x25,0x27,0xc2]
39  rol $4,2
40# CHECK-64:     sll     $1, $4, 2           # encoding: [0x00,0x04,0x08,0x80]
41# CHECK-64:     srl     $4, $4, 30          # encoding: [0x00,0x04,0x27,0x82]
42# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
43# CHECK-64R:    rotr    $4, $4, 30          # encoding: [0x00,0x24,0x27,0x82]
44  rol $4,$5,2
45# CHECK-64:     sll     $1, $5, 2           # encoding: [0x00,0x05,0x08,0x80]
46# CHECK-64:     srl     $4, $5, 30          # encoding: [0x00,0x05,0x27,0x82]
47# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
48# CHECK-64R:    rotr    $4, $5, 30          # encoding: [0x00,0x25,0x27,0x82]
49
50  ror $4,$5
51# CHECK-64:     subu    $1, $zero, $5       # encoding: [0x00,0x05,0x08,0x23]
52# CHECK-64:     sllv    $1, $4, $1          # encoding: [0x00,0x24,0x08,0x04]
53# CHECK-64:     srlv    $4, $4, $5          # encoding: [0x00,0xa4,0x20,0x06]
54# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
55# CHECK-64R:    rotrv   $4, $4, $5          # encoding: [0x00,0xa4,0x20,0x46]
56  ror $4,$5,$6
57# CHECK-64:     subu    $1, $zero, $6       # encoding: [0x00,0x06,0x08,0x23]
58# CHECK-64:     sllv    $1, $5, $1          # encoding: [0x00,0x25,0x08,0x04]
59# CHECK-64:     srlv    $4, $5, $6          # encoding: [0x00,0xc5,0x20,0x06]
60# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
61# CHECK-64R:    rotrv   $4, $5, $6          # encoding: [0x00,0xc5,0x20,0x46]
62  ror $4,0
63# CHECK-64:     srl     $4, $4, 0           # encoding: [0x00,0x04,0x20,0x02]
64# CHECK-64R:    rotr    $4, $4, 0           # encoding: [0x00,0x24,0x20,0x02]
65  ror $4,$5,0
66# CHECK-64:     srl     $4, $5, 0           # encoding: [0x00,0x05,0x20,0x02]
67# CHECK-64R:    rotr    $4, $5, 0           # encoding: [0x00,0x25,0x20,0x02]
68  ror $4,1
69# CHECK-64:     srl     $1, $4, 1           # encoding: [0x00,0x04,0x08,0x42]
70# CHECK-64:     sll     $4, $4, 31          # encoding: [0x00,0x04,0x27,0xc0]
71# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
72# CHECK-64R:    rotr    $4, $4, 1           # encoding: [0x00,0x24,0x20,0x42]
73  ror $4,$5,1
74# CHECK-64:     srl     $1, $5, 1           # encoding: [0x00,0x05,0x08,0x42]
75# CHECK-64:     sll     $4, $5, 31          # encoding: [0x00,0x05,0x27,0xc0]
76# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
77# CHECK-64R:    rotr    $4, $5, 1           # encoding: [0x00,0x25,0x20,0x42]
78  ror $4,2
79# CHECK-64:     srl     $1, $4, 2           # encoding: [0x00,0x04,0x08,0x82]
80# CHECK-64:     sll     $4, $4, 30          # encoding: [0x00,0x04,0x27,0x80]
81# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
82# CHECK-64R:    rotr    $4, $4, 2           # encoding: [0x00,0x24,0x20,0x82]
83  ror $4,$5,2
84# CHECK-64:     srl     $1, $5, 2           # encoding: [0x00,0x05,0x08,0x82]
85# CHECK-64:     sll     $4, $5, 30          # encoding: [0x00,0x05,0x27,0x80]
86# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
87# CHECK-64R:    rotr    $4, $5, 2           # encoding: [0x00,0x25,0x20,0x82]
88
89  drol $4,$5
90# CHECK-64:     dsubu   $1, $zero, $5       # encoding: [0x00,0x05,0x08,0x2f]
91# CHECK-64:     dsrlv   $1, $4, $1          # encoding: [0x00,0x24,0x08,0x16]
92# CHECK-64:     dsllv   $4, $4, $5          # encoding: [0x00,0xa4,0x20,0x14]
93# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
94# CHECK-64R:    dsubu   $1, $zero, $5       # encoding: [0x00,0x05,0x08,0x2f]
95# CHECK-64R:    drotrv  $4, $4, $1          # encoding: [0x00,0x24,0x20,0x56]
96  drol $4,$5,$6
97# CHECK-64:     dsubu   $1, $zero, $6       # encoding: [0x00,0x06,0x08,0x2f]
98# CHECK-64:     dsrlv   $1, $5, $1          # encoding: [0x00,0x25,0x08,0x16]
99# CHECK-64:     dsllv   $4, $5, $6          # encoding: [0x00,0xc5,0x20,0x14]
100# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
101# CHECK-64R:    dsubu   $4, $zero, $6       # encoding: [0x00,0x06,0x20,0x2f]
102# CHECK-64R:    drotrv  $4, $5, $4          # encoding: [0x00,0x85,0x20,0x56]
103
104  drol $4,1
105# CHECK-64:     dsll    $1, $4, 1           # encoding: [0x00,0x04,0x08,0x78]
106# CHECK-64:     dsrl32  $4, $4, 31          # encoding: [0x00,0x04,0x27,0xfe]
107# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
108# CHECK-64R:    drotr32 $4, $4, 31          # encoding: [0x00,0x24,0x27,0xfe]
109  drol $4,$5,0
110# CHECK-64:     dsrl    $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3a]
111# CHECK-64R:    drotr   $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3a]
112  drol $4,$5,1
113# CHECK-64:     dsll    $1, $5, 1           # encoding: [0x00,0x05,0x08,0x78]
114# CHECK-64:     dsrl32  $4, $5, 31          # encoding: [0x00,0x05,0x27,0xfe]
115# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
116# CHECK-64R:    drotr32 $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfe]
117  drol $4,$5,31
118# CHECK-64:     dsll    $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xf8]
119# CHECK-64:     dsrl32  $4, $5, 1           # encoding: [0x00,0x05,0x20,0x7e]
120# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
121# CHECK-64R:    drotr32 $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7e]
122  drol $4,$5,32
123# CHECK-64:     dsll32  $1, $5, 0           # encoding: [0x00,0x05,0x08,0x3c]
124# CHECK-64:     dsrl32  $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3e]
125# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
126# CHECK-64R:    drotr32 $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3e]
127  drol $4,$5,33
128# CHECK-64:     dsll32  $1, $5, 1           # encoding: [0x00,0x05,0x08,0x7c]
129# CHECK-64:     dsrl    $4, $5, 31          # encoding: [0x00,0x05,0x27,0xfa]
130# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
131# CHECK-64R:    drotr   $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfa]
132  drol $4,$5,63
133# CHECK-64:     dsll32  $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xfc]
134# CHECK-64:     dsrl    $4, $5, 1           # encoding: [0x00,0x05,0x20,0x7a]
135# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
136# CHECK-64R:    drotr   $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7a]
137  drol $4,$5,64
138# CHECK-64:     dsrl    $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3a]
139# CHECK-64R:    drotr   $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3a]
140  drol $4,$5,65
141# CHECK-64:     dsll    $1, $5, 1           # encoding: [0x00,0x05,0x08,0x78]
142# CHECK-64:     dsrl32  $4, $5, 31          # encoding: [0x00,0x05,0x27,0xfe]
143# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
144# CHECK-64R:    drotr32 $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfe]
145  drol $4,$5,95
146# CHECK-64:     dsll    $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xf8]
147# CHECK-64:     dsrl32  $4, $5, 1           # encoding: [0x00,0x05,0x20,0x7e]
148# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
149# CHECK-64R:    drotr32 $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7e]
150  drol $4,$5,96
151# CHECK-64:     dsll32  $1, $5, 0           # encoding: [0x00,0x05,0x08,0x3c]
152# CHECK-64:     dsrl32  $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3e]
153# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
154# CHECK-64R:    drotr32 $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3e]
155  drol $4,$5,97
156# CHECK-64:     dsll32  $1, $5, 1           # encoding: [0x00,0x05,0x08,0x7c]
157# CHECK-64:     dsrl    $4, $5, 31          # encoding: [0x00,0x05,0x27,0xfa]
158# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
159# CHECK-64R:    drotr   $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfa]
160  drol $4,$5,127
161# CHECK-64:     dsll32  $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xfc]
162# CHECK-64:     dsrl    $4, $5, 1           # encoding: [0x00,0x05,0x20,0x7a]
163# CHECK-64:     or  $4, $4, $1              # encoding: [0x00,0x81,0x20,0x25]
164# CHECK-64R:    drotr   $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7a]
165
166  dror $4,$5
167# CHECK-64:     dsubu   $1, $zero, $5       # encoding: [0x00,0x05,0x08,0x2f]
168# CHECK-64:     dsllv   $1, $4, $1          # encoding: [0x00,0x24,0x08,0x14]
169# CHECK-64:     dsrlv   $4, $4, $5          # encoding: [0x00,0xa4,0x20,0x16]
170# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
171# CHECK-64R:    drotrv  $4, $4, $5          # encoding: [0x00,0xa4,0x20,0x56]
172  dror $4,$5,$6
173# CHECK-64:     dsubu   $1, $zero, $6       # encoding: [0x00,0x06,0x08,0x2f]
174# CHECK-64:     dsllv   $1, $5, $1          # encoding: [0x00,0x25,0x08,0x14]
175# CHECK-64:     dsrlv   $4, $5, $6          # encoding: [0x00,0xc5,0x20,0x16]
176# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
177# CHECK-64R:    drotrv  $4, $5, $6          # encoding: [0x00,0xc5,0x20,0x56]
178  dror $4,1
179# CHECK-64:     dsrl    $1, $4, 1           # encoding: [0x00,0x04,0x08,0x7a]
180# CHECK-64:     dsll32  $4, $4, 31          # encoding: [0x00,0x04,0x27,0xfc]
181# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
182# CHECK-64R:    drotr   $4, $4, 1           # encoding: [0x00,0x24,0x20,0x7a]
183  dror $4,$5,0
184# CHECK-64:     dsrl    $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3a]
185# CHECK-64R:    drotr   $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3a]
186  dror $4,$5,1
187# CHECK-64:     dsrl    $1, $5, 1           # encoding: [0x00,0x05,0x08,0x7a]
188# CHECK-64:     dsll32  $4, $5, 31          # encoding: [0x00,0x05,0x27,0xfc]
189# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
190# CHECK-64R:    drotr   $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7a]
191  dror $4,$5,31
192# CHECK-64:     dsrl    $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xfa]
193# CHECK-64:     dsll32  $4, $5, 1           # encoding: [0x00,0x05,0x20,0x7c]
194# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
195# CHECK-64R:    drotr   $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfa]
196  dror $4,$5,32
197# CHECK-64:     dsrl32  $1, $5, 0           # encoding: [0x00,0x05,0x08,0x3e]
198# CHECK-64:     dsll32  $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3c]
199# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
200# CHECK-64R:    drotr32 $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3e]
201  dror $4,$5,33
202# CHECK-64:     dsrl32  $1, $5, 1           # encoding: [0x00,0x05,0x08,0x7e]
203# CHECK-64:     dsll    $4, $5, 31          # encoding: [0x00,0x05,0x27,0xf8]
204# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
205# CHECK-64R:    drotr32 $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7e]
206  dror $4,$5,63
207# CHECK-64:     dsrl32  $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xfe]
208# CHECK-64:     dsll    $4, $5, 1           # encoding: [0x00,0x05,0x20,0x78]
209# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
210# CHECK-64R:    drotr32 $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfe]
211  dror $4,$5,64
212# CHECK-64:     dsrl    $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3a]
213# CHECK-64R:    drotr   $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3a]
214  dror $4,$5,65
215# CHECK-64:     dsrl    $1, $5, 1           # encoding: [0x00,0x05,0x08,0x7a]
216# CHECK-64:     dsll32  $4, $5, 31          # encoding: [0x00,0x05,0x27,0xfc]
217# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
218# CHECK-64R:    drotr   $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7a]
219  dror $4,$5,95
220# CHECK-64:     dsrl    $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xfa]
221# CHECK-64:     dsll32  $4, $5, 1           # encoding: [0x00,0x05,0x20,0x7c]
222# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
223# CHECK-64R:    drotr   $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfa]
224  dror $4,$5,96
225# CHECK-64:     dsrl32  $1, $5, 0           # encoding: [0x00,0x05,0x08,0x3e]
226# CHECK-64:     dsll32  $4, $5, 0           # encoding: [0x00,0x05,0x20,0x3c]
227# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
228# CHECK-64R:    drotr32 $4, $5, 0           # encoding: [0x00,0x25,0x20,0x3e]
229  dror $4,$5,97
230# CHECK-64:     dsrl32  $1, $5, 1           # encoding: [0x00,0x05,0x08,0x7e]
231# CHECK-64:     dsll    $4, $5, 31          # encoding: [0x00,0x05,0x27,0xf8]
232# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
233# CHECK-64R:    drotr32 $4, $5, 1           # encoding: [0x00,0x25,0x20,0x7e]
234  dror $4,$5,127
235# CHECK-64:     dsrl32  $1, $5, 31          # encoding: [0x00,0x05,0x0f,0xfe]
236# CHECK-64:     dsll    $4, $5, 1           # encoding: [0x00,0x05,0x20,0x78]
237# CHECK-64:     or      $4, $4, $1          # encoding: [0x00,0x81,0x20,0x25]
238# CHECK-64R:    drotr32 $4, $5, 31          # encoding: [0x00,0x25,0x27,0xfe]
239