tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH] TCC arm64 back end


From: Michael Matz
Subject: Re: [Tinycc-devel] [PATCH] TCC arm64 back end
Date: Sun, 22 Feb 2015 19:13:31 +0100 (CET)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

Hi,

On Sun, 22 Feb 2015, Edmund Grimley Evans wrote:

I've done roughly that. However, I included both fixes for VT_LLOCAL/'.', but with both disabled. Also, I omitted the VT_REF patch, of course.

New diff attached, with updated README.arm64.

Just for demonstration, this is what I meant that you could have also used VT_REF instead of VT_LLOCAL. On top of your patch, without the VT_LLOCAL/'.' hunks active, this also makes abitest pass. Except for register allocation (not using x30 as temp reg, but a normal allocated register) it generates the same code for some examples extracted from abitest.c, between with this patch vs. activating one of the LLOCAL/'.' hunks.


Ciao,
Michael.
diff --git a/arm64-gen.c b/arm64-gen.c
index cf3764b..44675f5 100644
--- a/arm64-gen.c
+++ b/arm64-gen.c
@@ -430,7 +430,7 @@ ST_FUNC void load(int r, SValue *sv)
     int svrv = svr & VT_VALMASK;
     uint64_t svcul = (int32_t)sv->c.ul;

-    if (svr == (VT_LOCAL | VT_LVAL)) {
+    if ((svr & ~VT_REF) == (VT_LOCAL | VT_LVAL)) {
         if (IS_FREG(r))
             gen_fload(arm64_type_size(svtt), fltr(r), 29, svcul);
         else
@@ -1010,7 +1010,7 @@ ST_FUNC void gfunc_prolog(CType *func_type)
                    a[i] < 32 ? 16 + (a[i] - 16) / 2 * 16 :
                    224 + ((a[i] - 32) >> 1 << 1));
         sym_push(sym->v & ~SYM_FIELD, &sym->type,
-                 (a[i] & 1 ? VT_LLOCAL : VT_LOCAL) | lvalue_type(sym->type.t),
+                 (a[i] & 1 ? (VT_LOCAL | VT_REF) /*VT_LLOCAL*/ : VT_LOCAL) | 
lvalue_type(sym->type.t),
                  off);
         // HFAs of float and double need to be written differently:
         if (16 <= a[i] && a[i] < 32 && (sym->type.t & VT_BTYPE) == VT_STRUCT) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]