CPU_DoubleU and soft-float
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
@@ -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;
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_DoubleUis 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.42cpu-all.hcpu-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
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