[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/40] target/ppc: Remove silly GETFIELD/SETFIELD/MAS
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 02/40] target/ppc: Remove silly GETFIELD/SETFIELD/MASK_TO_LSH macros |
Date: |
Fri, 21 Dec 2018 16:45:28 +1100 |
The (only) obvious use for these macros is constructing and parsing guest
visible register fields. But the way they're constructed, they're only
valid when used on a *host* long, whose size shouldn't be visible to the
guest at all.
They also have no current users, so just get rid of them.
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/cpu.h | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 527181c0f0..d5f99f1fc7 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -78,18 +78,6 @@
PPC_BIT32(bs))
#define PPC_BITMASK8(bs, be) ((PPC_BIT8(bs) - PPC_BIT8(be)) | PPC_BIT8(bs))
-#if HOST_LONG_BITS == 32
-# define MASK_TO_LSH(m) (__builtin_ffsll(m) - 1)
-#elif HOST_LONG_BITS == 64
-# define MASK_TO_LSH(m) (__builtin_ffsl(m) - 1)
-#else
-# error Unknown sizeof long
-#endif
-
-#define GETFIELD(m, v) (((v) & (m)) >> MASK_TO_LSH(m))
-#define SETFIELD(m, v, val) \
- (((v) & ~(m)) | ((((typeof(v))(val)) << MASK_TO_LSH(m)) & (m)))
-
/*****************************************************************************/
/* Exception vectors definitions */
enum {
--
2.19.2
- [Qemu-devel] [PULL 00/40] ppc-for-4.0 queue 20181221, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 02/40] target/ppc: Remove silly GETFIELD/SETFIELD/MASK_TO_LSH macros,
David Gibson <=
- [Qemu-devel] [PULL 03/40] spapr: Fix ibm, max-associativity-domains property number of nodes, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 01/40] target/ppc: fix the PPC_BIT definitions, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 04/40] target/ppc: tcg: Implement addex instruction, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 05/40] spapr: drop redundant statement in spapr_populate_drconf_memory(), David Gibson, 2018/12/21
- [Qemu-devel] [PULL 10/40] ppc440_bamboo: use g_new(T, n) instead of g_malloc(sizeof(T) * n), David Gibson, 2018/12/21
- [Qemu-devel] [PULL 15/40] ppc/xive: introduce a XIVE interrupt source model, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 13/40] mac_newworld: simplify IRQ wiring, David Gibson, 2018/12/21
- [Qemu-devel] [PULL 07/40] spapr: use g_new(T, n) instead of g_malloc(sizeof(T) * n), David Gibson, 2018/12/21
- [Qemu-devel] [PULL 08/40] ppc405_boards: use g_new(T, n) instead of g_malloc(sizeof(T) * n), David Gibson, 2018/12/21
- [Qemu-devel] [PULL 12/40] virtex_ml507: use g_new(T, n) instead of g_malloc(sizeof(T) * n), David Gibson, 2018/12/21