bluesky idea: __attribute__ (netorder)

Richard Henderson
Mon Sep 7 19:09:00 GMT 1998

On Mon, Sep 07, 1998 at 10:04:12AM +0100, Jamie Lokier wrote:
> Please note you can use still use inline __asm__ in your version of
> ntohl etc.

Not effectively.  Inline asms do not have the same alternatives
feature of a full-fledged define_insn. 

Take ppc for example: it has three relevant instructions, byte-swap
load, store, and and a two-address in-register swap.  There is no
way to write an inline asm that can take in to account both source
and destination to choose which of these three instructions to use.

Of course, we could achieve the same optimization goals with a
builtin function rather than a data attribute and it would be far
less invasive.


More information about the Gcc mailing list