diff options
author | Joel Hutton <joel.hutton@arm.com> | 2020-11-19 10:43:53 +0000 |
---|---|---|
committer | Joel Hutton <joel.hutton@arm.com> | 2020-11-19 11:49:59 +0000 |
commit | 27842e2a1eb26a7eae80b8efd98fb8c8bd74a68e (patch) | |
tree | f1201421b53cb3c438e52f1dc132d35b0666b1ef /gcc/tree-vect-stmts.c | |
parent | 9fc9573f9a5e9432e53c7de93985cfbd267f0309 (diff) | |
download | gcc-27842e2a1eb26a7eae80b8efd98fb8c8bd74a68e.zip gcc-27842e2a1eb26a7eae80b8efd98fb8c8bd74a68e.tar.gz gcc-27842e2a1eb26a7eae80b8efd98fb8c8bd74a68e.tar.bz2 |
[3/3] [AArch64][vect] vec_widen_lshift pattern
Add aarch64 vec_widen_lshift_lo/hi patterns and fix bug it triggers in
mid-end. This pattern takes one vector with N elements of size S, shifts
each element left by the element width and stores the results as N
elements of size 2*s (in 2 result vectors). The aarch64 backend
implements this with the shll,shll2 instruction pair.
gcc/ChangeLog:
* config/aarch64/aarch64-simd.md: Add vec_widen_lshift_hi/lo<mode>
patterns.
* tree-vect-stmts.c (vectorizable_conversion): Fix for widen_lshift
case.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/vect-widen-lshift.c: New test.
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index f88f07a..a4980a9 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -4935,8 +4935,9 @@ vectorizable_conversion (vec_info *vinfo, &vec_oprnds1); if (code == WIDEN_LSHIFT_EXPR) { - vec_oprnds1.create (ncopies * ninputs); - for (i = 0; i < ncopies * ninputs; ++i) + int oprnds_size = vec_oprnds0.length (); + vec_oprnds1.create (oprnds_size); + for (i = 0; i < oprnds_size; ++i) vec_oprnds1.quick_push (op1); } /* Arguments are ready. Create the new vector stmts. */ |