aboutsummaryrefslogtreecommitdiff
path: root/softmmu_header.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-01-04 23:56:24 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-01-04 23:56:24 +0000
commit2d603d2216444a0654223fd80f51300f36e52076 (patch)
tree840bf44b9923e2e620b5fdd8676dce28a8ad7b6c /softmmu_header.h
parent61190b14fc96d4e19c9bdde25643be4c5eb90e62 (diff)
PowerPC support - float macros
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@537 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'softmmu_header.h')
-rw-r--r--softmmu_header.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/softmmu_header.h b/softmmu_header.h
index b8077ef43b..0bbc3681cc 100644
--- a/softmmu_header.h
+++ b/softmmu_header.h
@@ -51,12 +51,20 @@
#elif ACCESS_TYPE == 2
+#ifdef TARGET_I386
#define CPU_MEM_INDEX ((env->hflags & HF_CPL_MASK) == 3)
+#elif defined (TARGET_PPC)
+#define CPU_MEM_INDEX (msr_pr)
+#endif
#define MMUSUFFIX _mmu
#elif ACCESS_TYPE == 3
+#ifdef TARGET_I386
#define CPU_MEM_INDEX ((env->hflags & HF_CPL_MASK) == 3)
+#elif defined (TARGET_PPC)
+#define CPU_MEM_INDEX (msr_pr)
+#endif
#define MMUSUFFIX _cmmu
#else
@@ -283,6 +291,50 @@ static inline void glue(glue(st, SUFFIX), MEMSUFFIX)(void *ptr, RES_TYPE v)
#endif
+#if DATA_SIZE == 8
+static inline double glue(ldfq, MEMSUFFIX)(void *ptr)
+{
+ union {
+ double d;
+ uint64_t i;
+ } u;
+ u.i = glue(ldq, MEMSUFFIX)(ptr);
+ return u.d;
+}
+
+static inline void glue(stfq, MEMSUFFIX)(void *ptr, double v)
+{
+ union {
+ double d;
+ uint64_t i;
+ } u;
+ u.d = v;
+ glue(stq, MEMSUFFIX)(ptr, u.i);
+}
+#endif /* DATA_SIZE == 8 */
+
+#if DATA_SIZE == 4
+static inline float glue(ldfl, MEMSUFFIX)(void *ptr)
+{
+ union {
+ float f;
+ uint32_t i;
+ } u;
+ u.i = glue(ldl, MEMSUFFIX)(ptr);
+ return u.f;
+}
+
+static inline void glue(stfl, MEMSUFFIX)(void *ptr, float v)
+{
+ union {
+ float f;
+ uint32_t i;
+ } u;
+ u.f = v;
+ glue(stl, MEMSUFFIX)(ptr, u.i);
+}
+#endif /* DATA_SIZE == 4 */
+
#undef RES_TYPE
#undef DATA_TYPE
#undef DATA_STYPE