* [Qemu-devel] Sparc taddctv/tsubcctv patch
@ 2007-10-10 16:55 David Matthews
0 siblings, 0 replies; only message in thread
From: David Matthews @ 2007-10-10 16:55 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
This patch fixes a couple of bugs in taddcctv and tsubcctv on the Sparc.
It saves the state so that if the instructions trap the correct
address is delivered to the kernel and it fixes the detection of
overflow in taddcctv. This was patched against CVS version of 20070816
but the fixes don't seem to be in the current CVS.
To provide a bit of context: I'm maintaining Poly/ML (www.polyml.org) on
various platforms including the Sparc. The Sparc code-generator is now
nearly 20 years old and uses the taddcctv and tsubcctv instructions for
arbitrary precision arithmetic. I'm using an ageing Sparcstation 5 with
16M and it is painfully slow so I tried out qemu. I couldn't get
Solaris to boot but the Debian installation runs fine. I was using the
Debian package of qemu which seems to have been prepared on 16th August.
I did try the latest CVS but that gave an exception on booting Sparc
Debian. Perhaps I need a newer version of openbios as well.
Thanks for all your work on qemu.
David.
[-- Attachment #2: qemu-sparc.patch --]
[-- Type: text/plain, Size: 1236 bytes --]
Index: target-sparc/op.c
===================================================================
RCS file: /sources/qemu/qemu/target-sparc/op.c,v
retrieving revision 1.35
diff -u -r1.35 op.c
--- target-sparc/op.c 11 Jul 2007 16:43:30 -0000 1.35
+++ target-sparc/op.c 10 Oct 2007 16:26:34 -0000
@@ -531,7 +531,7 @@
((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31))
raise_exception(TT_TOVF);
#else
- if ((src1 & 0x03) || (T1 & 0x03))
+ if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31))
raise_exception(TT_TOVF);
#endif
Index: target-sparc/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-sparc/translate.c,v
retrieving revision 1.65
diff -u -r1.65 translate.c
--- target-sparc/translate.c 11 Jul 2007 16:43:30 -0000 1.65
+++ target-sparc/translate.c 10 Oct 2007 16:26:36 -0000
@@ -1928,10 +1928,12 @@
gen_movl_T0_reg(rd);
break;
case 0x22: /* taddcctv */
+ save_state(dc);
gen_op_tadd_T1_T0_ccTV();
gen_movl_T0_reg(rd);
break;
case 0x23: /* tsubcctv */
+ save_state(dc);
gen_op_tsub_T1_T0_ccTV();
gen_movl_T0_reg(rd);
break;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-10 16:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 16:55 [Qemu-devel] Sparc taddctv/tsubcctv patch David Matthews
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).