[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/35] target-arm: Use new revbit functions
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 17/35] target-arm: Use new revbit functions |
Date: |
Tue, 15 Sep 2015 08:03:55 -0700 |
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
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
- [Qemu-devel] [PULL 04/35] target-tilegx: Add opcode basic implementation from Tilera Corporation, (continued)
- [Qemu-devel] [PULL 04/35] target-tilegx: Add opcode basic implementation from Tilera Corporation, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 07/35] target-tilegx: Fix LDNA_ADD_IMM8_OPCODE_X1, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 01/35] linux-user: tilegx: Add architecture related features, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 06/35] target-tilegx: Modify _SPECIAL_ opcodes, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 05/35] target-tilegx: Modify opcode_tilegx.h to fit QEMU usage, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 09/35] target-tilegx: Add cpu basic features for linux-user, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 12/35] target-tilegx: Generate SEGV properly, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 08/35] target-tilegx: Add special register information from Tilera Corporation, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 13/35] target-tilegx: Add TILE-Gx building files, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 10/35] target-tilegx: Add several helpers for instructions translation, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 17/35] target-arm: Use new revbit functions,
Richard Henderson <=
- [Qemu-devel] [PULL 16/35] host-utils: Add revbit functions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 15/35] target-tilegx: Handle arithmetic instructions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 22/35] target-tilegx: Handle conditional branch instructions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 18/35] target-tilegx: Handle most bit manipulation instructions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 20/35] target-tilegx: Handle post-increment load and store instructions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 11/35] target-tilegx: Framework for decoding bundles, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 23/35] target-tilegx: Handle comparison instructions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 19/35] target-tilegx: Handle basic load and store instructions, Richard Henderson, 2015/09/15
- [Qemu-devel] [PULL 14/35] target-tilegx: Handle simple logical operations, Richard Henderson, 2015/09/15