From 6127341b747ac26b361fd1779e155d940d49e39f Mon Sep 17 00:00:00 2001 From: Konstantin Baladurin Date: Sat, 14 Sep 2024 01:26:02 +0100 Subject: Arm64: fix VecPredToBoolean code generation for SVE This patch fixes code generation for VecPredToBoolean so it updates conditional flags itself based on its predicate input. Prior to this patch, code generation for VecPredToBoolean (incorrectly) implicitly assumed that the conditional flags were always updated by its input HIR (VecPredWhile) and that it immediately followed that HIR. Authors: Konstantin Baladurin Chris Jones Test: env ART_FORCE_TRY_PREDICATED_SIMD=true art/test.py --target --optimizing Test: art/tools/run-gtests.sh Change-Id: Id4c2494cdefd008509f9039e36081151aaf0e4a6 --- compiler/optimizing/nodes_vector.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/optimizing/nodes_vector.h') diff --git a/compiler/optimizing/nodes_vector.h b/compiler/optimizing/nodes_vector.h index 6a60d6be01..a5f5720f7e 100644 --- a/compiler/optimizing/nodes_vector.h +++ b/compiler/optimizing/nodes_vector.h @@ -1529,6 +1529,11 @@ class HVecPredNot final : public HVecPredSetOperation { DEFAULT_COPY_CONSTRUCTOR(VecPredNot); }; +// Return the number of elements of the given type that will fit into a vector of given size. +inline size_t GetNumberOfElementsInVector(size_t vector_size_in_bytes, DataType::Type type) { + return vector_size_in_bytes / DataType::Size(type); +} + } // namespace art #endif // ART_COMPILER_OPTIMIZING_NODES_VECTOR_H_ -- cgit v1.2.3-59-g8ed1b