public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Excluding parts of the instruction set during compilation
@ 2014-02-13 10:21 Fabian Oboril
  2014-02-13 11:51 ` Kyrill Tkachov
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Oboril @ 2014-02-13 10:21 UTC (permalink / raw)
  To: gcc-help

Hello everybody,

I am currently working on a project for which I need to compile C-code 
using only a small subset of the available instruction set. So for 
example, instead of using add, addi, addiu and addu, I would like that 
the compiler is using just one of them. Is there a way, that this can be 
handled with gcc, for example by giving a list of not-to-use 
instructions at compile time?

Can anyone help?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Excluding parts of the instruction set during compilation
  2014-02-13 10:21 Excluding parts of the instruction set during compilation Fabian Oboril
@ 2014-02-13 11:51 ` Kyrill Tkachov
  0 siblings, 0 replies; 2+ messages in thread
From: Kyrill Tkachov @ 2014-02-13 11:51 UTC (permalink / raw)
  To: Fabian Oboril; +Cc: gcc-help

On 13/02/14 10:21, Fabian Oboril wrote:
> Hello everybody,
>
> I am currently working on a project for which I need to compile C-code
> using only a small subset of the available instruction set. So for
> example, instead of using add, addi, addiu and addu, I would like that
> the compiler is using just one of them. Is there a way, that this can be
> handled with gcc, for example by giving a list of not-to-use
> instructions at compile time?
>
> Can anyone help?

Hi Fabian,

It's not really possible to give gcc a list of instructions not to use. What if 
some operations in your source code can only be performed by those instructions 
that you excluded? Getting the compiler to synthesise any operation using any 
arbitrary subset of instructions is not realistic.
Some targets, for example arm, can generate code for multiple revisions of the 
architecture and newer revisions might allow instructions that are not present 
in previous ones. In that case gcc will know not to generate those instructions 
if asked to compile for the old instruction by having -march set appropriately, 
but the list of instructions available for use is defined by the architecture, 
not the user.

HTH,
Kyrill


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-13 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 10:21 Excluding parts of the instruction set during compilation Fabian Oboril
2014-02-13 11:51 ` Kyrill Tkachov

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