re PR rtl-optimization/42589 (bswap optimization does not work for 32bit (but for 64bit) on 64bit registers)
2010-01-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/42589 * tree-ssa-math-opts.c (execute_optimize_bswap): Allow double-word expansion of bswap32. * gcc.target/i386/pr42589.c: New testcase. From-SVN: r155588
This commit is contained in:
parent
5004040e8d
commit
ba1ee2281d
4 changed files with 31 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2010-01-03 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/42589
|
||||
* tree-ssa-math-opts.c (execute_optimize_bswap): Allow
|
||||
double-word expansion of bswap32.
|
||||
|
||||
2010-01-03 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* postreload-gcse.c (insert_expr_in_table): Replace BLOCK_NUM
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2010-01-03 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/42589
|
||||
* gcc.target/i386/pr42589.c: New testcase.
|
||||
|
||||
2010-01-03 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/42438
|
||||
|
|
17
gcc/testsuite/gcc.target/i386/pr42589.c
Normal file
17
gcc/testsuite/gcc.target/i386/pr42589.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-require-effective-target ilp32 } */
|
||||
/* { dg-options "-O2 -march=i486" } */
|
||||
|
||||
void
|
||||
foo (unsigned long long *p)
|
||||
{
|
||||
unsigned long long tmp;
|
||||
tmp = *p;
|
||||
tmp = (tmp >> 32) | (tmp << 32);
|
||||
tmp = (((tmp & 0xff00ff00ff00ff00ULL) >> 8)
|
||||
| ((tmp & 71777214294589695ULL) << 8));
|
||||
*p = (((tmp & 0xffff0000ffff0000ULL) >> 16)
|
||||
| ((tmp & 281470681808895ULL) << 16));
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-times "bswap" 2 } } */
|
|
@ -1111,8 +1111,9 @@ execute_optimize_bswap (void)
|
|||
&& optab_handler (bswap_optab, SImode)->insn_code !=
|
||||
CODE_FOR_nothing);
|
||||
bswap64_p = (built_in_decls[BUILT_IN_BSWAP64]
|
||||
&& optab_handler (bswap_optab, DImode)->insn_code !=
|
||||
CODE_FOR_nothing);
|
||||
&& (optab_handler (bswap_optab, DImode)->insn_code !=
|
||||
CODE_FOR_nothing
|
||||
|| (bswap32_p && word_mode == SImode)));
|
||||
|
||||
if (!bswap32_p && !bswap64_p)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue