xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/sandybridge-loads.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -o - < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker;CHECK-LABEL: wideloads:
4*9880d681SAndroid Build Coastguard Worker;CHECK: vmovaps
5*9880d681SAndroid Build Coastguard Worker;CHECK: vinsertf128
6*9880d681SAndroid Build Coastguard Worker;CHECK: vmovaps
7*9880d681SAndroid Build Coastguard Worker;CHECK-NOT: vinsertf128
8*9880d681SAndroid Build Coastguard Worker;CHECK: ret
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine void @wideloads(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
11*9880d681SAndroid Build Coastguard Worker  %v0 = load <8 x float>, <8 x float>* %a, align 16  ; <---- unaligned!
12*9880d681SAndroid Build Coastguard Worker  %v1 = load <8 x float>, <8 x float>* %b, align 32  ; <---- aligned!
13*9880d681SAndroid Build Coastguard Worker  %m0 = fcmp olt <8 x float> %v1, %v0
14*9880d681SAndroid Build Coastguard Worker  %v2 = load <8 x float>, <8 x float>* %c, align 32  ; <---- aligned!
15*9880d681SAndroid Build Coastguard Worker  %m1 = fcmp olt <8 x float> %v2, %v0
16*9880d681SAndroid Build Coastguard Worker  %mand = and <8 x i1> %m1, %m0
17*9880d681SAndroid Build Coastguard Worker  %r = zext <8 x i1> %mand to <8 x i32>
18*9880d681SAndroid Build Coastguard Worker  store <8 x i32> %r, <8 x i32>* undef, align 32
19*9880d681SAndroid Build Coastguard Worker  ret void
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; CHECK: widestores
23*9880d681SAndroid Build Coastguard Worker; loads:
24*9880d681SAndroid Build Coastguard Worker; CHECK: vmovaps
25*9880d681SAndroid Build Coastguard Worker; CHECK: vmovaps
26*9880d681SAndroid Build Coastguard Worker; stores:
27*9880d681SAndroid Build Coastguard Worker; CHECK: vmovaps
28*9880d681SAndroid Build Coastguard Worker; CHECK: vextractf128
29*9880d681SAndroid Build Coastguard Worker; CHECK: vmovaps
30*9880d681SAndroid Build Coastguard Worker;CHECK: ret
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdefine void @widestores(<8 x float>* %a, <8 x float>* %b, <8 x float>* %c) nounwind uwtable noinline ssp {
33*9880d681SAndroid Build Coastguard Worker  %v0 = load <8 x float>, <8 x float>* %a, align 32
34*9880d681SAndroid Build Coastguard Worker  %v1 = load <8 x float>, <8 x float>* %b, align 32
35*9880d681SAndroid Build Coastguard Worker  store <8 x float> %v0, <8 x float>* %b, align 32 ; <--- aligned
36*9880d681SAndroid Build Coastguard Worker  store <8 x float> %v1, <8 x float>* %a, align 16 ; <--- unaligned
37*9880d681SAndroid Build Coastguard Worker  ret void
38*9880d681SAndroid Build Coastguard Worker}
39*9880d681SAndroid Build Coastguard Worker
40