diff mbox

[05/18] tcg: Define TCG_TYPE_PTR properly

Message ID 1377190729-14008-6-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Aug. 22, 2013, 4:58 p.m. UTC
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Aurelien Jarno Aug. 29, 2013, 10:53 a.m. UTC | #1
On Thu, Aug 22, 2013 at 09:58:36AM -0700, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
>  tcg/tcg.h | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/tcg/tcg.h b/tcg/tcg.h
> index bfe420a..b71dcf4 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -173,9 +173,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

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

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index bfe420a..b71dcf4 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -173,9 +173,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