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
+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>
* gcc/config/i386/sse.md (avx512f_maskcmp<mode>3):
static machine_mode
rs6000_preferred_simd_mode (scalar_mode mode)
{
- if (TARGET_VSX)
- switch (mode)
- {
- case E_DFmode:
- 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:;
- }
+ opt_machine_mode vmode = mode_for_vector (mode, 16 / GET_MODE_SIZE (mode));
+
+ if (vmode.exists () && !VECTOR_UNIT_NONE_P (vmode.require ()))
+ return vmode.require ();
+
return word_mode;
}