diff mbox

[2/6] tcg: Add tcg_invert_cond.

Message ID bbc9ce1ea8962414d2ffc5715e33dddd127b3caf.1261078375.git.rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Dec. 17, 2009, 5:28 p.m. UTC
It is very handy to have a reliable mapping of a condition to its inverse.
This will be used in several patches to follow.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Laurent Desnogues Dec. 18, 2009, 11:39 a.m. UTC | #1
On Thu, Dec 17, 2009 at 6:28 PM, Richard Henderson <rth@twiddle.net> wrote:
> It is very handy to have a reliable mapping of a condition to its inverse.
> This will be used in several patches to follow.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>


Laurent

> ---
>  tcg/tcg.h |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/tcg/tcg.h b/tcg/tcg.h
> index 9824493..376d6af 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -205,6 +205,11 @@ typedef enum {
>     TCG_COND_GTU,
>  } TCGCond;
>
> +static inline TCGCond tcg_invert_cond(TCGCond c)
> +{
> +    return (TCGCond)(c ^ 1);
> +}
> +
>  #define TEMP_VAL_DEAD  0
>  #define TEMP_VAL_REG   1
>  #define TEMP_VAL_MEM   2
> --
> 1.6.5.2
>
>
diff mbox

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 9824493..376d6af 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -205,6 +205,11 @@  typedef enum {
     TCG_COND_GTU,
 } TCGCond;
 
+static inline TCGCond tcg_invert_cond(TCGCond c)
+{
+    return (TCGCond)(c ^ 1);
+}
+
 #define TEMP_VAL_DEAD  0
 #define TEMP_VAL_REG   1
 #define TEMP_VAL_MEM   2