Commit ba1ee228 by Richard Guenther Committed by Richard Biener

re PR rtl-optimization/42589 (bswap optimization does not work for 32bit (but…

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
parent 5004040e
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
......
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
* gcc.dg/tree-ssa/ssa-pre-27.c: New testcase.
......
/* { 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment