ppc: Fix xsmaddmdp and friends
PATCH 1/1 ppc: Fix xsmaddmdp and friends
From: "Paul A. Clarke" <[email protected]>
A class of instructions of the form:
op Target,A,B
which operate like:
Target = Target * A + B
have a bit set which distinguishes them from instructions that operate as:
Target = Target * B + A
This bit is not being checked properly (using PPC_BIT macro), so all instructions in this class are operating incorrectly as the second form above. The bit was being checked as if it were part of a 64-bit instruction opcode, rather than a proper 32-bit opcode. Fix by using the macro (PPC_BIT32) which treats the opcode as a 32-bit quantity.
--- target/ppc/translate/vsx-impl.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/ppc/translate/vsx-impl.inc.c +1 -1
@@ -1308,7 +1308,7 @@ static void gen_##name(DisasContext *ctx) \ } \ xt =gen_vsr_ptr (xT (ctx->opcode)); \ xa =gen_vsr_ptr (xA (ctx->opcode)); \ -if (ctx->opcode &PPC_BIT (25 )) { \ +if (ctx->opcode &PPC_BIT32 (25 )) { \/* \ * AxT + B \ */ \
Signature · 1 line
1.8.3.1
David Gibson
AppliedQuoted 9 lines · Paul A. Clarke
From: "Paul A. Clarke" <[email protected]>
A class of instructions of the form:
op Target,A,B
which operate like:
Target = Target * A + B
have a bit set which distinguishes them from instructions that operate as:
Target = Target * B + A
Quoted 7 lines
This bit is not being checked properly (using
PPC_BITmacro), so all instructions in this class are operating incorrectly as the second form above. The bit was being checked as if it were part of a 64-bit instruction opcode, rather than a proper 32-bit opcode. Fix by using the macro (PPC_BIT32) which treats the opcode as a 32-bit quantity.Signed-off-by Paul A. Clarke <[email protected]>
Applied to ppc-for-4.2, thanks.
Quoted 17 lines
--- target/ppc/translate/vsx-impl.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/ppc/translate/vsx-impl.inc.c +1
-1@@ -1308,7 +1308,7 @@ static void gen_##name(DisasContext *ctx) \ } \ xt =gen_vsr_ptr (xT (ctx->opcode)); \ xa =gen_vsr_ptr (xA (ctx->opcode)); \ -if (ctx->opcode &PPC_BIT (25 )) { \ +if (ctx->opcode &PPC_BIT32 (25 )) { \/* \ * AxT + B \ */ \
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 16 lines · David Gibson
Quoted 15 lines · Paul A. Clarke
From: "Paul A. Clarke" <[email protected]>
A class of instructions of the form:
op Target,A,B
which operate like:
Target = Target * A + B
have a bit set which distinguishes them from instructions that operate as:
Target = Target * B + AThis bit is not being checked properly (using
PPC_BITmacro), so all instructions in this class are operating incorrectly as the second form above. The bit was being checked as if it were part of a 64-bit instruction opcode, rather than a proper 32-bit opcode. Fix by using the macro (PPC_BIT32) which treats the opcode as a 32-bit quantity.
Quoted 3 lines
Quoted 1 line
Signed-off-by Paul A. Clarke <[email protected]>Applied to ppc-for-4.2, thanks.
David,
could you add:
Thanks,
Laurent
Quoted 21 lines · Laurent Vivier
Quoted 16 lines · David Gibson
Quoted 15 lines · Paul A. Clarke
From: "Paul A. Clarke" <[email protected]>
A class of instructions of the form:
op Target,A,B
which operate like:
Target = Target * A + B
have a bit set which distinguishes them from instructions that operate as:
Target = Target * B + AThis bit is not being checked properly (using
PPC_BITmacro), so all instructions in this class are operating incorrectly as the second form above. The bit was being checked as if it were part of a 64-bit instruction opcode, rather than a proper 32-bit opcode. Fix by using the macro (PPC_BIT32) which treats the opcode as a 32-bit quantity.Quoted 3 lines
Quoted 1 line
Signed-off-by Paul A. Clarke <[email protected]>Applied to ppc-for-4.2, thanks.
Quoted 8 lines
David,
could you add:
Fixes c9f4e4d8b632 ("target/ppc: improve VSX_FMADD with new GEN_VSX_HELPER_VSX_MADD macro")Reviewed-by Laurent Vivier <[email protected]>Tested-by Laurent Vivier <[email protected]>
Done, thanks.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson