mirror of https://gitlab.com/qemu-project/qemu
Use the shiny new clz helpers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3464 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
57ba97deb8
commit
941db52871
|
@ -26,6 +26,7 @@
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "mmu.h"
|
#include "mmu.h"
|
||||||
#include "exec-all.h"
|
#include "exec-all.h"
|
||||||
|
#include "host-utils.h"
|
||||||
|
|
||||||
#if defined(CONFIG_USER_ONLY)
|
#if defined(CONFIG_USER_ONLY)
|
||||||
|
|
||||||
|
@ -134,8 +135,7 @@ void do_interrupt(CPUState *env)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
irqnum = 31 -
|
irqnum = 31 - clz32(env->pending_interrupts);
|
||||||
__builtin_clz(env->pending_interrupts);
|
|
||||||
irqnum += 0x30;
|
irqnum += 0x30;
|
||||||
ebp = env->pregs[SR_EBP];
|
ebp = env->pregs[SR_EBP];
|
||||||
isr = ldl_code(ebp + irqnum * 4);
|
isr = ldl_code(ebp + irqnum * 4);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
|
#include "host-utils.h"
|
||||||
|
|
||||||
#define REGNAME r0
|
#define REGNAME r0
|
||||||
#define REG (env->regs[0])
|
#define REG (env->regs[0])
|
||||||
|
@ -1003,10 +1004,7 @@ void OPPROTO op_bound_T0_T1 (void)
|
||||||
|
|
||||||
void OPPROTO op_lz_T0_T1 (void)
|
void OPPROTO op_lz_T0_T1 (void)
|
||||||
{
|
{
|
||||||
if (T1 == 0)
|
T0 = clz32(T1);
|
||||||
T0 = 32;
|
|
||||||
else
|
|
||||||
T0 = __builtin_clz(T1);
|
|
||||||
RETURN();
|
RETURN();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue