Re: [PATCH] LoongArch: Rework bswap{hi,si,di}2 definition

2024-07-31 Thread Lulu Cheng
在 2024/7/31 下午6:25, Xi Ruoyao 写道: On Wed, 2024-07-31 at 16:57 +0800, Lulu Cheng wrote: 在 2024/7/29 下午3:58, Xi Ruoyao 写道: Per a gcc-help thread we are generating sub-optimal code for __builtin_bswap{32,64}.  To fix it: - Use a single revb.d instruction for bswapdi2. - Use a single revb.2w ins

Re: [PATCH] LoongArch: Rework bswap{hi,si,di}2 definition

2024-07-31 Thread Xi Ruoyao
On Wed, 2024-07-31 at 16:57 +0800, Lulu Cheng wrote: > > 在 2024/7/29 下午3:58, Xi Ruoyao 写道: > > Per a gcc-help thread we are generating sub-optimal code for > > __builtin_bswap{32,64}.  To fix it: > > > > - Use a single revb.d instruction for bswapdi2. > > - Use a single revb.2w instruction for bs

Re: [PATCH] LoongArch: Rework bswap{hi,si,di}2 definition

2024-07-31 Thread Lulu Cheng
在 2024/7/29 下午3:58, Xi Ruoyao 写道: Per a gcc-help thread we are generating sub-optimal code for __builtin_bswap{32,64}. To fix it: - Use a single revb.d instruction for bswapdi2. - Use a single revb.2w instruction for bswapsi2 for TARGET_64BIT, revb.2h + rotri.w for !TARGET_64BIT. - Use a s

[PATCH] LoongArch: Rework bswap{hi,si,di}2 definition

2024-07-29 Thread Xi Ruoyao
Per a gcc-help thread we are generating sub-optimal code for __builtin_bswap{32,64}. To fix it: - Use a single revb.d instruction for bswapdi2. - Use a single revb.2w instruction for bswapsi2 for TARGET_64BIT, revb.2h + rotri.w for !TARGET_64BIT. - Use a single revb.2h instruction for bswapsi2