diff options
author | Jennifer Schmitz <jschmitz@nvidia.com> | 2024-08-30 06:56:52 -0700 |
---|---|---|
committer | Jennifer Schmitz <jschmitz@nvidia.com> | 2024-09-03 09:20:47 +0200 |
commit | 87217bea3aa556779a111cec0ef45dcefd1736f6 (patch) | |
tree | 04aed5393234d36e89c7427659f267187ba38af4 /gcc/tree-pass.h | |
parent | 7c9394e84c54238dd2cf01dfaa06d8e87b39cf95 (diff) | |
download | gcc-87217bea3aa556779a111cec0ef45dcefd1736f6.zip gcc-87217bea3aa556779a111cec0ef45dcefd1736f6.tar.gz gcc-87217bea3aa556779a111cec0ef45dcefd1736f6.tar.bz2 |
SVE intrinsics: Refactor const_binop to allow constant folding of intrinsics.
This patch sets the stage for constant folding of binary operations for SVE
intrinsics:
In fold-const.cc, the code for folding vector constants was moved from
const_binop to a new function vector_const_binop. This function takes a
function pointer as argument specifying how to fold the vector elements.
The intention is to call vector_const_binop from the backend with an
aarch64-specific callback function.
The code in const_binop for folding operations where the first operand is a
vector constant and the second argument is an integer constant was also moved
into vector_const_binop to to allow folding of binary SVE intrinsics where
the second operand is an integer (_n).
To allow calling poly_int_binop from the backend, the latter was made public.
The patch was bootstrapped and regtested on aarch64-linux-gnu, no regression.
OK for mainline?
Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
gcc/
* fold-const.h: Declare vector_const_binop.
* fold-const.cc (const_binop): Remove cases for vector constants.
(vector_const_binop): New function that folds vector constants
element-wise.
(int_const_binop): Remove call to wide_int_binop.
(poly_int_binop): Add call to wide_int_binop.
Diffstat (limited to 'gcc/tree-pass.h')
0 files changed, 0 insertions, 0 deletions