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
On Fri, Aug 17, 2007 at 03:36:34PM -0700, H. Peter Anvin wrote:
> Rask Ingemann Lambertsen wrote:
> >
> > The linux boot code compiles into 32-bit, i386+ code using the
> > unmodified
> >i386 back end. That it runs in a code segment where the default data and
> >address sizes are 16 bits just means that it needs a lot of 0x66 and 0x67
> >prefixes, but that's handled entirely by GAS. If you want to help the linux
> >people here, implement an option to reliably output a ".code16gcc"
> >directive
> >at the beginning of the asm file.
>
> There is a fair bit of code bloat as a result, though.
That's what I said, isn't it?
> I have been
> mentoring and working with a GSoC student, Daniel Verkamp, in putting
> out a different 16-bit x86 backend based on old work by DJ Delorie.
IMHO, a 16-bit x86 back end is not a very nice GSoC project. More like
something you can break your neck on.
> That backend just got to the point where we can compare code sizes; the
> code appears 10-20% smaller than the i386 backend with .code16gcc and
> -Os. Although that is less than I would have expected, that is without
> any optimizations whatsoever and so the resulting code is actually quite
> poor.
You could probably save at least as much by using 16-bit integers, thus
avoiding the 0x66 prefixes.
--
Rask Ingemann Lambertsen