On Sat, Feb 09, 2019 at 01:22:30PM +0100, Jakub Jelinek wrote:
> On Sat, Feb 09, 2019 at 04:11:43AM -0800, H.J. Lu wrote:
> > I believe all usages of
> > 
> > (ior (match_operand 0 "ext_sse_reg_operand")
> >       (match_operand 1 "ext_sse_reg_operand"))
> > 
> > should be checked.  I am not sure if they should be there at all.
> 
> E.g. in i386.md all the other spots look fine, because {DI,SI,DF,SF}mode
> is allowed in ext sse regs even with -mavx512f.  And sse.md doesn't use this
> at all.  What I'm wondering is if we need the sse.md (*mov<mode>_internal)
> code I've cited earlier, doing bootstrap/regtest now with gcc_unreachable in
> there (and in *mov{o,x}i_internal* for MODE_XI too) too see if it ever
> triggers.

The following didn't ICE on anything, which is not a proof, but given that
hard_regno_mode_ok should return false for ext_sse_reg_operand regs for
avx512f && !avx512vl, it matches my expectations, on the other hand, it was
a normal defaults bootstrap, don't have a knl which might be best for this
to test -mavx512f -mno-avx512vl on everything.
So perhaps we can also nuke the large if from mov<mode>_internal.

--- gcc/config/i386/i386.md.jj  2019-02-09 12:35:57.971475641 +0100
+++ gcc/config/i386/i386.md     2019-02-09 12:37:40.776802962 +0100
@@ -1905,6 +1905,7 @@ (define_insn "*movoi_internal_avx"
       return standard_sse_constant_opcode (insn, operands);
 
     case TYPE_SSEMOV:
+      gcc_assert (get_attr_mode (insn) != MODE_XI);
       if (misaligned_operand (operands[0], OImode)
          || misaligned_operand (operands[1], OImode))
        {
@@ -1970,6 +1971,7 @@ (define_insn "*movti_internal"
     case TYPE_SSEMOV:
       /* TDmode values are passed as TImode on the stack.  Moving them
         to stack may result in unaligned memory access.  */
+      gcc_assert (get_attr_mode (insn) != MODE_XI);
       if (misaligned_operand (operands[0], TImode)
          || misaligned_operand (operands[1], TImode))
        {
--- gcc/config/i386/sse.md.jj   2019-01-28 21:57:39.301110220 +0100
+++ gcc/config/i386/sse.md      2019-02-09 12:36:45.863696416 +0100
@@ -989,6 +989,7 @@ (define_insn "mov<mode>_internal"
          && (EXT_REX_SSE_REG_P (operands[0])
              || EXT_REX_SSE_REG_P (operands[1])))
        {
+         gcc_unreachable ();
          if (memory_operand (operands[0], <MODE>mode))
            {
              if (<MODE_SIZE> == 32)

        Jakub

Reply via email to