* [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile
@ 2012-03-20 15:24 Juan Quintela
2012-03-20 15:36 ` Peter Maydell
2012-03-20 15:41 ` Andreas Färber
0 siblings, 2 replies; 5+ messages in thread
From: Juan Quintela @ 2012-03-20 15:24 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell
This change makes it compile and return the same value than the #undef one.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
fpu/softfloat.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 81a7d1a..a1f4527 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -2219,7 +2219,7 @@ float32 float32_muladd(float32 a, float32 b, float32 c, int flags STATUS_PARAM)
}
}
/* Zero plus something non-zero : just return the something */
- return c ^ (signflip << 31);
+ return make_float32(float32_val(c) ^ (signflip << 31));
}
if (aExp == 0) {
@@ -3772,7 +3772,7 @@ float64 float64_muladd(float64 a, float64 b, float64 c, int flags STATUS_PARAM)
}
}
/* Zero plus something non-zero : just return the something */
- return c ^ ((uint64_t)signflip << 63);
+ return make_float64(float64_val(c) ^ ((uint64_t)signflip << 63));
}
if (aExp == 0) {
--
1.7.7.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile
2012-03-20 15:24 [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile Juan Quintela
@ 2012-03-20 15:36 ` Peter Maydell
2012-03-20 15:41 ` Andreas Färber
1 sibling, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2012-03-20 15:36 UTC (permalink / raw)
To: Juan Quintela; +Cc: qemu-devel
On 20 March 2012 15:24, Juan Quintela <quintela@redhat.com> wrote:
> This change makes it compile and return the same value than the #undef one.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
Oops, that would have been my fault when I put in the fused multiply
accumulate support.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile
2012-03-20 15:24 [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile Juan Quintela
2012-03-20 15:36 ` Peter Maydell
@ 2012-03-20 15:41 ` Andreas Färber
2012-03-20 15:49 ` Juan Quintela
2012-03-20 16:11 ` Peter Maydell
1 sibling, 2 replies; 5+ messages in thread
From: Andreas Färber @ 2012-03-20 15:41 UTC (permalink / raw)
To: Juan Quintela; +Cc: peter.maydell, qemu-devel
Am 20.03.2012 16:24, schrieb Juan Quintela:
> This change makes it compile and return the same value than the #undef one.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
Cool,
Acked-by: Andreas Färber <afaerber@suse.de>
Tested the default, non-struct version only.
Juan, would it make sense to add a configure option for this #define,
similar to --enable-debug-tcg?
Andreas
> ---
> fpu/softfloat.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index 81a7d1a..a1f4527 100644
> --- a/fpu/softfloat.c
> +++ b/fpu/softfloat.c
> @@ -2219,7 +2219,7 @@ float32 float32_muladd(float32 a, float32 b, float32 c, int flags STATUS_PARAM)
> }
> }
> /* Zero plus something non-zero : just return the something */
> - return c ^ (signflip << 31);
> + return make_float32(float32_val(c) ^ (signflip << 31));
> }
>
> if (aExp == 0) {
> @@ -3772,7 +3772,7 @@ float64 float64_muladd(float64 a, float64 b, float64 c, int flags STATUS_PARAM)
> }
> }
> /* Zero plus something non-zero : just return the something */
> - return c ^ ((uint64_t)signflip << 63);
> + return make_float64(float64_val(c) ^ ((uint64_t)signflip << 63));
> }
>
> if (aExp == 0) {
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile
2012-03-20 15:41 ` Andreas Färber
@ 2012-03-20 15:49 ` Juan Quintela
2012-03-20 16:11 ` Peter Maydell
1 sibling, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2012-03-20 15:49 UTC (permalink / raw)
To: Andreas Färber; +Cc: peter.maydell, qemu-devel
Andreas Färber <afaerber@suse.de> wrote:
> Am 20.03.2012 16:24, schrieb Juan Quintela:
>> This change makes it compile and return the same value than the #undef one.
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>
> Cool,
>
> Acked-by: Andreas Färber <afaerber@suse.de>
>
> Tested the default, non-struct version only.
>
> Juan, would it make sense to add a configure option for this #define,
> similar to --enable-debug-tcg?
It depends of its users, clearly it was not used for quite long. Put in
under --enabled-debug? Notice that I have only used this _once_, so I
am not the best person to decide.
Later, Juan.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile
2012-03-20 15:41 ` Andreas Färber
2012-03-20 15:49 ` Juan Quintela
@ 2012-03-20 16:11 ` Peter Maydell
1 sibling, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2012-03-20 16:11 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel, Juan Quintela
On 20 March 2012 15:41, Andreas Färber <afaerber@suse.de> wrote:
> Tested the default, non-struct version only.
>
> Juan, would it make sense to add a configure option for this #define,
> similar to --enable-debug-tcg?
We'd need to fix some of the other targets:
target-alpha/machine.c:25: error: invalid operands to binary - (have
‘uint64_t (*)[31]’ and ‘struct float64 (*)[31]’)
target-m68k/helper.c:540: error: conflicting types for ‘helper_f64_to_i32’
target-microblaze/op_helper.c:447: error: incompatible types when
assigning to type ‘uint32_t’ from type ‘float32’
target-mips/op_helper.c:2487: error: incompatible type for argument 1
of ‘float64_sqrt’
target-ppc/op_helper.c:1236: error: incompatible types when assigning
to type ‘uint64_t’ from type ‘float64’
gdbstub.c:1177: error: incompatible type for argument 2 of ‘stl_le_p’
target-s390x/op_helper.c:1056: error: incompatible types when
assigning to type ‘uint32_t’ from type ‘float32’
target-unicore32/translate.c:2094: error: aggregate value used where
an integer was expected
(one sample error message only from each; eg mips has tons)
A quick look at gcc object files suggests that we do generate
slightly worse code sometimes (a few extra insns here and there,
esp. for float16). I think we could reasonably turn on this
debug by default if --enable-debug is turned on (the way that
--enable-debug-tcg is turned on by --enable-debug).
I think we should either have this type checking happen when
you use --enable-debug or we should say we flat out don't care
about float32/uint32_t mismatches; the current situation just
means we accumulate errors without noticing.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-20 16:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20 15:24 [Qemu-devel] [PATCH] softfloat: make USE_SOFTFLOAT_STRUCT_TYPES compile Juan Quintela
2012-03-20 15:36 ` Peter Maydell
2012-03-20 15:41 ` Andreas Färber
2012-03-20 15:49 ` Juan Quintela
2012-03-20 16:11 ` Peter Maydell
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).