Skip to content

Commit

Permalink
AVX-512. Add kshift[lr][bwdq]. Fix iterator.
Browse files Browse the repository at this point in the history
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<logic><mode>"): Use new iterator name.
	(define_insn "*<mshift><mode>3"): New.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228034 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
kyukhin committed Sep 23, 2015
1 parent b030c82 commit ab0a0ac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
9 changes: 9 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2015-09-23 Kirill Yukhin <[email protected]>

* 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<logic><mode>"): Use new iterator name.
(define_insn "*<mshift><mode>3"): New.

2015-09-23 Mikhail Maltsev <[email protected]>

PR middle-end/67649
Expand Down
24 changes: 18 additions & 6 deletions gcc/config/i386/i386.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -7841,9 +7844,9 @@
(match_dup 2)))])

(define_insn "*k<logic><mode>"
[(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>mode == QImode)
Expand Down Expand Up @@ -9358,6 +9361,15 @@
;; shift pair, instead using moves and sign extension for counts greater
;; than 31.

(define_insn "*<mshift><mode>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<mshift><mskmodesuffix> %2, %1, %0|%0, %1, %2"
[(set_attr "type" "msklog")
(set_attr "prefix" "vex")])

(define_expand "ashl<mode>3"
[(set (match_operand:SDWIM 0 "<shift_operand>")
(ashift:SDWIM (match_operand:SDWIM 1 "<ashl_input_operand>")
Expand Down

0 comments on commit ab0a0ac

Please sign in to comment.