[PATCH] target/mips: Fix msaregnames off-by-one

Anton Johansson via posted 1 patch 2 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250912141325.17788-1-anjo@rev.ng
Maintainers: "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <arikalo@gmail.com>
target/mips/tcg/msa_translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] target/mips: Fix msaregnames off-by-one
Posted by Anton Johansson via 2 weeks, 2 days ago
The names of w10.d0 and following registers are 7 bytes in length
including null-terminator, not 6 bytes.

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/mips/tcg/msa_translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
index 82b149922f..0e947125a0 100644
--- a/target/mips/tcg/msa_translate.c
+++ b/target/mips/tcg/msa_translate.c
@@ -32,7 +32,7 @@ static inline int plus_2(DisasContext *s, int x)
 /* Include the auto-generated decoder.  */
 #include "decode-msa.c.inc"
 
-static const char msaregnames[][6] = {
+static const char msaregnames[][7] = {
     "w0.d0",  "w0.d1",  "w1.d0",  "w1.d1",
     "w2.d0",  "w2.d1",  "w3.d0",  "w3.d1",
     "w4.d0",  "w4.d1",  "w5.d0",  "w5.d1",
-- 
2.51.0
Re: [PATCH] target/mips: Fix msaregnames off-by-one
Posted by Anton Johansson via 2 weeks, 2 days ago
On 12/09/25, Anton Johansson via wrote:
> The names of w10.d0 and following registers are 7 bytes in length
> including null-terminator, not 6 bytes.
> 
> Signed-off-by: Anton Johansson <anjo@rev.ng>
> ---
>  target/mips/tcg/msa_translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
> index 82b149922f..0e947125a0 100644
> --- a/target/mips/tcg/msa_translate.c
> +++ b/target/mips/tcg/msa_translate.c
> @@ -32,7 +32,7 @@ static inline int plus_2(DisasContext *s, int x)
>  /* Include the auto-generated decoder.  */
>  #include "decode-msa.c.inc"
>  
> -static const char msaregnames[][6] = {
> +static const char msaregnames[][7] = {
>      "w0.d0",  "w0.d1",  "w1.d0",  "w1.d1",
>      "w2.d0",  "w2.d1",  "w3.d0",  "w3.d1",
>      "w4.d0",  "w4.d1",  "w5.d0",  "w5.d1",
> -- 
> 2.51.0
> 
> 

Ignore this one, I missed muxregnames! You could say I was off-by-one.
Sent a new patch fixing msaregnames and mxuregnames..

-- 
Anton Johansson
rev.ng Labs Srl.