]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Fix calling variadic functions ih jit_apply. Spill values with sizes less than
authorKlaus Treichel <ktreichel@web.de>
Tue, 4 Nov 2008 19:49:12 +0000 (19:49 +0000)
committerKlaus Treichel <ktreichel@web.de>
Tue, 4 Nov 2008 19:49:12 +0000 (19:49 +0000)
sizeof jit_int as jit_int on the stack.

ChangeLog
jit/jit-apply-x86-64.h
jit/jit-rules-x86-64.c

index 1f57fb8cb37b2d9c9a93d67dc2d221b3fe92a591..2985e9e2967babbc573bba21daa4aa6164c3d8a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-04  Klaus Treichel  <ktreichel@web.de>
+
+       * jit/jit-apply-x86-64.h (jit_builtin_apply): Use r11 for calling
+       the function and pass the constant 8 in rax for the number of SSE
+       registers used to pass values for variadic functions.
+
+       * jit/jit-rules-x86-64.c (_spill_reg): Spill values with sizes
+       less than 4 as jit_type_int on the stack.
+
 2008-10-12  Aleksey Demakov  <ademakov@gmail.com>
 
        * jit/jit-unwind.c: fix typos.
index cbcbfb5458c85a5933563afb98ffa46c7b3449e4..3c391548cc5df626100bda270128f278d5d6e22f 100644 (file)
@@ -175,8 +175,9 @@ _jit_classify_struct(jit_param_passing_t *passing,
                                "movaps 0x90(%%rax), %%xmm5\n\t" \
                                "movaps 0xA0(%%rax), %%xmm6\n\t" \
                                "movaps 0xB0(%%rax), %%xmm7\n\t" \
-                               "movq %0, %%rax\n\t" \
-                               "callq *%%rax\n\t" \
+                               "movq %0, %%r11\n\t" \
+                               "movl $8, %%eax\n\t" \
+                               "callq *%%r11\n\t" \
                                "movq %3, %%rcx\n\t" \
                                "movq %%rax, (%%rcx)\n\t" \
                                "movq %%rdx, 0x08(%%rcx)\n\t" \
index 487c2e2113c65b2c8f5fbca683554a3aca28f072..e514f7eab8fcaa6e4d2502cd59009a8cb8a64a19 100644 (file)
@@ -899,6 +899,7 @@ _spill_reg(unsigned char **inst_ptr, jit_type_t type,
        {
                switch(type->kind)
                {
+#if 0
                        case JIT_TYPE_SBYTE:
                        case JIT_TYPE_UBYTE:
                        {
@@ -914,7 +915,12 @@ _spill_reg(unsigned char **inst_ptr, jit_type_t type,
                                                                                        _jit_reg_info[reg].cpu_reg, 2);
                        }
                        break;
-
+#else
+                       case JIT_TYPE_SBYTE:
+                       case JIT_TYPE_UBYTE:
+                       case JIT_TYPE_SHORT:
+                       case JIT_TYPE_USHORT:
+#endif
                        case JIT_TYPE_INT:
                        case JIT_TYPE_UINT:
                        case JIT_TYPE_FLOAT32: