1 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -mcpu=mips32r2 -show-encoding | FileCheck %s 2 3 4 .text 5 text_label: 6 7 add $4, -0x80000000 8 # CHECK: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c] 9 # CHECK: add $4, $4, $1 # encoding: [0x20,0x20,0x81,0x00] 10 add $4, -0x8001 11 # CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] 12 # CHECK: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34] 13 # CHECK: add $4, $4, $1 # encoding: [0x20,0x20,0x81,0x00] 14 add $4, -0x8000 15 # CHECK: addi $4, $4, -32768 # encoding: [0x00,0x80,0x84,0x20] 16 add $4, 0 17 # CHECK: addi $4, $4, 0 # encoding: [0x00,0x00,0x84,0x20] 18 add $4, 0xFFFF 19 # CHECK: ori $1, $zero, 65535 # encoding: [0xff,0xff,0x01,0x34] 20 # CHECK: add $4, $4, $1 # encoding: [0x20,0x20,0x81,0x00] 21 add $4, 0x10000 22 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 23 # CHECK: add $4, $4, $1 # encoding: [0x20,0x20,0x81,0x00] 24 add $4, 0xFFFFFFFF 25 # CHECK: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 26 # CHECK: add $4, $4, $1 # encoding: [0x20,0x20,0x81,0x00] 27 28 add $4, $5, -0x80000000 29 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 30 # CHECK: add $4, $4, $5 # encoding: [0x20,0x20,0x85,0x00] 31 add $4, $5, -0x8001 32 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 33 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 34 # CHECK: add $4, $4, $5 # encoding: [0x20,0x20,0x85,0x00] 35 add $4, $5, -0x8000 36 # CHECK: addi $4, $5, -32768 # encoding: [0x00,0x80,0xa4,0x20] 37 add $4, $5, 0 38 # CHECK: addi $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x20] 39 add $4, $5, 0xFFFF 40 # CHECK: ori $4, $zero, 65535 # encoding: [0xff,0xff,0x04,0x34] 41 # CHECK: add $4, $4, $5 # encoding: [0x20,0x20,0x85,0x00] 42 add $4, $5, 0x10000 43 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 44 # CHECK: add $4, $4, $5 # encoding: [0x20,0x20,0x85,0x00] 45 add $4, $5, 0xFFFFFFFF 46 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 47 # CHECK: add $4, $4, $5 # encoding: [0x20,0x20,0x85,0x00] 48 49 addu $4, -0x80000000 50 # CHECK: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c] 51 # CHECK: addu $4, $4, $1 # encoding: [0x21,0x20,0x81,0x00] 52 addu $4, -0x8001 53 # CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] 54 # CHECK: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34] 55 # CHECK: addu $4, $4, $1 # encoding: [0x21,0x20,0x81,0x00] 56 addu $4, -0x8000 57 # CHECK: addiu $4, $4, -32768 # encoding: [0x00,0x80,0x84,0x24] 58 addu $4, 0 59 # CHECK: addiu $4, $4, 0 # encoding: [0x00,0x00,0x84,0x24] 60 addu $4, 0xFFFF 61 # CHECK: ori $1, $zero, 65535 # encoding: [0xff,0xff,0x01,0x34] 62 # CHECK: addu $4, $4, $1 # encoding: [0x21,0x20,0x81,0x00] 63 addu $4, 0x10000 64 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 65 # CHECK: addu $4, $4, $1 # encoding: [0x21,0x20,0x81,0x00] 66 addu $4, 0xFFFFFFFF 67 # CHECK: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 68 # CHECK: addu $4, $4, $1 # encoding: [0x21,0x20,0x81,0x00] 69 70 addu $4, $5, -0x80000000 71 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 72 # CHECK: addu $4, $4, $5 # encoding: [0x21,0x20,0x85,0x00] 73 addu $4, $5, -0x8001 74 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 75 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 76 # CHECK: addu $4, $4, $5 # encoding: [0x21,0x20,0x85,0x00] 77 addu $4, $5, -0x8000 78 # CHECK: addiu $4, $5, -32768 # encoding: [0x00,0x80,0xa4,0x24] 79 addu $4, $5, 0 80 # CHECK: addiu $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x24] 81 addu $4, $5, 0xFFFF 82 # CHECK: ori $4, $zero, 65535 # encoding: [0xff,0xff,0x04,0x34] 83 # CHECK: addu $4, $4, $5 # encoding: [0x21,0x20,0x85,0x00] 84 addu $4, $5, 0x10000 85 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 86 # CHECK: addu $4, $4, $5 # encoding: [0x21,0x20,0x85,0x00] 87 addu $4, $5, 0xFFFFFFFF 88 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 89 # CHECK: addu $4, $4, $5 # encoding: [0x21,0x20,0x85,0x00] 90 91 and $4, -0x80000000 92 # CHECK: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c] 93 # CHECK: and $4, $4, $1 # encoding: [0x24,0x20,0x81,0x00] 94 and $4, -0x8001 95 # CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] 96 # CHECK: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34] 97 # CHECK: and $4, $4, $1 # encoding: [0x24,0x20,0x81,0x00] 98 and $4, -0x8000 99 # CHECK: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 100 and $4, 0 101 # CHECK: andi $4, $4, 0 # encoding: [0x00,0x00,0x84,0x30] 102 and $4, 0xFFFF 103 # CHECK: andi $4, $4, 65535 # encoding: [0xff,0xff,0x84,0x30] 104 and $4, 0x10000 105 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 106 # CHECK: and $4, $4, $1 # encoding: [0x24,0x20,0x81,0x00] 107 and $4, 0xFFFFFFFF 108 # CHECK: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 109 # CHECK: and $4, $4, $1 # encoding: [0x24,0x20,0x81,0x00] 110 111 and $4, $5, -0x80000000 112 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 113 # CHECK: and $4, $4, $5 # encoding: [0x24,0x20,0x85,0x00] 114 and $4, $5, -0x8001 115 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 116 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 117 # CHECK: and $4, $4, $5 # encoding: [0x24,0x20,0x85,0x00] 118 and $4, $5, -0x8000 119 # CHECK: addiu $4, $zero, -32768 # encoding: [0x00,0x80,0x04,0x24] 120 # CHECK: and $4, $4, $5 # encoding: [0x24,0x20,0x85,0x00] 121 and $4, $5, 0 122 # CHECK: andi $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x30] 123 and $4, $5, 0xFFFF 124 # CHECK: andi $4, $5, 65535 # encoding: [0xff,0xff,0xa4,0x30] 125 and $4, $5, 0x10000 126 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 127 # CHECK: and $4, $4, $5 # encoding: [0x24,0x20,0x85,0x00] 128 and $4, $5, 0xFFFFFFFF 129 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 130 # CHECK: and $4, $4, $5 # encoding: [0x24,0x20,0x85,0x00] 131 132 nor $4, $5, 0 133 # CHECK: addiu $4, $zero, 0 # encoding: [0x00,0x00,0x04,0x24] 134 # CHECK: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00] 135 nor $4, $5, 1 136 # CHECK: addiu $4, $zero, 1 # encoding: [0x01,0x00,0x04,0x24] 137 # CHECK: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00] 138 nor $4, $5, 0x8000 139 # CHECK: ori $4, $zero, 32768 # encoding: [0x00,0x80,0x04,0x34] 140 # CHECK: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00] 141 nor $4, $5, -0x8000 142 # CHECK: addiu $4, $zero, -32768 # encoding: [0x00,0x80,0x04,0x24] 143 # CHECK: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00] 144 nor $4, $5, 0x10000 145 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 146 # CHECK: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00] 147 nor $4, $5, 0x1a5a5 148 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 149 # CHECK: ori $4, $4, 42405 # encoding: [0xa5,0xa5,0x84,0x34] 150 # CHECK: nor $4, $4, $5 # encoding: [0x27,0x20,0x85,0x00] 151 152 or $4, -0x80000000 153 # CHECK: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c] 154 # CHECK: or $4, $4, $1 # encoding: [0x25,0x20,0x81,0x00] 155 or $4, -0x8001 156 # CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] 157 # CHECK: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34] 158 # CHECK: or $4, $4, $1 # encoding: [0x25,0x20,0x81,0x00] 159 or $4, -0x8000 160 # CHECK: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 161 # CHECK: or $4, $4, $1 # encoding: [0x25,0x20,0x81,0x00] 162 or $4, 0 163 # CHECK: ori $4, $4, 0 # encoding: [0x00,0x00,0x84,0x34] 164 or $4, 0xFFFF 165 # CHECK: ori $4, $4, 65535 # encoding: [0xff,0xff,0x84,0x34] 166 or $4, 0x10000 167 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 168 # CHECK: or $4, $4, $1 # encoding: [0x25,0x20,0x81,0x00] 169 or $4, 0xFFFFFFFF 170 # CHECK: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 171 # CHECK: or $4, $4, $1 # encoding: [0x25,0x20,0x81,0x00] 172 173 or $4, $5, -0x80000000 174 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 175 # CHECK: or $4, $4, $5 # encoding: [0x25,0x20,0x85,0x00] 176 or $4, $5, -0x8001 177 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 178 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 179 # CHECK: or $4, $4, $5 # encoding: [0x25,0x20,0x85,0x00] 180 or $4, $5, -0x8000 181 # CHECK: addiu $4, $zero, -32768 # encoding: [0x00,0x80,0x04,0x24] 182 # CHECK: or $4, $4, $5 # encoding: [0x25,0x20,0x85,0x00] 183 or $4, $5, 0 184 # CHECK: ori $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x34] 185 or $4, $5, 0xFFFF 186 # CHECK: ori $4, $5, 65535 # encoding: [0xff,0xff,0xa4,0x34] 187 or $4, $5, 0x10000 188 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 189 # CHECK: or $4, $4, $5 # encoding: [0x25,0x20,0x85,0x00] 190 or $4, $5, 0xFFFFFFFF 191 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 192 # CHECK: or $4, $4, $5 # encoding: [0x25,0x20,0x85,0x00] 193 194 slt $4, $5, -0x80000000 195 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 196 # CHECK: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00] 197 slt $4, $5, -0x8001 198 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 199 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 200 # CHECK: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00] 201 slt $4, $5, -0x8000 202 # CHECK: slti $4, $5, -32768 # encoding: [0x00,0x80,0xa4,0x28] 203 slt $4, $5, 0 204 # CHECK: slti $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x28] 205 slt $4, $5, 0xFFFF 206 # CHECK: ori $4, $zero, 65535 # encoding: [0xff,0xff,0x04,0x34] 207 slt $4, $5, 0x10000 208 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 209 # CHECK: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00] 210 slt $4, $5, 0xFFFFFFFF 211 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 212 # CHECK: slt $4, $4, $5 # encoding: [0x2a,0x20,0x85,0x00] 213 214 sltu $4, $5, -0x80000000 215 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 216 # CHECK: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00] 217 sltu $4, $5, -0x8001 218 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 219 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 220 # CHECK: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00] 221 sltu $4, $5, -0x8000 222 # CHECK: sltiu $4, $5, -32768 # encoding: [0x00,0x80,0xa4,0x2c] 223 sltu $4, $5, 0 224 # CHECK: sltiu $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x2c] 225 sltu $4, $5, 0xFFFF 226 # CHECK: ori $4, $zero, 65535 # encoding: [0xff,0xff,0x04,0x34] 227 sltu $4, $5, 0x10000 228 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 229 # CHECK: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00] 230 sltu $4, $5, 0xFFFFFFFF 231 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 232 # CHECK: sltu $4, $4, $5 # encoding: [0x2b,0x20,0x85,0x00] 233 234 xor $4, -0x80000000 235 # CHECK: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c] 236 # CHECK: xor $4, $4, $1 # encoding: [0x26,0x20,0x81,0x00] 237 xor $4, -0x8001 238 # CHECK: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c] 239 # CHECK: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34] 240 # CHECK: xor $4, $4, $1 # encoding: [0x26,0x20,0x81,0x00] 241 xor $4, -0x8000 242 # CHECK: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24] 243 xor $4, 0 244 # CHECK: xori $4, $4, 0 # encoding: [0x00,0x00,0x84,0x38] 245 xor $4, 0xFFFF 246 # CHECK: xori $4, $4, 65535 # encoding: [0xff,0xff,0x84,0x38] 247 xor $4, 0x10000 248 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c] 249 # CHECK: xor $4, $4, $1 # encoding: [0x26,0x20,0x81,0x00] 250 xor $4, 0xFFFFFFFF 251 # CHECK: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24] 252 # CHECK: xor $4, $4, $1 # encoding: [0x26,0x20,0x81,0x00] 253 254 xor $4, $5, -0x80000000 255 # CHECK: lui $4, 32768 # encoding: [0x00,0x80,0x04,0x3c] 256 # CHECK: xor $4, $4, $5 # encoding: [0x26,0x20,0x85,0x00] 257 xor $4, $5, -0x8001 258 # CHECK: lui $4, 65535 # encoding: [0xff,0xff,0x04,0x3c] 259 # CHECK: ori $4, $4, 32767 # encoding: [0xff,0x7f,0x84,0x34] 260 # CHECK: xor $4, $4, $5 # encoding: [0x26,0x20,0x85,0x00] 261 xor $4, $5, -0x8000 262 # CHECK: addiu $4, $zero, -32768 # encoding: [0x00,0x80,0x04,0x24] 263 # CHECK: xor $4, $4, $5 # encoding: [0x26,0x20,0x85,0x00] 264 xor $4, $5, 0 265 # CHECK: xori $4, $5, 0 # encoding: [0x00,0x00,0xa4,0x38] 266 xor $4, $5, 0xFFFF 267 # CHECK: xori $4, $5, 65535 # encoding: [0xff,0xff,0xa4,0x38] 268 xor $4, $5, 0x10000 269 # CHECK: lui $4, 1 # encoding: [0x01,0x00,0x04,0x3c] 270 # CHECK: xor $4, $4, $5 # encoding: [0x26,0x20,0x85,0x00] 271 xor $4, $5, 0xFFFFFFFF 272 # CHECK: addiu $4, $zero, -1 # encoding: [0xff,0xff,0x04,0x24] 273 # CHECK: xor $4, $4, $5 # encoding: [0x26,0x20,0x85,0x00] 274