9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
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))
Date: Sat, 1 Aug 2020 05:23:02 -0700	[thread overview]
Message-ID: <20200801122302.GC31465@alice> (raw)
In-Reply-To: <8BFCD64ADCEA9E2631D9323B893FF9A2@felloff.net>

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 <charles.forsyth@gmail.com>
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


  reply	other threads:[~2020-08-01 12:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 15:54 netsurf native frontend telephil9
2020-05-21 16:06 ` [9front] " hiro
2020-05-21 17:59 ` Romano
2020-07-28  7:11   ` [9front] netsurf native frontend (text_insert: illegal combination FCVTZSDW FCON NONE REG) Romano
2020-07-29  6:08     ` arm64 fails to link when float converted to int (Was Re: [9front] netsurf native frontend (text_insert: illegal combination FCVTZSDW FCON NONE REG)) Romano
2020-08-01 11:43       ` cinap_lenrek
2020-08-01 12:23         ` Anthony Martin [this message]
2020-05-21 21:16 ` [9front] netsurf native frontend Dave MacFarlane
2020-05-23 11:03   ` telephil9
2020-05-23 15:42     ` Stanley Lieber
2020-05-23 16:13     ` Stanley Lieber
2020-05-23  4:08 ` kokamoto
2020-05-23  6:13   ` Eli Cohen
2020-05-23  6:18     ` telephil9
2020-05-23  6:37       ` Eli Cohen
2020-05-23 20:10   ` jamos
2020-05-24  0:02     ` kokamoto
2020-05-25  3:51       ` kokamoto
2020-05-24  2:13 ` sl
2020-08-01 18:41 arm64 fails to link when float converted to int (Was Re: [9front] netsurf native frontend (text_insert: illegal combination FCVTZSDW FCON NONE REG)) Romano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200801122302.GC31465@alice \
    --to=ality@pbrane.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).