]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[aarch64] Use exact_log2 (INTVAL (operands[2])) >= 0 to gate for vec_merge patterns.
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Thu, 19 Jan 2023 07:13:55 +0000 (12:43 +0530)
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Thu, 19 Jan 2023 07:16:08 +0000 (12:46 +0530)
gcc/ChangeLog:
* config/aarch64/aarch64-simd.md (aarch64_simd_vec_set<mode>): Use
exact_log2 (INTVAL (operands[2])) >= 0 as condition for gating
the pattern.
(aarch64_simd_vec_copy_lane<mode>): Likewise.
(aarch64_simd_vec_copy_lane_<vswap_width_name><mode>): Likewise.

gcc/config/aarch64/aarch64-simd.md

index 31d9e8980eae0d45ccf61da78cc80bcf6bdfaf81..7f212bf37cd2c120dceb7efa733c9fa76226f029 100644 (file)
                (match_operand:<VEL> 1 "aarch64_simd_nonimmediate_operand" "w,?r,Utv"))
            (match_operand:VALL_F16 3 "register_operand" "0,0,0")
            (match_operand:SI 2 "immediate_operand" "i,i,i")))]
-  "TARGET_SIMD"
+  "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0"
   {
    int elt = ENDIAN_LANE_N (<nunits>, exact_log2 (INTVAL (operands[2])));
    operands[2] = GEN_INT ((HOST_WIDE_INT) 1 << elt);
                  [(match_operand:SI 4 "immediate_operand" "i")])))
            (match_operand:VALL_F16 1 "register_operand" "0")
            (match_operand:SI 2 "immediate_operand" "i")))]
-  "TARGET_SIMD"
+  "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0"
   {
     int elt = ENDIAN_LANE_N (<nunits>, exact_log2 (INTVAL (operands[2])));
     operands[2] = GEN_INT (HOST_WIDE_INT_1 << elt);
                  [(match_operand:SI 4 "immediate_operand" "i")])))
            (match_operand:VALL_F16_NO_V2Q 1 "register_operand" "0")
            (match_operand:SI 2 "immediate_operand" "i")))]
-  "TARGET_SIMD"
+  "TARGET_SIMD && exact_log2 (INTVAL (operands[2])) >= 0"
   {
     int elt = ENDIAN_LANE_N (<nunits>, exact_log2 (INTVAL (operands[2])));
     operands[2] = GEN_INT (HOST_WIDE_INT_1 << elt);