[llvm] [LoongArch] Pre-commit for lowering shuffle as lane permute and shuffle. (PR #141205)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 23 00:36:51 PDT 2025


tangaac wrote:

~~~llvm
define <4 x double> @shuffle_v4f64(<4 x double> %a, <4 x double> %b) {
  %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 3, i32 1, i32 2, i32 0>
  ret <4 x double> %shuffle
}
~~~

after optimization
~~~asm
	pcalau12i	$a0, %pc_hi20(.LCPI5_0)
	xvld	$xr2, $a0, %pc_lo12(.LCPI5_0)
	pcalau12i	$a0, %pc_hi20(.LCPI5_1)
	xvld	$xr1, $a0, %pc_lo12(.LCPI5_1)
	xvpermi.d	$xr3, $xr0, 78
	xvshuf.d	$xr2, $xr0, $xr3
	xvshuf.d	$xr1, $xr2, $xr0
	xvori.b	$xr0, $xr1, 0
	ret

~~~

https://github.com/llvm/llvm-project/pull/141205


More information about the llvm-commits mailing list