From d56376cce54e7df976780ecbd03228f60d276433 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 21 May 2015 12:32:34 +0000 Subject: Revert "Revert "Introduce a NearLabel in thumb2."" This reverts commit 1f277e3cef6c33cd35e91123978491d83338d2ad. - Fix CompareAndBranch to not use cbz/cbnz with high registers. - Add a test for CompareAndBranch with the *inc file, as the other assembler test infrastructure does not handle labels. Change-Id: If552bf1112b96caa3b9bb6c73c4b40bb90a33db7 --- compiler/utils/assembler_thumb_test.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'compiler/utils/assembler_thumb_test.cc') diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index 773862710d..1a2c9a9000 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -1338,6 +1338,24 @@ TEST(Thumb2AssemblerTest, LoadStoreLimits) { delete assembler; } +TEST(Thumb2AssemblerTest, CompareAndBranch) { + arm::Thumb2Assembler* assembler = static_cast(Assembler::Create(kThumb2)); + + arm::NearLabel label; + __ CompareAndBranchIfZero(arm::R0, &label); + __ CompareAndBranchIfZero(arm::R11, &label); + __ CompareAndBranchIfNonZero(arm::R0, &label); + __ CompareAndBranchIfNonZero(arm::R11, &label); + __ Bind(&label); + + size_t cs = __ CodeSize(); + std::vector managed_code(cs); + MemoryRegion code(&managed_code[0], managed_code.size()); + __ FinalizeInstructions(code); + dump(managed_code, "CompareAndBranch"); + delete assembler; +} + #undef __ } // namespace arm } // namespace art -- cgit v1.2.3-59-g8ed1b