diff options
author | Richard Henderson <rth@twiddle.net> | 2016-12-15 13:37:23 -0800 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-01-23 09:52:40 -0800 |
commit | b2167459ae46bcaa07a84fc7e9df1743000be81f (patch) | |
tree | 5b39c233c0bc38a0ece655e11e61611d715ded56 /target/hppa/op_helper.c | |
parent | 129e9cc3a1792b66bd189838d58f7a2944602a82 (diff) |
target-hppa: Implement basic arithmetic
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target/hppa/op_helper.c')
-rw-r--r-- | target/hppa/op_helper.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 4dd0119424..f36ce74163 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -31,6 +31,29 @@ void QEMU_NORETURN HELPER(excp)(CPUHPPAState *env, int excp) cpu_loop_exit(cs); } +static void QEMU_NORETURN dynexcp(CPUHPPAState *env, int excp, uintptr_t ra) +{ + HPPACPU *cpu = hppa_env_get_cpu(env); + CPUState *cs = CPU(cpu); + + cs->exception_index = excp; + cpu_loop_exit_restore(cs, ra); +} + +void HELPER(tsv)(CPUHPPAState *env, target_ulong cond) +{ + if (unlikely((target_long)cond < 0)) { + dynexcp(env, EXCP_SIGFPE, GETPC()); + } +} + +void HELPER(tcond)(CPUHPPAState *env, target_ulong cond) +{ + if (unlikely(cond)) { + dynexcp(env, EXCP_SIGFPE, GETPC()); + } +} + void HELPER(loaded_fr0)(CPUHPPAState *env) { uint32_t shadow = env->fr[0] >> 32; |