|
2794 | 2794 | [(set_attr "movprfx" "*,*,*,*,yes,yes")]
|
2795 | 2795 | )
|
2796 | 2796 |
|
2797 |
| -;; Unpredicated floating-point multiplication. |
2798 |
| -(define_expand "mul<mode>3" |
| 2797 | +;; Unpredicated floating-point binary operations that can take a single-bit |
| 2798 | +;; immediate. |
| 2799 | +(define_expand "<optab><mode>3" |
2799 | 2800 | [(set (match_operand:SVE_F 0 "register_operand")
|
2800 | 2801 | (unspec:SVE_F
|
2801 | 2802 | [(match_dup 3)
|
2802 | 2803 | (const_int SVE_ALLOW_NEW_FAULTS)
|
2803 | 2804 | (match_operand:SVE_F 1 "register_operand")
|
2804 | 2805 | (match_operand:SVE_F 2 "aarch64_sve_float_mul_operand")]
|
2805 |
| - UNSPEC_COND_MUL))] |
| 2806 | + SVE_COND_FP_BINARY_I1))] |
2806 | 2807 | "TARGET_SVE"
|
2807 | 2808 | {
|
2808 | 2809 | operands[3] = force_reg (<VPRED>mode, CONSTM1_RTX (<VPRED>mode));
|
2809 | 2810 | }
|
2810 | 2811 | )
|
2811 | 2812 |
|
2812 |
| -;; Floating-point multiplication predicated with a PTRUE. |
| 2813 | +;; Predicated floating-point multiplication. |
2813 | 2814 | (define_insn_and_split "@aarch64_pred_mul<mode>"
|
2814 | 2815 | [(set (match_operand:SVE_F 0 "register_operand" "=w, w, w, ?&w, ?&w")
|
2815 | 2816 | (unspec:SVE_F
|
|
2835 | 2836 | [(set_attr "movprfx" "*,*,*,yes,yes")]
|
2836 | 2837 | )
|
2837 | 2838 |
|
| 2839 | +;; Predicated floating-point MAX/MIN. |
| 2840 | +(define_insn "@aarch64_pred_<optab><mode>" |
| 2841 | + [(set (match_operand:SVE_F 0 "register_operand" "=w, w, ?&w, ?&w") |
| 2842 | + (unspec:SVE_F |
| 2843 | + [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl") |
| 2844 | + (match_operand:SI 4 "const_int_operand") |
| 2845 | + (match_operand:SVE_F 2 "register_operand" "%0, 0, w, w") |
| 2846 | + (match_operand:SVE_F 3 "aarch64_sve_float_maxmin_operand" "vsB, w, vsB, w")] |
| 2847 | + SVE_COND_MAXMIN))] |
| 2848 | + "TARGET_SVE" |
| 2849 | + "@ |
| 2850 | + <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 2851 | + <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
| 2852 | + movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 2853 | + movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>" |
| 2854 | + [(set_attr "movprfx" "*,*,yes,yes")] |
| 2855 | +) |
| 2856 | + |
2838 | 2857 | ;; Unpredicated floating-point binary operations (post-RA only).
|
2839 | 2858 | ;; These are generated by splitting a predicated instruction whose
|
2840 | 2859 | ;; predicate is unused.
|
|
3451 | 3470 | [(set_attr "movprfx" "yes")]
|
3452 | 3471 | )
|
3453 | 3472 |
|
3454 |
| -;; Predicated FMUL operations with select. |
3455 |
| -(define_expand "@cond_mul<mode>" |
| 3473 | +;; Predicated floating-point binary operations with select, covering |
| 3474 | +;; operations that can take a single-bit immediate. |
| 3475 | +(define_expand "@cond_<optab><mode>" |
3456 | 3476 | [(set (match_operand:SVE_F 0 "register_operand")
|
3457 | 3477 | (unspec:SVE_F
|
3458 | 3478 | [(match_operand:<VPRED> 1 "register_operand")
|
3459 | 3479 | (unspec:SVE_F
|
3460 | 3480 | [(match_dup 1)
|
3461 | 3481 | (const_int SVE_FORBID_NEW_FAULTS)
|
3462 | 3482 | (match_operand:SVE_F 2 "register_operand")
|
3463 |
| - (match_operand:SVE_F 3 "aarch64_sve_float_mul_operand")] |
3464 |
| - UNSPEC_COND_MUL) |
| 3483 | + (match_operand:SVE_F 3 "aarch64_sve_float_<sve_imm_pred>_operand")] |
| 3484 | + SVE_COND_FP_BINARY_I1) |
3465 | 3485 | (match_operand:SVE_F 4 "aarch64_simd_reg_or_zero")]
|
3466 | 3486 | UNSPEC_SEL))]
|
3467 | 3487 | "TARGET_SVE"
|
3468 | 3488 | {
|
3469 |
| - if (rtx_equal_p (operands[3], operands[4])) |
| 3489 | + if (!CONSTANT_P (operands[4]) && rtx_equal_p (operands[3], operands[4])) |
3470 | 3490 | std::swap (operands[2], operands[3]);
|
3471 | 3491 | })
|
3472 | 3492 |
|
3473 |
| -;; Predicated FMUL operations with select matching second operand. |
| 3493 | +;; Predicated floating-point binary operations with select matching second |
| 3494 | +;; operand, covering operations that can take a single-bit immediate. |
3474 | 3495 | (define_insn "*cond_mul<mode>_2"
|
3475 | 3496 | [(set (match_operand:SVE_F 0 "register_operand" "=w, w, ?&w, ?&w")
|
3476 | 3497 | (unspec:SVE_F
|
|
3479 | 3500 | [(match_dup 1)
|
3480 | 3501 | (match_operand 4)
|
3481 | 3502 | (match_operand:SVE_F 2 "register_operand" "0, 0, w, w")
|
3482 |
| - (match_operand:SVE_F 3 "aarch64_sve_float_mul_operand" "vsM, w, vsM, w")] |
3483 |
| - UNSPEC_COND_MUL) |
| 3503 | + (match_operand:SVE_F 3 "aarch64_sve_float_<sve_imm_pred>_operand" "<sve_imm_con>, w, <sve_imm_con>, w")] |
| 3504 | + SVE_COND_FP_BINARY_I1) |
3484 | 3505 | (match_dup 2)]
|
3485 | 3506 | UNSPEC_SEL))]
|
3486 | 3507 | "TARGET_SVE"
|
3487 | 3508 | "@
|
3488 |
| - fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
3489 |
| - fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
3490 |
| - movprfx\t%0, %2\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
3491 |
| - movprfx\t%0, %2\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>" |
| 3509 | + <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 3510 | + <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
| 3511 | + movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 3512 | + movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>" |
3492 | 3513 | [(set_attr "movprfx" "*,*,yes,yes")]
|
3493 | 3514 | )
|
3494 | 3515 |
|
3495 |
| -;; Predicated FMUL operations in which the values of inactive lanes are |
3496 |
| -;; distinct from the other inputs. |
| 3516 | +;; Predicated floating-point binary operations in which the values of inactive |
| 3517 | +;; lanes are distinct from the other inputs, covering operations that can take |
| 3518 | +;; a single-bit immediate. |
3497 | 3519 | (define_insn "*cond_mul<mode>_any"
|
3498 | 3520 | [(set (match_operand:SVE_F 0 "register_operand" "=&w, &w, &w, &w, &w, &w, ?&w, ?&w")
|
3499 | 3521 | (unspec:SVE_F
|
|
3502 | 3524 | [(match_dup 1)
|
3503 | 3525 | (match_operand 5)
|
3504 | 3526 | (match_operand:SVE_F 2 "register_operand" "%0, 0, w, w, w, w, w, w")
|
3505 |
| - (match_operand:SVE_F 3 "aarch64_sve_float_mul_operand" "vsM, w, vsM, w, vsM, w, vsM, w")] |
3506 |
| - UNSPEC_COND_MUL) |
| 3527 | + (match_operand:SVE_F 3 "aarch64_sve_float_<sve_imm_pred>_operand" "<sve_imm_con>, w, <sve_imm_con>, w, <sve_imm_con>, w, <sve_imm_con>, w")] |
| 3528 | + SVE_COND_FP_BINARY_I1) |
3507 | 3529 | (match_operand:SVE_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, Dz, 0, 0, w, w")]
|
3508 | 3530 | UNSPEC_SEL))]
|
3509 | 3531 | "TARGET_SVE"
|
3510 | 3532 | "@
|
3511 |
| - movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
3512 |
| - movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
3513 |
| - movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
3514 |
| - movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
3515 |
| - movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
3516 |
| - movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
| 3533 | + movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 3534 | + movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
| 3535 | + movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 3536 | + movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
| 3537 | + movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3 |
| 3538 | + movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype> |
3517 | 3539 | #
|
3518 | 3540 | #"
|
3519 | 3541 | [(set_attr "movprfx" "yes")]
|
|
0 commit comments