|
2086 | 2086 | ;; - vredxor.vs
|
2087 | 2087 | ;; -------------------------------------------------------------------------
|
2088 | 2088 |
|
2089 |
| -(define_expand "reduc_plus_scal_<mode>" |
2090 |
| - [(match_operand:<VEL> 0 "register_operand") |
2091 |
| - (match_operand:VI 1 "register_operand")] |
2092 |
| - "TARGET_VECTOR" |
| 2089 | +(define_insn_and_split "reduc_plus_scal_<mode>" |
| 2090 | + [(set (match_operand:<VEL> 0 "register_operand") |
| 2091 | + (unspec:<VEL> [ |
| 2092 | + (match_operand:VI 1 "register_operand") |
| 2093 | + ] UNSPEC_REDUC_SUM))] |
| 2094 | + "TARGET_VECTOR && can_create_pseudo_p ()" |
| 2095 | + "#" |
| 2096 | + "&& 1" |
| 2097 | + [(const_int 0)] |
2093 | 2098 | {
|
2094 | 2099 | riscv_vector::expand_reduction (UNSPEC_REDUC_SUM, operands, CONST0_RTX (<VEL>mode));
|
2095 | 2100 | DONE;
|
2096 |
| -}) |
| 2101 | +} |
| 2102 | +[(set_attr "type" "vector")]) |
2097 | 2103 |
|
2098 | 2104 | (define_expand "reduc_smax_scal_<mode>"
|
2099 | 2105 | [(match_operand:<VEL> 0 "register_operand")
|
|
2173 | 2179 | ;; - vfredmin.vs
|
2174 | 2180 | ;; -------------------------------------------------------------------------
|
2175 | 2181 |
|
2176 |
| -(define_expand "reduc_plus_scal_<mode>" |
2177 |
| - [(match_operand:<VEL> 0 "register_operand") |
2178 |
| - (match_operand:VF 1 "register_operand")] |
2179 |
| - "TARGET_VECTOR" |
| 2182 | +(define_insn_and_split "reduc_plus_scal_<mode>" |
| 2183 | + [(set (match_operand:<VEL> 0 "register_operand") |
| 2184 | + (unspec:<VEL> [ |
| 2185 | + (match_operand:VF 1 "register_operand") |
| 2186 | + ] UNSPEC_REDUC_SUM_UNORDERED))] |
| 2187 | + "TARGET_VECTOR && can_create_pseudo_p ()" |
| 2188 | + "#" |
| 2189 | + "&& 1" |
| 2190 | + [(const_int 0)] |
2180 | 2191 | {
|
2181 | 2192 | riscv_vector::expand_reduction (UNSPEC_REDUC_SUM_UNORDERED, operands,
|
2182 | 2193 | CONST0_RTX (<VEL>mode));
|
2183 | 2194 | DONE;
|
2184 |
| -}) |
| 2195 | +} |
| 2196 | +[(set_attr "type" "vector")]) |
2185 | 2197 |
|
2186 | 2198 | (define_expand "reduc_smax_scal_<mode>"
|
2187 | 2199 | [(match_operand:<VEL> 0 "register_operand")
|
|
2215 | 2227 | ;; -------------------------------------------------------------------------
|
2216 | 2228 |
|
2217 | 2229 | ;; Unpredicated in-order FP reductions.
|
2218 |
| -(define_expand "fold_left_plus_<mode>" |
2219 |
| - [(match_operand:<VEL> 0 "register_operand") |
2220 |
| - (match_operand:<VEL> 1 "register_operand") |
2221 |
| - (match_operand:VF 2 "register_operand")] |
2222 |
| - "TARGET_VECTOR" |
| 2230 | +(define_insn_and_split "fold_left_plus_<mode>" |
| 2231 | + [(set (match_operand:<VEL> 0 "register_operand") |
| 2232 | + (unspec:<VEL> [ |
| 2233 | + (match_operand:VF 2 "register_operand") |
| 2234 | + (match_operand:<VEL> 1 "register_operand") |
| 2235 | + ] UNSPEC_REDUC_SUM_ORDERED))] |
| 2236 | + "TARGET_VECTOR && can_create_pseudo_p ()" |
| 2237 | + "#" |
| 2238 | + "&& 1" |
| 2239 | + [(const_int 0)] |
2223 | 2240 | {
|
2224 | 2241 | riscv_vector::expand_reduction (UNSPEC_REDUC_SUM_ORDERED, operands,
|
2225 | 2242 | operands[1],
|
2226 | 2243 | riscv_vector::reduction_type::FOLD_LEFT);
|
2227 | 2244 | DONE;
|
2228 |
| -}) |
| 2245 | +} |
| 2246 | +[(set_attr "type" "vector")]) |
2229 | 2247 |
|
2230 | 2248 | ;; Predicated in-order FP reductions.
|
2231 |
| -(define_expand "mask_len_fold_left_plus_<mode>" |
2232 |
| - [(match_operand:<VEL> 0 "register_operand") |
2233 |
| - (match_operand:<VEL> 1 "register_operand") |
2234 |
| - (match_operand:VF 2 "register_operand") |
2235 |
| - (match_operand:<VM> 3 "vector_mask_operand") |
2236 |
| - (match_operand 4 "autovec_length_operand") |
2237 |
| - (match_operand 5 "const_0_operand")] |
2238 |
| - "TARGET_VECTOR" |
| 2249 | +(define_insn_and_split "mask_len_fold_left_plus_<mode>" |
| 2250 | + [(set (match_operand:<VEL> 0 "register_operand") |
| 2251 | + (unspec:<VEL> [ |
| 2252 | + (match_operand:VF 2 "register_operand") |
| 2253 | + (match_operand:<VEL> 1 "register_operand") |
| 2254 | + (match_operand:<VM> 3 "vector_mask_operand") |
| 2255 | + (match_operand 4 "autovec_length_operand") |
| 2256 | + (match_operand 5 "const_0_operand") |
| 2257 | + ] UNSPEC_REDUC_SUM_ORDERED))] |
| 2258 | + "TARGET_VECTOR && can_create_pseudo_p ()" |
| 2259 | + "#" |
| 2260 | + "&& 1" |
| 2261 | + [(const_int 0)] |
2239 | 2262 | {
|
2240 | 2263 | if (rtx_equal_p (operands[4], const0_rtx))
|
2241 | 2264 | emit_move_insn (operands[0], operands[1]);
|
|
2244 | 2267 | operands[1],
|
2245 | 2268 | riscv_vector::reduction_type::MASK_LEN_FOLD_LEFT);
|
2246 | 2269 | DONE;
|
2247 |
| -}) |
| 2270 | +} |
| 2271 | +[(set_attr "type" "vector")]) |
2248 | 2272 |
|
2249 | 2273 | ;; -------------------------------------------------------------------------
|
2250 | 2274 | ;; ---- [INT,FP] Extract active element
|
|
0 commit comments