1 ;; GCC machine description for AVX512F instructions
2 ;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 3, or (at your option)
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
20 ;; Some iterators for extending subst as much as possible
21 ;; All vectors (Use it for destination)
22 (define_mode_iterator SUBST_V
30 (define_mode_iterator SUBST_S
33 (define_mode_iterator SUBST_A
43 (define_subst_attr "mask_name" "mask" "" "_mask")
44 (define_subst_attr "mask_applied" "mask" "false" "true")
45 (define_subst_attr "mask_operand2" "mask" "" "%{%3%}%N2")
46 (define_subst_attr "mask_operand3" "mask" "" "%{%4%}%N3")
47 (define_subst_attr "mask_operand3_1" "mask" "" "%%{%%4%%}%%N3") ;; for sprintf
48 (define_subst_attr "mask_operand4" "mask" "" "%{%5%}%N4")
49 (define_subst_attr "mask_operand6" "mask" "" "%{%7%}%N6")
50 (define_subst_attr "mask_operand7" "mask" "" "%{%8%}%N7")
51 (define_subst_attr "mask_operand10" "mask" "" "%{%11%}%N10")
52 (define_subst_attr "mask_operand11" "mask" "" "%{%12%}%N11")
53 (define_subst_attr "mask_operand18" "mask" "" "%{%19%}%N18")
54 (define_subst_attr "mask_operand19" "mask" "" "%{%20%}%N19")
55 (define_subst_attr "mask_codefor" "mask" "*" "")
56 (define_subst_attr "mask_operand_arg34" "mask" "" ", operands[3], operands[4]")
57 (define_subst_attr "mask_mode512bit_condition" "mask" "1" "(GET_MODE_SIZE (GET_MODE (operands[0])) == 64 || TARGET_AVX512VL)")
58 (define_subst_attr "store_mask_constraint" "mask" "vm" "v")
59 (define_subst_attr "store_mask_predicate" "mask" "nonimmediate_operand" "register_operand")
60 (define_subst_attr "mask_prefix" "mask" "vex" "evex")
61 (define_subst_attr "mask_prefix2" "mask" "maybe_vex" "evex")
62 (define_subst_attr "mask_prefix3" "mask" "orig,vex" "evex")
63 (define_subst_attr "mask_expand_op3" "mask" "3" "5")
66 [(set (match_operand:SUBST_V 0)
67 (match_operand:SUBST_V 1))]
72 (match_operand:SUBST_V 2 "vector_move_operand" "0C")
73 (match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))])
75 (define_subst_attr "mask_scalar_merge_name" "mask_scalar_merge" "" "_mask")
76 (define_subst_attr "mask_scalar_merge_operand3" "mask_scalar_merge" "" "%{%3%}")
77 (define_subst_attr "mask_scalar_merge_operand4" "mask_scalar_merge" "" "%{%4%}")
79 (define_subst "mask_scalar_merge"
80 [(set (match_operand:SUBST_S 0)
81 (match_operand:SUBST_S 1))]
86 (match_operand:SUBST_S 3 "register_operand" "Yk")))])
88 (define_subst_attr "sd_maskz_name" "sd" "" "_maskz_1")
89 (define_subst_attr "sd_mask_op4" "sd" "" "%{%5%}%N4")
90 (define_subst_attr "sd_mask_op5" "sd" "" "%{%6%}%N5")
91 (define_subst_attr "sd_mask_codefor" "sd" "*" "")
92 (define_subst_attr "sd_mask_mode512bit_condition" "sd" "1" "(<MODE_SIZE> == 64 || TARGET_AVX512VL)")
95 [(set (match_operand:SUBST_V 0)
96 (match_operand:SUBST_V 1))]
101 (match_operand:SUBST_V 2 "const0_operand" "C")
102 (match_operand:<avx512fmaskmode> 3 "register_operand" "Yk")))
105 (define_subst_attr "round_name" "round" "" "_round")
106 (define_subst_attr "round_mask_operand2" "mask" "%R2" "%R4")
107 (define_subst_attr "round_mask_operand3" "mask" "%R3" "%R5")
108 (define_subst_attr "round_mask_operand4" "mask" "%R4" "%R6")
109 (define_subst_attr "round_sd_mask_operand4" "sd" "%R4" "%R6")
110 (define_subst_attr "round_op2" "round" "" "%R2")
111 (define_subst_attr "round_op3" "round" "" "%R3")
112 (define_subst_attr "round_op4" "round" "" "%R4")
113 (define_subst_attr "round_op5" "round" "" "%R5")
114 (define_subst_attr "round_op6" "round" "" "%R6")
115 (define_subst_attr "round_mask_op2" "round" "" "<round_mask_operand2>")
116 (define_subst_attr "round_mask_op3" "round" "" "<round_mask_operand3>")
117 (define_subst_attr "round_mask_op4" "round" "" "<round_mask_operand4>")
118 (define_subst_attr "round_sd_mask_op4" "round" "" "<round_sd_mask_operand4>")
119 (define_subst_attr "round_constraint" "round" "vm" "v")
120 (define_subst_attr "round_constraint2" "round" "m" "v")
121 (define_subst_attr "round_constraint3" "round" "rm" "r")
122 (define_subst_attr "round_nimm_predicate" "round" "nonimmediate_operand" "register_operand")
123 (define_subst_attr "round_prefix" "round" "vex" "evex")
124 (define_subst_attr "round_mode512bit_condition" "round" "1" "(GET_MODE (operands[0]) == V16SFmode
125 || GET_MODE (operands[0]) == V8DFmode
126 || GET_MODE (operands[0]) == V8DImode
127 || GET_MODE (operands[0]) == V16SImode)")
128 (define_subst_attr "round_modev8sf_condition" "round" "1" "(GET_MODE (operands[0]) == V8SFmode)")
129 (define_subst_attr "round_modev4sf_condition" "round" "1" "(GET_MODE (operands[0]) == V4SFmode)")
130 (define_subst_attr "round_codefor" "round" "*" "")
131 (define_subst_attr "round_opnum" "round" "5" "6")
133 (define_subst "round"
134 [(set (match_operand:SUBST_A 0)
135 (match_operand:SUBST_A 1))]
140 (unspec [(match_operand:SI 2 "const_4_or_8_to_11_operand")] UNSPEC_EMBEDDED_ROUNDING)])])
142 (define_subst_attr "round_saeonly_name" "round_saeonly" "" "_round")
143 (define_subst_attr "round_saeonly_mask_operand2" "mask" "%r2" "%r4")
144 (define_subst_attr "round_saeonly_mask_operand3" "mask" "%r3" "%r5")
145 (define_subst_attr "round_saeonly_mask_operand4" "mask" "%r4" "%r6")
146 (define_subst_attr "round_saeonly_mask_scalar_merge_operand4" "mask_scalar_merge" "%r4" "%r5")
147 (define_subst_attr "round_saeonly_sd_mask_operand5" "sd" "%r5" "%r7")
148 (define_subst_attr "round_saeonly_op2" "round_saeonly" "" "%r2")
149 (define_subst_attr "round_saeonly_op3" "round_saeonly" "" "%r3")
150 (define_subst_attr "round_saeonly_op4" "round_saeonly" "" "%r4")
151 (define_subst_attr "round_saeonly_op5" "round_saeonly" "" "%r5")
152 (define_subst_attr "round_saeonly_op6" "round_saeonly" "" "%r6")
153 (define_subst_attr "round_saeonly_prefix" "round_saeonly" "vex" "evex")
154 (define_subst_attr "round_saeonly_mask_op2" "round_saeonly" "" "<round_saeonly_mask_operand2>")
155 (define_subst_attr "round_saeonly_mask_op3" "round_saeonly" "" "<round_saeonly_mask_operand3>")
156 (define_subst_attr "round_saeonly_mask_op4" "round_saeonly" "" "<round_saeonly_mask_operand4>")
157 (define_subst_attr "round_saeonly_mask_scalar_merge_op4" "round_saeonly" "" "<round_saeonly_mask_scalar_merge_operand4>")
158 (define_subst_attr "round_saeonly_sd_mask_op5" "round_saeonly" "" "<round_saeonly_sd_mask_operand5>")
159 (define_subst_attr "round_saeonly_constraint" "round_saeonly" "vm" "v")
160 (define_subst_attr "round_saeonly_constraint2" "round_saeonly" "m" "v")
161 (define_subst_attr "round_saeonly_nimm_predicate" "round_saeonly" "nonimmediate_operand" "register_operand")
162 (define_subst_attr "round_saeonly_mode512bit_condition" "round_saeonly" "1" "(<MODE>mode == V16SFmode
163 || <MODE>mode == V8DFmode
164 || <MODE>mode == V8DImode
165 || <MODE>mode == V16SImode)")
166 (define_subst_attr "round_saeonly_modev8sf_condition" "round_saeonly" "1" "(<MODE>mode == V8SFmode)")
168 (define_subst "round_saeonly"
169 [(set (match_operand:SUBST_A 0)
170 (match_operand:SUBST_A 1))]
175 (unspec [(match_operand:SI 2 "const48_operand")] UNSPEC_EMBEDDED_ROUNDING)])])
177 (define_subst_attr "round_expand_name" "round_expand" "" "_round")
178 (define_subst_attr "round_expand_nimm_predicate" "round_expand" "nonimmediate_operand" "register_operand")
179 (define_subst_attr "round_expand_operand" "round_expand" "" ", operands[5]")
181 (define_subst "round_expand"
182 [(match_operand:SUBST_V 0)
183 (match_operand:SUBST_V 1)
184 (match_operand:SUBST_V 2)
185 (match_operand:SUBST_V 3)
186 (match_operand:SUBST_S 4)]
193 (unspec [(match_operand:SI 5 "const_4_or_8_to_11_operand")] UNSPEC_EMBEDDED_ROUNDING)])
195 (define_subst_attr "round_saeonly_expand_name" "round_saeonly_expand" "" "_round")
196 (define_subst_attr "round_saeonly_expand_nimm_predicate" "round_saeonly_expand" "nonimmediate_operand" "register_operand")
197 (define_subst_attr "round_saeonly_expand_operand6" "round_saeonly_expand" "" ", operands[6]")
199 (define_subst "round_saeonly_expand"
200 [(match_operand:SUBST_V 0)
201 (match_operand:SUBST_V 1)
202 (match_operand:SUBST_V 2)
203 (match_operand:SUBST_A 3)
205 (match_operand:SUBST_S 5)]
213 (unspec [(match_operand:SI 6 "const48_operand")] UNSPEC_EMBEDDED_ROUNDING)])
215 (define_subst_attr "mask_expand4_name" "mask_expand4" "" "_mask")
216 (define_subst_attr "mask_expand4_args" "mask_expand4" "" ", operands[4], operands[5]")
218 (define_subst "mask_expand4"
219 [(match_operand:SUBST_V 0)
220 (match_operand:SUBST_V 1)
221 (match_operand:SUBST_V 2)
222 (match_operand:SI 3)]
228 (match_operand:SUBST_V 4 "vector_move_operand")
229 (match_operand:<avx512fmaskmode> 5 "register_operand")])