]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tcg-hppa: Fix 64-bit argument ordering
authorRichard Henderson <rth@twiddle.net>
Sat, 20 Feb 2010 19:32:23 +0000 (11:32 -0800)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 23 Mar 2010 21:00:47 +0000 (22:00 +0100)
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/tcg.c

index 1818868226833d55fd5e90cb999495d9a723b13e..d753149f76ed37117fe428ef3ce7f5e78edfeed6 100644 (file)
--- 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