From 622302901065ebcb21201310d34b22d107fe851e Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 23 Dec 2014 22:11:17 +0000 Subject: target-sparc: Remove unused gen_op_subi_cc and gen_op_addi_cc The functions gen_op_addi_cc() and gen_op_subi_cc() are unused; remove them. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- target-sparc/translate.c | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'target-sparc') diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 25d1bd6988..834b50f18a 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -363,14 +363,6 @@ static inline void gen_mov_reg_C(TCGv reg, TCGv_i32 src) tcg_gen_andi_tl(reg, reg, 0x1); } -static inline void gen_op_addi_cc(TCGv dst, TCGv src1, target_long src2) -{ - tcg_gen_mov_tl(cpu_cc_src, src1); - tcg_gen_movi_tl(cpu_cc_src2, src2); - tcg_gen_addi_tl(cpu_cc_dst, cpu_cc_src, src2); - tcg_gen_mov_tl(dst, cpu_cc_dst); -} - static inline void gen_op_add_cc(TCGv dst, TCGv src1, TCGv src2) { tcg_gen_mov_tl(cpu_cc_src, src1); @@ -502,22 +494,6 @@ static void gen_op_addx_int(DisasContext *dc, TCGv dst, TCGv src1, } } -static inline void gen_op_subi_cc(TCGv dst, TCGv src1, target_long src2, DisasContext *dc) -{ - tcg_gen_mov_tl(cpu_cc_src, src1); - tcg_gen_movi_tl(cpu_cc_src2, src2); - if (src2 == 0) { - tcg_gen_mov_tl(cpu_cc_dst, src1); - tcg_gen_movi_i32(cpu_cc_op, CC_OP_LOGIC); - dc->cc_op = CC_OP_LOGIC; - } else { - tcg_gen_subi_tl(cpu_cc_dst, cpu_cc_src, src2); - tcg_gen_movi_i32(cpu_cc_op, CC_OP_SUB); - dc->cc_op = CC_OP_SUB; - } - tcg_gen_mov_tl(dst, cpu_cc_dst); -} - static inline void gen_op_sub_cc(TCGv dst, TCGv src1, TCGv src2) { tcg_gen_mov_tl(cpu_cc_src, src1); -- cgit 1.4.1 From e60538c79fc7285e72f5b431281986737db1607b Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 23 Dec 2014 22:11:18 +0000 Subject: target-sparc: address_mask(), asi_address_mask() are TARGET_SPARC64 only The address_mask() and asi_address_mask() functions are only used in TARGET_SPARC64 configs, so guard with ifdefs to avoid warnings about unused functions in 32-bit builds. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- target-sparc/ldst_helper.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'target-sparc') diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index e62228c998..cdc21d3325 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -250,6 +250,7 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb, #endif +#if defined(TARGET_SPARC64) || defined(CONFIG_USER_ONLY) static inline target_ulong address_mask(CPUSPARCState *env1, target_ulong addr) { #ifdef TARGET_SPARC64 @@ -259,6 +260,7 @@ static inline target_ulong address_mask(CPUSPARCState *env1, target_ulong addr) #endif return addr; } +#endif /* returns true if access using this ASI is to have address translated by MMU otherwise access is to raw physical address */ @@ -287,6 +289,7 @@ static inline int is_translating_asi(int asi) #endif } +#ifdef TARGET_SPARC64 static inline target_ulong asi_address_mask(CPUSPARCState *env, int asi, target_ulong addr) { @@ -296,6 +299,7 @@ static inline target_ulong asi_address_mask(CPUSPARCState *env, return addr; } } +#endif void helper_check_align(CPUSPARCState *env, target_ulong addr, uint32_t align) { -- cgit 1.4.1 From 69694625e86aebb135b56c4aaafefd5c1d17bb3c Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 23 Dec 2014 22:11:19 +0000 Subject: target-sparc: is_translating_asi() is TARGET_SPARC64 only Move the is_translating_asi() inside the TARGET_SPARC64 ifdef (and remove the unimplemented 32-bit codepath), as it is only called from TARGET_SPARC64 code. This fixes a clang 3.4 unused-function warning. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Mark Cave-Ayland --- target-sparc/ldst_helper.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'target-sparc') diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index cdc21d3325..c7ad47d35c 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -262,11 +262,12 @@ static inline target_ulong address_mask(CPUSPARCState *env1, target_ulong addr) } #endif +#ifdef TARGET_SPARC64 /* returns true if access using this ASI is to have address translated by MMU otherwise access is to raw physical address */ +/* TODO: check sparc32 bits */ static inline int is_translating_asi(int asi) { -#ifdef TARGET_SPARC64 /* Ultrasparc IIi translating asi - note this list is defined by cpu implementation */ @@ -283,13 +284,8 @@ static inline int is_translating_asi(int asi) default: return 0; } -#else - /* TODO: check sparc32 bits */ - return 0; -#endif } -#ifdef TARGET_SPARC64 static inline target_ulong asi_address_mask(CPUSPARCState *env, int asi, target_ulong addr) { -- cgit 1.4.1 From a2035e83fd60e5b66644d321816ed634b908b4ee Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 23 Dec 2014 22:11:20 +0000 Subject: target-sparc: Mark gen_load_trap_state_at_tl() as !CONFIG_USER_ONLY The function gen_load_trap_state_at_tl() is only used in the softmmu configs; wrap it in #ifndef CONFIG_USER_ONLY to avoid clang compiler warnings in linux-user builds. Signed-off-by: Peter Maydell Signed-off-by: Mark Cave-Ayland --- target-sparc/translate.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'target-sparc') diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 834b50f18a..68527d595f 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -2300,6 +2300,7 @@ static void gen_fmovq(DisasContext *dc, DisasCompare *cmp, int rd, int rs) gen_update_fprs_dirty(qd); } +#ifndef CONFIG_USER_ONLY static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env) { TCGv_i32 r_tl = tcg_temp_new_i32(); @@ -2324,6 +2325,7 @@ static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_ptr cpu_env) tcg_temp_free_i32(r_tl); } +#endif static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, int width, bool cc, bool left) -- cgit 1.4.1