This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: New back end ia16: 16-bit Intel x86
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Aug 2007 11:37:58 -0400 (EDT)
- Subject: Re: New back end ia16: 16-bit Intel x86
Rask Ingemann Lambertsen writes:
>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.
Except for the first point, your port should take advantage of the
improvements made in those areas.
As I see it, there's two groups of developers who would want to use
your port. Thoses writing embedded applications targeting the 80186
and those writing low-level 16-bit system code, like boot loaders.
The later group of people are targetting at least i386 processors, and
can often assume more modern processors are being used. I have 16-bit
C code, that when compiled with my 16 year-old Borland C++ compiler,
produces code that uses 32-bit registers and instructions. I think
features like this would be a lot more useful today in a 16-bit IA-32
compiler than getting the RTX costs right on a processor like the 80286
that hasn't been made in a couple of decades.
>> 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?
Like I said, while ideally they should be merged, I can see good reasons
for not doing so. I'm not really arguing for that, at least not at
this point.
>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.
Ideally, the 16-bit port should support the entire IA-32 instruction set,
and I don't see that happening if the ports aren't merged. Maybe it
will be never worth the trouble, but it would make your port a lot more
useful to me.
Ross Ridge