https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99718

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You still have:
  if (VECTOR_MEM_VSX_P (mode))
    {
      if (!CONST_INT_P (elt_rtx))
        {
          if ((TARGET_P9_VECTOR && TARGET_POWERPC64) || width == 8)
            return ..._p9 (...);
          else if (TARGET_P8_VECTOR)
            return ..._p8 (...);
        }

      if (mode == V2DFmode)
        insn = gen_vsx_set_v2df (target, target, val, elt_rtx);

      else if (mode == V2DImode)
        insn = gen_vsx_set_v2di (target, target, val, elt_rtx);

      else if (TARGET_P9_VECTOR && TARGET_POWERPC64)
        {
          ...
        }
      if (insn)
        return;
    }

  gcc_assert (CONST_INT_P (elt_rtx));

while the vector.md condition is VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode),
i.e. true for TARGET_ALTIVEC for many modes already (V4SI, V8HI, V16QI, V4SF
and
for TARGET_VSX also V2DF and V2DI, right).
I somehow don't see how this can work properly.
Looking at vsx_set_v2df and vsx_set_v2di, neither of them will handle
non-constant elt_rtx (it ICEs on anything but const0_rtx and const1_rtx).

So, questions:
1) does the rs6000_expand_vector_set_var_p9 routine for width == 8 (i.e.
V2DImode or V2DFmode?)
handle everything, even when TARGET_P9_VECTOR or TARGET_POWERPC64 is not true,
plain old VSX?
2) what happens if TARGET_P8_VECTOR is false and TARGET_VSX is true and mode is
other than V2DI/V2DF? If I read the code right, it will fall through to
gcc_assert (CONST_INT_P (elt_rtx));
3) what happens if !TARGET_VSX (more specifically, when VECTOR_MEM_VSX_P (mode)
is false.
I see there just the assertion that would fail right away.
Perhaps I'm missing something obvious and those cases are impossible, but if
that is the case, it would still be better to add further assertion at least to
the if (...) else if (...) as else gcc_assert ...

Reply via email to