This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New back end ia16: 16-bit Intel x86


On Tue, Aug 21, 2007 at 01:45:35AM -0700, H. Peter Anvin wrote:
> 
> As an interesting mental exercise, I tried to see if I could get the
> i386 backend to emit 16-bit code.  It now produces code for some very
> simple functions, but I find myself getting stuck pretty hard on the
> fact that the i386 backend seems to assume pretty hard that
> word == Pmode == the width of a hard register, which is not true when
> one wants to use 32-bit registers but have 16-bit addressing.
> 
> Another problematic issue is that I haven't, at least, figured out any
> way by which one can tell that only part of a register has been
> clobbered by a function.  This means spilling 32-bit registers to the
> stack every time, with extra 66 bytes.

   Ah yes, there was that little detail. And if you split up the registers,
you would really have to audit the rest of the back end for assumptions that
register size == word size. That's probably not worth it for your project.

> This, in fact, was the
> motivation for using HImode registers in DrV's port (there seems to be
> some issues with that which we haven't figured out, but that's probably
> just naïveté on our part.)

   If it's simply saving too many registers, I think that's not quite unusual.
It sometimes happens with other back ends too.

-- 
Rask Ingemann Lambertsen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]