diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2023-05-14 21:53:17 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2023-05-14 21:53:17 +0200 |
commit | aed51e2051b24a6a2127c6626f451641557a571a (patch) | |
tree | b408fd0fdbce1636332ce75526ff557417e78e21 | |
parent | bde21de1205c0456f6df68c950fb7ee631fcfa93 (diff) | |
download | gcc-aed51e2051b24a6a2127c6626f451641557a571a.tar.gz |
i386: Handle unsupported modes from ix86_widen_mult_cost [PR109807]
Revert my previous change that faked handling of V4HI and V2SImodes
in ix86_widen_mult_cost and rather return arbitrary high value
for unsupported modes. This should prevent cost estimator from
selecting non-existent vector widen multiply operation.
gcc/ChangeLog:
PR target/109807
* config/i386/i386.cc: Revert the 2023-05-11 change.
(ix86_widen_mult_cost): Return high value instead of
ICEing for unsupported modes.
gcc/testsuite/ChangeLog:
PR target/109807
* gcc.target/i386/pr109825.c: New test.
-rw-r--r-- | gcc/config/i386/i386.cc | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr109825.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 4011203486b..498fac468b5 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -20417,14 +20417,12 @@ ix86_widen_mult_cost (const struct processor_costs *cost, int basic_cost = 0; switch (mode) { - case V4HImode: case V8HImode: case V16HImode: if (!uns_p || mode == V16HImode) extra_cost = cost->sse_op * 2; basic_cost = cost->mulss * 2 + cost->sse_op * 4; break; - case V2SImode: case V4SImode: case V8SImode: /* pmulhw/pmullw can be used. */ @@ -20441,7 +20439,8 @@ ix86_widen_mult_cost (const struct processor_costs *cost, basic_cost = cost->mulss * 2 + cost->sse_op * 4; break; default: - gcc_unreachable(); + /* Not implemented. */ + return 100; } return ix86_vec_cost (mode, basic_cost + extra_cost); } diff --git a/gcc/testsuite/gcc.target/i386/pr109825.c b/gcc/testsuite/gcc.target/i386/pr109825.c new file mode 100644 index 00000000000..a8f7ca94641 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr109825.c @@ -0,0 +1,4 @@ +/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-options "-Os -ftree-slp-vectorize -mavx512vl" } */ + +#include "../../gcc.dg/vect/slp-widen-mult-u8.c" |