public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rask Ingemann Lambertsen <rask@sygehus.dk>
To: Ross Ridge <rridge@csclub.uwaterloo.ca>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: New back end ia16: 16-bit Intel x86
Date: Wed, 01 Aug 2007 00:34:00 -0000	[thread overview]
Message-ID: <20070801003403.GW25795@sygehus.dk> (raw)
In-Reply-To: <20070731174456.8199574286@caffeine.csclub.uwaterloo.ca>

On Tue, Jul 31, 2007 at 01:44:56PM -0400, Ross Ridge wrote:
> Michael Matz writes:
> > Blaeh, that's all ugly.  I actually think that ia16 is a reasonable name 
> >for this ISA, even though Rask just made it up.
> 
> I think "ia16" is an ugly backformation and being made up like this
> there's a risk of it conflicting with something else in the future.

   I did not make it up. Try asking Google for "Intel IA16" or "Intel
IA-16". At least one search result is 7 (seven) years old. It is also clear
from the search results that outside of Intel, IA16 or IA-16 means the
16-bit x86 family members i8086-i80286 and IA32 or IA-32 means x86 family
members starting with the i80386.

> >It's generating code for the 16 bit mode (which works on all the intel
> >CPUs) which for all practical measures is a different CPU architecture
> >than the same chip in 32bit or 64bit mode (it just happens to share some
> >mnemonics and insn encodings).
> 
> That's absurd.  By sharing the same instruction set and registers, for
> "all practical measures" it is the same CPU architecture.

   You know, over the years Intel (and for x86-64, AMD) fixed (or worked
around) many shortcomings of the i8086:

   1) Addressing modes, most notably the lack of sp relative addressing.
   2) Tight register constraints.
   3) Registers with no 8-bit move instructions.
   4) Lack (or prohibitive slowness) of useful instructions.

   There is also a huge difference in what optimized code looks like even
between the i80286 and the i80386. Compare the ia16 instruction cost tables
and ia16_rtx_cost() with the i386 ones and ix86_rtx_cost(). I borrowed much
for the i386 back here but the differences are too big for a merge.

> There's a
> bigger difference between 32-bit and 64-bit mode and GCC doesn't treat the
> x86_64 as a different architecture.

   The 32-bit and 64-bit modes are not all that different. The only big
differences are pc-relative addressing and zero extension of 32-bit
destination operands, the latter of which only requires extra instruction
patterns to utilize.

> Ideally a 16-bit IA-32 port should
> be merged into the i386 port, just like the x86_64 port.

   Q: How do I know you didn't discuss that with the i386 maintainers?
   A: Because you haven't started running for your life yet! :-)

   Notice a couple of things:

1) Different STORE_FLAG_VALUE.
2) Different register layout.
3) Much different optimization strategy.
4) Difference in insn patterns for addw, subw, andw, orw and xorw, where
ia16 tries hard to optimize 16-bit operations which are rare on i386.

   Now, x87 hardware floating point gives an easy upportunity for sharing
code between 16-bit and 32-bit modes[1], but with reg-stack.c already split
out from the i386 back end and 16-bit x87 not having all that many
instructions to write patterns for, I doubt the saving is worth the amount
of extra grot that a merge of ia16 and i386 would produce.

[1] 64-bit mode dropped the x87 style FPU.

-- 
Rask Ingemann Lambertsen

  reply	other threads:[~2007-08-01  0:34 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 18:06 Ross Ridge
2007-08-01  0:34 ` Rask Ingemann Lambertsen [this message]
2007-08-01  9:53   ` Richard Kenner
2007-08-01 12:33     ` Rask Ingemann Lambertsen
2007-08-01 12:44       ` Richard Kenner
2007-08-01 13:41         ` Rask Ingemann Lambertsen
2007-08-01 13:52           ` Richard Kenner
2007-08-01 10:38   ` Jan Hubicka
2007-08-01 17:30     ` Rask Ingemann Lambertsen
  -- strict thread matches above, loose matches on Subject: below --
2007-08-19 19:58 Ross Ridge
2007-08-19 16:11 Ross Ridge
2007-08-19 17:36 ` Rask Ingemann Lambertsen
2007-08-18 20:46 Ross Ridge
2007-08-19 16:20 ` Rask Ingemann Lambertsen
2007-08-06 14:23 Uros Bizjak
2007-08-07  1:29 ` Rask Ingemann Lambertsen
2007-08-07 17:37   ` Daniel Jacobowitz
2007-08-07 20:03   ` Uros Bizjak
2007-08-08 12:21     ` Jan Hubicka
2007-08-08 17:30       ` Mark Mitchell
2007-08-08 23:22         ` Richard Kenner
2007-08-08 18:52       ` Rask Ingemann Lambertsen
2007-08-08 20:24         ` Michael Matz
2007-08-08 20:59         ` H.J. Lu
2007-08-08 22:46           ` DJ Delorie
2007-08-09  9:33         ` Jan Hubicka
2007-08-09 14:01           ` Rask Ingemann Lambertsen
2007-08-09 15:43           ` DJ Delorie
2007-08-08 15:28     ` Rask Ingemann Lambertsen
2007-08-17 22:38       ` H. Peter Anvin
2007-08-18  2:34         ` Rask Ingemann Lambertsen
2007-08-18  5:33           ` H. Peter Anvin
2007-08-18 17:36             ` Rask Ingemann Lambertsen
2007-08-18 17:50               ` H. Peter Anvin
2007-08-18 20:39                 ` Rask Ingemann Lambertsen
2007-08-19  2:11                   ` H. Peter Anvin
2007-08-19 12:25                     ` Rask Ingemann Lambertsen
2007-08-19 20:07                       ` H. Peter Anvin
2007-08-21  8:48                       ` H. Peter Anvin
2007-08-21 14:35                         ` Rask Ingemann Lambertsen
2007-08-21 17:46                           ` H. Peter Anvin
2007-08-19  7:29                   ` H. Peter Anvin
2007-08-19 10:56                     ` Rask Ingemann Lambertsen
2007-08-19 21:40                       ` H. Peter Anvin
2007-08-02 20:15 Ross Ridge
2007-08-01 19:25 Ross Ridge
2007-08-01 22:57 ` Rask Ingemann Lambertsen
     [not found] <20070801153758.ACBB974253@caffeine.csclub.uwaterloo.ca.suse.lists.egcs-patches>
2007-08-01 17:44 ` Andi Kleen
2007-08-01 15:38 Ross Ridge
2007-08-01 17:59 ` Rask Ingemann Lambertsen
2007-07-31 15:24 Ross Ridge
2007-07-31 17:44 ` Michael Matz
2007-07-31  0:50 Ross Ridge
2007-07-31  8:54 ` Tristan Gingold
2007-07-31 13:46 ` Rask Ingemann Lambertsen

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=20070801003403.GW25795@sygehus.dk \
    --to=rask@sygehus.dk \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rridge@csclub.uwaterloo.ca \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).