diff options
Diffstat (limited to 'target-arm/helper.c')
-rw-r--r-- | target-arm/helper.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c index df09778ea8..236aaed23b 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -340,6 +340,14 @@ uint32_t HELPER(uxtb16)(uint32_t x) return res; } +uint32_t HELPER(clz)(uint32_t x) +{ + int count; + for (count = 32; x; count--) + x >>= 1; + return count; +} + #if defined(CONFIG_USER_ONLY) void do_interrupt (CPUState *env) |