From 6daebeba6ceab4e7dff5a3d65929eeac9a334004 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Mon, 3 Apr 2017 14:35:41 -0700 Subject: Implemented ABS vectorization. Rationale: This CL adds the concept of vectorizing intrinsics to the ART vectorizer. More can follow (MIN, MAX, etc). Test: test-art-host, test-art-target (angler) Change-Id: Ieed8aa83ec64c1250ac0578570249cce338b5d36 --- compiler/optimizing/nodes_vector.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'compiler/optimizing/nodes_vector.h') diff --git a/compiler/optimizing/nodes_vector.h b/compiler/optimizing/nodes_vector.h index 9f9b918f17..0cbbf2a215 100644 --- a/compiler/optimizing/nodes_vector.h +++ b/compiler/optimizing/nodes_vector.h @@ -278,6 +278,25 @@ class HVecNeg FINAL : public HVecUnaryOperation { DISALLOW_COPY_AND_ASSIGN(HVecNeg); }; +// Takes absolute value of every component in the vector, +// viz. abs[ x1, .. , xn ] = [ |x1|, .. , |xn| ]. +class HVecAbs FINAL : public HVecUnaryOperation { + public: + HVecAbs(ArenaAllocator* arena, + HInstruction* input, + Primitive::Type packed_type, + size_t vector_length, + uint32_t dex_pc = kNoDexPc) + : HVecUnaryOperation(arena, packed_type, vector_length, dex_pc) { + DCHECK(input->IsVecOperation()); + DCHECK_EQ(input->AsVecOperation()->GetPackedType(), packed_type); + SetRawInputAt(0, input); + } + DECLARE_INSTRUCTION(VecAbs); + private: + DISALLOW_COPY_AND_ASSIGN(HVecAbs); +}; + // Bitwise- or boolean-nots every component in the vector, // viz. not[ x1, .. , xn ] = [ ~x1, .. , ~xn ], or // not[ x1, .. , xn ] = [ !x1, .. , !xn ] for boolean. -- cgit v1.2.3-59-g8ed1b