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

2015-02-22 Thread Michael Matz

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) {

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


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

2015-02-22 Thread Michael Matz

Hi,

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


That's excellent. Many thanks. When do you sleep, by the way? :-)


Roughly when you asked this question :)


- merge my local uncommitted stuff or at least stash it somehow
 (I've implemented HFAs and have started doing va_list)
- rebase my branch onto the latest mob, omitting the VT_LLOCAL/'.' patch
- merge your patch
- send out the new diff, which should then demonstrate the problem when
 you do: ( cd tests  make abitest )


(I'll fiddle with the patch you sent)

I'm not a git expert, but what I'll try to do before committing the 
arm64 branch to mob is greatly simplify the history but leave your 
changes to tccelf.c as a separate commit ... so that anyone who consults 
the history will know who the expert is on linking!


I'm hoping the arm64 stuff can go onto mob within about a week even if 
it's without va_list.


Just push the stuff right now to mob.  Makes collaboration a bit easier 
than having to deal with the large patch by hand.  As for history: make 
sure the branch you push doesn't contain any merges (uglifies history), 
i.e. your working-mob branch should always have been rebased, not merged 
with origin/mob.  One more request: if you could make sure that multi-line 
comments in your patch are using /**/ and no leader chars, that would be 
ideal.



Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel