This is the mail archive of the
mailing list for the GCC project.
Re: Detecting and optimising byte swaping operations in words
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: "K.G." <k_guillaume at libertysurf dot fr>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 21 Sep 2004 16:49:18 +0200
- Subject: Re: Detecting and optimising byte swaping operations in words
- References: <firstname.lastname@example.org>
> I was wondering how difficult it would be to write some code in
> gcc in order to detect and optimise byte swaping operations with host
> processor instructions, like 'bswap' on x86.
> Reading the generated assembly code, I see that gcc already detect and
> optimise binary rotation code. Maybe this would be quite similar ?
> Where should I look in gcc to to find the place where this
> optimisation is done ?
This has been already discussed on this mailing list. I suggest you look for
the previous discussions as they contain advices about where to start. I think
the first step would be to implement a builtin function like