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, take 2] Fix PR 18503


Richard Henderson wrote:

This issue was fixed by splitting current sse2_movsd pattern back into movsd and movlpd part, where movlpd insn is generated in the same way as movupd insn.



Not ok. Seems to me that you're breaking reload for these patterns. It is required that all alternatives be in the same instruction.



Indeed. sse2_movsd and sse2_movlpd are the same pattern with different alternatives. However, the correct insn constraint for "movlpd" part is "GET_CODE (operands[1]) == MEM || GET_CODE (operands[2]) == MEM)", but "movsd" part handles the case when operands[1] == REG && operands[2] == REG. I guess the correct fix is to remove the wrong constraint in sse2_movsd insn.

Revised patch, which passes all testcases in my previous emails and fixes PR 18503 is attached to the message. Patch is bootstrapped on i686-pc-linux-gnu and regtested for c,c++. OK to install?

2004-11-23 Uros Bizjak <uros@kss-loka.si>

   PR target/18503
   * configure/i386/i386.md (sse_movss, sse2_movsd, sse2_movhpd):
   Fix wrong vec_merge selector bitmask.
   (sse2_movsd): Remove ix86_binary_operator_ok() from insn
   constraint.

Uros.

Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.565
diff -u -p -r1.565 i386.md
--- config/i386/i386.md	23 Nov 2004 01:22:58 -0000	1.565
+++ config/i386/i386.md	23 Nov 2004 12:26:01 -0000
@@ -20808,7 +20808,7 @@
 	(vec_merge:V4SF
 	 (vec_duplicate:V4SF (match_operand:SF 1 "memory_operand" "m"))
 	 (match_operand:V4SF 2 "const0_operand" "X")
-	 (const_int 1)))]
+	 (const_int 14)))]
   "TARGET_SSE"
   "movss\t{%1, %0|%0, %1}"
   [(set_attr "type" "ssemov")
@@ -24249,7 +24249,7 @@
 	(vec_merge:V2DF
 	 (match_operand:V2DF 1 "nonimmediate_operand" "0,0")
 	 (match_operand:V2DF 2 "nonimmediate_operand" "m,x")
-	 (const_int 2)))]
+	 (const_int 1)))]
   "TARGET_SSE2 && (GET_CODE (operands[1]) == MEM || GET_CODE (operands[2]) == MEM)"
   "movhpd\t{%2, %0|%0, %2}"
   [(set_attr "type" "ssecvt")
@@ -24281,8 +24281,8 @@
 	(vec_merge:V2DF
 	 (match_operand:V2DF 1 "nonimmediate_operand" "0,0,0")
 	 (match_operand:V2DF 2 "nonimmediate_operand" "x,m,x")
-	 (const_int 1)))]
-  "TARGET_SSE2 && ix86_binary_operator_ok (UNKNOWN, V2DFmode, operands)"
+	 (const_int 2)))]
+  "TARGET_SSE2"
   "@movsd\t{%2, %0|%0, %2}
     movlpd\t{%2, %0|%0, %2}
     movlpd\t{%2, %0|%0, %2}"

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