Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bswap is slow on SPARC



On Mon, Nov 24, 2025 at 18:10:07 +0300, Valery Ushakov wrote:

> With the suggested renaming this turns into:
> 
>     #define bswap64(x) \
>             __CAST(uint64_t, __builtin_constant_p((x)) ? \
>             __byte_swap_u64_constexpr(x) : __BYTE_SWAP_U64_VARIABLE(x))

VARIABLE here is actually also confusing, b/c it immediately made me
think, why don't we use a little-endian ASI to read the "variable" in
SparcV9.  Can we actually express this with gcc builtin tests -
assuming it little endian ASI actually works and provides performance
win?  I would naively assume it does, but cache effects or whatever
might interfere...

Can you try it since you are messing with v9 asm anyway?  It might
make it even faster :)

-uwe


Home | Main Index | Thread Index | Old Index