qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH][SPARC] Fix branch conditions
@ 2007-03-21 12:41 Aurelien Jarno
  2007-03-21 19:02 ` Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2007-03-21 12:41 UTC (permalink / raw)
  To: qemu-devel

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
diff -u -d -p -r1.34 translate.c
--- target-sparc/translate.c	23 Oct 2006 21:37:34 -0000	1.34
+++ target-sparc/translate.c	21 Mar 2007 10:47:35 -0000
@@ -681,7 +681,7 @@ static inline void gen_mov_pc_npc(DisasC
 
 static 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,

-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [Qemu-devel] [PATCH][SPARC] Fix branch conditions
  2007-03-21 12:41 [Qemu-devel] [PATCH][SPARC] Fix branch conditions Aurelien Jarno
@ 2007-03-21 19:02 ` Blue Swirl
  0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2007-03-21 19:02 UTC (permalink / raw)
  To: aurelien; +Cc: qemu-devel

>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.

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-03-21 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-21 12:41 [Qemu-devel] [PATCH][SPARC] Fix branch conditions Aurelien Jarno
2007-03-21 19:02 ` Blue Swirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).