From 355392329e4a843580e53cb027ed85e0cbebb640 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 20 Jan 2015 15:19:34 +0000 Subject: cpu_ldst_template.h: Use ld*_p directly rather than via ld*_raw macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ld*_raw and st*_raw macros are now only used within the code produced by cpu_ldst_template.h, and only in three places. Expand these out to just call the ld_p and st_p functions directly. Note that in all the callsites the address argument is a uintptr_t, so we can drop that part of the double-cast used in the saddr() and laddr() macros. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée Message-id: 1421334118-3287-13-git-send-email-peter.maydell@linaro.org --- include/exec/cpu_ldst_template.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/exec/cpu_ldst_template.h') diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index 006093ac49..3b5360598d 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -79,7 +79,7 @@ glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) res = glue(glue(helper_ld, SUFFIX), MMUSUFFIX)(env, addr, mmu_idx); } else { uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend; - res = glue(glue(ld, USUFFIX), _raw)(hostaddr); + res = glue(glue(ld, USUFFIX), _p)((uint8_t *)hostaddr); } return res; } @@ -101,7 +101,7 @@ glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) MMUSUFFIX)(env, addr, mmu_idx); } else { uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend; - res = glue(glue(lds, SUFFIX), _raw)(hostaddr); + res = glue(glue(lds, SUFFIX), _p)((uint8_t *)hostaddr); } return res; } @@ -127,7 +127,7 @@ glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr, glue(glue(helper_st, SUFFIX), MMUSUFFIX)(env, addr, v, mmu_idx); } else { uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend; - glue(glue(st, SUFFIX), _raw)(hostaddr, v); + glue(glue(st, SUFFIX), _p)((uint8_t *)hostaddr, v); } } -- cgit v1.2.3 From 82f11917c99e3c7fa3d6aa98572ecc98c7324c2f Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 20 Jan 2015 15:19:34 +0000 Subject: cpu_ldst_template.h: Drop unused cpu_ldfq/stfq/ldfl/stfl accessors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cpu_ldfq/stfq/ldfl/stfl accessors for loading and storing float32 and float64 are completely unused, so delete them. (The union they use for converting from the float32/float64 type to uint32_t or uint64_t is the wrong way to do it anyway: they should be using make_float* and float*_val.) Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée Message-id: 1421334118-3287-15-git-send-email-peter.maydell@linaro.org --- include/exec/cpu_ldst_template.h | 54 +--------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'include/exec/cpu_ldst_template.h') diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index 3b5360598d..95ab7504e2 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -4,9 +4,7 @@ * Generate inline load/store functions for one MMU mode and data * size. * - * Generate a store function as well as signed and unsigned loads. For - * 32 and 64 bit cases, also generate floating point functions with - * the same size. + * Generate a store function as well as signed and unsigned loads. * * Not used directly but included from cpu_ldst.h. * @@ -131,56 +129,6 @@ glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr, } } - - -#if DATA_SIZE == 8 -static inline float64 glue(cpu_ldfq, MEMSUFFIX)(CPUArchState *env, - target_ulong ptr) -{ - union { - float64 d; - uint64_t i; - } u; - u.i = glue(cpu_ldq, MEMSUFFIX)(env, ptr); - return u.d; -} - -static inline void glue(cpu_stfq, MEMSUFFIX)(CPUArchState *env, - target_ulong ptr, float64 v) -{ - union { - float64 d; - uint64_t i; - } u; - u.d = v; - glue(cpu_stq, MEMSUFFIX)(env, ptr, u.i); -} -#endif /* DATA_SIZE == 8 */ - -#if DATA_SIZE == 4 -static inline float32 glue(cpu_ldfl, MEMSUFFIX)(CPUArchState *env, - target_ulong ptr) -{ - union { - float32 f; - uint32_t i; - } u; - u.i = glue(cpu_ldl, MEMSUFFIX)(env, ptr); - return u.f; -} - -static inline void glue(cpu_stfl, MEMSUFFIX)(CPUArchState *env, - target_ulong ptr, float32 v) -{ - union { - float32 f; - uint32_t i; - } u; - u.f = v; - glue(cpu_stl, MEMSUFFIX)(env, ptr, u.i); -} -#endif /* DATA_SIZE == 4 */ - #endif /* !SOFTMMU_CODE_ACCESS */ #undef RES_TYPE -- cgit v1.2.3