This is the mail archive of the gcc@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: Endian swapping with C code on ARM


On Fri, Jul 09, 2004 at 07:00:37PM +0200, Falk Hueffner wrote:
> I've attached my old patch. It uses a libgcc function as fallback. If
> it seems OK, I could tie up the loose ends and send it to gcc-patches.

I think this is probably worthwhile.

> +    case BUILT_IN_BSWAP32:

I'm not sure I'd call them this though; bswap{,l,ll} would be more
in line with existing builtins.

> +      target = expand_builtin_unop (SImode, arglist, target,
> +				    subtarget, bswap_optab);

Certainly hardcoding SImode/DImode is wrong.  

> +extern USItype __bswapsi2 (USItype);
> +extern UDItype __bswapdi2 (UDItype);

You need the same mode name frobbing bits as with the other functions.

> +	_popcountsi2 _popcountdi2 _paritysi2 _paritydi2_bswapsi2 _bswapdi2'

Missing space.

> +/* Byte swapping.  */
> +DEFTREECODE (BSWAP_EXPR, "bswap_expr", '1', 1)

I don't think we need this.  We optimize builtin functions well
enough as it is.


r~


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