| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 Label here; | 334 Label here; |
| 335 | 335 |
| 336 __ bal(&here); | 336 __ bal(&here); |
| 337 __ dsll(at, a0, 3); // In delay slot. | 337 __ dsll(at, a0, 3); // In delay slot. |
| 338 __ bind(&here); | 338 __ bind(&here); |
| 339 __ daddu(at, at, ra); | 339 __ daddu(at, at, ra); |
| 340 __ ld(at, MemOperand(at, 6 * Assembler::kInstrSize)); | 340 __ ld(at, MemOperand(at, 6 * Assembler::kInstrSize)); |
| 341 __ jalr(at); | 341 __ jalr(at); |
| 342 __ nop(); // Branch delay slot nop. | 342 __ nop(); // Branch delay slot nop. |
| 343 __ bc(&done); | 343 __ bc(&done); |
| 344 // A nop instruction must be generated by the forbidden slot guard |
| 345 // (Assembler::dd(Label*)) so the first label goes to an 8 bytes aligned |
| 346 // location. |
| 344 for (int i = 0; i < kNumCases; ++i) { | 347 for (int i = 0; i < kNumCases; ++i) { |
| 345 __ dd(&labels[i]); | 348 __ dd(&labels[i]); |
| 346 } | 349 } |
| 347 } | 350 } |
| 348 | 351 |
| 349 for (int i = 0; i < kNumCases; ++i) { | 352 for (int i = 0; i < kNumCases; ++i) { |
| 350 __ bind(&labels[i]); | 353 __ bind(&labels[i]); |
| 351 __ lui(v0, (values[i] >> 16) & 0xffff); | 354 __ lui(v0, (values[i] >> 16) & 0xffff); |
| 352 __ ori(v0, v0, values[i] & 0xffff); | 355 __ ori(v0, v0, values[i] & 0xffff); |
| 353 __ jr(ra); | 356 __ jr(ra); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 for (size_t i = 0; i < nr_test_cases; ++i) { | 538 for (size_t i = 0; i < nr_test_cases; ++i) { |
| 536 uint64_t res = run_dlsa(tc[i].rt, tc[i].rs, tc[i].sa); | 539 uint64_t res = run_dlsa(tc[i].rt, tc[i].rs, tc[i].sa); |
| 537 PrintF("0x%" PRIx64 " =? 0x%" PRIx64 " == Dlsa(v0, %" PRIx64 ", %" PRIx64 | 540 PrintF("0x%" PRIx64 " =? 0x%" PRIx64 " == Dlsa(v0, %" PRIx64 ", %" PRIx64 |
| 538 ", %hhu)\n", | 541 ", %hhu)\n", |
| 539 tc[i].expected_res, res, tc[i].rt, tc[i].rs, tc[i].sa); | 542 tc[i].expected_res, res, tc[i].rt, tc[i].rs, tc[i].sa); |
| 540 CHECK_EQ(tc[i].expected_res, res); | 543 CHECK_EQ(tc[i].expected_res, res); |
| 541 } | 544 } |
| 542 } | 545 } |
| 543 | 546 |
| 544 #undef __ | 547 #undef __ |
| OLD | NEW |