i386.md (*bswapdi2_rex): Renamed from bswapdi2.

* config/i386/i386.md (*bswapdi2_rex): Renamed from bswapdi2.
	(bswapdi2): New define_expand to implement 32-bit implementation.

	* gcc.target/i386/builtin-bswap-3.c: New test case.

From-SVN: r121851
This commit is contained in:
Roger Sayle 2007-02-12 18:41:08 +00:00 committed by Roger Sayle
parent c662432e8c
commit d8d25baea6
4 changed files with 38 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-02-12 Roger Sayle <roger@eyesopen.com>
* config/i386/i386.md (*bswapdi2_rex): Renamed from bswapdi2.
(bswapdi2): New define_expand to implement 32-bit implementation.
2007-02-12 Nick Clifton <nickc@redhat.com>
* doc/invoke.texi (Overall Options): Document --help=.

View File

@ -14973,7 +14973,7 @@
[(set_attr "prefix_0f" "1")
(set_attr "length" "2")])
(define_insn "bswapdi2"
(define_insn "*bswapdi2_rex"
[(set (match_operand:DI 0 "register_operand" "=r")
(bswap:DI (match_operand:DI 1 "register_operand" "0")))
(clobber (reg:CC FLAGS_REG))]
@ -14982,6 +14982,25 @@
[(set_attr "prefix_0f" "1")
(set_attr "length" "3")])
(define_expand "bswapdi2"
[(parallel [(set (match_operand:DI 0 "register_operand" "")
(bswap:DI (match_operand:DI 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"TARGET_BSWAP"
{
if (!TARGET_64BIT)
{
rtx tmp1, tmp2;
tmp1 = gen_reg_rtx (SImode);
tmp2 = gen_reg_rtx (SImode);
emit_insn (gen_bswapsi2 (tmp1, gen_lowpart (SImode, operands[1])));
emit_insn (gen_bswapsi2 (tmp2, gen_highpart (SImode, operands[1])));
emit_move_insn (gen_lowpart (SImode, operands[0]), tmp2);
emit_move_insn (gen_highpart (SImode, operands[0]), tmp1);
DONE;
}
})
(define_expand "clzdi2"
[(parallel
[(set (match_operand:DI 0 "register_operand" "")

View File

@ -1,3 +1,7 @@
2007-02-12 Roger Sayle <roger@eyesopen.com>
* gcc.target/i386/builtin-bswap-3.c: New test case.
2007-02-12 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/29145

View File

@ -0,0 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=nocona" } */
/* { dg-final { scan-assembler-not "bswapdi2" } } */
long long foo (long long x)
{
return __builtin_bswap64 (x);
}