mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
target/openrisc: Streamline arithmetic and OVE
Fix incorrect overflow calculation. Move overflow exception check to a helper function, to eliminate inline branches. Remove some incorrect special casing of R0. Implement multiply inline. Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
6da544a6c4
commit
9ecaa27e71
5 changed files with 191 additions and 314 deletions
|
@ -20,6 +20,7 @@
|
|||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exception.h"
|
||||
|
||||
void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp)
|
||||
|
@ -28,3 +29,14 @@ void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp)
|
|||
|
||||
raise_exception(cpu, excp);
|
||||
}
|
||||
|
||||
void HELPER(ove)(CPUOpenRISCState *env, target_ulong test)
|
||||
{
|
||||
if (unlikely(test) && (env->sr & SR_OVE)) {
|
||||
OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
|
||||
CPUState *cs = CPU(cpu);
|
||||
|
||||
cs->exception_index = EXCP_RANGE;
|
||||
cpu_loop_exit_restore(cs, GETPC());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue