libgcc2.c (__bswapdi2): Rename from bswapDI2.

2006-11-07  Eric Christopher  <echristo@apple.com>

        * libgcc2.c (__bswapdi2): Rename from bswapDI2.
        (__bswapsi2): Ditto.
        * libgcc2.h: Remove transformation of bswap routines.
        * config/i386/i386.md (bswapsi2): New.
        (bswapdi2): Ditto.

2006-11-07  Eric Christopher  <echristo@apple.com>

        * gcc.target/i386/builtin-bswap-1.c: Rewrite for 64-bit.
        Test using scan-assembler-not.

From-SVN: r118576
This commit is contained in:
Eric Christopher 2006-11-08 02:24:26 +00:00
parent 701640b1f9
commit 6300f037d0
6 changed files with 328 additions and 295 deletions

View File

@ -1,3 +1,11 @@
2006-11-07 Eric Christopher <echristo@apple.com>
* libgcc2.c (__bswapdi2): Rename from bswapDI2.
(__bswapsi2): Ditto.
* libgcc2.h: Remove transformation of bswap routines.
* config/i386/i386.md (bswapsi2): New.
(bswapdi2): Ditto.
2006-11-07 Jakub Jelinek <jakub@redhat.com>
* c-common.c (c_common_attributes): Add gnu_inline attribyte.

View File

@ -14600,6 +14600,24 @@
"bsr{l}\t{%1, %0|%0, %1}"
[(set_attr "prefix_0f" "1")])
(define_insn "bswapsi2"
[(set (match_operand:SI 0 "register_operand" "=r")
(bswap:SI (match_operand:SI 1 "register_operand" "0")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_BSWAP"
"bswap\t%k0"
[(set_attr "prefix_0f" "1")
(set_attr "length" "2")])
(define_insn "bswapdi2"
[(set (match_operand:DI 0 "register_operand" "=r")
(bswap:DI (match_operand:DI 1 "register_operand" "0")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_BSWAP"
"bswap\t%0"
[(set_attr "prefix_0f" "1")
(set_attr "length" "3")])
(define_expand "clzdi2"
[(parallel
[(set (match_operand:DI 0 "register_operand" "")

View File

@ -494,7 +494,7 @@ __ashrdi3 (DWtype u, word_type b)
#ifdef L_bswapsi2
UWtype
__bswapSI2 (UWtype u)
__bswapsi2 (UWtype u)
{
return ((((u) & 0xff000000) >> 24)
| (((u) & 0x00ff0000) >> 8)
@ -504,7 +504,7 @@ __bswapSI2 (UWtype u)
#endif
#ifdef L_bswapdi2
UDWtype
__bswapDI2 (UDWtype u)
__bswapdi2 (UDWtype u)
{
return ((((u) & 0xff00000000000000ull) >> 56)
| (((u) & 0x00ff000000000000ull) >> 40)

View File

@ -304,13 +304,11 @@ typedef int word_type __attribute__ ((mode (__word__)));
#define __ctzSI2 __NW(ctz,2)
#define __popcountSI2 __NW(popcount,2)
#define __paritySI2 __NW(parity,2)
#define __bswapSI2 __NW(bswap,2)
#define __ffsDI2 __NDW(ffs,2)
#define __clzDI2 __NDW(clz,2)
#define __ctzDI2 __NDW(ctz,2)
#define __popcountDI2 __NDW(popcount,2)
#define __parityDI2 __NDW(parity,2)
#define __bswapDI2 __NDW(bswap,2)
extern DWtype __muldi3 (DWtype, DWtype);
extern DWtype __divdi3 (DWtype, DWtype);
@ -347,13 +345,13 @@ extern Wtype __addvSI3 (Wtype, Wtype);
extern Wtype __subvSI3 (Wtype, Wtype);
extern Wtype __mulvSI3 (Wtype, Wtype);
extern Wtype __negvSI2 (Wtype);
extern UWtype __bswapSI2 (UWtype);
extern UWtype __bswapsi2 (UWtype);
extern DWtype __absvDI2 (DWtype);
extern DWtype __addvDI3 (DWtype, DWtype);
extern DWtype __subvDI3 (DWtype, DWtype);
extern DWtype __mulvDI3 (DWtype, DWtype);
extern DWtype __negvDI2 (DWtype);
extern UDWtype __bswapDI2 (UDWtype);
extern UDWtype __bswapdi2 (UDWtype);
#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
extern SItype __absvsi2 (SItype);

View File

@ -1,3 +1,8 @@
2006-11-07 Eric Christopher <echristo@apple.com>
* gcc.target/i386/builtin-bswap-1.c: Rewrite for 64-bit.
Test using scan-assembler-not.
2006-11-07 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/inline-17.c: New test.

View File

@ -1,12 +1,16 @@
/* { dg-do compile } */
/* { dg-options "-march=i486" } */
/* { dg-final { scan-assembler "bswap" } } */
/* { dg-options "-march=nocona" } */
/* { dg-final { scan-assembler-not "builtin_bswap" } } */
int foo (int a)
long foo (long a)
{
int b;
long b;
b = __builtin_bswap (a);
#if __LP64__
b = __builtin_bswap64 (a);
#else
b = __builtin_bswap32 (a);
#endif
return b;
}