tcg: Add TCGV_IS_UNUSED_*
PATCH v2 1/1 tcg: Add TCGV_IS_UNUSED_*
--- tcg/tcg-op.h | 2 ++ tcg/tcg.h | 3 +++ 2 files changed, 5 insertions(+)
Changes since v1:
* Add tl-sized TCGV_IS_UNUSED to tcg-op.h.
r~
tcg/tcg-op.h +2 -0
@@ -2329,6 +2329,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i32#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i32#define TCGV_UNUSED (x) TCGV_UNUSED_I32(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I32(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I32(a, b)#else #define TCGv TCGv_i64
@@ -2340,6 +2341,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i64#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i64#define TCGV_UNUSED (x) TCGV_UNUSED_I64(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I64(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I64(a, b)#endif
tcg/tcg.h +3 -0
@@ -270,6 +270,9 @@ typedef int TCGv_i64;#define TCGV_UNUSED_I32 (x) x = MAKE_TCGV_I32(-1)#define TCGV_UNUSED_I64 (x) x = MAKE_TCGV_I64(-1) +#define TCGV_IS_UNUSED_I32 (x) (GET_TCGV_I32(x) == -1) +#define TCGV_IS_UNUSED_I64 (x) (GET_TCGV_I64(x) == -1) +/* call flags */ /* Helper does not read globals (either directly or through an exception). It implies TCG_CALL_NO_WRITE_GLOBALS. */
Signature · 1 line
1.7.11.7
Ping?
r~
Quoted 49 lines · Richard Henderson
Cc Aurelien Jarno <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- tcg/tcg-op.h | 2 ++ tcg/tcg.h | 3 +++ 2 files changed, 5 insertions(+)Changes since v1:
* Add tl-sizedTCGV_IS_UNUSEDtotcg-op.h.r~
tcg/tcg-op.h +2
-0@@ -2329,6 +2329,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i32#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i32#define TCGV_UNUSED (x) TCGV_UNUSED_I32(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I32(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I32(a, b)#else #define TCGv TCGv_i64@@ -2340,6 +2341,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i64#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i64#define TCGV_UNUSED (x) TCGV_UNUSED_I64(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I64(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I64(a, b)#endif tcg/tcg.h +3
-0@@ -270,6 +270,9 @@ typedef int TCGv_i64;#define TCGV_UNUSED_I32 (x) x = MAKE_TCGV_I32(-1)#define TCGV_UNUSED_I64 (x) x = MAKE_TCGV_I64(-1) +#define TCGV_IS_UNUSED_I32 (x) (GET_TCGV_I32(x) == -1) +#define TCGV_IS_UNUSED_I64 (x) (GET_TCGV_I64(x) == -1) +/* call flags */ /* Helper does not read globals (either directly or through an exception). It implies TCG_CALL_NO_WRITE_GLOBALS. */
Am 07.12.2012 22:07, schrieb Richard Henderson:
Quoted 2 lines
Cc Aurelien Jarno <[email protected]>Signed-off-by Richard Henderson <[email protected]>
Looks fine to me. The only remark I have is that for a use case of mine (writing a new target) I found it helpful to distinguish between tl and i32/i64, which requires static inline functions rather than macros for type safety - but since TCGV_UNUSED() is a macro, too, such changes would be a follow-up.
Andreas
Quoted 47 lines
--- tcg/tcg-op.h | 2 ++ tcg/tcg.h | 3 +++ 2 files changed, 5 insertions(+)Changes since v1:
* Add tl-sizedTCGV_IS_UNUSEDtotcg-op.h.r~
tcg/tcg-op.h +2
-0@@ -2329,6 +2329,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i32#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i32#define TCGV_UNUSED (x) TCGV_UNUSED_I32(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I32(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I32(a, b)#else #define TCGv TCGv_i64@@ -2340,6 +2341,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i64#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i64#define TCGV_UNUSED (x) TCGV_UNUSED_I64(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I64(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I64(a, b)#endif tcg/tcg.h +3
-0@@ -270,6 +270,9 @@ typedef int TCGv_i64;#define TCGV_UNUSED_I32 (x) x = MAKE_TCGV_I32(-1)#define TCGV_UNUSED_I64 (x) x = MAKE_TCGV_I64(-1) +#define TCGV_IS_UNUSED_I32 (x) (GET_TCGV_I32(x) == -1) +#define TCGV_IS_UNUSED_I64 (x) (GET_TCGV_I64(x) == -1) +/* call flags */ /* Helper does not read globals (either directly or through an exception). It implies TCG_CALL_NO_WRITE_GLOBALS. */
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Ping 2. There is a Reviewed-by...
r~
Quoted 49 lines · Richard Henderson
Cc Aurelien Jarno <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- tcg/tcg-op.h | 2 ++ tcg/tcg.h | 3 +++ 2 files changed, 5 insertions(+)Changes since v1:
* Add tl-sizedTCGV_IS_UNUSEDtotcg-op.h.r~
tcg/tcg-op.h +2
-0@@ -2329,6 +2329,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i32#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i32#define TCGV_UNUSED (x) TCGV_UNUSED_I32(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I32(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I32(a, b)#else #define TCGv TCGv_i64@@ -2340,6 +2341,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i64#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i64#define TCGV_UNUSED (x) TCGV_UNUSED_I64(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I64(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I64(a, b)#endif tcg/tcg.h +3
-0@@ -270,6 +270,9 @@ typedef int TCGv_i64;#define TCGV_UNUSED_I32 (x) x = MAKE_TCGV_I32(-1)#define TCGV_UNUSED_I64 (x) x = MAKE_TCGV_I64(-1) +#define TCGV_IS_UNUSED_I32 (x) (GET_TCGV_I32(x) == -1) +#define TCGV_IS_UNUSED_I64 (x) (GET_TCGV_I64(x) == -1) +/* call flags */ /* Helper does not read globals (either directly or through an exception). It implies TCG_CALL_NO_WRITE_GLOBALS. */
Blue Swirl
AppliedThanks, applied.
Quoted 52 lines · Richard Henderson
Cc Aurelien Jarno <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- tcg/tcg-op.h | 2 ++ tcg/tcg.h | 3 +++ 2 files changed, 5 insertions(+)Changes since v1:
* Add tl-sizedTCGV_IS_UNUSEDtotcg-op.h.r~
tcg/tcg-op.h +2
-0@@ -2329,6 +2329,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i32#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i32#define TCGV_UNUSED (x) TCGV_UNUSED_I32(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I32(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I32(a, b)#else #define TCGv TCGv_i64@@ -2340,6 +2341,7 @@ static inline void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret,#define tcg_gen_qemu_ldst_op tcg_gen_op3i_i64#define tcg_gen_qemu_ldst_op_i64 tcg_gen_qemu_ldst_op_i64_i64#define TCGV_UNUSED (x) TCGV_UNUSED_I64(x) +#define TCGV_IS_UNUSED (x) TCGV_IS_UNUSED_I64(x)#define TCGV_EQUAL (a, b) TCGV_EQUAL_I64(a, b)#endif tcg/tcg.h +3
-1@@ -270,6 +270,9 @@ typedef int TCGv_i64;#define TCGV_UNUSED_I32 (x) x = MAKE_TCGV_I32(-1)#define TCGV_UNUSED_I64 (x) x = MAKE_TCGV_I64(-1) +#define TCGV_IS_UNUSED_I32 (x) (GET_TCGV_I32(x) == -1) +#define TCGV_IS_UNUSED_I64 (x) (GET_TCGV_I64(x) == -1) +/* call flags */ /* Helper does not read globals (either directly or through an exception). It implies TCG_CALL_NO_WRITE_GLOBALS. */ --1.7.11.7