[InstCombine] Signed saturation patterns
[llvm-core.git] / test / MC / Mips / micromips-loadstore-instructions.s
blob584942d6b2f078870520a396626306079d973b99
1 # RUN: llvm-mc %s -triple=mipsel -show-encoding -mattr=micromips -show-inst \
2 # RUN: | FileCheck -check-prefix=CHECK-EL %s
3 # RUN: llvm-mc %s -triple=mips -show-encoding -mattr=micromips -show-inst \
4 # RUN: | FileCheck -check-prefix=CHECK-EB %s
5 # Check that the assembler can handle the documented syntax
6 # for load and store instructions.
7 #------------------------------------------------------------------------------
8 # Load and Store Instructions
9 #------------------------------------------------------------------------------
10 # Little endian
11 #------------------------------------------------------------------------------
12 # CHECK-EL: lb $5, 8($4) # encoding: [0xa4,0x1c,0x08,0x00]
13 # CHECK-EL: lbu $6, 8($4) # encoding: [0xc4,0x14,0x08,0x00]
14 # CHECK-EL: lh $2, 8($4) # encoding: [0x44,0x3c,0x08,0x00]
15 # CHECK-EL: lhu $4, 8($2) # encoding: [0x82,0x34,0x08,0x00]
16 # CHECK-EL: lw $6, 4($5) # encoding: [0xc5,0xfc,0x04,0x00]
17 # CHECK-EL: lw $6, 123($sp) # encoding: [0xdd,0xfc,0x7b,0x00]
18 # CHECK-EL: sb $5, 8($4) # encoding: [0xa4,0x18,0x08,0x00]
19 # CHECK-EL: sh $2, 8($4) # encoding: [0x44,0x38,0x08,0x00]
20 # CHECK-EL: sw $5, 4($6) # encoding: [0xa6,0xf8,0x04,0x00]
21 # CHECK-EL: sw $5, 123($sp) # encoding: [0xbd,0xf8,0x7b,0x00]
22 # CHECK-EL: sw $3, 32($gp) # encoding: [0x7c,0xf8,0x20,0x00]
23 # CHECK-EL: ll $2, 8($4) # encoding: [0x44,0x60,0x08,0x30]
24 # CHECK-EL: sc $2, 8($4) # encoding: [0x44,0x60,0x08,0xb0]
25 # CHECK-EL: lwu $2, 8($4) # encoding: [0x44,0x60,0x08,0xe0]
26 # CHECK-EL: lwxs $2, $3($4) # encoding: [0x64,0x00,0x18,0x11]
27 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWXS_MM
28 # CHECK-EL: lwm32 $16, $17, 8($4) # encoding: [0x44,0x20,0x08,0x50]
29 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
30 # CHECK-EL: lwm32 $16, $17, $18, $19, 8($4) # encoding: [0x84,0x20,0x08,0x50]
31 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
32 # CHECK-EL: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, 8($4) # encoding: [0x24,0x21,0x08,0x50]
33 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
34 # CHECK-EL: lwm32 $16, $17, $18, $19, $ra, 8($4) # encoding: [0x84,0x22,0x08,0x50]
35 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
36 # CHECK-EL: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x24,0x23,0x08,0x50]
37 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
38 # CHECK-EL: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x24,0x23,0x08,0x50]
39 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
40 # CHECK-EL: swm32 $16, $17, 8($4) # encoding: [0x44,0x20,0x08,0xd0]
41 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
42 # CHECK-EL: swm32 $16, $17, $18, $19, 8($4) # encoding: [0x84,0x20,0x08,0xd0]
43 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
44 # CHECK-EL: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x12,0x45]
45 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM16_MM
46 # CHECK-EL: swm16 $16, $17, $ra, 8($sp) # encoding: [0x52,0x45]
47 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM16_MM
48 # CHECK-EL: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x12,0x45]
49 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM16_MM
50 # CHECK-EL: lwm32 $16, $17, $ra, 64($sp) # encoding: [0x5d,0x22,0x40,0x50]
51 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
52 # CHECK-EL: lwm32 $16, $17, $ra, 8($4) # encoding: [0x44,0x22,0x08,0x50]
53 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
54 # CHECK-EL: lwm32 $16, $17, 8($sp) # encoding: [0x5d,0x20,0x08,0x50]
55 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
56 # CHECK-EL: swm16 $16, $17, $ra, 8($sp) # encoding: [0x52,0x45]
57 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM16_MM
58 # CHECK-EL: swm32 $16, $17, $ra, 64($sp) # encoding: [0x5d,0x22,0x40,0xd0]
59 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
60 # CHECK-EL: swm32 $16, $17, $ra, 8($4) # encoding: [0x44,0x22,0x08,0xd0]
61 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
62 # CHECK-EL: swm32 $16, $17, 8($sp) # encoding: [0x5d,0x20,0x08,0xd0]
63 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
64 # CHECK-EL: swp $16, 8($4) # encoding: [0x04,0x22,0x08,0x90]
65 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} SWP_MM
66 # CHECK-EL: lwp $16, 8($4) # encoding: [0x04,0x22,0x08,0x10]
67 # CHECK-EL-NEXT: # <MCInst #{{[0-9]+}} LWP_MM
68 #------------------------------------------------------------------------------
69 # Big endian
70 #------------------------------------------------------------------------------
71 # CHECK-EB: lb $5, 8($4) # encoding: [0x1c,0xa4,0x00,0x08]
72 # CHECK-EB: lbu $6, 8($4) # encoding: [0x14,0xc4,0x00,0x08]
73 # CHECK-EB: lh $2, 8($4) # encoding: [0x3c,0x44,0x00,0x08]
74 # CHECK-EB: lhu $4, 8($2) # encoding: [0x34,0x82,0x00,0x08]
75 # CHECK-EB: lw $6, 4($5) # encoding: [0xfc,0xc5,0x00,0x04]
76 # CHECK-EB: lw $6, 123($sp) # encoding: [0xfc,0xdd,0x00,0x7b]
77 # CHECK-EB: sb $5, 8($4) # encoding: [0x18,0xa4,0x00,0x08]
78 # CHECK-EB: sh $2, 8($4) # encoding: [0x38,0x44,0x00,0x08]
79 # CHECK-EB: sw $5, 4($6) # encoding: [0xf8,0xa6,0x00,0x04]
80 # CHECK-EB: sw $5, 123($sp) # encoding: [0xf8,0xbd,0x00,0x7b]
81 # CHECK-EB: sw $3, 32($gp) # encoding: [0xf8,0x7c,0x00,0x20]
82 # CHECK-EB: ll $2, 8($4) # encoding: [0x60,0x44,0x30,0x08]
83 # CHECK-EB: sc $2, 8($4) # encoding: [0x60,0x44,0xb0,0x08]
84 # CHECK-EB: lwu $2, 8($4) # encoding: [0x60,0x44,0xe0,0x08]
85 # CHECK-EB: lwxs $2, $3($4) # encoding: [0x00,0x64,0x11,0x18]
86 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWXS_MM
87 # CHECK-EB: lwm32 $16, $17, 8($4) # encoding: [0x20,0x44,0x50,0x08]
88 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
89 # CHECK-EB: lwm32 $16, $17, $18, $19, 8($4) # encoding: [0x20,0x84,0x50,0x08]
90 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
91 # CHECK-EB: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, 8($4) # encoding: [0x21,0x24,0x50,0x08]
92 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
93 # CHECK-EB: lwm32 $16, $17, $18, $19, $ra, 8($4) # encoding: [0x22,0x84,0x50,0x08]
94 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
95 # CHECK-EB: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x23,0x24,0x50,0x08]
96 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
97 # CHECK-EB: lwm32 $16, $17, $18, $19, $20, $21, $22, $23, $fp, $ra, 8($4) # encoding: [0x23,0x24,0x50,0x08]
98 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
99 # CHECK-EB: swm32 $16, $17, 8($4) # encoding: [0x20,0x44,0xd0,0x08]
100 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
101 # CHECK-EB: swm32 $16, $17, $18, $19, 8($4) # encoding: [0x20,0x84,0xd0,0x08]
102 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
103 # CHECK-EB: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x12]
104 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM16_MM
105 # CHECK-EB: swm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x52]
106 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM16_MM
107 # CHECK-EB: lwm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x12]
108 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM16_MM
109 # CHECK-EB: lwm32 $16, $17, $ra, 64($sp) # encoding: [0x22,0x5d,0x50,0x40]
110 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
111 # CHECK-EB: lwm32 $16, $17, $ra, 8($4) # encoding: [0x22,0x44,0x50,0x08]
112 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
113 # CHECK-EB: lwm32 $16, $17, 8($sp) # encoding: [0x20,0x5d,0x50,0x08]
114 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWM32_MM
115 # CHECK-EB: swm16 $16, $17, $ra, 8($sp) # encoding: [0x45,0x52]
116 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM16_MM
117 # CHECK-EB: swm32 $16, $17, $ra, 64($sp) # encoding: [0x22,0x5d,0xd0,0x40]
118 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
119 # CHECK-EB: swm32 $16, $17, $ra, 8($4) # encoding: [0x22,0x44,0xd0,0x08]
120 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
121 # CHECK-EB: swm32 $16, $17, 8($sp) # encoding: [0x20,0x5d,0xd0,0x08]
122 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWM32_MM
123 # CHECK-EB: swp $16, 8($4) # encoding: [0x22,0x04,0x90,0x08]
124 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} SWP_MM
125 # CHECK-EB: lwp $16, 8($4) # encoding: [0x22,0x04,0x10,0x08]
126 # CHECK-EB-NEXT: # <MCInst #{{[0-9]+}} LWP_MM
127 lb $5, 8($4)
128 lbu $6, 8($4)
129 lh $2, 8($4)
130 lhu $4, 8($2)
131 lw $6, 4($5)
132 lw $6, 123($sp)
133 sb $5, 8($4)
134 sh $2, 8($4)
135 sw $5, 4($6)
136 sw $5, 123($sp)
137 sw $3, 32($gp)
138 ll $2, 8($4)
139 sc $2, 8($4)
140 lwu $2, 8($4)
141 lwxs $2, $3($4)
142 lwm32 $16, $17, 8($4)
143 lwm32 $16 - $19, 8($4)
144 lwm32 $16-$23, $30, 8($4)
145 lwm32 $16-$19, $31, 8($4)
146 lwm32 $16-$23, $30, $31, 8($4)
147 lwm32 $16-$23, $30 - $31, 8($4)
148 swm32 $16, $17, 8($4)
149 swm32 $16 - $19, 8($4)
150 lwm16 $16, $17, $ra, 8($sp)
151 swm16 $16, $17, $ra, 8($sp)
152 lwm $16, $17, $ra, 8($sp)
153 lwm $16, $17, $ra, 64($sp)
154 lwm $16, $17, $ra, 8($4)
155 lwm $16, $17, 8($sp)
156 swm $16, $17, $ra, 8($sp)
157 swm $16, $17, $ra, 64($sp)
158 swm $16, $17, $ra, 8($4)
159 swm $16, $17, 8($sp)
160 swp $16, 8($4)
161 lwp $16, 8($4)