diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2015-05-25 01:28:56 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2015-06-12 12:02:48 +0200 |
commit | 34086945254c035a03e01e472d99e4524a2f2416 (patch) | |
tree | c90566470a7c76d82670f80ef05111dc8b075304 /target-sh4/cpu.h | |
parent | 5ed9a259c164bb9fd2a6fe8a363a4bda2e4a5461 (diff) | |
download | qemu-34086945254c035a03e01e472d99e4524a2f2416.tar.gz qemu-34086945254c035a03e01e472d99e4524a2f2416.tar.bz2 qemu-34086945254c035a03e01e472d99e4524a2f2416.zip |
target-sh4: Split out T from SR
In preparation for more efficient setting of this field.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-sh4/cpu.h')
-rw-r--r-- | target-sh4/cpu.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index 76fda350ef..a308c535ca 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -138,7 +138,8 @@ typedef struct CPUSH4State { uint32_t flags; /* general execution flags */ uint32_t gregs[24]; /* general registers */ float32 fregs[32]; /* floating point registers */ - uint32_t sr; /* status register */ + uint32_t sr; /* status register (with T split out) */ + uint32_t sr_t; /* T bit of status register */ uint32_t ssr; /* saved status register */ uint32_t spc; /* saved program counter */ uint32_t gbr; /* global base register */ @@ -331,6 +332,17 @@ static inline int cpu_ptel_pr (uint32_t ptel) #define TB_FLAG_PENDING_MOVCA (1 << 4) +static inline target_ulong cpu_read_sr(CPUSH4State *env) +{ + return env->sr | (env->sr_t << SR_T); +} + +static inline void cpu_write_sr(CPUSH4State *env, target_ulong sr) +{ + env->sr_t = sr & (1u << SR_T); + env->sr = sr & ~(1u << SR_T); +} + static inline void cpu_get_tb_cpu_state(CPUSH4State *env, target_ulong *pc, target_ulong *cs_base, int *flags) { |