Patchwork [1/5] tcg: Allow non-constant control macros

login
register
mail settings
Submitter Richard Henderson
Date June 6, 2013, 6:05 p.m.
Message ID <1370541947-909-2-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/249514/
State New
Headers show

Comments

Richard Henderson - June 6, 2013, 6:05 p.m.
This allows TCG_TARGET_HAS_* to be a variable rather than a constant,
which allows easier support for differing ISA levels for the host.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg-opc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h
index 4246e9c..db5e6e5 100644
--- a/tcg/tcg-opc.h
+++ b/tcg/tcg-opc.h
@@ -40,7 +40,7 @@  DEF(set_label, 0, 0, 1, TCG_OPF_BB_END)
 DEF(call, 0, 1, 2, TCG_OPF_CALL_CLOBBER) /* variable number of parameters */
 DEF(br, 0, 0, 1, TCG_OPF_BB_END)
 
-#define IMPL(X) (X ? 0 : TCG_OPF_NOT_PRESENT)
+#define IMPL(X) (__builtin_constant_p(X) && !(X) ? TCG_OPF_NOT_PRESENT : 0)
 #if TCG_TARGET_REG_BITS == 32
 # define IMPL64  TCG_OPF_64BIT | TCG_OPF_NOT_PRESENT
 #else