Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1126)

Side by Side Diff: test/cctest/test-assembler-arm64.cc

Issue 222433002: ARM64: Introduce a version of ADR handling distant targets. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix loop offset Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 1679
1680 RUN(); 1680 RUN();
1681 1681
1682 ASSERT_EQUAL_64(0x0, x0); 1682 ASSERT_EQUAL_64(0x0, x0);
1683 ASSERT_EQUAL_64(0x0, x1); 1683 ASSERT_EQUAL_64(0x0, x1);
1684 1684
1685 TEARDOWN(); 1685 TEARDOWN();
1686 } 1686 }
1687 1687
1688 1688
1689 TEST(adr_far) {
1690 INIT_V8();
1691
1692 int max_range = 1 << (Instruction::ImmPCRelRangeBitwidth - 1);
1693 SETUP_SIZE(max_range + 1000 * kInstructionSize);
1694
1695 Label done, fail;
1696 Label test_near, near_forward, near_backward;
1697 Label test_far, far_forward, far_backward;
1698
1699 START();
1700 __ Mov(x0, 0x0);
1701
1702 __ Bind(&test_near);
1703 __ Adr(x10, &near_forward, MacroAssembler::kAdrFar);
1704 __ Br(x10);
1705 __ B(&fail);
1706 __ Bind(&near_backward);
1707 __ Orr(x0, x0, 1 << 1);
1708 __ B(&test_far);
1709
1710 __ Bind(&near_forward);
1711 __ Orr(x0, x0, 1 << 0);
1712 __ Adr(x10, &near_backward, MacroAssembler::kAdrFar);
1713 __ Br(x10);
1714
1715 __ Bind(&test_far);
1716 __ Adr(x10, &far_forward, MacroAssembler::kAdrFar);
1717 __ Br(x10);
1718 __ B(&fail);
1719 __ Bind(&far_backward);
1720 __ Orr(x0, x0, 1 << 3);
1721 __ B(&done);
1722
1723 for (unsigned i = 0; i < max_range / kInstructionSize + 1; ++i) {
1724 if (i % 100 == 0) {
1725 // If we do land in this code, we do not want to execute so many nops
1726 // before reaching the end of test (especially if tracing is activated).
1727 __ b(&fail);
1728 } else {
1729 __ nop();
1730 }
1731 }
1732
1733
1734 __ Bind(&far_forward);
1735 __ Orr(x0, x0, 1 << 2);
1736 __ Adr(x10, &far_backward, MacroAssembler::kAdrFar);
1737 __ Br(x10);
1738
1739 __ B(&done);
1740 __ Bind(&fail);
1741 __ Orr(x0, x0, 1 << 4);
1742 __ Bind(&done);
1743
1744 END();
1745
1746 RUN();
1747
1748 ASSERT_EQUAL_64(0xf, x0);
1749
1750 TEARDOWN();
1751 }
1752
1753
1689 TEST(branch_cond) { 1754 TEST(branch_cond) {
1690 INIT_V8(); 1755 INIT_V8();
1691 SETUP(); 1756 SETUP();
1692 1757
1693 Label wrong; 1758 Label wrong;
1694 1759
1695 START(); 1760 START();
1696 __ Mov(x0, 0x1); 1761 __ Mov(x0, 0x1);
1697 __ Mov(x1, 0x1); 1762 __ Mov(x1, 0x1);
1698 __ Mov(x2, 0x8000000000000000L); 1763 __ Mov(x2, 0x8000000000000000L);
(...skipping 9093 matching lines...) Expand 10 before | Expand all | Expand 10 after
10792 if (RelocInfo::IsVeneerPool(info->rmode())) { 10857 if (RelocInfo::IsVeneerPool(info->rmode())) {
10793 ASSERT(info->data() == veneer_pool_size); 10858 ASSERT(info->data() == veneer_pool_size);
10794 ++pool_count; 10859 ++pool_count;
10795 } 10860 }
10796 } 10861 }
10797 10862
10798 ASSERT(pool_count == 2); 10863 ASSERT(pool_count == 2);
10799 10864
10800 TEARDOWN(); 10865 TEARDOWN();
10801 } 10866 }
OLDNEW
« src/arm64/macro-assembler-arm64.cc ('K') | « src/arm64/regexp-macro-assembler-arm64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698