[FFmpeg-devel] [PATCH] strict-aliasing-safe aes.c

Reimar Döffinger Reimar.Doeffinger
Wed Jun 30 07:09:51 CEST 2010


On Wed, Jun 30, 2010 at 12:17:06AM +0200, Michael Niedermayer wrote:
> On Wed, Jun 30, 2010 at 12:05:26AM +0200, Reimar D?ffinger wrote:
> > > >  aes.c |   74 +++++++++++++++++++++++++++++++++++++-----------------------------
> > > >  1 file changed, 42 insertions(+), 32 deletions(-)
> > > > 172e32357bec3f033440078a57b908ff696472d7  aesalias.diff
> > > 
> > > if its confirmed that there is no speedloss and the object file does not
> > > become larger than i wont object to the patch. But its still ugly
> > 
> > Well, I had to test with gcc-4.3, since 4.4 does not produce working code...
> > Pure assembler size increases from 3957 bytes to 4025, for what I can tell
> > mostly because gcc randomly decides to use some extra bytes for the local
> > variables, which just makes it having to use 4-byte instead of 1-byte offsets
> > to address function parameters, which in turn then causes some alignment
> > to increase as well.
> > As for speed, with aes-test the results seem to indicate a surprising
> > 2% performance advantage for the new code (I'd expect due to some
> > other random code or data re-shuffling):
> > old:
> > 13377 dezicycles in aes, 8191 runs, 1 skips
> > 13387 dezicycles in aes, 8192 runs, 0 skips
> > 13368 dezicycles in aes, 8191 runs, 1 skips
> > 13360 dezicycles in aes, 8191 runs, 1 skips
> > 14279 dezicycles in aes, 8191 runs, 1 skips
> > 
> > new:
> > 12929 dezicycles in aes, 8191 runs, 1 skips
> > 12926 dezicycles in aes, 8191 runs, 1 skips
> > 12916 dezicycles in aes, 8191 runs, 1 skips
> > 12913 dezicycles in aes, 8191 runs, 1 skips
> > 12973 dezicycles in aes, 8191 runs, 1 skips
> > 
> > I'd welcome someone else to test.
> > Does this seem good enough to you?
> 
> commit it before i change my mind

Applied then.



More information about the ffmpeg-devel mailing list