Skip to content

Commit

Permalink
target/sparc: Remove CC_OP leftovers
Browse files Browse the repository at this point in the history
All instructions have been converted to generate
full condition codes explicitly.

Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 5, 2023
1 parent 68524e8 commit b597eed
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 178 deletions.
5 changes: 0 additions & 5 deletions linux-user/sparc/cpu_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@ void cpu_loop (CPUSPARCState *env)
cpu_exec_end(cs);
process_queued_cpu_work(cs);

/* Compute PSR before exposing state. */
if (env->cc_op != CC_OP_FLAGS) {
cpu_get_psr(env);
}

switch (trapnr) {
case TARGET_TT_SYSCALL:
ret = do_syscall (env, env->gregs[1],
Expand Down
42 changes: 0 additions & 42 deletions target/sparc/cc_helper.c

This file was deleted.

1 change: 0 additions & 1 deletion target/sparc/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ static void sparc_cpu_reset_hold(Object *obj)
env->wim = 1;
#endif
env->regwptr = env->regbase + (env->cwp * 16);
CC_OP = CC_OP_FLAGS;
#if defined(CONFIG_USER_ONLY)
#ifdef TARGET_SPARC64
env->cleanwin = env->nwindows - 2;
Expand Down
21 changes: 0 additions & 21 deletions target/sparc/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,6 @@ enum {
#define PSR_CWP 0x1f
#endif

#define CC_SRC (env->cc_src)
#define CC_SRC2 (env->cc_src2)
#define CC_DST (env->cc_dst)
#define CC_OP (env->cc_op)

/* Even though lazy evaluation of CPU condition codes tends to be less
* important on RISC systems where condition codes are only updated
* when explicitly requested, SPARC uses it to update 32-bit and 64-bit
* condition codes.
*/
enum {
CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */
CC_OP_FLAGS, /* all cc are back in cc_*_[NZCV] registers */
CC_OP_NB,
};

/* Trap base register */
#define TBR_BASE_MASK 0xfffff000

Expand Down Expand Up @@ -474,11 +458,6 @@ struct CPUArchState {
target_ulong xcc_C;
#endif

/* emulator internal flags handling */
target_ulong cc_src, cc_src2;
target_ulong cc_dst;
uint32_t cc_op;

target_ulong cond; /* conditional branch result (XXX: save it in a
temporary register when possible) */

Expand Down
2 changes: 0 additions & 2 deletions target/sparc/helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,3 @@ VIS_CMPHELPER(cmpne)
#undef F_HELPER_0_1
#undef VIS_HELPER
#undef VIS_CMPHELPER
DEF_HELPER_1(compute_psr, void, env)
DEF_HELPER_FLAGS_1(compute_C_icc, TCG_CALL_NO_WG_SE, i32, env)
5 changes: 0 additions & 5 deletions target/sparc/int32_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ void sparc_cpu_do_interrupt(CPUState *cs)
CPUSPARCState *env = &cpu->env;
int cwp, intno = cs->exception_index;

/* Compute PSR before exposing state. */
if (env->cc_op != CC_OP_FLAGS) {
cpu_get_psr(env);
}

if (qemu_loglevel_mask(CPU_LOG_INT)) {
static int count;
const char *name;
Expand Down
5 changes: 0 additions & 5 deletions target/sparc/int64_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ void sparc_cpu_do_interrupt(CPUState *cs)
int intno = cs->exception_index;
trap_state *tsptr;

/* Compute PSR before exposing state. */
if (env->cc_op != CC_OP_FLAGS) {
cpu_get_psr(env);
}

#ifdef DEBUG_PCALL
if (qemu_loglevel_mask(CPU_LOG_INT)) {
static int count;
Expand Down
1 change: 0 additions & 1 deletion target/sparc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ gen = decodetree.process('insns.decode')
sparc_ss = ss.source_set()
sparc_ss.add(gen)
sparc_ss.add(files(
'cc_helper.c',
'cpu.c',
'fop_helper.c',
'gdbstub.c',
Expand Down

0 comments on commit b597eed

Please sign in to comment.