diff options
author | 2017-04-03 14:35:41 -0700 | |
---|---|---|
committer | 2017-04-05 09:24:01 -0700 | |
commit | 6daebeba6ceab4e7dff5a3d65929eeac9a334004 (patch) | |
tree | 6aa2948896c6a731531451840a9a8bb26854cdd8 /compiler/optimizing/nodes_vector.h | |
parent | 7cd18fb5a7ce83d98b1bbc3c55583fc5f93dc16f (diff) |
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
Diffstat (limited to 'compiler/optimizing/nodes_vector.h')
-rw-r--r-- | compiler/optimizing/nodes_vector.h | 19 |
1 files changed, 19 insertions, 0 deletions
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. |