Fix branch conditions
PATCH 1/1 Fix branch conditions
Hi,
I have noticed that the condition table in target-sparc/translate.c is wrong wrt ba and bnr, they are reversed. The emulation is still correct as they are currently not used (do_branch() has two cases to handle them). However I think it is a good idea to fix that, as they may be used at some point.
Bye,
Aurelien
Index: target-sparc/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-sparc/translate.c,v retrieving revision 1.34
translate.c +4 -4
@@ -681,7 +681,7 @@ static inline void gen_mov_pc_npc(DisasCstatic GenOpFunc *const gen_cond[2 ][16 ] = { { - gen_op_eval_ba, + gen_op_eval_bn, gen_op_eval_be, gen_op_eval_ble, gen_op_eval_bl,
@@ -689,7 +689,7 @@ static GenOpFunc * const gen_cond[2][16] gen_op_eval_bcs, gen_op_eval_bneg, gen_op_eval_bvs, - gen_op_eval_bn, + gen_op_eval_ba, gen_op_eval_bne, gen_op_eval_bg, gen_op_eval_bge,
@@ -722,7 +722,7 @@ static GenOpFunc * const gen_cond[2][16]static GenOpFunc *const gen_fcond[4 ][16 ] = { { - gen_op_eval_ba, + gen_op_eval_bn, gen_op_eval_fbne, gen_op_eval_fblg, gen_op_eval_fbul,
@@ -730,7 +730,7 @@ static GenOpFunc * const gen_fcond[4][16 gen_op_eval_fbug, gen_op_eval_fbg, gen_op_eval_fbu, - gen_op_eval_bn, + gen_op_eval_ba, gen_op_eval_fbe, gen_op_eval_fbue, gen_op_eval_fbge,
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net
Quoted 5 lines
I have noticed that the condition table in
target-sparc/translate.cis wrong wrt ba and bnr, they are reversed. The emulation is still correct as they are currently not used (do_branch()has two cases to handle them). However I think it is a good idea to fix that, as they may be used at some point.
You're right. The same problem exists with FPU branches and Sparc64 as well.
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.com/