Re: Byte permutation optimization

2008-07-13 Thread Daniel Berlin
On Sun, Jul 13, 2008 at 6:29 AM, Andi Kleen <[EMAIL PROTECTED]> wrote: > Nils Pipenbrinck <[EMAIL PROTECTED]> writes: > >> Since the codebase is huge I have the feeling that I have overlooked >> something. Does some kind of infrastructure to detect patterns within >> a SSA tree already exists somew

Re: Byte permutation optimization

2008-07-13 Thread Andi Kleen
Nils Pipenbrinck <[EMAIL PROTECTED]> writes: > Since the codebase is huge I have the feeling that I have overlooked > something. Does some kind of infrastructure to detect patterns within > a SSA tree already exists somewhere else? FWIW some time ago I wanted to do some other arithmetic optimizat

Byte permutation optimization

2008-07-12 Thread Nils Pipenbrinck
Hi there. I recently came across a nice micro-optimization to permutate bytes within a dword. On x86 all 24 combinations can be done using a maximum of 3 instructions (bswap, rotate32 and rotate16). I'd like to give it a try and write an optimization pass that detects such dword permutations