xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/vec_i64.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=i386-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X32
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; Used movq to load i64 into a v2i64 when the top i64 is 0.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @foo1(i64* %y) nounwind  {
8*9880d681SAndroid Build Coastguard Worker; X32-LABEL: foo1:
9*9880d681SAndroid Build Coastguard Worker; X32:       # BB#0: # %entry
10*9880d681SAndroid Build Coastguard Worker; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
11*9880d681SAndroid Build Coastguard Worker; X32-NEXT:    movq {{.*#+}} xmm0 = mem[0],zero
12*9880d681SAndroid Build Coastguard Worker; X32-NEXT:    retl
13*9880d681SAndroid Build Coastguard Worker;
14*9880d681SAndroid Build Coastguard Worker; X64-LABEL: foo1:
15*9880d681SAndroid Build Coastguard Worker; X64:       # BB#0: # %entry
16*9880d681SAndroid Build Coastguard Worker; X64-NEXT:    movq {{.*#+}} xmm0 = mem[0],zero
17*9880d681SAndroid Build Coastguard Worker; X64-NEXT:    retq
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker  %tmp1 = load i64, i64* %y, align 8
20*9880d681SAndroid Build Coastguard Worker  %s2v = insertelement <2 x i64> undef, i64 %tmp1, i32 0
21*9880d681SAndroid Build Coastguard Worker  %loadl = shufflevector <2 x i64> zeroinitializer, <2 x i64> %s2v, <2 x i32> <i32 2, i32 1>
22*9880d681SAndroid Build Coastguard Worker  ret <2 x i64> %loadl
23*9880d681SAndroid Build Coastguard Worker}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workerdefine <4 x float> @foo2(i64* %p) nounwind {
27*9880d681SAndroid Build Coastguard Worker; X32-LABEL: foo2:
28*9880d681SAndroid Build Coastguard Worker; X32:       # BB#0: # %entry
29*9880d681SAndroid Build Coastguard Worker; X32-NEXT:    movl {{[0-9]+}}(%esp), %eax
30*9880d681SAndroid Build Coastguard Worker; X32-NEXT:    movq {{.*#+}} xmm0 = mem[0],zero
31*9880d681SAndroid Build Coastguard Worker; X32-NEXT:    retl
32*9880d681SAndroid Build Coastguard Worker;
33*9880d681SAndroid Build Coastguard Worker; X64-LABEL: foo2:
34*9880d681SAndroid Build Coastguard Worker; X64:       # BB#0: # %entry
35*9880d681SAndroid Build Coastguard Worker; X64-NEXT:    movq {{.*#+}} xmm0 = mem[0],zero
36*9880d681SAndroid Build Coastguard Worker; X64-NEXT:    retq
37*9880d681SAndroid Build Coastguard Workerentry:
38*9880d681SAndroid Build Coastguard Worker  %load = load i64, i64* %p
39*9880d681SAndroid Build Coastguard Worker  %s2v = insertelement <2 x i64> undef, i64 %load, i32 0
40*9880d681SAndroid Build Coastguard Worker  %loadl = shufflevector <2 x i64> zeroinitializer, <2 x i64> %s2v, <2 x i32> <i32 2, i32 1>
41*9880d681SAndroid Build Coastguard Worker  %0 = bitcast <2 x i64> %loadl to <4 x float>
42*9880d681SAndroid Build Coastguard Worker  ret <4 x float> %0
43*9880d681SAndroid Build Coastguard Worker}
44