On Mon, 2012-09-24 at 09:47 +0200, Oleg Endo wrote:
> On Mon, 2012-09-24 at 09:15 +0200, Eric Botcazou wrote:
> > > A while ago I've tried doing that for SH (implementing bswap16 with RTL
> > > combine). It was like an explosion of patterns, because combine would
> > > try out a lot of things depe
On Fri, Sep 21, 2012 at 10:04 AM, Christophe Lyon
wrote:
> On 20 September 2012 09:55, Christophe Lyon
> wrote:
>> On 20 September 2012 09:12, Eric Botcazou wrote:
The attached patch catches C constructs:
(A << 8) | (A >> 8)
where A is unsigned 16 bits
and maps them to built
> I guess I just have to wait for approval by the right maintainer now?
Right, GCC's bureaucracy is no legend. :-)
I've CCed Richard, who approved the __builtin_bswap16 stuff back in April.
--
Eric Botcazou
On 25 September 2012 13:32, Segher Boessenkool
wrote:
>>> Christophe, it looks like the zero-extend in the unsigned case is not
>>> needed on any target? Assuming the shifts are at least SImode, of
>>> course (I'm too lazy to check, sorry).
>>
>>
>> It's also present when compiling:
>> unsigned s
Christophe, it looks like the zero-extend in the unsigned case is not
needed on any target? Assuming the shifts are at least SImode, of
course (I'm too lazy to check, sorry).
It's also present when compiling:
unsigned short swapu16(unsigned short x) {
return __builtin_bswap16(x);
}
so it'
On 25 September 2012 07:00, Segher Boessenkool
wrote:
> Christophe, it looks like the zero-extend in the unsigned case is not
> needed on any target? Assuming the shifts are at least SImode, of
> course (I'm too lazy to check, sorry).
>
It's also present when compiling:
unsigned short swapu16(un
The generated code is now:
myswaps16:
rlwinm 10,3,8,16,23
rlwinm 9,3,24,24,31
or 9,9,10
extsh 3,9
blr
myswapu16:
rlwinm 10,3,8,16,23
rlwinm 9,3,24,24,31
or 9,9,10
rlwinm 3,9,0,0x
blr
While it was (without my patc
> I have not yet been able to build an environment to run the testsuite
> with qemu-ppc (not sure about the best target & dejagnu board
> selection).
No problem, that wasn't really a requirement.
> However, when compiling a sample test
> short myswaps16(short x) {
>return (x << 8) | (x >> 8);
On 21 September 2012 12:56, Eric Botcazou wrote:
>> Here is a new patch, modifying tree-ssa-math-opts.c as you suggested.
>> It's indeed simpler :-)
>>
>> Validated with qemu-arm on target arm-none-linux-gnueabi.
>
> I cannot formally approve, but this looks good to me.
>
> However, could you chec
On Mon, 2012-09-24 at 09:15 +0200, Eric Botcazou wrote:
> > A while ago I've tried doing that for SH (implementing bswap16 with RTL
> > combine). It was like an explosion of patterns, because combine would
> > try out a lot of things depending on the surrounding code around the
> > actual bswap16.
> A while ago I've tried doing that for SH (implementing bswap16 with RTL
> combine). It was like an explosion of patterns, because combine would
> try out a lot of things depending on the surrounding code around the
> actual bswap16. In the end I decided to drop that stuff for the most
> part.
On Fri, Sep 21, 2012 at 1:04 AM, Christophe Lyon
wrote:
> On 20 September 2012 09:55, Christophe Lyon
> wrote:
>> On 20 September 2012 09:12, Eric Botcazou wrote:
The attached patch catches C constructs:
(A << 8) | (A >> 8)
where A is unsigned 16 bits
and maps them to builti
On Thu, 2012-09-20 at 09:12 +0200, Eric Botcazou wrote:
> > The attached patch catches C constructs:
> > (A << 8) | (A >> 8)
> > where A is unsigned 16 bits
> > and maps them to builtin_bswap16(A) which can provide more efficient
> > implementations on some targets.
>
> This belongs in tree-ssa-ma
> Here is a new patch, modifying tree-ssa-math-opts.c as you suggested.
> It's indeed simpler :-)
>
> Validated with qemu-arm on target arm-none-linux-gnueabi.
I cannot formally approve, but this looks good to me.
However, could you check that this is also an improvement for PowerPC, which
is t
On 20 September 2012 09:55, Christophe Lyon wrote:
> On 20 September 2012 09:12, Eric Botcazou wrote:
>>> The attached patch catches C constructs:
>>> (A << 8) | (A >> 8)
>>> where A is unsigned 16 bits
>>> and maps them to builtin_bswap16(A) which can provide more efficient
>>> implementations o
On 20 September 2012 09:12, Eric Botcazou wrote:
>> The attached patch catches C constructs:
>> (A << 8) | (A >> 8)
>> where A is unsigned 16 bits
>> and maps them to builtin_bswap16(A) which can provide more efficient
>> implementations on some targets.
>
> This belongs in tree-ssa-math-opts.c:ex
> The attached patch catches C constructs:
> (A << 8) | (A >> 8)
> where A is unsigned 16 bits
> and maps them to builtin_bswap16(A) which can provide more efficient
> implementations on some targets.
This belongs in tree-ssa-math-opts.c:execute_optimize_bswap instead.
When I implemented __builti
On Wed, 2012-09-19 at 18:44 +0200, Georg-Johann Lay wrote:
> This seems overly complicated on 16-bit platforms where (A << 8) | (A >> 8)
> is the same as rotate:HI (A 8).
>
> Does your patch make sure that (A << 8) | (A >> 8) is still mapped to ROTATE
> on these targets?
>
If I remember correct
Christophe Lyon wrote:
> Hi,
>
> The attached patch catches C constructs:
> (A << 8) | (A >> 8)
> where A is unsigned 16 bits
> and maps them to builtin_bswap16(A) which can provide more efficient
> implementations on some targets.
>
> The construct above is equivalent to the default bswap16 impl
19 matches
Mail list logo