]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arm: Fix constant immediates predicates and constraints for some MVE builtins
authorChristophe Lyon <christophe.lyon@arm.com>
Tue, 6 Sep 2022 16:08:36 +0000 (16:08 +0000)
committerChristophe Lyon <christophe.lyon@arm.com>
Thu, 8 Sep 2022 09:43:45 +0000 (09:43 +0000)
Several MVE builtins incorrectly use the same predicate/constraint
pair for several modes, which does not match the specification.
This patch uses the appropriate iterator instead.

2022-09-06  Christophe Lyon  <christophe.lyon@arm.com>

gcc/
* config/arm/mve.md (mve_vqshluq_n_s<mode>): Use
MVE_pred/MVE_constraint instead of mve_imm_7/Ra.
(mve_vqshluq_m_n_s<mode>): Likewise.
(mve_vqrshrnbq_n_<supf><mode>): Use MVE_pred3/MVE_constraint3
instead of mve_imm_8/Rb.
(mve_vqrshrunbq_n_s<mode>): Likewise.
(mve_vqrshrntq_n_<supf><mode>): Likewise.
(mve_vqrshruntq_n_s<mode>): Likewise.
(mve_vrshrnbq_n_<supf><mode>): Likewise.
(mve_vrshrntq_n_<supf><mode>): Likewise.
(mve_vqrshrnbq_m_n_<supf><mode>): Likewise.
(mve_vqrshrntq_m_n_<supf><mode>): Likewise.
(mve_vrshrnbq_m_n_<supf><mode>): Likewise.
(mve_vrshrntq_m_n_<supf><mode>): Likewise.
(mve_vqrshrunbq_m_n_s<mode>): Likewise.
(mve_vsriq_n_<supf><mode): Use MVE_pred2/MVE_constraint2 instead
of mve_imm_selective_upto_8/Rg.
(mve_vsriq_m_n_<supf><mode>): Likewise.

gcc/config/arm/mve.md

index c4dec01baaca7f2245abc40f0c192aac0fde3bc3..714178609f725a89598b0df1a0f748c60efd9ddc 100644 (file)
   [
    (set (match_operand:MVE_2 0 "s_register_operand" "=w")
        (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "w")
-                      (match_operand:SI 2 "mve_imm_7" "Ra")]
+                      (match_operand:SI 2 "<MVE_pred>" "<MVE_constraint>")]
         VQSHLUQ_N_S))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                                 (match_operand:MVE_5 2 "s_register_operand" "w")
-                                (match_operand:SI 3 "mve_imm_8" "Rb")]
+                                (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")]
         VQRSHRNBQ_N))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                                 (match_operand:MVE_5 2 "s_register_operand" "w")
-                                (match_operand:SI 3 "mve_imm_8" "Rb")]
+                                (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")]
         VQRSHRUNBQ_N_S))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:MVE_2 0 "s_register_operand" "=w")
        (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0")
                       (match_operand:MVE_2 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_selective_upto_8" "Rg")]
+                      (match_operand:SI 3 "<MVE_pred2>" "<MVE_constraint2>")]
         VSRIQ_N))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")]
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")]
         VQRSHRNTQ_N))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")]
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")]
         VQRSHRUNTQ_N_S))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")]
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")]
         VRSHRNBQ_N))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")]
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")]
         VRSHRNTQ_N))
   ]
   "TARGET_HAVE_MVE"
    (set (match_operand:MVE_2 0 "s_register_operand" "=w")
        (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0")
                       (match_operand:MVE_2 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_7" "Ra")
+                      (match_operand:SI 3 "<MVE_pred>" "<MVE_constraint>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VQSHLUQ_M_N_S))
   ]
    (set (match_operand:MVE_2 0 "s_register_operand" "=w")
        (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0")
                       (match_operand:MVE_2 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_selective_upto_8" "Rg")
+                      (match_operand:SI 3 "<MVE_pred2>" "<MVE_constraint2>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VSRIQ_M_N))
   ]
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VQRSHRNBQ_M_N))
   ]
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VQRSHRNTQ_M_N))
   ]
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VRSHRNBQ_M_N))
   ]
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VRSHRNTQ_M_N))
   ]
    (set (match_operand:<V_narrow_pack> 0 "s_register_operand" "=w")
        (unspec:<V_narrow_pack> [(match_operand:<V_narrow_pack> 1 "s_register_operand" "0")
                       (match_operand:MVE_5 2 "s_register_operand" "w")
-                      (match_operand:SI 3 "mve_imm_8" "Rb")
+                      (match_operand:SI 3 "<MVE_pred3>" "<MVE_constraint3>")
                       (match_operand:<MVE_VPRED> 4 "vpr_register_operand" "Up")]
         VQRSHRUNBQ_M_N_S))
   ]