public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* selecting between two forms of an instruction
@ 2008-11-15 14:56 Alan Lehotsky
  0 siblings, 0 replies; only message in thread
From: Alan Lehotsky @ 2008-11-15 14:56 UTC (permalink / raw)
  To: cgen; +Cc: Alan Lehotsky

Working on a port for a machine with 16 bit and 32 bit fixed length  
instructions.  The machine is somewhat like an ARM/Thumb  
architecture, but
there is no mode switch.  You use the 16 bit instructions if you have  
short displacements or only need to access a subset of all the  
registers.

It occurs to me that I could ALWAYS generate 32 bit instructions in  
the assembler and let the linker relax 32 bitters to 16 bitters based on
the actual requirements of the program.

Is there any downside to this strategy?   I've done this in the past  
for branching instructions and (on the IP2K) the insertion and  
deletion of bank switching
instructions - but never so aggressively where nearly every  
instruction has a short form.

-- Al


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-15 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-15 14:56 selecting between two forms of an instruction Alan Lehotsky

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).