[PATCH v2 039/101] target/arm: Remove helper_gvec_sudot_idx_4b

Richard Henderson posted 101 patches 4 months, 3 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Peter Maydell <peter.maydell@linaro.org>
There is a newer version of this series
[PATCH v2 039/101] target/arm: Remove helper_gvec_sudot_idx_4b
Posted by Richard Henderson 4 months, 3 weeks ago
Add gen_helper_gvec_sudot_idx_4b as an expander which
swaps arguments and uses helper_gvec_usdot_idx_4b.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/tcg/helper.h     | 2 --
 target/arm/tcg/translate.h  | 3 +++
 target/arm/tcg/gengvec.c    | 6 ++++++
 target/arm/tcg/vec_helper.c | 1 -
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/target/arm/tcg/helper.h b/target/arm/tcg/helper.h
index c459eba079..2702627eab 100644
--- a/target/arm/tcg/helper.h
+++ b/target/arm/tcg/helper.h
@@ -622,8 +622,6 @@ DEF_HELPER_FLAGS_5(gvec_sdot_idx_4h, TCG_CALL_NO_RWG,
                    void, ptr, ptr, ptr, ptr, i32)
 DEF_HELPER_FLAGS_5(gvec_udot_idx_4h, TCG_CALL_NO_RWG,
                    void, ptr, ptr, ptr, ptr, i32)
-DEF_HELPER_FLAGS_5(gvec_sudot_idx_4b, TCG_CALL_NO_RWG,
-                   void, ptr, ptr, ptr, ptr, i32)
 DEF_HELPER_FLAGS_5(gvec_usdot_idx_4b, TCG_CALL_NO_RWG,
                    void, ptr, ptr, ptr, ptr, i32)
 
diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
index 8cf6324e2f..90a03a4642 100644
--- a/target/arm/tcg/translate.h
+++ b/target/arm/tcg/translate.h
@@ -627,6 +627,9 @@ void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
 void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
                       uint32_t opr_sz, uint32_t max_sz);
 
+void gen_helper_gvec_sudot_idx_4b(TCGv_ptr d, TCGv_ptr n, TCGv_ptr m,
+                                  TCGv_ptr a, TCGv_i32 desc);
+
 /*
  * Forward to the isar_feature_* tests given a DisasContext pointer.
  */
diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c
index 01867f8ace..c182e5ab6f 100644
--- a/target/arm/tcg/gengvec.c
+++ b/target/arm/tcg/gengvec.c
@@ -23,6 +23,12 @@
 #include "translate.h"
 
 
+void gen_helper_gvec_sudot_idx_4b(TCGv_ptr d, TCGv_ptr n, TCGv_ptr m,
+                                  TCGv_ptr a, TCGv_i32 desc)
+{
+    gen_helper_gvec_usdot_idx_4b(d, m, n, a, desc);
+}
+
 static void gen_gvec_fn3_qc(uint32_t rd_ofs, uint32_t rn_ofs, uint32_t rm_ofs,
                             uint32_t opr_sz, uint32_t max_sz,
                             gen_helper_gvec_3_ptr *fn)
diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c
index 8beace8147..7904159d57 100644
--- a/target/arm/tcg/vec_helper.c
+++ b/target/arm/tcg/vec_helper.c
@@ -867,7 +867,6 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc)  \
 
 DO_DOT_IDX(gvec_sdot_idx_4b, int32_t, int8_t, int8_t, H4)
 DO_DOT_IDX(gvec_udot_idx_4b, uint32_t, uint8_t, uint8_t, H4)
-DO_DOT_IDX(gvec_sudot_idx_4b, int32_t, int8_t, uint8_t, H4)
 DO_DOT_IDX(gvec_usdot_idx_4b, int32_t, uint8_t, int8_t, H4)
 DO_DOT_IDX(gvec_sdot_idx_4h, int64_t, int16_t, int16_t, H8)
 DO_DOT_IDX(gvec_udot_idx_4h, uint64_t, uint16_t, uint16_t, H8)
-- 
2.43.0
Re: [PATCH v2 039/101] target/arm: Remove helper_gvec_sudot_idx_4b
Posted by Peter Maydell 4 months, 3 weeks ago
On Sun, 22 Jun 2025 at 00:53, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Add gen_helper_gvec_sudot_idx_4b as an expander which
> swaps arguments and uses helper_gvec_usdot_idx_4b.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/tcg/helper.h     | 2 --
>  target/arm/tcg/translate.h  | 3 +++
>  target/arm/tcg/gengvec.c    | 6 ++++++
>  target/arm/tcg/vec_helper.c | 1 -
>  4 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/target/arm/tcg/helper.h b/target/arm/tcg/helper.h
> index c459eba079..2702627eab 100644
> --- a/target/arm/tcg/helper.h
> +++ b/target/arm/tcg/helper.h
> @@ -622,8 +622,6 @@ DEF_HELPER_FLAGS_5(gvec_sdot_idx_4h, TCG_CALL_NO_RWG,
>                     void, ptr, ptr, ptr, ptr, i32)
>  DEF_HELPER_FLAGS_5(gvec_udot_idx_4h, TCG_CALL_NO_RWG,
>                     void, ptr, ptr, ptr, ptr, i32)
> -DEF_HELPER_FLAGS_5(gvec_sudot_idx_4b, TCG_CALL_NO_RWG,
> -                   void, ptr, ptr, ptr, ptr, i32)
>  DEF_HELPER_FLAGS_5(gvec_usdot_idx_4b, TCG_CALL_NO_RWG,
>                     void, ptr, ptr, ptr, ptr, i32)
>
> diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
> index 8cf6324e2f..90a03a4642 100644
> --- a/target/arm/tcg/translate.h
> +++ b/target/arm/tcg/translate.h
> @@ -627,6 +627,9 @@ void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
>  void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
>                        uint32_t opr_sz, uint32_t max_sz);
>
> +void gen_helper_gvec_sudot_idx_4b(TCGv_ptr d, TCGv_ptr n, TCGv_ptr m,
> +                                  TCGv_ptr a, TCGv_i32 desc);
> +
>  /*
>   * Forward to the isar_feature_* tests given a DisasContext pointer.
>   */
> diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c
> index 01867f8ace..c182e5ab6f 100644
> --- a/target/arm/tcg/gengvec.c
> +++ b/target/arm/tcg/gengvec.c
> @@ -23,6 +23,12 @@
>  #include "translate.h"
>
>
> +void gen_helper_gvec_sudot_idx_4b(TCGv_ptr d, TCGv_ptr n, TCGv_ptr m,
> +                                  TCGv_ptr a, TCGv_i32 desc)
> +{
> +    gen_helper_gvec_usdot_idx_4b(d, m, n, a, desc);
> +}
> +

How does this work? In the DO_DOT_IDX() helper functions
the 'm' argument is indexed, so I don't see how we can
just flip the n and m arguments around.

-- PMM
Re: [PATCH v2 039/101] target/arm: Remove helper_gvec_sudot_idx_4b
Posted by Richard Henderson 4 months, 3 weeks ago
On 6/23/25 10:00, Peter Maydell wrote:
> On Sun, 22 Jun 2025 at 00:53, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> Add gen_helper_gvec_sudot_idx_4b as an expander which
>> swaps arguments and uses helper_gvec_usdot_idx_4b.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   target/arm/tcg/helper.h     | 2 --
>>   target/arm/tcg/translate.h  | 3 +++
>>   target/arm/tcg/gengvec.c    | 6 ++++++
>>   target/arm/tcg/vec_helper.c | 1 -
>>   4 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/target/arm/tcg/helper.h b/target/arm/tcg/helper.h
>> index c459eba079..2702627eab 100644
>> --- a/target/arm/tcg/helper.h
>> +++ b/target/arm/tcg/helper.h
>> @@ -622,8 +622,6 @@ DEF_HELPER_FLAGS_5(gvec_sdot_idx_4h, TCG_CALL_NO_RWG,
>>                      void, ptr, ptr, ptr, ptr, i32)
>>   DEF_HELPER_FLAGS_5(gvec_udot_idx_4h, TCG_CALL_NO_RWG,
>>                      void, ptr, ptr, ptr, ptr, i32)
>> -DEF_HELPER_FLAGS_5(gvec_sudot_idx_4b, TCG_CALL_NO_RWG,
>> -                   void, ptr, ptr, ptr, ptr, i32)
>>   DEF_HELPER_FLAGS_5(gvec_usdot_idx_4b, TCG_CALL_NO_RWG,
>>                      void, ptr, ptr, ptr, ptr, i32)
>>
>> diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
>> index 8cf6324e2f..90a03a4642 100644
>> --- a/target/arm/tcg/translate.h
>> +++ b/target/arm/tcg/translate.h
>> @@ -627,6 +627,9 @@ void gen_gvec_urecpe(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
>>   void gen_gvec_ursqrte(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
>>                         uint32_t opr_sz, uint32_t max_sz);
>>
>> +void gen_helper_gvec_sudot_idx_4b(TCGv_ptr d, TCGv_ptr n, TCGv_ptr m,
>> +                                  TCGv_ptr a, TCGv_i32 desc);
>> +
>>   /*
>>    * Forward to the isar_feature_* tests given a DisasContext pointer.
>>    */
>> diff --git a/target/arm/tcg/gengvec.c b/target/arm/tcg/gengvec.c
>> index 01867f8ace..c182e5ab6f 100644
>> --- a/target/arm/tcg/gengvec.c
>> +++ b/target/arm/tcg/gengvec.c
>> @@ -23,6 +23,12 @@
>>   #include "translate.h"
>>
>>
>> +void gen_helper_gvec_sudot_idx_4b(TCGv_ptr d, TCGv_ptr n, TCGv_ptr m,
>> +                                  TCGv_ptr a, TCGv_i32 desc)
>> +{
>> +    gen_helper_gvec_usdot_idx_4b(d, m, n, a, desc);
>> +}
>> +
> 
> How does this work? In the DO_DOT_IDX() helper functions
> the 'm' argument is indexed, so I don't see how we can
> just flip the n and m arguments around.

Duh.  It doesn't work.  I wonder what I was thinking...


r~