diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-02-25 19:20:58 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2020-02-26 12:46:59 +0000 |
commit | b6268016bf46dd63227dcbb73d13c30a3b4b9d2a (patch) | |
tree | 6d54c20e191f38ffdf3b5bb4d5976ca8bf4d1307 /gcc/optabs-tree.c | |
parent | 67fa274cd635ec3c8af635294b67f09e45e3c56a (diff) | |
download | gcc-b6268016bf46dd63227dcbb73d13c30a3b4b9d2a.zip gcc-b6268016bf46dd63227dcbb73d13c30a3b4b9d2a.tar.gz gcc-b6268016bf46dd63227dcbb73d13c30a3b4b9d2a.tar.bz2 |
optabs: Don't use scalar conversions for vectors [PR93843]
In this PR we had a conversion between two integer vectors that
both had scalar integer modes. We then tried to implement the
conversion using the scalar optab for those modes, instead of
doing the conversion elementwise.
I wondered about letting through scalar modes for single-element
vectors, but I don't have any evidence that that's useful/necessary,
so it seemed better to keep things simple.
2020-02-26 Richard Sandiford <richard.sandiford@arm.com>
gcc/
PR middle-end/93843
* optabs-tree.c (supportable_convert_operation): Reject types with
scalar modes.
gcc/testsuite/
PR middle-end/93843
* gcc.dg/vect/pr93843-1.c: New test.
* gcc.dg/vect/pr93843-2.c: Likewise.
Diffstat (limited to 'gcc/optabs-tree.c')
-rw-r--r-- | gcc/optabs-tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/optabs-tree.c b/gcc/optabs-tree.c index 3d829c2..badd30b 100644 --- a/gcc/optabs-tree.c +++ b/gcc/optabs-tree.c @@ -284,9 +284,14 @@ supportable_convert_operation (enum tree_code code, machine_mode m1,m2; bool truncp; + gcc_assert (VECTOR_TYPE_P (vectype_out) && VECTOR_TYPE_P (vectype_in)); + m1 = TYPE_MODE (vectype_out); m2 = TYPE_MODE (vectype_in); + if (!VECTOR_MODE_P (m1) || !VECTOR_MODE_P (m2)) + return false; + /* First check if we can done conversion directly. */ if ((code == FIX_TRUNC_EXPR && can_fix_p (m1,m2,TYPE_UNSIGNED (vectype_out), &truncp) |