9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Latchesar Ionkov <lucho@ionkov.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] 8a/8l bug
Date: Wed, 17 Dec 2003 18:33:12 -0500	[thread overview]
Message-ID: <20031217233312.GA8216@ionkov.net> (raw)
In-Reply-To: <E1AWkYg-000BA1-JZ@t40.swtch.com>

Thanks,

I already found the code and changed it. Is it likely such changes to be
accepted in the standard Plan9 distribution?

Ideally there should be an option whether to do that type of optimizations.
Unfortunately it is hard to implement the option without introducing a flag
per row in the y* arrays. The flag will be also useful for opcodes that
translate to different types of instructions some of which have 0x0f prefix,
while others don't. Currently that is not supported and it is very hard to
add support for IMUL Reg, Imm8 for example.

Would you accept patch that:

1. Adds a new option whether to do instruction optimizations.
2. Modifies y* arrays to have a flag whether the instruction code should be
used if the optimizations are on.
3. Optionally the flag also holds information whether the specific
instruction has 0x0f/0x66 headers overriding the default specified in the
optab array.

Thanks,
	Lucho

On Wed, Dec 17, 2003 at 05:54:19PM -0500, Russ Cox said:
> > Also
> > 	ADDL	$-1, AX
> >
> > is not equivalent to
> >
> > 	SUBL	$1, AX
> >
> > The CF flag is different.
>
> The linker is doing the "optimizations" as part of
> instruction selection.  (The split of work between
> compiler and loader is different than it is with gcc.)
>
> In uchar yaddl[] = { ..., delete the two lines beginning
> with Yi1.
>
> Then you have to edit all the table entries in optab[]
> that reference yaddl to remove the offending inc/dec
> instructions.  But I can't remember how to decode
> that table.
>
> Russ


  reply	other threads:[~2003-12-17 23:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-17 17:59 Latchesar Ionkov
2003-12-17 19:26 ` Latchesar Ionkov
2003-12-17 22:54   ` Russ Cox
2003-12-17 23:33     ` Latchesar Ionkov [this message]
2003-12-17 23:38       ` Russ Cox
2003-12-18  0:13         ` Latchesar Ionkov
2003-12-18  0:25         ` Charles Forsyth
2003-12-18  4:54   ` jmk

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=20031217233312.GA8216@ionkov.net \
    --to=lucho@ionkov.net \
    --cc=9fans@cse.psu.edu \
    /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).