Move CPU softfloat unions to cpu-float.h
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 23 Mar 2022 15:57:39 +0000 (19:57 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 6 Apr 2022 12:31:43 +0000 (14:31 +0200)
The types are no longer used in bswap.h since commit
f930224fffe ("bswap.h: Remove unused float-access functions"), there
isn't much sense in keeping it there and having a dependency on fpu/.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220323155743.1585078-29-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
18 files changed:
include/qemu/bswap.h
include/qemu/cpu-float.h [new file with mode: 0644]
migration/vmstate-types.c
target/alpha/cpu.h
target/arm/cpu.h
target/hppa/cpu.h
target/i386/cpu.h
target/m68k/cpu.h
target/microblaze/cpu.h
target/openrisc/cpu.h
target/ppc/cpu.h
target/riscv/cpu.h
target/rx/cpu.h
target/s390x/cpu.h
target/sh4/cpu.h
target/sparc/cpu.h
target/tricore/cpu.h
target/xtensa/cpu.h

index 9dff7c7dbbc956c3ecdcb33acba2d9d1321b2b5c..346d05f2aab3fd53f3ee7d7a8d21215d88e651e3 100644 (file)
@@ -19,8 +19,6 @@
 extern "C" {
 #endif
 
-#include "fpu/softfloat-types.h"
-
 #ifdef BSWAP_FROM_BYTESWAP
 static inline uint16_t bswap16(uint16_t x)
 {
@@ -202,64 +200,6 @@ CPU_CONVERT(le, 64, uint64_t)
 # define const_le16(_x) (_x)
 #endif
 
-/* Unions for reinterpreting between floats and integers.  */
-
-typedef union {
-    float32 f;
-    uint32_t l;
-} CPU_FloatU;
-
-typedef union {
-    float64 d;
-#if HOST_BIG_ENDIAN
-    struct {
-        uint32_t upper;
-        uint32_t lower;
-    } l;
-#else
-    struct {
-        uint32_t lower;
-        uint32_t upper;
-    } l;
-#endif
-    uint64_t ll;
-} CPU_DoubleU;
-
-typedef union {
-     floatx80 d;
-     struct {
-         uint64_t lower;
-         uint16_t upper;
-     } l;
-} CPU_LDoubleU;
-
-typedef union {
-    float128 q;
-#if HOST_BIG_ENDIAN
-    struct {
-        uint32_t upmost;
-        uint32_t upper;
-        uint32_t lower;
-        uint32_t lowest;
-    } l;
-    struct {
-        uint64_t upper;
-        uint64_t lower;
-    } ll;
-#else
-    struct {
-        uint32_t lowest;
-        uint32_t lower;
-        uint32_t upper;
-        uint32_t upmost;
-    } l;
-    struct {
-        uint64_t lower;
-        uint64_t upper;
-    } ll;
-#endif
-} CPU_QuadU;
-
 /* unaligned/endian-independent pointer access */
 
 /*
diff --git a/include/qemu/cpu-float.h b/include/qemu/cpu-float.h
new file mode 100644 (file)
index 0000000..9110994
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef QEMU_CPU_FLOAT_H_
+#define QEMU_CPU_FLOAT_H_
+
+#include "fpu/softfloat-types.h"
+
+/* Unions for reinterpreting between floats and integers.  */
+
+typedef union {
+    float32 f;
+    uint32_t l;
+} CPU_FloatU;
+
+typedef union {
+    float64 d;
+#if HOST_BIG_ENDIAN
+    struct {
+        uint32_t upper;
+        uint32_t lower;
+    } l;
+#else
+    struct {
+        uint32_t lower;
+        uint32_t upper;
+    } l;
+#endif
+    uint64_t ll;
+} CPU_DoubleU;
+
+typedef union {
+     floatx80 d;
+     struct {
+         uint64_t lower;
+         uint16_t upper;
+     } l;
+} CPU_LDoubleU;
+
+typedef union {
+    float128 q;
+#if HOST_BIG_ENDIAN
+    struct {
+        uint32_t upmost;
+        uint32_t upper;
+        uint32_t lower;
+        uint32_t lowest;
+    } l;
+    struct {
+        uint64_t upper;
+        uint64_t lower;
+    } ll;
+#else
+    struct {
+        uint32_t lowest;
+        uint32_t lower;
+        uint32_t upper;
+        uint32_t upmost;
+    } l;
+    struct {
+        uint64_t lower;
+        uint64_t upper;
+    } ll;
+#endif
+} CPU_QuadU;
+
+#endif /* QEMU_CPU_FLOAT_H_ */
index bf4d440308eadaa68226209e38543e3644d76d3a..e83bfccb9ecfc6dd5b662661b720336c3d8a1b6f 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/cpu-float.h"
 #include "qemu-file.h"
 #include "migration.h"
 #include "migration/vmstate.h"
index 58f00b7814fd7fb63725b1db24c07a9e6fa2480c..994a018b910dc3e27023d807202e958d1023e328 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 
 /* Alpha processors have a weak memory model */
 #define TCG_GUEST_DEFAULT_MO      (0)
index ccf635ac5cbc92705068652fc847674560be3681..cb5359a7470254e36179b6fa1f27ec9a5bc6f46c 100644 (file)
@@ -21,6 +21,7 @@
 #define ARM_CPU_H
 
 #include "kvm-consts.h"
+#include "qemu/cpu-float.h"
 #include "hw/registerfields.h"
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
index 4cc936b6bfda3b8179b24f3988de629f50a0ea59..c43b93a68f140577ff0f14305b1f4ca120244bba 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 
 /* PA-RISC 1.x processors have a strong memory model.  */
 /* ??? While we do not yet implement PA-RISC 2.0, those processors have
index ccf627d2c53b1687db324ff3d24a5115bc1361d5..8422f6c18e7a2396def4fac6e884cf5db75c61df 100644 (file)
@@ -25,6 +25,7 @@
 #include "kvm/hyperv-proto.h"
 #include "exec/cpu-defs.h"
 #include "qapi/qapi-types-common.h"
+#include "qemu/cpu-float.h"
 
 /* The x86 has a strong memory model with some store-after-load re-ordering */
 #define TCG_GUEST_DEFAULT_MO      (TCG_MO_ALL & ~TCG_MO_ST_LD)
index 872e8ce6375823a3b5a25257a903521a8ba32479..9b3bf7a44819ce5d9f326d746941f786157d94c0 100644 (file)
@@ -22,6 +22,7 @@
 #define M68K_CPU_H
 
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 #include "cpu-qom.h"
 
 #define OS_BYTE     0
index 0a0ce71b6a5c8c186ac9d66ad65d44431b11d2e5..67aa88b8db5baea8466a93529f5467b0ce636109 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
-#include "fpu/softfloat-types.h"
+#include "qemu/cpu-float.h"
 
 typedef struct CPUArchState CPUMBState;
 #if !defined(CONFIG_USER_ONLY)
index bdf29d2dc4c357d6e04b938d0fd8f3c63f158893..b9584f10d452cd77c369c58a1287c8b7e43d0be6 100644 (file)
@@ -21,6 +21,7 @@
 #define OPENRISC_CPU_H
 
 #include "exec/cpu-defs.h"
+#include "fpu/softfloat-types.h"
 #include "hw/core/cpu.h"
 #include "qom/object.h"
 
index 627e574127ba8a86e6f0f8279750096ab6c3ba7a..473436a49eb5169221d9d67793dcfb4b59a7fc1a 100644 (file)
@@ -21,6 +21,7 @@
 #define PPC_CPU_H
 
 #include "qemu/int128.h"
+#include "qemu/cpu-float.h"
 #include "exec/cpu-defs.h"
 #include "cpu-qom.h"
 #include "qom/object.h"
index c069fe85fa1be3c5871a6a17390a7ab43f7b030e..e1d976bdef06c2ab496d17b9323a770833169972 100644 (file)
@@ -23,7 +23,7 @@
 #include "hw/core/cpu.h"
 #include "hw/registerfields.h"
 #include "exec/cpu-defs.h"
-#include "fpu/softfloat-types.h"
+#include "qemu/cpu-float.h"
 #include "qom/object.h"
 #include "qemu/int128.h"
 #include "cpu_bits.h"
index b4abd90ccd1eab827a2ee086b95914a3a9962a59..1c267f83bfd2f31ce88307ad7f5a5f3529ed83d0 100644 (file)
@@ -24,6 +24,7 @@
 #include "cpu-qom.h"
 
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 
 /* PSW define */
 REG32(PSW, 0)
index c49c8466e74d6721cd904473b8be3a32c55bf94e..7d6d01325b2dfa9dd4b216c3d5283dc5a5c4c424 100644 (file)
@@ -28,6 +28,7 @@
 #include "cpu-qom.h"
 #include "cpu_models.h"
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 
 #define ELF_MACHINE_UNAME "S390X"
 
index c72a30edfd413b0ef5d074e56c1a76a4ab39598c..14d490ac4705ae9e193007c98ec48f4ccc056e82 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 
 /* CPU Subtypes */
 #define SH_CPU_SH7750  (1 << 0)
index abb38db6749dee5c5eba1a5ff6ba618923def2b8..dd9e2f5cdb6a4f41d8a2a76c7f9d3ad62b3881fa 100644 (file)
@@ -4,6 +4,7 @@
 #include "qemu/bswap.h"
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 
 #if !defined(TARGET_SPARC64)
 #define TARGET_DPREGS 16
index 108d6b8288fb2aac9fbec036072feed733a8c5b9..3b9c533a7c3b10756b6ad3608110a3340b006666 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "cpu-qom.h"
 #include "exec/cpu-defs.h"
+#include "qemu/cpu-float.h"
 #include "tricore-defs.h"
 
 struct tricore_boot_info;
index f10cfabdc35c45402d8b53713886b9a06cee7b4f..71142ea8f453e7d2fd9e1fb89230a74a2d153da9 100644 (file)
@@ -29,6 +29,7 @@
 #define XTENSA_CPU_H
 
 #include "cpu-qom.h"
+#include "qemu/cpu-float.h"
 #include "exec/cpu-defs.h"
 #include "xtensa-isa.h"