Commit 941db528719cda9ec54e3c5be901e175241141b2
1 parent
57ba97de
Use the shiny new clz helpers.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3464 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
4 additions
and
6 deletions
target-cris/helper.c
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | #include "cpu.h" | 26 | #include "cpu.h" |
| 27 | #include "mmu.h" | 27 | #include "mmu.h" |
| 28 | #include "exec-all.h" | 28 | #include "exec-all.h" |
| 29 | +#include "host-utils.h" | ||
| 29 | 30 | ||
| 30 | #if defined(CONFIG_USER_ONLY) | 31 | #if defined(CONFIG_USER_ONLY) |
| 31 | 32 | ||
| @@ -134,8 +135,7 @@ void do_interrupt(CPUState *env) | @@ -134,8 +135,7 @@ void do_interrupt(CPUState *env) | ||
| 134 | return; | 135 | return; |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | - irqnum = 31 - | ||
| 138 | - __builtin_clz(env->pending_interrupts); | 138 | + irqnum = 31 - clz32(env->pending_interrupts); |
| 139 | irqnum += 0x30; | 139 | irqnum += 0x30; |
| 140 | ebp = env->pregs[SR_EBP]; | 140 | ebp = env->pregs[SR_EBP]; |
| 141 | isr = ldl_code(ebp + irqnum * 4); | 141 | isr = ldl_code(ebp + irqnum * 4); |
target-cris/op.c
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ | 19 | */ |
| 20 | #include "exec.h" | 20 | #include "exec.h" |
| 21 | +#include "host-utils.h" | ||
| 21 | 22 | ||
| 22 | #define REGNAME r0 | 23 | #define REGNAME r0 |
| 23 | #define REG (env->regs[0]) | 24 | #define REG (env->regs[0]) |
| @@ -1003,10 +1004,7 @@ void OPPROTO op_bound_T0_T1 (void) | @@ -1003,10 +1004,7 @@ void OPPROTO op_bound_T0_T1 (void) | ||
| 1003 | 1004 | ||
| 1004 | void OPPROTO op_lz_T0_T1 (void) | 1005 | void OPPROTO op_lz_T0_T1 (void) |
| 1005 | { | 1006 | { |
| 1006 | - if (T1 == 0) | ||
| 1007 | - T0 = 32; | ||
| 1008 | - else | ||
| 1009 | - T0 = __builtin_clz(T1); | 1007 | + T0 = clz32(T1); |
| 1010 | RETURN(); | 1008 | RETURN(); |
| 1011 | } | 1009 | } |
| 1012 | 1010 |