target/ppc: Fix lxvx/stxvx facility check
PATCH 1/1 target/ppc: Fix lxvx/stxvx facility check
The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree.
From the ISA:
Chapter 7. Vector-Scalar Extension Facility
Load VSX Vector Indexed X-form
lxvx XT,RA,RB
if TX=0 & MSR.VSX=0 then VSX_Unavailable()
if TX=1 & MSR.VEC=0 then Vector_Unavailable()
...
Let XT be the value 32×TX + T.
The code currently does the opposite:
if (paired || a->rt >= 32) {
REQUIRE_VSX(ctx);
} else {
REQUIRE_VECTOR(ctx);
}This was already fixed for lxv/stxv at commit "2cc0e449d1 (target/ppc:
Fix lxv/stxv MSR facility check)", but the indexed forms were missed.
--- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/translate/vsx-impl.c.inc +1 -1
@@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, static bool do_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired) { - if (paired || a->rt >= 32) { + if (paired || a->rt < 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx);
Signature · 1 line
2.35.3
Quoted 36 lines · Fabiano Rosas
The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree.
From the ISA:
Chapter 7. Vector-Scalar Extension Facility
Load VSX Vector Indexed X-formlxvx XT,RA,RB
if TX=0 & MSR.VSX=0 thenVSX_Unavailable()
if TX=1 & MSR.VEC=0 thenVector_Unavailable()
...
Let XT be the value 32×TX + T.The code currently does the opposite:
if (paired || a->rt >= 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx); }This was already fixed for lxv/stxv at commit "
2cc0e449d1(target/ppc:
Fix lxv/stxv MSR facility check)", but the indexed forms were missed.Fixes 70426b5bb7 ("target/ppc: moved stxvx and lxvx from legacy to decodtree")Signed-off-by Fabiano Rosas <[email protected]>--- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/translate/vsx-impl.c.inc +0
-0
target/ppc/translate/vsx-impl.c.inc static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, · line 2250
Quoted 8 lines
target/ppc/translate/vsx-impl.c.inc +1
-1@@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, static bool do_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired) { - if (paired || a->rt >= 32) { + if (paired || a->rt < 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx);
Adding Ilya FYI.
Ciao,
Claudio
Quoted 48 lines · Claudio Fontana
Quoted 36 lines · Fabiano Rosas
The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree.
From the ISA:
Chapter 7. Vector-Scalar Extension Facility
Load VSX Vector Indexed X-formlxvx XT,RA,RB
if TX=0 & MSR.VSX=0 thenVSX_Unavailable()
if TX=1 & MSR.VEC=0 thenVector_Unavailable()
...
Let XT be the value 32×TX + T.The code currently does the opposite:
if (paired || a->rt >= 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx); }This was already fixed for lxv/stxv at commit "
2cc0e449d1(target/ppc:
Fix lxv/stxv MSR facility check)", but the indexed forms were missed.Fixes 70426b5bb7 ("target/ppc: moved stxvx and lxvx from legacy to decodtree")Signed-off-by Fabiano Rosas <[email protected]>--- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/translate/vsx-impl.c.inc +0
-0target/ppc/translate/vsx-impl.c.inc static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, · line 2250
Quoted 8 lines
target/ppc/translate/vsx-impl.c.inc +1
-1@@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, static bool do_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired) { - if (paired || a->rt >= 32) { + if (paired || a->rt < 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx);Reviewed-by Claudio Fontana <[email protected]>
ping, adding Richard.
We will need to include this downstream because of the breakage its lack causes.
It is already reviewed by me, but some TCG maintainer indicating it will be included in some queue would help,
Thanks,
Claudio
Quoted 57 lines · Claudio Fontana
Adding Ilya FYI.
Ciao,
Claudio
Quoted 48 lines · Claudio Fontana
Quoted 36 lines · Fabiano Rosas
The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree.
From the ISA:
Chapter 7. Vector-Scalar Extension Facility
Load VSX Vector Indexed X-formlxvx XT,RA,RB
if TX=0 & MSR.VSX=0 thenVSX_Unavailable()
if TX=1 & MSR.VEC=0 thenVector_Unavailable()
...
Let XT be the value 32×TX + T.The code currently does the opposite:
if (paired || a->rt >= 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx); }This was already fixed for lxv/stxv at commit "
2cc0e449d1(target/ppc:
Fix lxv/stxv MSR facility check)", but the indexed forms were missed.Fixes 70426b5bb7 ("target/ppc: moved stxvx and lxvx from legacy to decodtree")Signed-off-by Fabiano Rosas <[email protected]>--- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/translate/vsx-impl.c.inc +0
-0target/ppc/translate/vsx-impl.c.inc static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, · line 2250
Quoted 8 lines
target/ppc/translate/vsx-impl.c.inc +1
-1@@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, static bool do_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired) { - if (paired || a->rt >= 32) { + if (paired || a->rt < 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx);Reviewed-by Claudio Fontana <[email protected]>
Ilya Leoshkevich
Acked-byQuoted 7 lines · Claudio Fontana
ping, adding Richard.
We will need to include this downstream because of the breakage its lack causes.
It is already reviewed by me, but some TCG maintainer indicating it will be included in some queue would help,
Quoted 65 lines
Thanks,
Claudio
Quoted 60 lines · Claudio Fontana
Adding Ilya FYI.
Ciao,
Claudio
Quoted 53 lines · Claudio Fontana
Quoted 45 lines · Fabiano Rosas
The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree.
From the ISA:
Chapter 7. Vector-Scalar Extension Facility
Load VSX Vector Indexed X-formlxvx XT,RA,RB
if TX=0 & MSR.VSX=0 thenVSX_Unavailable()
if TX=1 & MSR.VEC=0 thenVector_Unavailable()
...
Let XT be the value 32×TX + T.The code currently does the opposite:
if (paired ||
a->rt>= 32) {
REQUIRE_VSX(ctx);
} else {
REQUIRE_VECTOR(ctx);
}This was already fixed for lxv/stxv at commit "
2cc0e449d1(target/ppc:
Fix lxv/stxv MSR facility check)", but the indexed forms were missed.Fixes 70426b5bb7 ("target/ppc: moved stxvx and lxvx fromlegacy to decodtree")
Signed-off-by Fabiano Rosas <[email protected]>---
target/ppc/translate/vsx-impl.c.inc | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/translate/vsx-impl.c.inc +0
-0@@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a,
static booldo_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired)
{Quoted 5 lines
- if (paired || a->rt >= 32) { + if (paired || a->rt < 32) {
REQUIRE_VSX(ctx);
} else {
REQUIRE_VECTOR(ctx);Reviewed-by Claudio Fontana <[email protected]>
FWIW
But I'm not a maintainer, I guess Richard will need to pick it up.
Richard Henderson
AppliedQuoted 74 lines · Ilya Leoshkevich
Quoted 7 lines · Claudio Fontana
ping, adding Richard.
We will need to include this downstream because of the breakage its lack causes.
It is already reviewed by me, but some TCG maintainer indicating it will be included in some queue would help,Quoted 65 lines
Thanks,
Claudio
Quoted 60 lines · Claudio Fontana
Adding Ilya FYI.
Ciao,
Claudio
Quoted 53 lines · Claudio Fontana
Quoted 48 lines · Fabiano Rosas
The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree.
From the ISA:
Chapter 7. Vector-Scalar Extension Facility
Load VSX Vector Indexed X-formlxvx XT,RA,RB
if TX=0 & MSR.VSX=0 thenVSX_Unavailable()
if TX=1 & MSR.VEC=0 thenVector_Unavailable()
...
Let XT be the value 32×TX + T.The code currently does the opposite:
if (paired ||
a->rt>= 32) {
REQUIRE_VSX(ctx);
} else {
REQUIRE_VECTOR(ctx);
}This was already fixed for lxv/stxv at commit "
2cc0e449d1(target/ppc:
Fix lxv/stxv MSR facility check)", but the indexed forms were missed.Fixes 70426b5bb7 ("target/ppc: moved stxvx and lxvx fromlegacy to decodtree")
Signed-off-by Fabiano Rosas <[email protected]>--- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/translate/vsx-impl.c.inc +1
-1@@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, static bool do_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired) { - if (paired || a->rt >= 32) { + if (paired || a->rt < 32) { REQUIRE_VSX(ctx);Quoted 2 lines
} else {
REQUIRE_VECTOR(ctx);Reviewed-by Claudio Fontana <[email protected]>
Quoted 5 lines
FWIW
Acked-by Ilya Leoshkevich <[email protected]>But I'm not a maintainer, I guess Richard will need to pick it up.
Queued, thanks.
r~