1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-pc-linux -mattr=+sse4.2 < %s | FileCheck %s --check-prefix=X86-64
3 ; RUN: llc -mtriple=i386-pc-linux -mattr=+sse4.2 < %s | FileCheck %s --check-prefix=I386
5 ; Check that unaligned loads merge with cvtdq2pd and cvtps2pd.
7 define <2 x double> @peephole_cvtps2pd(<4 x float>* %a0) {
8 ; X86-64-LABEL: peephole_cvtps2pd:
10 ; X86-64-NEXT: cvtps2pd (%rdi), %xmm0
13 ; I386-LABEL: peephole_cvtps2pd:
15 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
16 ; I386-NEXT: cvtps2pd (%eax), %xmm0
18 %1 = load <4 x float>, <4 x float>* %a0, align 1
19 %2 = shufflevector <4 x float> %1, <4 x float> undef, <2 x i32> <i32 0, i32 1>
20 %3 = fpext <2 x float> %2 to <2 x double>
24 define <2 x double> @peephole_cvtdq2pd(<4 x i32>* %a0) {
25 ; X86-64-LABEL: peephole_cvtdq2pd:
27 ; X86-64-NEXT: cvtdq2pd (%rdi), %xmm0
30 ; I386-LABEL: peephole_cvtdq2pd:
32 ; I386-NEXT: movl {{[0-9]+}}(%esp), %eax
33 ; I386-NEXT: cvtdq2pd (%eax), %xmm0
35 %1 = load <4 x i32>, <4 x i32>* %a0, align 1
36 %2 = shufflevector <4 x i32> %1, <4 x i32> undef, <2 x i32> <i32 0, i32 1>
37 %3 = sitofp <2 x i32> %2 to <2 x double>