From patchwork Thu Oct 15 21:14:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 36150 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0486CB7B8A for ; Fri, 16 Oct 2009 08:15:35 +1100 (EST) Received: from localhost ([127.0.0.1]:55162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyXfX-0005Vk-EI for incoming@patchwork.ozlabs.org; Thu, 15 Oct 2009 17:15:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyXf0-0005UB-3a for qemu-devel@nongnu.org; Thu, 15 Oct 2009 17:14:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyXez-0005TD-6b for qemu-devel@nongnu.org; Thu, 15 Oct 2009 17:14:57 -0400 Received: from [199.232.76.173] (port=35271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyXez-0005T8-1b for qemu-devel@nongnu.org; Thu, 15 Oct 2009 17:14:57 -0400 Received: from hall.aurel32.net ([88.191.82.174]:56908) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MyXey-00054U-LP for qemu-devel@nongnu.org; Thu, 15 Oct 2009 17:14:56 -0400 Received: from [2002:52e8:2fb:1:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MyXex-0007dv-Et for qemu-devel@nongnu.org; Thu, 15 Oct 2009 23:14:55 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1MyXeu-0003Y2-RG for qemu-devel@nongnu.org; Thu, 15 Oct 2009 23:14:52 +0200 Date: Thu, 15 Oct 2009 23:14:52 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Message-ID: <20091015211452.GC7071@volta.aurel32.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [Qemu-devel] [PATCH] target-arm: use clz32() instead of a for loop X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Aurelien Jarno Acked-by: Laurent Desnogues --- target-arm/helper.c | 6 ++---- 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)