aboutsummaryrefslogtreecommitdiff
path: root/target-arm
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2009-10-15 23:14:52 +0200
committerAurelien Jarno <aurelien@aurel32.net>2009-10-23 00:05:17 +0200
commit7bbcb0afe715c36545bbbd872441c473927c1a4e (patch)
treeca10454ea334d1efb56abb5ce7a10663f1614c20 /target-arm
parent102251a4f30d7a8187a029a49eb0dfadb6ac8087 (diff)
downloadqemu-7bbcb0afe715c36545bbbd872441c473927c1a4e.zip
qemu-7bbcb0afe715c36545bbbd872441c473927c1a4e.tar.gz
qemu-7bbcb0afe715c36545bbbd872441c473927c1a4e.tar.bz2
target-arm: use clz32() instead of a for loop
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Diffstat (limited to 'target-arm')
-rw-r--r--target-arm/helper.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 701629a..656b5df 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -7,6 +7,7 @@
#include "gdbstub.h"
#include "helpers.h"
#include "qemu-common.h"
+#include "host-utils.h"
static uint32_t cortexa8_cp15_c0_c1[8] =
{ 0x1031, 0x11, 0x400, 0, 0x31100003, 0x20000000, 0x01202000, 0x11 };
@@ -394,10 +395,7 @@ uint32_t HELPER(uxtb16)(uint32_t x)
uint32_t HELPER(clz)(uint32_t x)
{
- int count;
- for (count = 32; x; count--)
- x >>= 1;
- return count;
+ return clz32(x);
}
int32_t HELPER(sdiv)(int32_t num, int32_t den)