Commit 34b7ae1d by Kewen Lin

[rs6000] Fix PR92566 by checking VECTOR_UNIT_NONE_P

As Segher pointed out in PR92566, we shouldn't offer some vector modes which
aren't supported under current setting.  This patch is to make it check by
VECTOR_UNIT_NONE_P which is initialized as current architecture masks.

2019-11-28  Kewen Lin  <linkw@gcc.gnu.org>

    PR target/92566
    * gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Check by
    VECTOR_UNIT_NONE_P instead.

From-SVN: r278800
parent 9c9cb582
2019-11-28 Kewen Lin <linkw@gcc.gnu.org>
PR target/92566
* gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Check
by VECTOR_UNIT_NONE_P instead.
2019-11-28 Hongtao Liu <hongtao.liu@inte.com> 2019-11-28 Hongtao Liu <hongtao.liu@inte.com>
* gcc/config/i386/sse.md (avx512f_maskcmp<mode>3): * gcc/config/i386/sse.md (avx512f_maskcmp<mode>3):
...@@ -4915,30 +4915,11 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost, ...@@ -4915,30 +4915,11 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
static machine_mode static machine_mode
rs6000_preferred_simd_mode (scalar_mode mode) rs6000_preferred_simd_mode (scalar_mode mode)
{ {
if (TARGET_VSX) opt_machine_mode vmode = mode_for_vector (mode, 16 / GET_MODE_SIZE (mode));
switch (mode)
{ if (vmode.exists () && !VECTOR_UNIT_NONE_P (vmode.require ()))
case E_DFmode: return vmode.require ();
return V2DFmode;
default:;
}
if (TARGET_ALTIVEC || TARGET_VSX)
switch (mode)
{
case E_SFmode:
return V4SFmode;
case E_TImode:
return V1TImode;
case E_DImode:
return V2DImode;
case E_SImode:
return V4SImode;
case E_HImode:
return V8HImode;
case E_QImode:
return V16QImode;
default:;
}
return word_mode; return word_mode;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment