xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/sse-align-12.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-unknown -march=x86-64 -mcpu=nehalem | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @a(<4 x float>* %y) nounwind {
5*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: a:
6*9880d681SAndroid Build Coastguard Worker; CHECK:       # BB#0:
7*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    movups (%rdi), %xmm0
8*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    shufps {{.*#+}} xmm0 = xmm0[3,2,1,0]
9*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    retq
10*9880d681SAndroid Build Coastguard Worker  %x = load <4 x float>, <4 x float>* %y, align 4
11*9880d681SAndroid Build Coastguard Worker  %a = extractelement <4 x float> %x, i32 0
12*9880d681SAndroid Build Coastguard Worker  %b = extractelement <4 x float> %x, i32 1
13*9880d681SAndroid Build Coastguard Worker  %c = extractelement <4 x float> %x, i32 2
14*9880d681SAndroid Build Coastguard Worker  %d = extractelement <4 x float> %x, i32 3
15*9880d681SAndroid Build Coastguard Worker  %p = insertelement <4 x float> undef, float %d, i32 0
16*9880d681SAndroid Build Coastguard Worker  %q = insertelement <4 x float> %p, float %c, i32 1
17*9880d681SAndroid Build Coastguard Worker  %r = insertelement <4 x float> %q, float %b, i32 2
18*9880d681SAndroid Build Coastguard Worker  %s = insertelement <4 x float> %r, float %a, i32 3
19*9880d681SAndroid Build Coastguard Worker  ret <4 x float> %s
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @b(<4 x float>* %y, <4 x float> %z) nounwind {
23*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: b:
24*9880d681SAndroid Build Coastguard Worker; CHECK:       # BB#0:
25*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    movups (%rdi), %xmm1
26*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    unpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
27*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    retq
28*9880d681SAndroid Build Coastguard Worker  %x = load <4 x float>, <4 x float>* %y, align 4
29*9880d681SAndroid Build Coastguard Worker  %a = extractelement <4 x float> %x, i32 2
30*9880d681SAndroid Build Coastguard Worker  %b = extractelement <4 x float> %x, i32 3
31*9880d681SAndroid Build Coastguard Worker  %c = extractelement <4 x float> %z, i32 2
32*9880d681SAndroid Build Coastguard Worker  %d = extractelement <4 x float> %z, i32 3
33*9880d681SAndroid Build Coastguard Worker  %p = insertelement <4 x float> undef, float %c, i32 0
34*9880d681SAndroid Build Coastguard Worker  %q = insertelement <4 x float> %p, float %a, i32 1
35*9880d681SAndroid Build Coastguard Worker  %r = insertelement <4 x float> %q, float %d, i32 2
36*9880d681SAndroid Build Coastguard Worker  %s = insertelement <4 x float> %r, float %b, i32 3
37*9880d681SAndroid Build Coastguard Worker  ret <4 x float> %s
38*9880d681SAndroid Build Coastguard Worker}
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @c(<2 x double>* %y) nounwind {
41*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: c:
42*9880d681SAndroid Build Coastguard Worker; CHECK:       # BB#0:
43*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    movupd (%rdi), %xmm0
44*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    shufpd {{.*#+}} xmm0 = xmm0[1,0]
45*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    retq
46*9880d681SAndroid Build Coastguard Worker  %x = load <2 x double>, <2 x double>* %y, align 8
47*9880d681SAndroid Build Coastguard Worker  %a = extractelement <2 x double> %x, i32 0
48*9880d681SAndroid Build Coastguard Worker  %c = extractelement <2 x double> %x, i32 1
49*9880d681SAndroid Build Coastguard Worker  %p = insertelement <2 x double> undef, double %c, i32 0
50*9880d681SAndroid Build Coastguard Worker  %r = insertelement <2 x double> %p, double %a, i32 1
51*9880d681SAndroid Build Coastguard Worker  ret <2 x double> %r
52*9880d681SAndroid Build Coastguard Worker}
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @d(<2 x double>* %y, <2 x double> %z) nounwind {
55*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: d:
56*9880d681SAndroid Build Coastguard Worker; CHECK:       # BB#0:
57*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    movupd (%rdi), %xmm1
58*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    unpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
59*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT:    retq
60*9880d681SAndroid Build Coastguard Worker  %x = load <2 x double>, <2 x double>* %y, align 8
61*9880d681SAndroid Build Coastguard Worker  %a = extractelement <2 x double> %x, i32 1
62*9880d681SAndroid Build Coastguard Worker  %c = extractelement <2 x double> %z, i32 1
63*9880d681SAndroid Build Coastguard Worker  %p = insertelement <2 x double> undef, double %c, i32 0
64*9880d681SAndroid Build Coastguard Worker  %r = insertelement <2 x double> %p, double %a, i32 1
65*9880d681SAndroid Build Coastguard Worker  ret <2 x double> %r
66*9880d681SAndroid Build Coastguard Worker}
67