OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 | 86 |
87 // Verify that all invocations of the COMPARE macro passed successfully. | 87 // Verify that all invocations of the COMPARE macro passed successfully. |
88 // Exit with a failure if at least one of the tests failed. | 88 // Exit with a failure if at least one of the tests failed. |
89 #define VERIFY_RUN() \ | 89 #define VERIFY_RUN() \ |
90 if (failure) { \ | 90 if (failure) { \ |
91 V8_Fatal(__FILE__, __LINE__, "MIPS Disassembler tests failed.\n"); \ | 91 V8_Fatal(__FILE__, __LINE__, "MIPS Disassembler tests failed.\n"); \ |
92 } | 92 } |
93 | 93 |
94 | 94 |
| 95 #define COMPARE_PC_REL_COMPACT(asm_, compare_string, offset) \ |
| 96 { \ |
| 97 int pc_offset = assm.pc_offset(); \ |
| 98 byte *progcounter = &buffer[pc_offset]; \ |
| 99 char str_with_address[100]; \ |
| 100 snprintf(str_with_address, sizeof(str_with_address), "%s -> %p", \ |
| 101 compare_string, progcounter + 4 + (offset << 2)); \ |
| 102 assm.asm_; \ |
| 103 if (!DisassembleAndCompare(progcounter, str_with_address)) failure = true; \ |
| 104 } |
| 105 |
| 106 |
| 107 #define COMPARE_PC_REL(asm_, compare_string, offset) \ |
| 108 { \ |
| 109 int pc_offset = assm.pc_offset(); \ |
| 110 byte *progcounter = &buffer[pc_offset]; \ |
| 111 char str_with_address[100]; \ |
| 112 snprintf(str_with_address, sizeof(str_with_address), "%s -> %p", \ |
| 113 compare_string, progcounter + (offset << 2)); \ |
| 114 assm.asm_; \ |
| 115 if (!DisassembleAndCompare(progcounter, str_with_address)) failure = true; \ |
| 116 } |
| 117 |
| 118 |
| 119 #define COMPARE_PC_JUMP(asm_, compare_string, target) \ |
| 120 { \ |
| 121 int pc_offset = assm.pc_offset(); \ |
| 122 byte *progcounter = &buffer[pc_offset]; \ |
| 123 char str_with_address[100]; \ |
| 124 int instr_index = target >> 2; \ |
| 125 snprintf(str_with_address, sizeof(str_with_address), "%s -> %p", \ |
| 126 compare_string, reinterpret_cast<byte *>( \ |
| 127 ((uint32_t)(progcounter + 1) & ~0xfffffff) | \ |
| 128 (instr_index << 2))); \ |
| 129 assm.asm_; \ |
| 130 if (!DisassembleAndCompare(progcounter, str_with_address)) failure = true; \ |
| 131 } |
| 132 |
| 133 |
95 TEST(Type0) { | 134 TEST(Type0) { |
96 SET_UP(); | 135 SET_UP(); |
97 | 136 |
98 COMPARE(addu(a0, a1, a2), | 137 COMPARE(addu(a0, a1, a2), |
99 "00a62021 addu a0, a1, a2"); | 138 "00a62021 addu a0, a1, a2"); |
100 COMPARE(addu(t2, t3, t4), | 139 COMPARE(addu(t2, t3, t4), |
101 "016c5021 addu t2, t3, t4"); | 140 "016c5021 addu t2, t3, t4"); |
102 COMPARE(addu(v0, v1, s0), | 141 COMPARE(addu(v0, v1, s0), |
103 "00701021 addu v0, v1, s0"); | 142 "00701021 addu v0, v1, s0"); |
104 | 143 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 "00a620db modu a0, a1, a2"); | 231 "00a620db modu a0, a1, a2"); |
193 COMPARE(divu(t1, t2, t3), | 232 COMPARE(divu(t1, t2, t3), |
194 "014b489b divu t1, t2, t3"); | 233 "014b489b divu t1, t2, t3"); |
195 COMPARE(modu(t1, t2, t3), | 234 COMPARE(modu(t1, t2, t3), |
196 "014b48db modu t1, t2, t3"); | 235 "014b48db modu t1, t2, t3"); |
197 COMPARE(divu(v0, v1, a0), | 236 COMPARE(divu(v0, v1, a0), |
198 "0064109b divu v0, v1, a0"); | 237 "0064109b divu v0, v1, a0"); |
199 COMPARE(modu(v0, v1, a0), | 238 COMPARE(modu(v0, v1, a0), |
200 "006410db modu v0, v1, a0"); | 239 "006410db modu v0, v1, a0"); |
201 | 240 |
202 COMPARE(bovc(a0, a0, static_cast<int16_t>(0)), | 241 COMPARE_PC_REL_COMPACT(bovc(a0, a0, static_cast<int16_t>(0)), |
203 "20840000 bovc a0, a0, 0"); | 242 "20840000 bovc a0, a0, 0", 0); |
204 COMPARE(bovc(a1, a0, static_cast<int16_t>(0)), | 243 COMPARE_PC_REL_COMPACT(bovc(a1, a0, static_cast<int16_t>(0)), |
205 "20a40000 bovc a1, a0, 0"); | 244 "20a40000 bovc a1, a0, 0", 0); |
206 COMPARE(bovc(a1, a0, 32767), | 245 COMPARE_PC_REL_COMPACT(bovc(a1, a0, 32767), |
207 "20a47fff bovc a1, a0, 32767"); | 246 "20a47fff bovc a1, a0, 32767", 32767); |
208 COMPARE(bovc(a1, a0, -32768), | 247 COMPARE_PC_REL_COMPACT(bovc(a1, a0, -32768), |
209 "20a48000 bovc a1, a0, -32768"); | 248 "20a48000 bovc a1, a0, -32768", -32768); |
210 | 249 |
211 COMPARE(bnvc(a0, a0, static_cast<int16_t>(0)), | 250 COMPARE_PC_REL_COMPACT(bnvc(a0, a0, static_cast<int16_t>(0)), |
212 "60840000 bnvc a0, a0, 0"); | 251 "60840000 bnvc a0, a0, 0", 0); |
213 COMPARE(bnvc(a1, a0, static_cast<int16_t>(0)), | 252 COMPARE_PC_REL_COMPACT(bnvc(a1, a0, static_cast<int16_t>(0)), |
214 "60a40000 bnvc a1, a0, 0"); | 253 "60a40000 bnvc a1, a0, 0", 0); |
215 COMPARE(bnvc(a1, a0, 32767), | 254 COMPARE_PC_REL_COMPACT(bnvc(a1, a0, 32767), |
216 "60a47fff bnvc a1, a0, 32767"); | 255 "60a47fff bnvc a1, a0, 32767", 32767); |
217 COMPARE(bnvc(a1, a0, -32768), | 256 COMPARE_PC_REL_COMPACT(bnvc(a1, a0, -32768), |
218 "60a48000 bnvc a1, a0, -32768"); | 257 "60a48000 bnvc a1, a0, -32768", -32768); |
219 | 258 |
220 COMPARE(beqzc(a0, -1048576), "d8900000 beqzc a0, -1048576"); | 259 COMPARE_PC_REL_COMPACT(beqzc(a0, -1048576), |
221 COMPARE(beqzc(a0, -1), "d89fffff beqzc a0, -1"); | 260 "d8900000 beqzc a0, -1048576", -1048576); |
222 COMPARE(beqzc(a0, 0), "d8800000 beqzc a0, 0"); | 261 COMPARE_PC_REL_COMPACT(beqzc(a0, -1), "d89fffff beqzc a0, -1", -1); |
223 COMPARE(beqzc(a0, 1), "d8800001 beqzc a0, 1"); | 262 COMPARE_PC_REL_COMPACT(beqzc(a0, 0), "d8800000 beqzc a0, 0", 0); |
224 COMPARE(beqzc(a0, 1048575), "d88fffff beqzc a0, 1048575"); | 263 COMPARE_PC_REL_COMPACT(beqzc(a0, 1), "d8800001 beqzc a0, 1", 1); |
225 | 264 COMPARE_PC_REL_COMPACT(beqzc(a0, 1048575), |
226 COMPARE(bnezc(a0, 0), | 265 "d88fffff beqzc a0, 1048575", 1048575); |
227 "f8800000 bnezc a0, 0x0"); | 266 |
228 COMPARE(bnezc(a0, 0xfffff), // 0x0fffff == 1048575. | 267 COMPARE_PC_REL_COMPACT(bnezc(a0, 0), "f8800000 bnezc a0, 0x0", 0); |
229 "f88fffff bnezc a0, 0xfffff"); | 268 COMPARE_PC_REL_COMPACT(bnezc(a0, 0xfffff), // 0x0fffff == 1048575. |
230 COMPARE(bnezc(a0, 0x100000), // 0x100000 == -1048576. | 269 "f88fffff bnezc a0, 0xfffff", 1048575); |
231 "f8900000 bnezc a0, 0x100000"); | 270 COMPARE_PC_REL_COMPACT(bnezc(a0, 0x100000), // 0x100000 == -1048576. |
232 | 271 "f8900000 bnezc a0, 0x100000", -1048576); |
233 COMPARE(bc(-33554432), "ca000000 bc -33554432"); | 272 |
234 COMPARE(bc(-1), "cbffffff bc -1"); | 273 COMPARE_PC_REL_COMPACT(bc(-33554432), "ca000000 bc -33554432", |
235 COMPARE(bc(0), "c8000000 bc 0"); | 274 -33554432); |
236 COMPARE(bc(1), "c8000001 bc 1"); | 275 COMPARE_PC_REL_COMPACT(bc(-1), "cbffffff bc -1", -1); |
237 COMPARE(bc(33554431), "c9ffffff bc 33554431"); | 276 COMPARE_PC_REL_COMPACT(bc(0), "c8000000 bc 0", 0); |
238 | 277 COMPARE_PC_REL_COMPACT(bc(1), "c8000001 bc 1", 1); |
239 COMPARE(balc(-33554432), "ea000000 balc -33554432"); | 278 COMPARE_PC_REL_COMPACT(bc(33554431), "c9ffffff bc 33554431", |
240 COMPARE(balc(-1), "ebffffff balc -1"); | 279 33554431); |
241 COMPARE(balc(0), "e8000000 balc 0"); | 280 |
242 COMPARE(balc(1), "e8000001 balc 1"); | 281 COMPARE_PC_REL_COMPACT(balc(-33554432), "ea000000 balc -33554432", |
243 COMPARE(balc(33554431), "e9ffffff balc 33554431"); | 282 -33554432); |
| 283 COMPARE_PC_REL_COMPACT(balc(-1), "ebffffff balc -1", -1); |
| 284 COMPARE_PC_REL_COMPACT(balc(0), "e8000000 balc 0", 0); |
| 285 COMPARE_PC_REL_COMPACT(balc(1), "e8000001 balc 1", 1); |
| 286 COMPARE_PC_REL_COMPACT(balc(33554431), "e9ffffff balc 33554431", |
| 287 33554431); |
| 288 |
| 289 COMPARE_PC_REL_COMPACT(bgeuc(a0, a1, -32768), |
| 290 "18858000 bgeuc a0, a1, -32768", -32768); |
| 291 COMPARE_PC_REL_COMPACT(bgeuc(a0, a1, -1), |
| 292 "1885ffff bgeuc a0, a1, -1", -1); |
| 293 COMPARE_PC_REL_COMPACT(bgeuc(a0, a1, 1), |
| 294 "18850001 bgeuc a0, a1, 1", 1); |
| 295 COMPARE_PC_REL_COMPACT(bgeuc(a0, a1, 32767), |
| 296 "18857fff bgeuc a0, a1, 32767", 32767); |
| 297 |
| 298 COMPARE_PC_REL_COMPACT(bgezalc(a0, -32768), |
| 299 "18848000 bgezalc a0, -32768", -32768); |
| 300 COMPARE_PC_REL_COMPACT(bgezalc(a0, -1), "1884ffff bgezalc a0, -1", |
| 301 -1); |
| 302 COMPARE_PC_REL_COMPACT(bgezalc(a0, 1), "18840001 bgezalc a0, 1", 1); |
| 303 COMPARE_PC_REL_COMPACT(bgezalc(a0, 32767), |
| 304 "18847fff bgezalc a0, 32767", 32767); |
| 305 |
| 306 COMPARE_PC_REL_COMPACT(blezalc(a0, -32768), |
| 307 "18048000 blezalc a0, -32768", -32768); |
| 308 COMPARE_PC_REL_COMPACT(blezalc(a0, -1), "1804ffff blezalc a0, -1", |
| 309 -1); |
| 310 COMPARE_PC_REL_COMPACT(blezalc(a0, 1), "18040001 blezalc a0, 1", 1); |
| 311 COMPARE_PC_REL_COMPACT(blezalc(a0, 32767), |
| 312 "18047fff blezalc a0, 32767", 32767); |
| 313 |
| 314 COMPARE_PC_REL_COMPACT(bltuc(a0, a1, -32768), |
| 315 "1c858000 bltuc a0, a1, -32768", -32768); |
| 316 COMPARE_PC_REL_COMPACT(bltuc(a0, a1, -1), |
| 317 "1c85ffff bltuc a0, a1, -1", -1); |
| 318 COMPARE_PC_REL_COMPACT(bltuc(a0, a1, 1), "1c850001 bltuc a0, a1, 1", |
| 319 1); |
| 320 COMPARE_PC_REL_COMPACT(bltuc(a0, a1, 32767), |
| 321 "1c857fff bltuc a0, a1, 32767", 32767); |
| 322 |
| 323 COMPARE_PC_REL_COMPACT(bltzalc(a0, -32768), |
| 324 "1c848000 bltzalc a0, -32768", -32768); |
| 325 COMPARE_PC_REL_COMPACT(bltzalc(a0, -1), "1c84ffff bltzalc a0, -1", |
| 326 -1); |
| 327 COMPARE_PC_REL_COMPACT(bltzalc(a0, 1), "1c840001 bltzalc a0, 1", 1); |
| 328 COMPARE_PC_REL_COMPACT(bltzalc(a0, 32767), |
| 329 "1c847fff bltzalc a0, 32767", 32767); |
| 330 |
| 331 COMPARE_PC_REL_COMPACT(bgtzalc(a0, -32768), |
| 332 "1c048000 bgtzalc a0, -32768", -32768); |
| 333 COMPARE_PC_REL_COMPACT(bgtzalc(a0, -1), "1c04ffff bgtzalc a0, -1", |
| 334 -1); |
| 335 COMPARE_PC_REL_COMPACT(bgtzalc(a0, 1), "1c040001 bgtzalc a0, 1", 1); |
| 336 COMPARE_PC_REL_COMPACT(bgtzalc(a0, 32767), |
| 337 "1c047fff bgtzalc a0, 32767", 32767); |
| 338 |
| 339 COMPARE_PC_REL_COMPACT(bgezc(a0, -32768), |
| 340 "58848000 bgezc a0, -32768", -32768); |
| 341 COMPARE_PC_REL_COMPACT(bgezc(a0, -1), "5884ffff bgezc a0, -1", -1); |
| 342 COMPARE_PC_REL_COMPACT(bgezc(a0, 1), "58840001 bgezc a0, 1", 1); |
| 343 COMPARE_PC_REL_COMPACT(bgezc(a0, 32767), |
| 344 "58847fff bgezc a0, 32767", 32767); |
| 345 |
| 346 COMPARE_PC_REL_COMPACT(bgec(a0, a1, -32768), |
| 347 "58858000 bgec a0, a1, -32768", -32768); |
| 348 COMPARE_PC_REL_COMPACT(bgec(a0, a1, -1), |
| 349 "5885ffff bgec a0, a1, -1", -1); |
| 350 COMPARE_PC_REL_COMPACT(bgec(a0, a1, 1), "58850001 bgec a0, a1, 1", |
| 351 1); |
| 352 COMPARE_PC_REL_COMPACT(bgec(a0, a1, 32767), |
| 353 "58857fff bgec a0, a1, 32767", 32767); |
| 354 |
| 355 COMPARE_PC_REL_COMPACT(blezc(a0, -32768), |
| 356 "58048000 blezc a0, -32768", -32768); |
| 357 COMPARE_PC_REL_COMPACT(blezc(a0, -1), "5804ffff blezc a0, -1", -1); |
| 358 COMPARE_PC_REL_COMPACT(blezc(a0, 1), "58040001 blezc a0, 1", 1); |
| 359 COMPARE_PC_REL_COMPACT(blezc(a0, 32767), |
| 360 "58047fff blezc a0, 32767", 32767); |
| 361 |
| 362 COMPARE_PC_REL_COMPACT(bltzc(a0, -32768), |
| 363 "5c848000 bltzc a0, -32768", -32768); |
| 364 COMPARE_PC_REL_COMPACT(bltzc(a0, -1), "5c84ffff bltzc a0, -1", -1); |
| 365 COMPARE_PC_REL_COMPACT(bltzc(a0, 1), "5c840001 bltzc a0, 1", 1); |
| 366 COMPARE_PC_REL_COMPACT(bltzc(a0, 32767), |
| 367 "5c847fff bltzc a0, 32767", 32767); |
| 368 |
| 369 COMPARE_PC_REL_COMPACT(bltc(a0, a1, -32768), |
| 370 "5c858000 bltc a0, a1, -32768", -32768); |
| 371 COMPARE_PC_REL_COMPACT(bltc(a0, a1, -1), |
| 372 "5c85ffff bltc a0, a1, -1", -1); |
| 373 COMPARE_PC_REL_COMPACT(bltc(a0, a1, 1), "5c850001 bltc a0, a1, 1", |
| 374 1); |
| 375 COMPARE_PC_REL_COMPACT(bltc(a0, a1, 32767), |
| 376 "5c857fff bltc a0, a1, 32767", 32767); |
| 377 |
| 378 COMPARE_PC_REL_COMPACT(bgtzc(a0, -32768), |
| 379 "5c048000 bgtzc a0, -32768", -32768); |
| 380 COMPARE_PC_REL_COMPACT(bgtzc(a0, -1), "5c04ffff bgtzc a0, -1", -1); |
| 381 COMPARE_PC_REL_COMPACT(bgtzc(a0, 1), "5c040001 bgtzc a0, 1", 1); |
| 382 COMPARE_PC_REL_COMPACT(bgtzc(a0, 32767), |
| 383 "5c047fff bgtzc a0, 32767", 32767); |
| 384 |
| 385 COMPARE_PC_REL_COMPACT(bc1eqz(-32768, f1), |
| 386 "45218000 bc1eqz f1, -32768", -32768); |
| 387 COMPARE_PC_REL_COMPACT(bc1eqz(-1, f1), "4521ffff bc1eqz f1, -1", |
| 388 -1); |
| 389 COMPARE_PC_REL_COMPACT(bc1eqz(1, f1), "45210001 bc1eqz f1, 1", 1); |
| 390 COMPARE_PC_REL_COMPACT(bc1eqz(32767, f1), |
| 391 "45217fff bc1eqz f1, 32767", 32767); |
| 392 |
| 393 COMPARE_PC_REL_COMPACT(bc1nez(-32768, f1), |
| 394 "45a18000 bc1nez f1, -32768", -32768); |
| 395 COMPARE_PC_REL_COMPACT(bc1nez(-1, f1), "45a1ffff bc1nez f1, -1", |
| 396 -1); |
| 397 COMPARE_PC_REL_COMPACT(bc1nez(1, f1), "45a10001 bc1nez f1, 1", 1); |
| 398 COMPARE_PC_REL_COMPACT(bc1nez(32767, f1), |
| 399 "45a17fff bc1nez f1, 32767", 32767); |
| 400 |
| 401 COMPARE_PC_REL_COMPACT(bovc(a1, a0, -1), "20a4ffff bovc a1, a0, -1", |
| 402 -1); |
| 403 COMPARE_PC_REL_COMPACT(bovc(a0, a0, 1), "20840001 bovc a0, a0, 1", |
| 404 1); |
| 405 |
| 406 COMPARE_PC_REL_COMPACT(beqc(a0, a1, -32768), |
| 407 "20858000 beqc a0, a1, -32768", -32768); |
| 408 COMPARE_PC_REL_COMPACT(beqc(a0, a1, -1), "2085ffff beqc a0, a1, -1", |
| 409 -1); |
| 410 COMPARE_PC_REL_COMPACT(beqc(a0, a1, 1), "20850001 beqc a0, a1, 1", |
| 411 1); |
| 412 COMPARE_PC_REL_COMPACT(beqc(a0, a1, 32767), |
| 413 "20857fff beqc a0, a1, 32767", 32767); |
| 414 |
| 415 COMPARE_PC_REL_COMPACT(bnec(a0, a1, -32768), |
| 416 "60858000 bnec a0, a1, -32768", -32768); |
| 417 COMPARE_PC_REL_COMPACT(bnec(a0, a1, -1), "6085ffff bnec a0, a1, -1", |
| 418 -1); |
| 419 COMPARE_PC_REL_COMPACT(bnec(a0, a1, 1), "60850001 bnec a0, a1, 1", |
| 420 1); |
| 421 COMPARE_PC_REL_COMPACT(bnec(a0, a1, 32767), |
| 422 "60857fff bnec a0, a1, 32767", 32767); |
244 } | 423 } |
245 | 424 |
| 425 COMPARE_PC_REL_COMPACT(bne(a0, a1, -32768), |
| 426 "14858000 bne a0, a1, -32768", -32768); |
| 427 COMPARE_PC_REL_COMPACT(bne(a0, a1, -1), "1485ffff bne a0, a1, -1", |
| 428 -1); |
| 429 COMPARE_PC_REL_COMPACT(bne(a0, a1, 1), "14850001 bne a0, a1, 1", 1); |
| 430 COMPARE_PC_REL_COMPACT(bne(a0, a1, 32767), |
| 431 "14857fff bne a0, a1, 32767", 32767); |
| 432 |
| 433 COMPARE_PC_REL_COMPACT(beq(a0, a1, -32768), |
| 434 "10858000 beq a0, a1, -32768", -32768); |
| 435 COMPARE_PC_REL_COMPACT(beq(a0, a1, -1), "1085ffff beq a0, a1, -1", |
| 436 -1); |
| 437 COMPARE_PC_REL_COMPACT(beq(a0, a1, 1), "10850001 beq a0, a1, 1", 1); |
| 438 COMPARE_PC_REL_COMPACT(beq(a0, a1, 32767), |
| 439 "10857fff beq a0, a1, 32767", 32767); |
| 440 |
| 441 COMPARE_PC_REL_COMPACT(bltz(a0, -32768), "04808000 bltz a0, -32768", |
| 442 -32768); |
| 443 COMPARE_PC_REL_COMPACT(bltz(a0, -1), "0480ffff bltz a0, -1", -1); |
| 444 COMPARE_PC_REL_COMPACT(bltz(a0, 1), "04800001 bltz a0, 1", 1); |
| 445 COMPARE_PC_REL_COMPACT(bltz(a0, 32767), "04807fff bltz a0, 32767", |
| 446 32767); |
| 447 |
| 448 COMPARE_PC_REL_COMPACT(bgez(a0, -32768), "04818000 bgez a0, -32768", |
| 449 -32768); |
| 450 COMPARE_PC_REL_COMPACT(bgez(a0, -1), "0481ffff bgez a0, -1", -1); |
| 451 COMPARE_PC_REL_COMPACT(bgez(a0, 1), "04810001 bgez a0, 1", 1); |
| 452 COMPARE_PC_REL_COMPACT(bgez(a0, 32767), "04817fff bgez a0, 32767", |
| 453 32767); |
| 454 |
| 455 COMPARE_PC_REL_COMPACT(blez(a0, -32768), "18808000 blez a0, -32768", |
| 456 -32768); |
| 457 COMPARE_PC_REL_COMPACT(blez(a0, -1), "1880ffff blez a0, -1", -1); |
| 458 COMPARE_PC_REL_COMPACT(blez(a0, 1), "18800001 blez a0, 1", 1); |
| 459 COMPARE_PC_REL_COMPACT(blez(a0, 32767), "18807fff blez a0, 32767", |
| 460 32767); |
| 461 |
| 462 COMPARE_PC_REL_COMPACT(bgtz(a0, -32768), "1c808000 bgtz a0, -32768", |
| 463 -32768); |
| 464 COMPARE_PC_REL_COMPACT(bgtz(a0, -1), "1c80ffff bgtz a0, -1", -1); |
| 465 COMPARE_PC_REL_COMPACT(bgtz(a0, 1), "1c800001 bgtz a0, 1", 1); |
| 466 COMPARE_PC_REL_COMPACT(bgtz(a0, 32767), "1c807fff bgtz a0, 32767", |
| 467 32767); |
| 468 |
| 469 COMPARE_PC_JUMP(j(0x4), "08000001 j 0x4", 0x4); |
| 470 COMPARE_PC_JUMP(j(0xffffffc), "0bffffff j 0xffffffc", 0xffffffc); |
| 471 |
| 472 COMPARE_PC_JUMP(jal(0x4), "0c000001 jal 0x4", 0x4); |
| 473 COMPARE_PC_JUMP(jal(0xffffffc), "0fffffff jal 0xffffffc", |
| 474 0xffffffc); |
| 475 |
246 COMPARE(addiu(a0, a1, 0x0), | 476 COMPARE(addiu(a0, a1, 0x0), |
247 "24a40000 addiu a0, a1, 0"); | 477 "24a40000 addiu a0, a1, 0"); |
248 COMPARE(addiu(s0, s1, 32767), | 478 COMPARE(addiu(s0, s1, 32767), |
249 "26307fff addiu s0, s1, 32767"); | 479 "26307fff addiu s0, s1, 32767"); |
250 COMPARE(addiu(t2, t3, -32768), | 480 COMPARE(addiu(t2, t3, -32768), |
251 "256a8000 addiu t2, t3, -32768"); | 481 "256a8000 addiu t2, t3, -32768"); |
252 COMPARE(addiu(v0, v1, -1), | 482 COMPARE(addiu(v0, v1, -1), |
253 "2462ffff addiu v0, v1, -1"); | 483 "2462ffff addiu v0, v1, -1"); |
254 | 484 |
255 COMPARE(and_(a0, a1, a2), | 485 COMPARE(and_(a0, a1, a2), |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); | 1029 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
800 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { | 1030 if (IsMipsArchVariant(kMips32r6) || IsMipsArchVariant(kMips32r2)) { |
801 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); | 1031 COMPARE(cvt_s_l(f22, f24), "46a0c5a0 cvt.s.l f22, f24"); |
802 } | 1032 } |
803 | 1033 |
804 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); | 1034 COMPARE(cvt_s_d(f22, f24), "4620c5a0 cvt.s.d f22, f24"); |
805 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); | 1035 COMPARE(cvt_s_w(f22, f24), "4680c5a0 cvt.s.w f22, f24"); |
806 | 1036 |
807 VERIFY_RUN(); | 1037 VERIFY_RUN(); |
808 } | 1038 } |
OLD | NEW |