From d4bccf1ece319a3a99e03ecbcbbf40bb82b9e331 Mon Sep 17 00:00:00 2001 From: Artem Serov Date: Mon, 3 Apr 2017 18:47:32 +0100 Subject: ARM64: Support 128-bit registers for SIMD. Test: test-art-host, test-art-target Change-Id: Ifb931a99d34ea77602a0e0781040ed092de9faaa --- compiler/optimizing/codegen_test.cc | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'compiler/optimizing/codegen_test.cc') diff --git a/compiler/optimizing/codegen_test.cc b/compiler/optimizing/codegen_test.cc index f8bbf68c1c..4ba5c5580f 100644 --- a/compiler/optimizing/codegen_test.cc +++ b/compiler/optimizing/codegen_test.cc @@ -769,6 +769,45 @@ TEST_F(CodegenTest, ARM64ParallelMoveResolverB34760542) { InternalCodeAllocator code_allocator; codegen.Finalize(&code_allocator); } + +// Check that ParallelMoveResolver works fine for ARM64 for both cases when SIMD is on and off. +TEST_F(CodegenTest, ARM64ParallelMoveResolverSIMD) { + std::unique_ptr features( + Arm64InstructionSetFeatures::FromCppDefines()); + ArenaPool pool; + ArenaAllocator allocator(&pool); + HGraph* graph = CreateGraph(&allocator); + arm64::CodeGeneratorARM64 codegen(graph, *features.get(), CompilerOptions()); + + codegen.Initialize(); + + graph->SetHasSIMD(true); + for (int i = 0; i < 2; i++) { + HParallelMove* move = new (graph->GetArena()) HParallelMove(graph->GetArena()); + move->AddMove(Location::SIMDStackSlot(0), + Location::SIMDStackSlot(257), + Primitive::kPrimDouble, + nullptr); + move->AddMove(Location::SIMDStackSlot(257), + Location::SIMDStackSlot(0), + Primitive::kPrimDouble, + nullptr); + move->AddMove(Location::FpuRegisterLocation(0), + Location::FpuRegisterLocation(1), + Primitive::kPrimDouble, + nullptr); + move->AddMove(Location::FpuRegisterLocation(1), + Location::FpuRegisterLocation(0), + Primitive::kPrimDouble, + nullptr); + codegen.GetMoveResolver()->EmitNativeCode(move); + graph->SetHasSIMD(false); + } + + InternalCodeAllocator code_allocator; + codegen.Finalize(&code_allocator); +} + #endif #ifdef ART_ENABLE_CODEGEN_mips -- cgit v1.2.3-59-g8ed1b