From ab07f048d8ac8c598abd33f695d14affbd063fa6 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 4 Mar 2021 18:36:58 -0500 Subject: [PATCH] bswap.h: Remove unused float-access functions The float-access functions stfl_*, stfq*, ldfl* and ldfq* are now unused; remove them. (Accesses to float64 and float32 types can be made with the ldl/stl/ldq/stq functions, as float64 and float32 are guaranteed to be typedefs for normal integer types.) Backports f930224fffead81e23e699517d1351e33890b6f7 --- qemu/include/exec/cpu-all.h | 8 ----- qemu/include/qemu/bswap.h | 60 ------------------------------------- 2 files changed, 68 deletions(-) diff --git a/qemu/include/exec/cpu-all.h b/qemu/include/exec/cpu-all.h index 59d91842..82aa6f19 100644 --- a/qemu/include/exec/cpu-all.h +++ b/qemu/include/exec/cpu-all.h @@ -126,13 +126,9 @@ static inline void tswap64s(uint64_t *s) #define ldsw_p(p) ldsw_be_p(p) #define ldl_p(p) ldl_be_p(p) #define ldq_p(p) ldq_be_p(p) -#define ldfl_p(p) ldfl_be_p(p) -#define ldfq_p(p) ldfq_be_p(p) #define stw_p(p, v) stw_be_p(p, v) #define stl_p(p, v) stl_be_p(p, v) #define stq_p(p, v) stq_be_p(p, v) -#define stfl_p(p, v) stfl_be_p(p, v) -#define stfq_p(p, v) stfq_be_p(p, v) #define ldn_p(p, sz) ldn_be_p(p, sz) #define stn_p(p, sz, v) stn_be_p(p, sz, v) #else @@ -140,13 +136,9 @@ static inline void tswap64s(uint64_t *s) #define ldsw_p(p) ldsw_le_p(p) #define ldl_p(p) ldl_le_p(p) #define ldq_p(p) ldq_le_p(p) -#define ldfl_p(p) ldfl_le_p(p) -#define ldfq_p(p) ldfq_le_p(p) #define stw_p(p, v) stw_le_p(p, v) #define stl_p(p, v) stl_le_p(p, v) #define stq_p(p, v) stq_le_p(p, v) -#define stfl_p(p, v) stfl_le_p(p, v) -#define stfq_p(p, v) stfq_le_p(p, v) #define ldn_p(p, sz) ldn_le_p(p, sz) #define stn_p(p, sz, v) stn_le_p(p, sz, v) #endif diff --git a/qemu/include/qemu/bswap.h b/qemu/include/qemu/bswap.h index 52cdef93..16194ef1 100644 --- a/qemu/include/qemu/bswap.h +++ b/qemu/include/qemu/bswap.h @@ -390,36 +390,6 @@ static inline void stq_le_p(void *ptr, uint64_t v) stq_he_p(ptr, le_bswap(v, 64)); } -/* float access */ - -static inline float32 ldfl_le_p(const void *ptr) -{ - CPU_FloatU u; - u.l = ldl_le_p(ptr); - return u.f; -} - -static inline void stfl_le_p(void *ptr, float32 v) -{ - CPU_FloatU u; - u.f = v; - stl_le_p(ptr, u.l); -} - -static inline float64 ldfq_le_p(const void *ptr) -{ - CPU_DoubleU u; - u.ll = ldq_le_p(ptr); - return u.d; -} - -static inline void stfq_le_p(void *ptr, float64 v) -{ - CPU_DoubleU u; - u.d = v; - stq_le_p(ptr, u.ll); -} - static inline int lduw_be_p(const void *ptr) { return (uint16_t)be_bswap(lduw_he_p(ptr), 16); @@ -455,36 +425,6 @@ static inline void stq_be_p(void *ptr, uint64_t v) stq_he_p(ptr, be_bswap(v, 64)); } -/* float access */ - -static inline float32 ldfl_be_p(const void *ptr) -{ - CPU_FloatU u; - u.l = ldl_be_p(ptr); - return u.f; -} - -static inline void stfl_be_p(void *ptr, float32 v) -{ - CPU_FloatU u; - u.f = v; - stl_be_p(ptr, u.l); -} - -static inline float64 ldfq_be_p(const void *ptr) -{ - CPU_DoubleU u; - u.ll = ldq_be_p(ptr); - return u.d; -} - -static inline void stfq_be_p(void *ptr, float64 v) -{ - CPU_DoubleU u; - u.d = v; - stq_be_p(ptr, u.ll); -} - static inline unsigned long leul_to_cpu(unsigned long v) { #if HOST_LONG_BITS == 32