diff mbox

[i386] : Remove avx_{vpermilp,vperm2f128}_*_operand predicates

Message ID BANLkTinC4NASmExMHADDNbJriqnZH9p7cw@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak April 27, 2011, 2:15 p.m. UTC
Hello!

Mode can't be passed to match_parallel predicates, so instead of
calling avx_{vpermilp,vperm2f128}_parallel functions via predicates,
we can call them from insn condition directly.

2011-04-27  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/predicates.md (avx_vpermilp_*_operand): Remove.
	(avx_vperm2f128_*_operand): Ditto.
	* config/i386/sse.md (*avx_vpermilp<mode>): Remove operand2 predicate.
	Use avx_vpermilp_parallel in insn condition.
	(*avx_vperm2f128<mode>_nozero): Remove operand3 predicate.
	Use avx_vperm2f128_parallel in insn condition.

Tested on x86_64-pc-linux-gnu {,-m32} AVX target, committed to mainline SVN.

Uros.
diff mbox

Patch

Index: config/i386/predicates.md
===================================================================
--- config/i386/predicates.md	(revision 173023)
+++ config/i386/predicates.md	(working copy)
@@ -1179,41 +1179,6 @@ 
   return true;
 })
 
-;; Return true if OP is a parallel for a vpermilp[ds] permute.
-;; ??? It would be much easier if the PARALLEL for a VEC_SELECT
-;; had a mode, but it doesn't.  So we have 4 copies and install
-;; the mode by hand.
-
-(define_predicate "avx_vpermilp_v8sf_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vpermilp_parallel (op, V8SFmode)")))
-
-(define_predicate "avx_vpermilp_v4df_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vpermilp_parallel (op, V4DFmode)")))
-
-(define_predicate "avx_vpermilp_v4sf_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vpermilp_parallel (op, V4SFmode)")))
-
-(define_predicate "avx_vpermilp_v2df_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vpermilp_parallel (op, V2DFmode)")))
-
-;; Return true if OP is a parallel for a vperm2f128 permute.
-
-(define_predicate "avx_vperm2f128_v8sf_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vperm2f128_parallel (op, V8SFmode)")))
-
-(define_predicate "avx_vperm2f128_v8si_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vperm2f128_parallel (op, V8SImode)")))
-
-(define_predicate "avx_vperm2f128_v4df_operand"
-  (and (match_code "parallel")
-       (match_test "avx_vperm2f128_parallel (op, V4DFmode)")))
-
 ;; Return true if OP is a parallel for a vbroadcast permute.
 
 (define_predicate "avx_vbroadcast_operand"
Index: config/i386/sse.md
===================================================================
--- config/i386/sse.md	(revision 173023)
+++ config/i386/sse.md	(working copy)
@@ -10055,9 +10055,10 @@ 
   [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
 	(vec_select:AVXMODEF2P
 	  (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "xm")
-	  (match_parallel 2 "avx_vpermilp_<mode>_operand"
+	  (match_parallel 2 ""
 	    [(match_operand 3 "const_int_operand" "")])))]
-  "TARGET_AVX"
+  "TARGET_AVX
+   && avx_vpermilp_parallel (operands[2], <MODE>mode)"
 {
   int mask = avx_vpermilp_parallel (operands[2], <MODE>mode) - 1;
   operands[2] = GEN_INT (mask);
@@ -10140,9 +10141,10 @@ 
 	  (vec_concat:<ssedoublesizemode>
 	    (match_operand:AVX256MODE2P 1 "register_operand" "x")
 	    (match_operand:AVX256MODE2P 2 "nonimmediate_operand" "xm"))
-	  (match_parallel 3 "avx_vperm2f128_<mode>_operand"
+	  (match_parallel 3 ""
 	    [(match_operand 4 "const_int_operand" "")])))]
-  "TARGET_AVX"
+  "TARGET_AVX
+   && avx_vperm2f128_parallel (operands[3], <MODE>mode)"
 {
   int mask = avx_vperm2f128_parallel (operands[3], <MODE>mode) - 1;
   operands[3] = GEN_INT (mask);