From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from MTA-09-3.privateemail.com ([68.65.122.19]) by ewsd; Sat Aug 1 08:23:14 EDT 2020 Received: from MTA-09.privateemail.com (localhost [127.0.0.1]) by MTA-09.privateemail.com (Postfix) with ESMTP id D631D60043 for <9front@9front.org>; Sat, 1 Aug 2020 08:23:09 -0400 (EDT) Received: from localhost (unknown [10.20.151.225]) by MTA-09.privateemail.com (Postfix) with ESMTPA id F406560041 for <9front@9front.org>; Sat, 1 Aug 2020 12:23:08 +0000 (UTC) Date: Sat, 1 Aug 2020 05:23:02 -0700 From: Anthony Martin To: 9front@9front.org Subject: Re: arm64 fails to link when float converted to int (Was Re: [9front] netsurf native frontend (text_insert: illegal combination FCVTZSDW FCON NONE REG)) Message-ID: <20200801122302.GC31465@alice> References: <8BFCD64ADCEA9E2631D9323B893FF9A2@felloff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8BFCD64ADCEA9E2631D9323B893FF9A2@felloff.net> X-Virus-Scanned: ClamAV using ClamSMTP List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: JSON core full-stack template base cinap_lenrek@felloff.net once said: > we have to do the operation using the type of the right hand side: > > diff -r f8f63e944375 sys/src/cmd/7c/cgen.c > --- a/sys/src/cmd/7c/cgen.c Fri Jul 17 16:53:20 2020 +0200 > +++ b/sys/src/cmd/7c/cgen.c Sat Aug 01 13:33:09 2020 +0200 > @@ -287,10 +287,10 @@ > reglcgen(&nod2, l, Z); > else > nod2 = *l; > - regalloc(&nod, n, nn); > + regalloc(&nod, r, nn); > cgen(r, &nod); > } else { > - regalloc(&nod, n, nn); > + regalloc(&nod, r, nn); > cgen(r, &nod); > if(l->addable < INDEXED) > reglcgen(&nod2, l, Z); > > [...] > > we'll need to to do a bunch of test now to make sure this > change doesnt break anything. A similar change was made here a while back: https://bitbucket.org/64tharmybrigade/7acl/commits/7fcd631dd3 changeset: 177:7fcd631dd30f user: Charles Forsyth date: Tue Jul 26 11:13:44 2016 +0100 files: 7c/cgen.c description: handle mixed-mode asops diff --git a/7c/cgen.c b/7c/cgen.c --- a/7c/cgen.c +++ b/7c/cgen.c @@ -287,28 +287,22 @@ reglcgen(&nod2, l, Z); else nod2 = *l; - regalloc(&nod, n, nn); + regalloc(&nod, r, nn); cgen(r, &nod); } else { - regalloc(&nod, n, nn); + regalloc(&nod, r, nn); cgen(r, &nod); if(l->addable < INDEXED) reglcgen(&nod2, l, Z); else nod2 = *l; } - regalloc(&nod1, n, Z); - gopcode(OAS, &nod2, Z, &nod1); - if(nod1.type->etype != nod.type->etype){ - regalloc(&nod3, &nod, Z); - gmove(&nod1, &nod3); - regfree(&nod1); - nod1 = nod3; - } + regalloc(&nod1, &nod, nod1.type==nod2.type? nn: Z); + gmove(&nod2, &nod1); gopcode(o, &nod, &nod1, &nod); gmove(&nod, &nod2); if(nn != Z) - gmove(&nod, nn); + gmove(&nod2, nn); regfree(&nod); regfree(&nod1); if(l->addable < INDEXED) Anthony