* [Qemu-devel] [PATCH] Fix broken fp comparison on PPC host
@ 2005-08-07 13:06 Marcus Comstedt
2005-08-10 9:02 ` [Qemu-devel] Default BIOS path for win32 Kazu
0 siblings, 1 reply; 2+ messages in thread
From: Marcus Comstedt @ 2005-08-07 13:06 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]
Hi.
In QEMU 0.7.1, floating point comparisons do not work properly when
the host is PPC. The reason being that the floatXX_compare functions
are declared as returning "char", which is an unsigned type on PPC,
even though "-1" is one of the possible return values. This means
that r3 will be set to 0x000000ff, but the translated code expects
0xffffffff. Changing the return type to "signed char" fixes the
problem (patch attached), although I honsestly don't see a reason for
returning char sized types from a function in the first place.
Returning "int" will give identical or better code on all modern
architectures...
Anyway, thanks for QEMU, it's a great program. :-)
// Marcus
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to change returntype \"char\" to \"signed char\" for fp comparison functions --]
[-- Type: text/x-patch, Size: 5177 bytes --]
--- fpu/softfloat.h.orig 2005-08-07 14:45:44.000000000 +0200
+++ fpu/softfloat.h 2005-08-07 14:48:11.000000000 +0200
@@ -234,8 +234,8 @@
char float32_eq_signaling( float32, float32 STATUS_PARAM );
char float32_le_quiet( float32, float32 STATUS_PARAM );
char float32_lt_quiet( float32, float32 STATUS_PARAM );
-char float32_compare( float32, float32 STATUS_PARAM );
-char float32_compare_quiet( float32, float32 STATUS_PARAM );
+signed char float32_compare( float32, float32 STATUS_PARAM );
+signed char float32_compare_quiet( float32, float32 STATUS_PARAM );
char float32_is_signaling_nan( float32 );
INLINE float32 float32_abs(float32 a)
@@ -281,8 +281,8 @@
char float64_eq_signaling( float64, float64 STATUS_PARAM );
char float64_le_quiet( float64, float64 STATUS_PARAM );
char float64_lt_quiet( float64, float64 STATUS_PARAM );
-char float64_compare( float64, float64 STATUS_PARAM );
-char float64_compare_quiet( float64, float64 STATUS_PARAM );
+signed char float64_compare( float64, float64 STATUS_PARAM );
+signed char float64_compare_quiet( float64, float64 STATUS_PARAM );
char float64_is_signaling_nan( float64 );
INLINE float64 float64_abs(float64 a)
--- fpu/softfloat.c.orig 2005-08-07 14:45:48.000000000 +0200
+++ fpu/softfloat.c 2005-08-07 14:48:31.000000000 +0200
@@ -5306,12 +5306,12 @@
} \
} \
\
-char float ## s ## _compare( float ## s a, float ## s b STATUS_PARAM ) \
+signed char float ## s ## _compare( float ## s a, float ## s b STATUS_PARAM ) \
{ \
return float ## s ## _compare_internal(a, b, 0 STATUS_VAR); \
} \
\
-char float ## s ## _compare_quiet( float ## s a, float ## s b STATUS_PARAM ) \
+signed char float ## s ## _compare_quiet( float ## s a, float ## s b STATUS_PARAM ) \
{ \
return float ## s ## _compare_internal(a, b, 1 STATUS_VAR); \
}
--- fpu/softfloat-native.h.orig 2005-08-07 14:52:56.000000000 +0200
+++ fpu/softfloat-native.h 2005-08-07 14:53:15.000000000 +0200
@@ -154,8 +154,8 @@
return isunordered(a, b);
}
-char float32_compare( float32, float32 STATUS_PARAM );
-char float32_compare_quiet( float32, float32 STATUS_PARAM );
+signed char float32_compare( float32, float32 STATUS_PARAM );
+signed char float32_compare_quiet( float32, float32 STATUS_PARAM );
char float32_is_signaling_nan( float32 );
INLINE float32 float32_abs(float32 a)
@@ -235,8 +235,8 @@
return isunordered(a, b);
}
-char float64_compare( float64, float64 STATUS_PARAM );
-char float64_compare_quiet( float64, float64 STATUS_PARAM );
+signed char float64_compare( float64, float64 STATUS_PARAM );
+signed char float64_compare_quiet( float64, float64 STATUS_PARAM );
char float64_is_signaling_nan( float64 );
INLINE float64 float64_abs(float64 a)
@@ -316,8 +316,8 @@
return isunordered(a, b);
}
-char floatx80_compare( floatx80, floatx80 STATUS_PARAM );
-char floatx80_compare_quiet( floatx80, floatx80 STATUS_PARAM );
+signed char floatx80_compare( floatx80, floatx80 STATUS_PARAM );
+signed char floatx80_compare_quiet( floatx80, floatx80 STATUS_PARAM );
char floatx80_is_signaling_nan( floatx80 );
INLINE floatx80 floatx80_abs(floatx80 a)
--- fpu/softfloat-native.c.orig 2005-08-07 14:52:13.000000000 +0200
+++ fpu/softfloat-native.c 2005-08-07 14:52:35.000000000 +0200
@@ -129,7 +129,7 @@
{
return sqrtf(a);
}
-char float32_compare( float32 a, float32 b STATUS_PARAM )
+signed char float32_compare( float32 a, float32 b STATUS_PARAM )
{
if (a < b) {
return -1;
@@ -141,7 +141,7 @@
return 2;
}
}
-char float32_compare_quiet( float32 a, float32 b STATUS_PARAM )
+signed char float32_compare_quiet( float32 a, float32 b STATUS_PARAM )
{
if (isless(a, b)) {
return -1;
@@ -233,7 +233,7 @@
{
return sqrt(a);
}
-char float64_compare( float64 a, float64 b STATUS_PARAM )
+signed char float64_compare( float64 a, float64 b STATUS_PARAM )
{
if (a < b) {
return -1;
@@ -245,7 +245,7 @@
return 2;
}
}
-char float64_compare_quiet( float64 a, float64 b STATUS_PARAM )
+signed char float64_compare_quiet( float64 a, float64 b STATUS_PARAM )
{
if (isless(a, b)) {
return -1;
@@ -314,7 +314,7 @@
{
return sqrtl(a);
}
-char floatx80_compare( floatx80 a, floatx80 b STATUS_PARAM )
+signed char floatx80_compare( floatx80 a, floatx80 b STATUS_PARAM )
{
if (a < b) {
return -1;
@@ -326,7 +326,7 @@
return 2;
}
}
-char floatx80_compare_quiet( floatx80 a, floatx80 b STATUS_PARAM )
+signed char floatx80_compare_quiet( floatx80 a, floatx80 b STATUS_PARAM )
{
if (isless(a, b)) {
return -1;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] Default BIOS path for win32
2005-08-07 13:06 [Qemu-devel] [PATCH] Fix broken fp comparison on PPC host Marcus Comstedt
@ 2005-08-10 9:02 ` Kazu
0 siblings, 0 replies; 2+ messages in thread
From: Kazu @ 2005-08-10 9:02 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
Hi,
A default BIOS path isn't set properly for win32 when a slash is used to set
a drive letter. Attached patch is a workaround for it. It's OK when a path
is set manually by -L option.
Regards,
Kazu
[-- Attachment #2: qemu-0.7.1-bios.patch --]
[-- Type: application/octet-stream, Size: 381 bytes --]
--- qemu-0.7.1.orig/configure Mon Jul 25 03:52:08 2005
+++ qemu/configure Tue Aug 2 19:15:34 2005
@@ -356,10 +356,10 @@
if test "$mingw32" = "yes" ; then
if test -z "$prefix" ; then
- prefix="/c/Program Files/Qemu"
+ prefix="c:/Program Files/Qemu"
fi
mandir="$prefix"
-datadir="$prefix"
+datadir="$prefix/bios"
docdir="$prefix"
bindir="$prefix"
else
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-10 9:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-07 13:06 [Qemu-devel] [PATCH] Fix broken fp comparison on PPC host Marcus Comstedt
2005-08-10 9:02 ` [Qemu-devel] Default BIOS path for win32 Kazu
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).