[llvm] LegalizeVectorTypes: fix bug in widening of vec result in xrint (PR #71198)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 09:32:40 PDT 2023
================
@@ -101,6 +134,21 @@ define <4 x iXLen> @lrint_v4f32(<4 x float> %x) {
; X86-AVX-NEXT: vcvtss2si %xmm0, %eax
; X86-AVX-NEXT: vpinsrd $3, %eax, %xmm1, %xmm0
; X86-AVX-NEXT: retl
+;
+; X64-AVX-i32-LABEL: lrint_v4f32:
+; X64-AVX-i32: # %bb.0:
+; X64-AVX-i32-NEXT: vmovshdup {{.*#+}} xmm1 = xmm0[1,1,3,3]
+; X64-AVX-i32-NEXT: vcvtss2si %xmm1, %eax
+; X64-AVX-i32-NEXT: vcvtss2si %xmm0, %ecx
+; X64-AVX-i32-NEXT: vmovd %ecx, %xmm1
+; X64-AVX-i32-NEXT: vpinsrd $1, %eax, %xmm1, %xmm1
+; X64-AVX-i32-NEXT: vshufpd {{.*#+}} xmm2 = xmm0[1,0]
+; X64-AVX-i32-NEXT: vcvtss2si %xmm2, %eax
+; X64-AVX-i32-NEXT: vpinsrd $2, %eax, %xmm1, %xmm1
+; X64-AVX-i32-NEXT: vshufps {{.*#+}} xmm0 = xmm0[3,3,3,3]
+; X64-AVX-i32-NEXT: vcvtss2si %xmm0, %eax
+; X64-AVX-i32-NEXT: vpinsrd $3, %eax, %xmm1, %xmm0
+; X64-AVX-i32-NEXT: retq
----------------
artagnon wrote:
Nope, not my patch. I ran it by hand and checked that asm is produced, so I don't know what's wrong with UTC.
https://github.com/llvm/llvm-project/pull/71198
More information about the llvm-commits
mailing list