[PATCH v2 07/11] target/ppc: expand comment on FP/VMX/VSX access functions

Alex Bennée posted 11 patches 1 week ago
[PATCH v2 07/11] target/ppc: expand comment on FP/VMX/VSX access functions
Posted by Alex Bennée 1 week ago
Mainly as an aid to myself getting confused too many bswaps deep into
the code.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 target/ppc/cpu.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index efab54a068..1e833ade04 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2906,7 +2906,12 @@ static inline bool lsw_reg_in_range(int start, int nregs, int rx)
            (start + nregs > 32 && (rx >= start || rx < start + nregs - 32));
 }
 
-/* Accessors for FP, VMX and VSX registers */
+/*
+ * Access functions for FP, VMX and VSX registers
+ *
+ * The register is stored as a 128 bit host endian value so we need to
+ * take that into account when accessing smaller parts of it.
+ */
 #if HOST_BIG_ENDIAN
 #define VsrB(i) u8[i]
 #define VsrSB(i) s8[i]
-- 
2.39.5


Re: [PATCH v2 07/11] target/ppc: expand comment on FP/VMX/VSX access functions
Posted by Pierrick Bouvier 1 week ago
On 3/24/25 03:21, Alex Bennée wrote:
> Mainly as an aid to myself getting confused too many bswaps deep into
> the code.
> 
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   target/ppc/cpu.h | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index efab54a068..1e833ade04 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -2906,7 +2906,12 @@ static inline bool lsw_reg_in_range(int start, int nregs, int rx)
>              (start + nregs > 32 && (rx >= start || rx < start + nregs - 32));
>   }
>   
> -/* Accessors for FP, VMX and VSX registers */
> +/*
> + * Access functions for FP, VMX and VSX registers
> + *
> + * The register is stored as a 128 bit host endian value so we need to
> + * take that into account when accessing smaller parts of it.
> + */
>   #if HOST_BIG_ENDIAN
>   #define VsrB(i) u8[i]
>   #define VsrSB(i) s8[i]

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Re: [PATCH v2 07/11] target/ppc: expand comment on FP/VMX/VSX access functions
Posted by Richard Henderson 1 week ago
On 3/24/25 03:21, Alex Bennée wrote:
> Mainly as an aid to myself getting confused too many bswaps deep into
> the code.
> 
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   target/ppc/cpu.h | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~