On Mon, Jun 27, 2011 at 10:06 AM, Kai Tietz <kti...@redhat.com> wrote: > Hello, > > this patch improves the bswap (32/64) detection and fixes an issue about > shifted bit values out of type-size precision. > > ChangeLog > > 2011-06-27 Kai Tietz <kti...@redhat.com> > > * tree-ssa-math-opts.c (do_shift_rotate): Zero bits > out of type precision after operation. > (find_bswap): Take for limit value the integer auto- > promotion into account. > > ChangeLog > > 2011-06-27 Kai Tietz <kti...@redhat.com> > > * gcc.dg/optimize-bswapdi-2.c: New test. > > Bootstrapped and regression tested for x86_64-pc-linux-gnu. Ok for apply?
The do_shift_rotate hunk is ok. Where did you get the testcase from? I can easily construct testcases that go via an intermediate SImode step and the still won't be recongized. Thus, is the testcase practically relevant? If so we should add 1 + log2 (byte-size) instead of 3 to also cover the SImode -> HImode intermediate case. Thanks, Richard. > Regards, > Kai >