diff mbox

[i386,4/8,AVX512,7/8] Add substed patterns: `round for expand' subst.

Message ID 20131106072400.GD23881@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Kirill Yukhin Nov. 6, 2013, 7:24 a.m. UTC
Hello,
This patch introduces dedicated subst to add rounding to
structureless expands.

Bootstrapped.

Is it ok for trunk?

--
Thanks, K

---
 gcc/config/i386/sse.md   | 24 ++++++++++++------------
 gcc/config/i386/subst.md | 18 ++++++++++++++++++
 2 files changed, 30 insertions(+), 12 deletions(-)

Comments

Kirill Yukhin Nov. 15, 2013, 5:08 p.m. UTC | #1
Hello,
On 06 Nov 10:24, Kirill Yukhin wrote:
> Bootstrapped.
> 
> Is it ok for trunk?
Ping.

--
Thanks, K
Kirill Yukhin Nov. 19, 2013, 9:12 a.m. UTC | #2
Hello,
On 15 Nov 20:08, Kirill Yukhin wrote:
> > Is it ok for trunk?
> Ping.
Ping.

--
Thanks, K
Kirill Yukhin Dec. 2, 2013, 1:11 p.m. UTC | #3
Hello,
On 19 Nov 12:12, Kirill Yukhin wrote:
> Hello,
> On 15 Nov 20:08, Kirill Yukhin wrote:
> > > Is it ok for trunk?
> > Ping.
> Ping.
Ping.

--
Thanks, K
diff mbox

Patch

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 2325328..5aa1563 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -2752,17 +2752,17 @@ 
 	  (match_operand:FMAMODE 3 "nonimmediate_operand")))]
   "")
 
-(define_expand "avx512f_fmadd_<mode>_maskz"
+(define_expand "avx512f_fmadd_<mode>_maskz<round_expand_name>"
   [(match_operand:VF_512 0 "register_operand")
-   (match_operand:VF_512 1 "nonimmediate_operand")
-   (match_operand:VF_512 2 "nonimmediate_operand")
-   (match_operand:VF_512 3 "nonimmediate_operand")
+   (match_operand:VF_512 1 "<round_expand_predicate>")
+   (match_operand:VF_512 2 "<round_expand_predicate>")
+   (match_operand:VF_512 3 "<round_expand_predicate>")
    (match_operand:<avx512fmaskmode> 4 "register_operand")]
   "TARGET_AVX512F"
 {
-  emit_insn (gen_fma_fmadd_<mode>_maskz_1 (
+  emit_insn (gen_fma_fmadd_<mode>_maskz_1<round_expand_name> (
     operands[0], operands[1], operands[2], operands[3],
-    CONST0_RTX (<MODE>mode), operands[4]));
+    CONST0_RTX (<MODE>mode), operands[4]<round_expand_operand>));
   DONE;
 })
 
@@ -2994,17 +2994,17 @@ 
 	  UNSPEC_FMADDSUB))]
   "TARGET_FMA || TARGET_FMA4 || TARGET_AVX512F")
 
-(define_expand "avx512f_fmaddsub_<mode>_maskz"
+(define_expand "avx512f_fmaddsub_<mode>_maskz<round_expand_name>"
   [(match_operand:VF_512 0 "register_operand")
-   (match_operand:VF_512 1 "nonimmediate_operand")
-   (match_operand:VF_512 2 "nonimmediate_operand")
-   (match_operand:VF_512 3 "nonimmediate_operand")
+   (match_operand:VF_512 1 "<round_expand_predicate>")
+   (match_operand:VF_512 2 "<round_expand_predicate>")
+   (match_operand:VF_512 3 "<round_expand_predicate>")
    (match_operand:<avx512fmaskmode> 4 "register_operand")]
   "TARGET_AVX512F"
 {
-  emit_insn (gen_fma_fmaddsub_<mode>_maskz_1 (
+  emit_insn (gen_fma_fmaddsub_<mode>_maskz_1<round_expand_name> (
     operands[0], operands[1], operands[2], operands[3],
-    CONST0_RTX (<MODE>mode), operands[4]));
+    CONST0_RTX (<MODE>mode), operands[4]<round_expand_operand>));
   DONE;
 })
 
diff --git a/gcc/config/i386/subst.md b/gcc/config/i386/subst.md
index 825c6d0..a3b2714 100644
--- a/gcc/config/i386/subst.md
+++ b/gcc/config/i386/subst.md
@@ -182,3 +182,21 @@ 
      (set (match_dup 0)
           (match_dup 1))
      (unspec [(match_operand:SI 2 "const_4_to_5_operand")] UNSPEC_EMBEDDED_ROUNDING)])])
+
+(define_subst_attr "round_expand_name" "round_expand" "" "_round")
+(define_subst_attr "round_expand_predicate" "round_expand" "nonimmediate_operand" "register_operand")
+(define_subst_attr "round_expand_operand" "round_expand" "" ", operands[5]")
+
+(define_subst "round_expand"
+ [(match_operand:SUBST_V 0)
+  (match_operand:SUBST_V 1)
+  (match_operand:SUBST_V 2)
+  (match_operand:SUBST_V 3)
+  (match_operand:SUBST_S 4)]
+  "TARGET_AVX512F"
+  [(match_dup 0)
+   (match_dup 1)
+   (match_dup 2)
+   (match_dup 3)
+   (match_dup 4)
+   (unspec [(match_operand:SI 5 "const_0_to_4_operand")] UNSPEC_EMBEDDED_ROUNDING)])