From 728cd0d15086a917e1613eb6d157d2b6efdf4681 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 5 Dec 2025 16:35:20 +0100 Subject: [PATCH] pan/cs: Fix bitop helpers Source assignment is mixed up in some of them. While at it, make source argument names consistent with the descriptor field names. Signed-off-by: Boris Brezillon Reviewed-by: Christoph Pillmayer Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/panfrost/genxml/cs_builder.h | 38 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/panfrost/genxml/cs_builder.h b/src/panfrost/genxml/cs_builder.h index 7206e68c51e..2c431d2ddcf 100644 --- a/src/panfrost/genxml/cs_builder.h +++ b/src/panfrost/genxml/cs_builder.h @@ -1695,13 +1695,13 @@ cs_add64(struct cs_builder *b, struct cs_index dest, struct cs_index src, } static inline void -cs_umin32(struct cs_builder *b, struct cs_index dest, struct cs_index src1, - struct cs_index src2) +cs_umin32(struct cs_builder *b, struct cs_index dest, struct cs_index src0, + struct cs_index src1) { cs_emit(b, UMIN32, I) { I.destination = cs_dst32(b, dest); + I.source_0 = cs_src32(b, src0); I.source_1 = cs_src32(b, src1); - I.source_0 = cs_src32(b, src2); } } @@ -1720,35 +1720,35 @@ cs_move_reg32(struct cs_builder *b, struct cs_index dest, struct cs_index src) #if PAN_ARCH >= 11 static inline void -cs_and32(struct cs_builder *b, struct cs_index dest, struct cs_index src1, - struct cs_index src2) +cs_and32(struct cs_builder *b, struct cs_index dest, struct cs_index src0, + struct cs_index src1) { cs_emit(b, AND32, I) { I.destination = cs_dst32(b, dest); + I.source_0 = cs_src32(b, src0); I.source_1 = cs_src32(b, src1); - I.source_0 = cs_src32(b, src2); } } static inline void -cs_or32(struct cs_builder *b, struct cs_index dest, struct cs_index src1, - struct cs_index src2) +cs_or32(struct cs_builder *b, struct cs_index dest, struct cs_index src0, + struct cs_index src1) { cs_emit(b, OR32, I) { I.destination = cs_dst32(b, dest); + I.source_0 = cs_src32(b, src0); I.source_1 = cs_src32(b, src1); - I.source_0 = cs_src32(b, src2); } } static inline void -cs_xor32(struct cs_builder *b, struct cs_index dest, struct cs_index src1, - struct cs_index src2) +cs_xor32(struct cs_builder *b, struct cs_index dest, struct cs_index src0, + struct cs_index src1) { cs_emit(b, XOR32, I) { I.destination = cs_dst32(b, dest); + I.source_0 = cs_src32(b, src0); I.source_1 = cs_src32(b, src1); - I.source_0 = cs_src32(b, src2); } } @@ -1762,24 +1762,24 @@ cs_not32(struct cs_builder *b, struct cs_index dest, struct cs_index src) } static inline void -cs_bit_set32(struct cs_builder *b, struct cs_index dest, struct cs_index src1, - struct cs_index src2) +cs_bit_set32(struct cs_builder *b, struct cs_index dest, struct cs_index src0, + struct cs_index src1) { cs_emit(b, BIT_SET32, I) { I.destination = cs_dst32(b, dest); - I.source_0 = cs_src32(b, src1); - I.source_1 = cs_src32(b, src2); + I.source_0 = cs_src32(b, src0); + I.source_1 = cs_src32(b, src1); } } static inline void -cs_bit_clear32(struct cs_builder *b, struct cs_index dest, struct cs_index src1, - struct cs_index src2) +cs_bit_clear32(struct cs_builder *b, struct cs_index dest, struct cs_index src0, + struct cs_index src1) { cs_emit(b, BIT_CLEAR32, I) { I.destination = cs_dst32(b, dest); + I.source_0 = cs_src32(b, src0); I.source_1 = cs_src32(b, src1); - I.source_0 = cs_src32(b, src2); } }