[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/9] tcg: Change TCGType to an enumeration.
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 4/9] tcg: Change TCGType to an enumeration. |
Date: |
Fri, 19 Mar 2010 11:36:30 -0700 |
The TCGType name was already used consistently. Changing it
to an enumeration instead of a set of defines aids debugging.
---
tcg/tcg-op.h | 2 --
tcg/tcg.h | 19 ++++++++++++-------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 350a096..e2873ff 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -2175,7 +2175,6 @@ static inline void tcg_gen_qemu_st64(TCGv_i64 arg, TCGv
addr, int mem_index)
#endif /* TCG_TARGET_REG_BITS != 32 */
#if TARGET_LONG_BITS == 64
-#define TCG_TYPE_TL TCG_TYPE_I64
#define tcg_gen_movi_tl tcg_gen_movi_i64
#define tcg_gen_mov_tl tcg_gen_mov_i64
#define tcg_gen_ld8u_tl tcg_gen_ld8u_i64
@@ -2247,7 +2246,6 @@ static inline void tcg_gen_qemu_st64(TCGv_i64 arg, TCGv
addr, int mem_index)
#define tcg_const_tl tcg_const_i64
#define tcg_const_local_tl tcg_const_local_i64
#else
-#define TCG_TYPE_TL TCG_TYPE_I32
#define tcg_gen_movi_tl tcg_gen_movi_i32
#define tcg_gen_mov_tl tcg_gen_mov_i32
#define tcg_gen_ld8u_tl tcg_gen_ld8u_i32
diff --git a/tcg/tcg.h b/tcg/tcg.h
index dd02a47..166c889 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -96,17 +96,22 @@ typedef struct TCGPool {
this value, they are statically allocated in the TB stack frame */
#define TCG_STATIC_CALL_ARGS_SIZE 128
-typedef int TCGType;
-
-#define TCG_TYPE_I32 0
-#define TCG_TYPE_I64 1
-#define TCG_TYPE_COUNT 2 /* number of different types */
+typedef enum TCGType {
+ TCG_TYPE_I32,
+ TCG_TYPE_I64,
+ TCG_TYPE_COUNT, /* number of different types */
#if TCG_TARGET_REG_BITS == 32
-#define TCG_TYPE_PTR TCG_TYPE_I32
+ TCG_TYPE_PTR = TCG_TYPE_I32,
+#else
+ TCG_TYPE_PTR = TCG_TYPE_I64,
+#endif
+#if TARGET_LONG_BITS == 64
+ TCG_TYPE_TL = TCG_TYPE_I64,
#else
-#define TCG_TYPE_PTR TCG_TYPE_I64
+ TCG_TYPE_TL = TCG_TYPE_I32,
#endif
+} TCGType;
typedef tcg_target_ulong TCGArg;
--
1.6.6.1
- [Qemu-devel] [PATCH 0/9] tcg cleanups, Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 4/9] tcg: Change TCGType to an enumeration.,
Richard Henderson <=
- [Qemu-devel] [PATCH 3/9] tcg: Use TCGCond where appropriate., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 6/9] tcg: Use not_i32 to implement not_i64., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 7/9] tcg: Allow target-specific implementation of EQV., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 8/9] tcg: Allow target-specific implementation of NAND., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 5/9] tcg: Disambiguate qemu_ld32u with 32-bit and 64-bit outputs., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 1/9] tcg: Remove jmp opcode., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 9/9] tcg: Allow target-specific implementation of NOR., Richard Henderson, 2010/03/19
- [Qemu-devel] [PATCH 2/9] tcg: Name the opcode enumeration., Richard Henderson, 2010/03/19
- Re: [Qemu-devel] [PATCH 0/9] tcg cleanups, Aurelien Jarno, 2010/03/26