| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 bool failure = false; | 80 bool failure = false; |
| 81 | 81 |
| 82 | 82 |
| 83 // This macro assembles one instruction using the preallocated assembler and | 83 // This macro assembles one instruction using the preallocated assembler and |
| 84 // disassembles the generated instruction, comparing the output to the expected | 84 // disassembles the generated instruction, comparing the output to the expected |
| 85 // value. If the comparison fails an error message is printed, but the test | 85 // value. If the comparison fails an error message is printed, but the test |
| 86 // continues to run until the end. | 86 // continues to run until the end. |
| 87 #define COMPARE(asm_, compare_string) \ | 87 #define COMPARE(asm_, compare_string) \ |
| 88 { \ | 88 { \ |
| 89 int pc_offset = assm.pc_offset(); \ | 89 int pc_offset = assm.pc_offset(); \ |
| 90 byte *pc = &buffer[pc_offset]; \ | 90 byte *progcounter = &buffer[pc_offset]; \ |
| 91 assm.asm_; \ | 91 assm.asm_; \ |
| 92 if (!DisassembleAndCompare(pc, compare_string)) failure = true; \ | 92 if (!DisassembleAndCompare(progcounter, compare_string)) failure = true; \ |
| 93 } | 93 } |
| 94 | 94 |
| 95 | 95 |
| 96 // Verify that all invocations of the COMPARE macro passed successfully. | 96 // Verify that all invocations of the COMPARE macro passed successfully. |
| 97 // Exit with a failure if at least one of the tests failed. | 97 // Exit with a failure if at least one of the tests failed. |
| 98 #define VERIFY_RUN() \ | 98 #define VERIFY_RUN() \ |
| 99 if (failure) { \ | 99 if (failure) { \ |
| 100 V8_Fatal(__FILE__, __LINE__, "ARM Disassembler tests failed.\n"); \ | 100 V8_Fatal(__FILE__, __LINE__, "ARM Disassembler tests failed.\n"); \ |
| 101 } | 101 } |
| 102 | 102 |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 COMPARE(vldr(d1, r1, 4), | 492 COMPARE(vldr(d1, r1, 4), |
| 493 "ed911b01 vldr d1, [r1 + 4*1]"); | 493 "ed911b01 vldr d1, [r1 + 4*1]"); |
| 494 COMPARE(vldr(d15, r10, 1020), | 494 COMPARE(vldr(d15, r10, 1020), |
| 495 "ed9afbff vldr d15, [r10 + 4*255]"); | 495 "ed9afbff vldr d15, [r10 + 4*255]"); |
| 496 COMPARE(vstr(d0, r0, 0), | 496 COMPARE(vstr(d0, r0, 0), |
| 497 "ed800b00 vstr d0, [r0 + 4*0]"); | 497 "ed800b00 vstr d0, [r0 + 4*0]"); |
| 498 COMPARE(vstr(d1, r1, 4), | 498 COMPARE(vstr(d1, r1, 4), |
| 499 "ed811b01 vstr d1, [r1 + 4*1]"); | 499 "ed811b01 vstr d1, [r1 + 4*1]"); |
| 500 COMPARE(vstr(d15, r10, 1020), | 500 COMPARE(vstr(d15, r10, 1020), |
| 501 "ed8afbff vstr d15, [r10 + 4*255]"); | 501 "ed8afbff vstr d15, [r10 + 4*255]"); |
| 502 |
| 503 COMPARE(vmsr(r5), |
| 504 "eee15a10 vmsr FPSCR, r5"); |
| 505 COMPARE(vmsr(r10, pl), |
| 506 "5ee1aa10 vmsrpl FPSCR, r10"); |
| 507 COMPARE(vmsr(pc), |
| 508 "eee1fa10 vmsr FPSCR, APSR"); |
| 509 COMPARE(vmrs(r5), |
| 510 "eef15a10 vmrs r5, FPSCR"); |
| 511 COMPARE(vmrs(r10, ge), |
| 512 "aef1aa10 vmrsge r10, FPSCR"); |
| 513 COMPARE(vmrs(pc), |
| 514 "eef1fa10 vmrs APSR, FPSCR"); |
| 502 } | 515 } |
| 503 | 516 |
| 504 VERIFY_RUN(); | 517 VERIFY_RUN(); |
| 505 } | 518 } |
| OLD | NEW |