From e28d9ae520082caece9dc90c87b69f864bf886e5 Mon Sep 17 00:00:00 2001 From: Anton Kirilov Date: Tue, 25 Oct 2016 18:17:23 +0100 Subject: ARM: VIXL32: Implement the functionality needed by intrinsics. This patch passes: * 004-UnsafeTest Test: ART_USE_VIXL_ARM_BACKEND=true m test-art-host Test: ART_USE_VIXL_ARM_BACKEND=true m test-art-target Change-Id: I7a3cd410411ef3a520d419734a835090097b2aee --- compiler/optimizing/common_arm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/common_arm.h') diff --git a/compiler/optimizing/common_arm.h b/compiler/optimizing/common_arm.h index 8c08a9c8b9..13824ad671 100644 --- a/compiler/optimizing/common_arm.h +++ b/compiler/optimizing/common_arm.h @@ -135,6 +135,16 @@ inline vixl::aarch32::Register InputRegister(HInstruction* instr) { return InputRegisterAt(instr, 0); } +inline int32_t Int32ConstantFrom(Location location) { + HConstant* instr = location.GetConstant(); + if (instr->IsIntConstant()) { + return instr->AsIntConstant()->GetValue(); + } else { + DCHECK(instr->IsNullConstant()) << instr->DebugName(); + return 0; + } +} + inline int64_t Int64ConstantFrom(Location location) { HConstant* instr = location.GetConstant(); if (instr->IsIntConstant()) { -- cgit v1.2.3-59-g8ed1b