Patchwork [i386,AVX512,24/n] Add integer max/min.

login
register
mail settings
Submitter Kirill Yukhin
Date Aug. 27, 2014, 12:16 p.m.
Message ID <20140827121621.GB7762@msticlxl57.ims.intel.com>
Download mbox | patch
Permalink /patch/383437/
State New
Headers show

Comments

Kirill Yukhin - Aug. 27, 2014, 12:16 p.m.
Hello,
This patch introduces integer max/min AVX-512 pattern.

Bootstrapped.
AVX-512* tests on top of patch-set all pass
under simulator.

Is it ok for trunk?

gcc/
	* config/i386/sse.md
	(define_mode_iterator VI128_256): New.
	(define_insn "<mask_codefor><code><mode>3<mask_name>"): Ditto.

--
Thanks, K
Uros Bizjak - Aug. 27, 2014, 3:16 p.m.
On Wed, Aug 27, 2014 at 2:16 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:

> This patch introduces integer max/min AVX-512 pattern.
>
> Bootstrapped.
> AVX-512* tests on top of patch-set all pass
> under simulator.
>
> Is it ok for trunk?
>
> gcc/
>         * config/i386/sse.md
>         (define_mode_iterator VI128_256): New.
>         (define_insn "<mask_codefor><code><mode>3<mask_name>"): Ditto.

OK.

Thanks,
Uros.

Patch

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 5904450..6c99d84 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -281,6 +281,9 @@ 
 (define_mode_iterator VI8_256_512
   [V8DI (V4DI "TARGET_AVX512VL")])
 
+(define_mode_iterator VI128_256
+  [V4DI V2DI V4SI (V16QI "TARGET_AVX512BW") (V8HI "TARGET_AVX512BW")])
+
 (define_mode_iterator VI1_AVX2
   [(V32QI "TARGET_AVX2") V16QI])
 
@@ -8922,6 +8925,17 @@ 
    (set_attr "prefix" "maybe_evex")
    (set_attr "mode" "OI")])
 
+(define_insn "<mask_codefor><code><mode>3<mask_name>"
+  [(set (match_operand:VI128_256 0 "register_operand" "=v")
+        (maxmin:VI128_256
+          (match_operand:VI128_256 1 "register_operand" "v")
+          (match_operand:VI128_256 2 "nonimmediate_operand" "vm")))]
+  "TARGET_AVX512VL"
+  "vp<maxmin_int><ssemodesuffix>\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
+  [(set_attr "type" "sseiadd")
+   (set_attr "prefix" "evex")
+   (set_attr "mode" "<sseinsnmode>")])
+
 (define_expand "<code><mode>3"
   [(set (match_operand:VI8_AVX2 0 "register_operand")
 	(maxmin:VI8_AVX2