aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/cpu-float.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-23 19:57:39 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-06 14:31:43 +0200
commit69242e7e7ea55f2a3f4fa50e367cad849c9cdc36 (patch)
tree70b4ad63c8071055e6595a5fbb2a9f171afabd6e /include/qemu/cpu-float.h
parent4e40e89325dc9d70f2f58217d1dea8dd1e9f3ee4 (diff)
downloadqemu-69242e7e7ea55f2a3f4fa50e367cad849c9cdc36.zip
qemu-69242e7e7ea55f2a3f4fa50e367cad849c9cdc36.tar.gz
qemu-69242e7e7ea55f2a3f4fa50e367cad849c9cdc36.tar.bz2
Move CPU softfloat unions to cpu-float.h
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>
Diffstat (limited to 'include/qemu/cpu-float.h')
-rw-r--r--include/qemu/cpu-float.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/qemu/cpu-float.h b/include/qemu/cpu-float.h
new file mode 100644
index 0000000..9110994
--- /dev/null
+++ b/include/qemu/cpu-float.h
@@ -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_ */