This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN 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: variable width instructions


Hi -

On Fri, Dec 20, 2002 at 05:57:54PM -0500, David Carney wrote:
> [...]
> My question is: how I should go about defining the instruction fields for
> this architecture?  I.e. what value should I use for the "start" fields in 
> "(define-ifield ...)" for the msb so that instruction fields are compatible 
> for both 16-bit and (the effectively) 32-bit instructions (15 or 31) ?

There is a simple trick ...

> My confusion stems from observing the line:
> 	(dnf f-i32       "32 bit immediate"      (SIGN-OPT) 16 32)
> in fr30.cpu.  Doesn't the "16 32" denote that the start of the opcode is at 
> bit 16, but the length is 32?  

Yes - methinks it's used by 48-bit-long instructions.

The trick is that, for variable-length instruction sets, one should
start numbering bits from the left (opcode) end.  (Set lsb0=#f.)


- FChE


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