Patchwork [PULL,10/29] tcg: Define TCG_TYPE_PTR properly

login
register
mail settings
Submitter Richard Henderson
Date Sept. 2, 2013, 4:28 p.m.
Message ID <1378139354-28602-11-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/272017/
State New
Headers show

Comments

Richard Henderson - Sept. 2, 2013, 4:28 p.m.
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 8a5e55b..7a6f2e5 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -178,9 +178,12 @@  typedef enum TCGType {
     TCG_TYPE_REG = TCG_TYPE_I64,
 #endif
 
-    /* An alias for the size of the native pointer.  We don't currently
-       support any hosts with 64-bit registers and 32-bit pointers.  */
-    TCG_TYPE_PTR = TCG_TYPE_REG,
+    /* An alias for the size of the native pointer.  */
+#if UINTPTR_MAX == UINT32_MAX
+    TCG_TYPE_PTR = TCG_TYPE_I32,
+#else
+    TCG_TYPE_PTR = TCG_TYPE_I64,
+#endif
 
     /* An alias for the size of the target "long", aka register.  */
 #if TARGET_LONG_BITS == 64