From 40f1d2ab2662c2ed41707a2126ea0c5c9e028653 Mon Sep 17 00:00:00 2001 From: Kirill Yukhin Date: Wed, 23 Sep 2015 07:08:56 +0000 Subject: [PATCH] AVX-512. Add kshift[lr][bwdq]. Fix iterator. gcc/ * config/i386/i386.md (define_code_attr mshift): New. (define_mode_iterator SWI1248_AVX512BW): Rename ... (SWI1248_AVX512BW): ... to this. Make QI enabled for TARGET_AVX512DQ only. (define_insn "*k"): Use new iterator name. (define_insn "*3"): New. From-SVN: r228034 --- gcc/ChangeLog | 9 +++++++++ gcc/config/i386/i386.md | 24 ++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c79492f22b..0cc98c7febd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-09-23 Kirill Yukhin + + * config/i386/i386.md (define_code_attr mshift): New. + (define_mode_iterator SWI1248_AVX512BW): Rename ... + (SWI1248_AVX512BW): ... to this. Make QI enabled for TARGET_AVX512DQ + only. + (define_insn "*k"): Use new iterator name. + (define_insn "*3"): New. + 2015-09-23 Mikhail Maltsev PR middle-end/67649 diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 2f8cdb2c727..c0911d443de 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -893,6 +893,9 @@ (define_code_attr shift [(ashift "sll") (lshiftrt "shr") (ashiftrt "sar")]) (define_code_attr vshift [(ashift "sll") (lshiftrt "srl") (ashiftrt "sra")]) +;; Mask variant left right mnemonics +(define_code_attr mshift [(ashift "shiftl") (lshiftrt "shiftr")]) + ;; Mapping of rotate operators (define_code_iterator any_rotate [rotate rotatert]) @@ -935,9 +938,9 @@ ;; All integer modes. (define_mode_iterator SWI1248x [QI HI SI DI]) -;; All integer modes with AVX512BW. -(define_mode_iterator SWI1248_AVX512BW - [QI HI (SI "TARGET_AVX512BW") (DI "TARGET_AVX512BW")]) +;; All integer modes with AVX512BW/DQ. +(define_mode_iterator SWI1248_AVX512BWDQ + [(QI "TARGET_AVX512DQ") HI (SI "TARGET_AVX512BW") (DI "TARGET_AVX512BW")]) ;; All integer modes without QImode. (define_mode_iterator SWI248x [HI SI DI]) @@ -7841,9 +7844,9 @@ (match_dup 2)))]) (define_insn "*k" - [(set (match_operand:SWI1248_AVX512BW 0 "mask_reg_operand" "=k") - (any_logic:SWI1248_AVX512BW (match_operand:SWI1248_AVX512BW 1 "mask_reg_operand" "k") - (match_operand:SWI1248_AVX512BW 2 "mask_reg_operand" "k")))] + [(set (match_operand:SWI1248_AVX512BWDQ 0 "mask_reg_operand" "=k") + (any_logic:SWI1248_AVX512BWDQ (match_operand:SWI1248_AVX512BWDQ 1 "mask_reg_operand" "k") + (match_operand:SWI1248_AVX512BWDQ 2 "mask_reg_operand" "k")))] "TARGET_AVX512F" { if (!TARGET_AVX512DQ && mode == QImode) @@ -9358,6 +9361,15 @@ ;; shift pair, instead using moves and sign extension for counts greater ;; than 31. +(define_insn "*3" + [(set (match_operand:SWI1248_AVX512BWDQ 0 "register_operand" "=k") + (any_lshift:SWI1248_AVX512BWDQ (match_operand:SWI1248_AVX512BWDQ 1 "register_operand" "k") + (match_operand:QI 2 "immediate_operand" "i")))] + "TARGET_AVX512F" + "k %2, %1, %0|%0, %1, %2" + [(set_attr "type" "msklog") + (set_attr "prefix" "vex")]) + (define_expand "ashl3" [(set (match_operand:SDWIM 0 "") (ashift:SDWIM (match_operand:SDWIM 1 "") -- 2.30.2