1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
4 ; NOTE: This should use IR equivalent to what is generated by clang/test/CodeGen/sse2-builtins.c
6 define i64 @test_mm_cvtsd_si64(<2 x double> %a0) nounwind {
7 ; X64-LABEL: test_mm_cvtsd_si64:
9 ; X64-NEXT: cvtsd2si %xmm0, %rax
11 %res = call i64 @llvm.x86.sse2.cvtsd2si64(<2 x double> %a0)
14 declare i64 @llvm.x86.sse2.cvtsd2si64(<2 x double>) nounwind readnone
16 define i64 @test_mm_cvtsi128_si64(<2 x i64> %a0) nounwind {
17 ; X64-LABEL: test_mm_cvtsi128_si64:
19 ; X64-NEXT: movd %xmm0, %rax
21 %res = extractelement <2 x i64> %a0, i32 0
25 define <2 x double> @test_mm_cvtsi64_sd(<2 x double> %a0, i64 %a1) nounwind {
26 ; X64-LABEL: test_mm_cvtsi64_sd:
28 ; X64-NEXT: cvtsi2sdq %rdi, %xmm0
30 %res = call <2 x double> @llvm.x86.sse2.cvtsi642sd(<2 x double> %a0, i64 %a1)
33 declare <2 x double> @llvm.x86.sse2.cvtsi642sd(<2 x double>, i64) nounwind readnone
35 define <2 x i64> @test_mm_cvtsi64_si128(i64 %a0) nounwind {
36 ; X64-LABEL: test_mm_cvtsi64_si128:
38 ; X64-NEXT: movd %rdi, %xmm0
40 %res0 = insertelement <2 x i64> undef, i64 %a0, i32 0
41 %res1 = insertelement <2 x i64> %res0, i64 0, i32 1
45 define i64 @test_mm_cvttsd_si64(<2 x double> %a0) nounwind {
46 ; X64-LABEL: test_mm_cvttsd_si64:
48 ; X64-NEXT: cvttsd2si %xmm0, %rax
50 %res = call i64 @llvm.x86.sse2.cvttsd2si64(<2 x double> %a0)
53 declare i64 @llvm.x86.sse2.cvttsd2si64(<2 x double>) nounwind readnone
55 define <2 x i64> @test_mm_loadu_si64(i64* %a0) nounwind {
56 ; X64-LABEL: test_mm_loadu_si64:
58 ; X64-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
60 %ld = load i64, i64* %a0, align 1
61 %res0 = insertelement <2 x i64> undef, i64 %ld, i32 0
62 %res1 = insertelement <2 x i64> %res0, i64 0, i32 1
66 define void @test_mm_stream_si64(i64 *%a0, i64 %a1) {
67 ; X64-LABEL: test_mm_stream_si64:
69 ; X64-NEXT: movntiq %rsi, (%rdi)
71 store i64 %a1, i64* %a0, align 1, !nontemporal !0