This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] i?86 unaligned/aligned load improvement for AVX512F


On Sat, Jan 04, 2014 at 09:46:32AM +0100, Uros Bizjak wrote:
> Taking into account Kirill's comment, the patch is OK, although I find

Thanks.

> a bit strange in [1] that
> 
> void f2 (int *__restrict e, int *__restrict f) { int i; for (i = 0; i
> < 1024; i++) e[i] = f[i]; }
> 
> results in
> 
>         vmovdqu64       (%rsi,%rax), %zmm0
>         vmovdqu32       %zmm0, (%rdi,%rax)
> 
> Shouldn't these two move insns be the same?

Right now *mov<mode>_internal doesn't care which of the vmovdqa{32,64}
(and vmovdqu{32,64}) it uses, we could do something like following.
We still have a problem that there is no vmovdq[ua]{8,16}, so we need to
pick one of {32,64} for it.  Also, there is
              case MODE_OI:
              case MODE_TI:
                return "vmovdqa64\t{%g1, %g0|%g0, %g1}";
a few lines above, if we wanted to make the output look "nicer", we could
also use vmovdqa64 there only for V{2,4}DImode and use vmovdqa32 for other
modes.

Note I haven't tested the patch at all, perhaps some testcases wouldn't
match their regexps anymore (but probably the
gcc.target/i386/avx512f-vmovdqu32-1.c change could go away).

--- gcc/config/i386/sse.md.jj	2014-01-04 09:48:48.000000000 +0100
+++ gcc/config/i386/sse.md	2014-01-04 10:03:30.256458372 +0100
@@ -743,9 +743,16 @@ (define_insn "*mov<mode>_internal"
 	case MODE_XI:
 	  if (misaligned_operand (operands[0], <MODE>mode)
 	      || misaligned_operand (operands[1], <MODE>mode))
-	    return "vmovdqu64\t{%1, %0|%0, %1}";
-	  else
+	    {
+	      if (<MODE>mode == V8DImode)
+		return "vmovdqu64\t{%1, %0|%0, %1}";
+	      else
+		return "vmovdqu32\t{%1, %0|%0, %1}";
+	    }
+	  else if (<MODE>mode == V8DImode)
 	    return "vmovdqa64\t{%1, %0|%0, %1}";
+	  else
+	    return "vmovdqa32\t{%1, %0|%0, %1}";
 
 	default:
 	  gcc_unreachable ();

> 
> [1] http://gcc.gnu.org/ml/gcc/2014-01/msg00015.html
> 
> Thanks,
> Uros.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]