Re: Guidelines for instruction set design?

Walter Banks <walter@bytecraft.com>
Wed, 06 May 2009 07:53:08 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: Guidelines for instruction set design? hsheboul@gmail.com (Hasan Alsheboul) (2009-05-04)
Re: Guidelines for instruction set design? cyril.cressent@gmail.com (2009-05-04)
Re: Guidelines for instruction set design? torbenm@pc-003.diku.dk (2009-05-04)
Re: Guidelines for instruction set design? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-05-05)
Re: Guidelines for instruction set design? bartc@freeuk.com (BartC) (2009-05-05)
Re: Guidelines for instruction set design? gneuner2@comcast.net (George Neuner) (2009-05-05)
Re: Guidelines for instruction set design? walter@bytecraft.com (Walter Banks) (2009-05-06)
Re: Guidelines for instruction set design? gmt@cs.arizona.edu (2009-05-06)
Re: Guidelines for instruction set design? dot@dotat.at (Tony Finch) (2009-05-07)
Re: Guidelines for instruction set design? gneuner2@comcast.net (George Neuner) (2009-05-10)
Re: Guidelines for instruction set design? toby@telegraphics.com.au (toby) (2009-05-10)
Re: Guidelines for instruction set design? anton@mips.complang.tuwien.ac.at (2009-05-12)
Re: Guidelines for instruction set design? gneuner2@comcast.net (George Neuner) (2009-05-12)
[5 later articles]
| List of all articles for this month |
From: Walter Banks <walter@bytecraft.com>
Newsgroups: comp.compilers
Date: Wed, 06 May 2009 07:53:08 -0400
Organization: Compilers Central
References: 09-05-020
Keywords: architecture, design
Posted-Date: 07 May 2009 07:30:49 EDT

cyril.cressent@gmail.com wrote:


> - $C0..15: 32-bits "Counter" registers. They can be used to load a
> constant or an address and to do indirect memory addressing. They also
> support post-inc/decrementation, if you append ++ or -- to the
> register name.


You might want to consider one of -- or ++ be pre operation and the
other a post operation. I personally prefer ++ as a post operation in
the instruction set designs I have worked on.




> An example of instruction:
>
> add $Cb, $Ra, $Rd
> add $Cb, $CON, $Rd
> add $CON, $Ra, $Rd
> add d($Cb[--|++]), $Ra, $Rd
> add d($Cb[--|++]), $CON, $Rd
> add d($Cb[--|++]), d(Imm | $Ca[--|++]), $Rd
>


Can $Rd be $Cx ?


> I guess writing a compiler for the CPU is possible, but porting one is
> much more difficult, even for retargetable compilers: most of them
> make assumptions about the CPU (load/store, register based...).


Don't underestimate the effort it takes to write a compiler from scratch
it doesn't take very long to get to the first level of emitting some code
then the real work begins.


You might want to do the code generation in two levels one with
the load store that is designed to feed into a peephole optimizer to take
advantage of the three operand nature of your instructions set.
Register allocation may be sub-optimal


Regards,


--
Walter Banks
Byte Craft Limited
http://www.bytecraft.com



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.