David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <memory> |
| 18 | #include <vector> |
| 19 | |
| 20 | #include "arch/instruction_set.h" |
Andreas Gampe | 2a5d728 | 2018-01-02 11:53:35 -0800 | [diff] [blame] | 21 | #include "base/runtime_debug.h" |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 22 | #include "cfi_test.h" |
Vladimir Marko | 3a21e38 | 2016-09-02 12:38:38 +0100 | [diff] [blame] | 23 | #include "driver/compiler_options.h" |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 24 | #include "gtest/gtest.h" |
| 25 | #include "optimizing/code_generator.h" |
Nicolas Geoffray | 0a23d74 | 2015-05-07 11:57:35 +0100 | [diff] [blame] | 26 | #include "optimizing/optimizing_unit_test.h" |
Andreas Gampe | 217488a | 2017-09-18 08:34:42 -0700 | [diff] [blame] | 27 | #include "read_barrier_config.h" |
Nicolas Geoffray | 467d94a | 2017-03-16 10:24:17 +0000 | [diff] [blame] | 28 | #include "utils/arm/assembler_arm_vixl.h" |
Andreas Gampe | 8cf9cb3 | 2017-07-19 09:28:38 -0700 | [diff] [blame] | 29 | #include "utils/assembler.h" |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 30 | #include "utils/mips/assembler_mips.h" |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 31 | #include "utils/mips64/assembler_mips64.h" |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 32 | |
| 33 | #include "optimizing/optimizing_cfi_test_expected.inc" |
| 34 | |
Scott Wakeling | 90ab673 | 2016-12-08 10:25:03 +0000 | [diff] [blame] | 35 | namespace vixl32 = vixl::aarch32; |
| 36 | |
| 37 | using vixl32::r0; |
Scott Wakeling | 90ab673 | 2016-12-08 10:25:03 +0000 | [diff] [blame] | 38 | |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 39 | namespace art { |
| 40 | |
| 41 | // Run the tests only on host. |
Bilyan Borisov | bb661c0 | 2016-04-04 16:27:32 +0100 | [diff] [blame] | 42 | #ifndef ART_TARGET_ANDROID |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 43 | |
Mathieu Chartier | fa3db3d | 2018-01-12 14:42:18 -0800 | [diff] [blame] | 44 | class OptimizingCFITest : public CFITest, public OptimizingUnitTestHelper { |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 45 | public: |
| 46 | // Enable this flag to generate the expected outputs. |
| 47 | static constexpr bool kGenerateExpected = false; |
| 48 | |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 49 | OptimizingCFITest() |
Vladimir Marko | a043111 | 2018-06-25 09:32:54 +0100 | [diff] [blame] | 50 | : graph_(nullptr), |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 51 | code_gen_(), |
Vladimir Marko | ca6fff8 | 2017-10-03 14:49:14 +0100 | [diff] [blame] | 52 | blocks_(GetAllocator()->Adapter()) {} |
| 53 | |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 54 | void SetUpFrame(InstructionSet isa) { |
Vladimir Marko | a043111 | 2018-06-25 09:32:54 +0100 | [diff] [blame] | 55 | OverrideInstructionSetFeatures(isa, "default"); |
| 56 | |
Andreas Gampe | 2a5d728 | 2018-01-02 11:53:35 -0800 | [diff] [blame] | 57 | // Ensure that slow-debug is off, so that there is no unexpected read-barrier check emitted. |
| 58 | SetRuntimeDebugFlagsEnabled(false); |
| 59 | |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 60 | // Setup simple context. |
Mathieu Chartier | fa3db3d | 2018-01-12 14:42:18 -0800 | [diff] [blame] | 61 | graph_ = CreateGraph(); |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 62 | // Generate simple frame with some spills. |
Vladimir Marko | a043111 | 2018-06-25 09:32:54 +0100 | [diff] [blame] | 63 | code_gen_ = CodeGenerator::Create(graph_, *compiler_options_); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 64 | code_gen_->GetAssembler()->cfi().SetEnabled(true); |
Vladimir Marko | 174b2e2 | 2017-10-12 13:34:49 +0100 | [diff] [blame] | 65 | code_gen_->InitializeCodeGenerationData(); |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 66 | const int frame_size = 64; |
| 67 | int core_reg = 0; |
| 68 | int fp_reg = 0; |
| 69 | for (int i = 0; i < 2; i++) { // Two registers of each kind. |
| 70 | for (; core_reg < 32; core_reg++) { |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 71 | if (code_gen_->IsCoreCalleeSaveRegister(core_reg)) { |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 72 | auto location = Location::RegisterLocation(core_reg); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 73 | code_gen_->AddAllocatedRegister(location); |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 74 | core_reg++; |
| 75 | break; |
| 76 | } |
| 77 | } |
| 78 | for (; fp_reg < 32; fp_reg++) { |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 79 | if (code_gen_->IsFloatingPointCalleeSaveRegister(fp_reg)) { |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 80 | auto location = Location::FpuRegisterLocation(fp_reg); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 81 | code_gen_->AddAllocatedRegister(location); |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 82 | fp_reg++; |
| 83 | break; |
| 84 | } |
| 85 | } |
| 86 | } |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 87 | code_gen_->block_order_ = &blocks_; |
| 88 | code_gen_->ComputeSpillMask(); |
| 89 | code_gen_->SetFrameSize(frame_size); |
| 90 | code_gen_->GenerateFrameEntry(); |
| 91 | } |
| 92 | |
| 93 | void Finish() { |
| 94 | code_gen_->GenerateFrameExit(); |
| 95 | code_gen_->Finalize(&code_allocator_); |
| 96 | } |
| 97 | |
| 98 | void Check(InstructionSet isa, |
| 99 | const char* isa_str, |
| 100 | const std::vector<uint8_t>& expected_asm, |
| 101 | const std::vector<uint8_t>& expected_cfi) { |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 102 | // Get the outputs. |
Vladimir Marko | ca1e038 | 2018-04-11 09:58:41 +0000 | [diff] [blame] | 103 | ArrayRef<const uint8_t> actual_asm = code_allocator_.GetMemory(); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 104 | Assembler* opt_asm = code_gen_->GetAssembler(); |
Vladimir Marko | ca1e038 | 2018-04-11 09:58:41 +0000 | [diff] [blame] | 105 | ArrayRef<const uint8_t> actual_cfi(*(opt_asm->cfi().data())); |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 106 | |
| 107 | if (kGenerateExpected) { |
| 108 | GenerateExpected(stdout, isa, isa_str, actual_asm, actual_cfi); |
| 109 | } else { |
Vladimir Marko | ca1e038 | 2018-04-11 09:58:41 +0000 | [diff] [blame] | 110 | EXPECT_EQ(ArrayRef<const uint8_t>(expected_asm), actual_asm); |
| 111 | EXPECT_EQ(ArrayRef<const uint8_t>(expected_cfi), actual_cfi); |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 112 | } |
| 113 | } |
David Srbecky | 46325a0 | 2015-04-09 22:51:56 +0100 | [diff] [blame] | 114 | |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 115 | void TestImpl(InstructionSet isa, const char* |
| 116 | isa_str, |
| 117 | const std::vector<uint8_t>& expected_asm, |
| 118 | const std::vector<uint8_t>& expected_cfi) { |
| 119 | SetUpFrame(isa); |
| 120 | Finish(); |
| 121 | Check(isa, isa_str, expected_asm, expected_cfi); |
| 122 | } |
| 123 | |
| 124 | CodeGenerator* GetCodeGenerator() { |
| 125 | return code_gen_.get(); |
| 126 | } |
| 127 | |
David Srbecky | 46325a0 | 2015-04-09 22:51:56 +0100 | [diff] [blame] | 128 | private: |
| 129 | class InternalCodeAllocator : public CodeAllocator { |
| 130 | public: |
| 131 | InternalCodeAllocator() {} |
| 132 | |
| 133 | virtual uint8_t* Allocate(size_t size) { |
| 134 | memory_.resize(size); |
| 135 | return memory_.data(); |
| 136 | } |
| 137 | |
Vladimir Marko | ca1e038 | 2018-04-11 09:58:41 +0000 | [diff] [blame] | 138 | ArrayRef<const uint8_t> GetMemory() const OVERRIDE { return ArrayRef<const uint8_t>(memory_); } |
David Srbecky | 46325a0 | 2015-04-09 22:51:56 +0100 | [diff] [blame] | 139 | |
| 140 | private: |
| 141 | std::vector<uint8_t> memory_; |
| 142 | |
| 143 | DISALLOW_COPY_AND_ASSIGN(InternalCodeAllocator); |
| 144 | }; |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 145 | |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 146 | HGraph* graph_; |
| 147 | std::unique_ptr<CodeGenerator> code_gen_; |
| 148 | ArenaVector<HBasicBlock*> blocks_; |
| 149 | InternalCodeAllocator code_allocator_; |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 150 | }; |
| 151 | |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 152 | #define TEST_ISA(isa) \ |
| 153 | TEST_F(OptimizingCFITest, isa) { \ |
| 154 | std::vector<uint8_t> expected_asm( \ |
| 155 | expected_asm_##isa, \ |
| 156 | expected_asm_##isa + arraysize(expected_asm_##isa)); \ |
| 157 | std::vector<uint8_t> expected_cfi( \ |
| 158 | expected_cfi_##isa, \ |
| 159 | expected_cfi_##isa + arraysize(expected_cfi_##isa)); \ |
| 160 | TestImpl(InstructionSet::isa, #isa, expected_asm, expected_cfi); \ |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 161 | } |
| 162 | |
Scott Wakeling | 90ab673 | 2016-12-08 10:25:03 +0000 | [diff] [blame] | 163 | #ifdef ART_ENABLE_CODEGEN_arm |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 164 | TEST_ISA(kThumb2) |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 165 | #endif |
Roland Levillain | af24def | 2017-07-12 13:18:01 +0100 | [diff] [blame] | 166 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 167 | #ifdef ART_ENABLE_CODEGEN_arm64 |
Roland Levillain | af24def | 2017-07-12 13:18:01 +0100 | [diff] [blame] | 168 | // Run the tests for ARM64 only with Baker read barriers, as the |
| 169 | // expected generated code saves and restore X21 and X22 (instead of |
| 170 | // X20 and X21), as X20 is used as Marking Register in the Baker read |
| 171 | // barrier configuration, and as such is removed from the set of |
| 172 | // callee-save registers in the ARM64 code generator of the Optimizing |
| 173 | // compiler. |
| 174 | #if defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER) |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 175 | TEST_ISA(kArm64) |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 176 | #endif |
Roland Levillain | af24def | 2017-07-12 13:18:01 +0100 | [diff] [blame] | 177 | #endif |
| 178 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 179 | #ifdef ART_ENABLE_CODEGEN_x86 |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 180 | TEST_ISA(kX86) |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 181 | #endif |
Roland Levillain | af24def | 2017-07-12 13:18:01 +0100 | [diff] [blame] | 182 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 183 | #ifdef ART_ENABLE_CODEGEN_x86_64 |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 184 | TEST_ISA(kX86_64) |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 185 | #endif |
Roland Levillain | af24def | 2017-07-12 13:18:01 +0100 | [diff] [blame] | 186 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 187 | #ifdef ART_ENABLE_CODEGEN_mips |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 188 | TEST_ISA(kMips) |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 189 | #endif |
Roland Levillain | af24def | 2017-07-12 13:18:01 +0100 | [diff] [blame] | 190 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 191 | #ifdef ART_ENABLE_CODEGEN_mips64 |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 192 | TEST_ISA(kMips64) |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 193 | #endif |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 194 | |
Scott Wakeling | 90ab673 | 2016-12-08 10:25:03 +0000 | [diff] [blame] | 195 | #ifdef ART_ENABLE_CODEGEN_arm |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 196 | TEST_F(OptimizingCFITest, kThumb2Adjust) { |
| 197 | std::vector<uint8_t> expected_asm( |
| 198 | expected_asm_kThumb2_adjust, |
| 199 | expected_asm_kThumb2_adjust + arraysize(expected_asm_kThumb2_adjust)); |
| 200 | std::vector<uint8_t> expected_cfi( |
| 201 | expected_cfi_kThumb2_adjust, |
| 202 | expected_cfi_kThumb2_adjust + arraysize(expected_cfi_kThumb2_adjust)); |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 203 | SetUpFrame(InstructionSet::kThumb2); |
Scott Wakeling | 90ab673 | 2016-12-08 10:25:03 +0000 | [diff] [blame] | 204 | #define __ down_cast<arm::ArmVIXLAssembler*>(GetCodeGenerator() \ |
| 205 | ->GetAssembler())->GetVIXLAssembler()-> |
| 206 | vixl32::Label target; |
| 207 | __ CompareAndBranchIfZero(r0, &target); |
| 208 | // Push the target out of range of CBZ. |
| 209 | for (size_t i = 0; i != 65; ++i) { |
| 210 | __ Ldr(r0, vixl32::MemOperand(r0)); |
| 211 | } |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 212 | __ Bind(&target); |
| 213 | #undef __ |
| 214 | Finish(); |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 215 | Check(InstructionSet::kThumb2, "kThumb2_adjust", expected_asm, expected_cfi); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 216 | } |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 217 | #endif |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 218 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 219 | #ifdef ART_ENABLE_CODEGEN_mips |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 220 | TEST_F(OptimizingCFITest, kMipsAdjust) { |
| 221 | // One NOP in delay slot, 1 << 15 NOPS have size 1 << 17 which exceeds 18-bit signed maximum. |
| 222 | static constexpr size_t kNumNops = 1u + (1u << 15); |
| 223 | std::vector<uint8_t> expected_asm( |
| 224 | expected_asm_kMips_adjust_head, |
| 225 | expected_asm_kMips_adjust_head + arraysize(expected_asm_kMips_adjust_head)); |
| 226 | expected_asm.resize(expected_asm.size() + kNumNops * 4u, 0u); |
| 227 | expected_asm.insert( |
| 228 | expected_asm.end(), |
| 229 | expected_asm_kMips_adjust_tail, |
| 230 | expected_asm_kMips_adjust_tail + arraysize(expected_asm_kMips_adjust_tail)); |
| 231 | std::vector<uint8_t> expected_cfi( |
| 232 | expected_cfi_kMips_adjust, |
| 233 | expected_cfi_kMips_adjust + arraysize(expected_cfi_kMips_adjust)); |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 234 | SetUpFrame(InstructionSet::kMips); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 235 | #define __ down_cast<mips::MipsAssembler*>(GetCodeGenerator()->GetAssembler())-> |
| 236 | mips::MipsLabel target; |
| 237 | __ Beqz(mips::A0, &target); |
| 238 | // Push the target out of range of BEQZ. |
| 239 | for (size_t i = 0; i != kNumNops; ++i) { |
| 240 | __ Nop(); |
| 241 | } |
| 242 | __ Bind(&target); |
| 243 | #undef __ |
| 244 | Finish(); |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 245 | Check(InstructionSet::kMips, "kMips_adjust", expected_asm, expected_cfi); |
Vladimir Marko | 10ef694 | 2015-10-22 15:25:54 +0100 | [diff] [blame] | 246 | } |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 247 | #endif |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 248 | |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 249 | #ifdef ART_ENABLE_CODEGEN_mips64 |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 250 | TEST_F(OptimizingCFITest, kMips64Adjust) { |
| 251 | // One NOP in forbidden slot, 1 << 15 NOPS have size 1 << 17 which exceeds 18-bit signed maximum. |
| 252 | static constexpr size_t kNumNops = 1u + (1u << 15); |
| 253 | std::vector<uint8_t> expected_asm( |
| 254 | expected_asm_kMips64_adjust_head, |
| 255 | expected_asm_kMips64_adjust_head + arraysize(expected_asm_kMips64_adjust_head)); |
| 256 | expected_asm.resize(expected_asm.size() + kNumNops * 4u, 0u); |
| 257 | expected_asm.insert( |
| 258 | expected_asm.end(), |
| 259 | expected_asm_kMips64_adjust_tail, |
| 260 | expected_asm_kMips64_adjust_tail + arraysize(expected_asm_kMips64_adjust_tail)); |
| 261 | std::vector<uint8_t> expected_cfi( |
| 262 | expected_cfi_kMips64_adjust, |
| 263 | expected_cfi_kMips64_adjust + arraysize(expected_cfi_kMips64_adjust)); |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 264 | SetUpFrame(InstructionSet::kMips64); |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 265 | #define __ down_cast<mips64::Mips64Assembler*>(GetCodeGenerator()->GetAssembler())-> |
| 266 | mips64::Mips64Label target; |
| 267 | __ Beqc(mips64::A1, mips64::A2, &target); |
| 268 | // Push the target out of range of BEQC. |
| 269 | for (size_t i = 0; i != kNumNops; ++i) { |
| 270 | __ Nop(); |
| 271 | } |
| 272 | __ Bind(&target); |
| 273 | #undef __ |
| 274 | Finish(); |
Vladimir Marko | 33bff25 | 2017-11-01 14:35:42 +0000 | [diff] [blame] | 275 | Check(InstructionSet::kMips64, "kMips64_adjust", expected_asm, expected_cfi); |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 276 | } |
Colin Cross | a75b01a | 2016-08-18 13:45:24 -0700 | [diff] [blame] | 277 | #endif |
Alexey Frunze | a0e87b0 | 2015-09-24 22:57:20 -0700 | [diff] [blame] | 278 | |
Bilyan Borisov | bb661c0 | 2016-04-04 16:27:32 +0100 | [diff] [blame] | 279 | #endif // ART_TARGET_ANDROID |
David Srbecky | c6b4dd8 | 2015-04-07 20:32:43 +0100 | [diff] [blame] | 280 | |
| 281 | } // namespace art |