qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering.
@ 2010-03-16 15:45 Richard Henderson
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2010-03-16 15:45 UTC (permalink / raw)
  To: qemu-devel

---
 tcg/tcg.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 1818868..d753149 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -596,7 +596,17 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
                 real_args++;
             }
 #endif
-#ifdef TCG_TARGET_WORDS_BIGENDIAN
+	    /* If stack grows up, then we will be placing successive
+	       arguments at lower addresses, which means we need to
+	       reverse the order compared to how we would normally
+	       treat either big or little-endian.  For those arguments
+	       that will wind up in registers, this still works for
+	       HPPA (the only current STACK_GROWSUP target) since the
+	       argument registers are *also* allocated in decreasing
+	       order.  If another such target is added, this logic may
+	       have to get more complicated to differentiate between
+	       stack arguments and register arguments.  */
+#if defined(TCG_TARGET_WORDS_BIGENDIAN) != defined(TCG_TARGET_STACK_GROWSUP)
             *gen_opparam_ptr++ = args[i] + 1;
             *gen_opparam_ptr++ = args[i];
 #else
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering.
  2010-03-16 15:50 [Qemu-devel] [PATCH 0/4] tcg-hppa get it working, v2.1 Richard Henderson
@ 2010-03-16 15:52 ` Richard Henderson
  2010-03-17  1:49   ` Stuart Brady
  2010-03-23 21:27   ` Aurelien Jarno
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Henderson @ 2010-03-16 15:52 UTC (permalink / raw)
  To: qemu-devel

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

diff --git a/tcg/tcg.c b/tcg/tcg.c
index 1818868..d753149 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -596,7 +596,17 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
                 real_args++;
             }
 #endif
-#ifdef TCG_TARGET_WORDS_BIGENDIAN
+	    /* If stack grows up, then we will be placing successive
+	       arguments at lower addresses, which means we need to
+	       reverse the order compared to how we would normally
+	       treat either big or little-endian.  For those arguments
+	       that will wind up in registers, this still works for
+	       HPPA (the only current STACK_GROWSUP target) since the
+	       argument registers are *also* allocated in decreasing
+	       order.  If another such target is added, this logic may
+	       have to get more complicated to differentiate between
+	       stack arguments and register arguments.  */
+#if defined(TCG_TARGET_WORDS_BIGENDIAN) != defined(TCG_TARGET_STACK_GROWSUP)
             *gen_opparam_ptr++ = args[i] + 1;
             *gen_opparam_ptr++ = args[i];
 #else
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering.
  2010-03-16 15:52 ` [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering Richard Henderson
@ 2010-03-17  1:49   ` Stuart Brady
  2010-03-23 21:27   ` Aurelien Jarno
  1 sibling, 0 replies; 4+ messages in thread
From: Stuart Brady @ 2010-03-17  1:49 UTC (permalink / raw)
  To: qemu-devel

On Sat, Feb 20, 2010 at 11:32:23AM -0800, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Acked-by: Stuart Brady <stuart.brady@gmail.com>

> ---
>  tcg/tcg.c |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 1818868..d753149 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -596,7 +596,17 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
>                  real_args++;
>              }
>  #endif
> -#ifdef TCG_TARGET_WORDS_BIGENDIAN
> +	    /* If stack grows up, then we will be placing successive
> +	       arguments at lower addresses, which means we need to
> +	       reverse the order compared to how we would normally
> +	       treat either big or little-endian.  For those arguments
> +	       that will wind up in registers, this still works for
> +	       HPPA (the only current STACK_GROWSUP target) since the
> +	       argument registers are *also* allocated in decreasing
> +	       order.  If another such target is added, this logic may
> +	       have to get more complicated to differentiate between
> +	       stack arguments and register arguments.  */
> +#if defined(TCG_TARGET_WORDS_BIGENDIAN) != defined(TCG_TARGET_STACK_GROWSUP)
>              *gen_opparam_ptr++ = args[i] + 1;
>              *gen_opparam_ptr++ = args[i];
>  #else
> -- 
> 1.6.6.1
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering.
  2010-03-16 15:52 ` [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering Richard Henderson
  2010-03-17  1:49   ` Stuart Brady
@ 2010-03-23 21:27   ` Aurelien Jarno
  1 sibling, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2010-03-23 21:27 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

On Sat, Feb 20, 2010 at 11:32:23AM -0800, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Thanks, applied.

> ---
>  tcg/tcg.c |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/tcg/tcg.c b/tcg/tcg.c
> index 1818868..d753149 100644
> --- a/tcg/tcg.c
> +++ b/tcg/tcg.c
> @@ -596,7 +596,17 @@ void tcg_gen_callN(TCGContext *s, TCGv_ptr func, unsigned int flags,
>                  real_args++;
>              }
>  #endif
> -#ifdef TCG_TARGET_WORDS_BIGENDIAN
> +	    /* If stack grows up, then we will be placing successive
> +	       arguments at lower addresses, which means we need to
> +	       reverse the order compared to how we would normally
> +	       treat either big or little-endian.  For those arguments
> +	       that will wind up in registers, this still works for
> +	       HPPA (the only current STACK_GROWSUP target) since the
> +	       argument registers are *also* allocated in decreasing
> +	       order.  If another such target is added, this logic may
> +	       have to get more complicated to differentiate between
> +	       stack arguments and register arguments.  */
> +#if defined(TCG_TARGET_WORDS_BIGENDIAN) != defined(TCG_TARGET_STACK_GROWSUP)
>              *gen_opparam_ptr++ = args[i] + 1;
>              *gen_opparam_ptr++ = args[i];
>  #else
> -- 
> 1.6.6.1
> 
> 
> 
> 

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-23 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 15:45 [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2010-03-16 15:50 [Qemu-devel] [PATCH 0/4] tcg-hppa get it working, v2.1 Richard Henderson
2010-03-16 15:52 ` [Qemu-devel] [PATCH 2/4] tcg-hppa: Fix 64-bit argument ordering Richard Henderson
2010-03-17  1:49   ` Stuart Brady
2010-03-23 21:27   ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).