Skip to contentSkip to conversation

CPU_DoubleU and soft-float

PATCH In review Paul Brook 2 participants 3 messages Mar 26, 2005 – Apr 7, 2005

lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 CPU_DoubleU and soft-float

The definition of CPU_DoubleU is incorrect on arm hosts when using soft-float. In this case "float64" will have host integer word ordering, not host hardware float ordering.

Paul

Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.42

cpu-all.h 26 Mar 2005 20:48:25 -0000 renamed from cpu-all.h 13 Mar 2005 18:50:23 -0000 1.42 +2 -1
diff -u -p -r1.42 cpu-all.h
@@ -120,7 +120,8 @@ static inline void tswap64s(uint64_t *s)
    endian ! */
 typedef union {
     float64 d;
-#if defined(WORDS_BIGENDIAN) || (defined(__arm__) && !defined(__VFP_FP__))
+#if defined(WORDS_BIGENDIAN) \
+    || (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT))
     struct {
         uint32_t upper;
         uint32_t lower;
#1 lore raw

OK for the patch.

It would be better to force the use of soft float on ARM if the VFP is not present. Supporting weird ordering for doubles is a source of problems and soft float may be faster than the kernel based ARM fpu emulator anyway.

Fabrice.

Quoted 31 lines · Paul Brook

The definition of CPU_DoubleU is incorrect on arm hosts when using soft-float. In this case "float64" will have host integer word ordering, not host hardware float ordering.

Paul

Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.42
diff -u -p -r1.42 cpu-all.h

cpu-all.h 26 Mar 2005 20:48:25 -0000 renamed from cpu-all.h 13 Mar 2005 18:50:23 -0000 1.42 +2 -1
@@ -120,7 +120,8 @@ static inline void tswap64s(uint64_t *s)
    endian ! */
 typedef union {
     float64 d;
-#if defined(WORDS_BIGENDIAN) || (defined(__arm__) && !defined(__VFP_FP__))
+#if defined(WORDS_BIGENDIAN) \
+    || (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT))
     struct {
         uint32_t upper;
         uint32_t lower;

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

author
#2 lore raw
Quoted 6 lines · Fabrice Bellard

OK for the patch.

It would be better to force the use of soft float on ARM if the VFP is not present. Supporting weird ordering for doubles is a source of problems and soft float may be faster than the kernel based ARM fpu emulator anyway.

Yes, however arm targets are the only ones that will currently build soft-float. The other targets still contain native floating point code.

Paul