9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] Start Syncing Compilers with Plan 9
Date: Tue, 18 Jun 2019 13:41:37 +0200	[thread overview]
Message-ID: <654BBA391790D2F7C6B12E5F673EE195@felloff.net> (raw)
In-Reply-To: 8FCE1A8D8D8B792BBF325E9251A383C1@eigenstate.org

ok, i tried the OINDEX change in a vm and ran into the issue
that 8c then runs out of registers compiling a chain of []
operations (libvorbis).

the reason is the following code in xcom(), which converts
addition with indirect operands into a index operation.
having side() return 1 for OINDE gated that bug.

the issue is that when the index operand is a name or
constant, its complex number (#reg) is zero which we
would propagate to the INDEX operation itself. but we
need at least ONE index register!

adjusting the #reg at just like at the brk: in xcom() fixes
the issue.

		if(n->addable == 8 && !side(n)) {
			indx(n);
			l = new1(OINDEX, idx.basetree, idx.regtree);
			l->scale = idx.scale;
			l->addable = 9;
			l->complex = l->right->complex;
+			if(l->complex == 0)
+				l->complex++;
			l->type = l->left->type;
			n->op = OADDR;
			n->left = l;
			n->right = Z;
			n->addable = 8;
			break;
		}

commited in:

changeset:   7276:0e16ecb295ad
parent:      7272:648786a6af71
user:        cinap_lenrek@felloff.net
date:        Tue Jun 18 13:28:15 2019 +0200
summary:     8c, 6c: fix INDEX node #reg calculation

--
cinap


             reply	other threads:[~2019-06-18 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 11:41 cinap_lenrek [this message]
2019-06-18 11:52 cinap_lenrek

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=654BBA391790D2F7C6B12E5F673EE195@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --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).