From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbcTh-0005SJ-4J for qemu-devel@nongnu.org; Mon, 14 Sep 2015 18:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbcTg-0003Aw-9j for qemu-devel@nongnu.org; Mon, 14 Sep 2015 18:44:01 -0400 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]:33004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbcTg-0003AP-29 for qemu-devel@nongnu.org; Mon, 14 Sep 2015 18:44:00 -0400 Received: by pacex6 with SMTP id ex6so156131970pac.0 for ; Mon, 14 Sep 2015 15:43:59 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 14 Sep 2015 15:43:24 -0700 Message-Id: <1442270622-8955-18-git-send-email-rth@twiddle.net> In-Reply-To: <1442270622-8955-1-git-send-email-rth@twiddle.net> References: <1442270622-8955-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v16 17/35] target-arm: Use new revbit functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Signed-off-by: Richard Henderson --- target-arm/helper-a64.c | 15 +-------------- target-arm/helper.c | 12 +----------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/target-arm/helper-a64.c b/target-arm/helper-a64.c index 2c7a645..deb8dbe 100644 --- a/target-arm/helper-a64.c +++ b/target-arm/helper-a64.c @@ -70,20 +70,7 @@ uint32_t HELPER(clz32)(uint32_t x) uint64_t HELPER(rbit64)(uint64_t x) { - /* assign the correct byte position */ - x = bswap64(x); - - /* assign the correct nibble position */ - x = ((x & 0xf0f0f0f0f0f0f0f0ULL) >> 4) - | ((x & 0x0f0f0f0f0f0f0f0fULL) << 4); - - /* assign the correct bit position */ - x = ((x & 0x8888888888888888ULL) >> 3) - | ((x & 0x4444444444444444ULL) >> 1) - | ((x & 0x2222222222222222ULL) << 1) - | ((x & 0x1111111111111111ULL) << 3); - - return x; + return revbit64(x); } /* Convert a softfloat float_relation_ (as returned by diff --git a/target-arm/helper.c b/target-arm/helper.c index 65b9ff5..12ea88f 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -5044,17 +5044,7 @@ uint32_t HELPER(udiv)(uint32_t num, uint32_t den) uint32_t HELPER(rbit)(uint32_t x) { - x = ((x & 0xff000000) >> 24) - | ((x & 0x00ff0000) >> 8) - | ((x & 0x0000ff00) << 8) - | ((x & 0x000000ff) << 24); - x = ((x & 0xf0f0f0f0) >> 4) - | ((x & 0x0f0f0f0f) << 4); - x = ((x & 0x88888888) >> 3) - | ((x & 0x44444444) >> 1) - | ((x & 0x22222222) << 1) - | ((x & 0x11111111) << 3); - return x; + return revbit32(x); } #if defined(CONFIG_USER_ONLY) -- 2.4.3