diff mbox

[001/126] tcg: Add TCGV_IS_UNUSED_*

Message ID 1347224784-19472-2-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Sept. 9, 2012, 9:04 p.m. UTC
Signed-off-by: Richard Henderson <rth@twiddle.net>
Cc: Aurelien Jarno <aurelien@aurel32.net>
---
 tcg/tcg.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Aurelien Jarno Sept. 10, 2012, 2:16 p.m. UTC | #1
On Sun, Sep 09, 2012 at 02:04:19PM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  tcg/tcg.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tcg/tcg.h b/tcg/tcg.h
> index d710694..a9367fe 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -251,6 +251,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 */
>  /* A pure function only reads its arguments and TCG global variables
>     and cannot raise exceptions. Hence a call to a pure function can be

Looks fine.

Reviewed: Aurelien Jarno <aurelien@aurel32.net>
diff mbox

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index d710694..a9367fe 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -251,6 +251,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 */
 /* A pure function only reads its arguments and TCG global variables
    and cannot raise exceptions. Hence a call to a pure function can be