[llvm] [X86][MC] Added support for -msse2avx option in llvm-mc (PR #96860)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 03:22:08 PDT 2024


================
@@ -0,0 +1,74 @@
+# RUN: llvm-mc -triple x86_64-unknown-unknown -msse2avx %s | FileCheck %s
+	.text
+# CHECK: vmovsd  -352(%rbp), %xmm0
+	movsd	-352(%rbp), %xmm0               # xmm0 = mem[0],zero
+# CHECK-NEXT: vunpcklpd       %xmm1, %xmm0, %xmm0     # xmm0 = xmm0[0],xmm1[0]
+	unpcklpd	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0]
+# CHECK-NEXT: vmovapd %xmm0, -368(%rbp)
+	movapd	%xmm0, -368(%rbp)
+# CHECK-NEXT: vmovapd -368(%rbp), %xmm0
+	movapd	-368(%rbp), %xmm0
+# CHECK-NEXT: vmovsd  -376(%rbp), %xmm1
+	movsd	-376(%rbp), %xmm1               # xmm1 = mem[0],zero
+# CHECK-NEXT: vmovsd  -384(%rbp), %xmm0
+	movsd	-384(%rbp), %xmm0               # xmm0 = mem[0],zero
+# CHECK-NEXT: vunpcklpd       %xmm1, %xmm0, %xmm0     # xmm0 = xmm0[0],xmm1[0]
+	unpcklpd	%xmm1, %xmm0                    # xmm0 = xmm0[0],xmm1[0]
+# CHECK-NEXT: vaddpd  %xmm1, %xmm0, %xmm0
+	addpd	%xmm1, %xmm0
+# CHECK-NEXT: vmovapd %xmm0, -464(%rbp)
+	movapd	%xmm0, -464(%rbp)
+# CHECK-NEXT: vmovaps -304(%rbp), %xmm1
+	movaps	-304(%rbp), %xmm1
+# CHECK-NEXT: vpandn  %xmm1, %xmm0, %xmm0
+	pandn	%xmm1, %xmm0
+# CHECK-NEXT: vmovaps %xmm0, -480(%rbp)
+	movaps	%xmm0, -480(%rbp)
+# CHECK-NEXT: vmovss  -220(%rbp), %xmm1
+	movss	-220(%rbp), %xmm1               # xmm1 = mem[0],zero,zero,zero
+# CHECK-NEXT: vinsertps       $16, %xmm1, %xmm0, %xmm0 # xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
+	insertps	$16, %xmm1, %xmm0               # xmm0 = xmm0[0],xmm1[0],xmm0[2,3]
+# CHECK-NEXT: vmovaps %xmm0, -496(%rbp)
+	movaps	%xmm0, -496(%rbp)
+# CHECK-NEXT: vmovss  -256(%rbp), %xmm0
+	movss	-256(%rbp), %xmm0               # xmm0 = mem[0],zero,zero,zero
+# CHECK-NEXT: vmovaps -192(%rbp), %xmm0
+	movaps	-192(%rbp), %xmm0
+# CHECK-NEXT: vdivss  %xmm1, %xmm0, %xmm0
+	divss	%xmm1, %xmm0
+# CHECK-NEXT: vmovaps %xmm0, -192(%rbp)
+	movaps	%xmm0, -192(%rbp)
+# CHECK-NEXT: vmovd   -128(%rbp), %xmm0
+	movd	-128(%rbp), %xmm0               # xmm0 = mem[0],zero,zero,zero
+# CHECK-NEXT: vpinsrd $1, %edx, %xmm0, %xmm0
+	pinsrd	$1, %edx, %xmm0
+# CHECK-NEXT: vmovaps %xmm0, -144(%rbp)
+	movaps	%xmm0, -144(%rbp)
+# CHECK-NEXT: vmovd   -160(%rbp), %xmm0
+	movd	-160(%rbp), %xmm0               # xmm0 = mem[0],zero,zero,zero
+# CHECK-NEXT: vpblendw        $170, %xmm1, %xmm0, %xmm0       # xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3],xmm0[4],xmm1[5],xmm0[6],xmm1[7]
+	pblendw	$170, %xmm1, %xmm0              # xmm0 = xmm0[0],xmm1[1],xmm0[2],xmm1[3],xmm0[4],xmm1[5],xmm0[6],xmm1[7]
+# CHECK-NEXT: vmovdqa %xmm0, -576(%rbp)
+	movdqa	%xmm0, -576(%rbp)
+# CHECK-NEXT: vphsubw %xmm1, %xmm0, %xmm0
+	phsubw	%xmm1, %xmm0
+# CHECK-NEXT: vmovdqa %xmm0, -592(%rbp)
+	movdqa	%xmm0, -592(%rbp)
+# CHECK-NEXT: vmovaps -496(%rbp), %xmm0
+	movaps	-496(%rbp), %xmm0
+# CHECK-NEXT: vroundps        $8, %xmm0, %xmm0
+	roundps	$8, %xmm0, %xmm0
+# CHECK-NEXT: vmovaps %xmm0, -608(%rbp)
+	movaps	%xmm0, -608(%rbp)
+# CHECK-NEXT: vmovapd -432(%rbp), %xmm0
+	movapd	-432(%rbp), %xmm0
+# CHECK-NEXT: vpxor   %xmm1, %xmm0, %xmm0
+	pxor	%xmm1, %xmm0
+# CHECK-NEXT: vmovaps %xmm0, -640(%rbp)
+	movaps	%xmm0, -640(%rbp)
+# CHECK-NEXT: vmovapd -32(%rbp), %xmm0
+	movapd	-32(%rbp), %xmm0
+# CHECK-NEXT: vmovupd %xmm0, (%rax)
+	movupd	%xmm0, (%rax)
+# CHECK-NEXT: vmovsd  -656(%rbp), %xmm0
+	movsd	-656(%rbp), %xmm0               # xmm0 = mem[0],zero
----------------
RKSimon wrote:

Please can you add some SSE4A instructions (EXTRQ/INSERTQ) to the tests - they don't have VEX equivalents.

Maybe some SSE instructions that take MMX registers as well? (maybe a stretch too far but technically something like CVTPI2PDrm could become VCVTDQ2PDrm .....)

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


More information about the llvm-commits mailing list