This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC, patch] implement __builtin_bswap


Eric Christopher <echristo@apple.com> writes:

> +#ifdef L_bswapsi2
> +Wtype
> +__bswapSI2 (Wtype u)
> +{
> +  return ((((u) & 0xff000000) >> 24) | (((u) & 0x00ff0000) >>  8) |
> +	  (((u) & 0x0000ff00) <<  8) | (((u) & 0x000000ff) << 24));
> +}

What kind of crazed formatting is this?  Please fix to GNU standard.

> +DWtype
> +__bswapDI2 (DWtype u)
> +{
> +  return ((((u) & 0xff00000000000000ull) >> 56) | (((u) & 0x00ff000000000000ull) >> 40) |
> +	  (((u) & 0x0000ff0000000000ull) >> 24) | (((u) & 0x000000ff00000000ull) >>  8) |
> +	  (((u) & 0x00000000ff000000ull) <<  8) | (((u) & 0x0000000000ff0000ull) << 24) |
> +	  (((u) & 0x000000000000ff00ull) << 40) | (((u) & 0x00000000000000ffull) << 56));
> +}
> +#endif

Please correct formatting and keep lines less than 80 columns.

As pbrook says:

> You need to add user documentation for the buintins to extend.texi, and 
> internals documentation for for the new RTL operator and standard pattern 
> names to rtl.texi and md.text.

With those changes, this is OK after 4.2 branches.  Which means that
you will have to change this to use version GCC_4.3.0:

@@ -273,4 +273,6 @@ GCC_4.2.0 {
   __floatuntixf
   __floatuntitf
   _Unwind_GetIPInfo
+  __bswapsi2
+  __bswapdi2
 }

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]