Skip to content

Commit 0443622

Browse files
committed
[X86] Add test for new _mm_movpi64_epi64 lowering
With the MMX retirement, _mm_movpi64_epi64 now lowers to shuffle((__m64)(double)x,(__m64)0) pattern - which demonstrates a unnecessary FPU->GPU->FPU transfer
1 parent 5540eac commit 0443622

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

llvm/test/CodeGen/X86/mmx-cvt.ll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,22 @@ define <4 x float> @cvt_v2i32_v2f32(ptr) nounwind {
279279
ret <4 x float> %8
280280
}
281281

282+
define noundef <2 x i64> @cvt_f64_v2i64(double %a0) {
283+
; X86-LABEL: cvt_f64_v2i64:
284+
; X86: # %bb.0:
285+
; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
286+
; X86-NEXT: retl
287+
;
288+
; X64-LABEL: cvt_f64_v2i64:
289+
; X64: # %bb.0:
290+
; X64-NEXT: movq %xmm0, %rax
291+
; X64-NEXT: movq %rax, %xmm0
292+
; X64-NEXT: retq
293+
%bc = bitcast double %a0 to <1 x i64>
294+
%r = shufflevector <1 x i64> %bc, <1 x i64> zeroinitializer, <2 x i32> <i32 0, i32 1>
295+
ret <2 x i64> %r
296+
}
297+
282298
declare <1 x i64> @llvm.x86.mmx.padd.d(<1 x i64>, <1 x i64>)
283299
declare <4 x i32> @llvm.x86.sse2.cvtpd2dq(<2 x double>)
284300
declare <4 x i32> @llvm.x86.sse2.cvttpd2dq(<2 x double>)

0 commit comments

Comments
 (0)