1 ; RUN: llc < %s -march=x86 -mattr=sse41 | FileCheck %s --check-prefix=X32
2 ; RUN: llc < %s -march=x86-64 -mattr=sse41 | FileCheck %s --check-prefix=X64
4 define i32 @test1() nounwind readonly {
6 %tmp = load i32* addrspace(256)* getelementptr (i32* addrspace(256)* inttoptr (i32 72 to i32* addrspace(256)*), i32 31) ; <i32*> [#uses=1]
7 %tmp1 = load i32* %tmp ; <i32> [#uses=1]
11 ; X32: movl %gs:196, %eax
12 ; X32: movl (%eax), %eax
16 ; X64: movq %gs:320, %rax
17 ; X64: movl (%rax), %eax
20 define i64 @test2(void (i8*)* addrspace(256)* %tmp8) nounwind {
22 %tmp9 = load void (i8*)* addrspace(256)* %tmp8, align 8
23 tail call void %tmp9(i8* undef) nounwind optsize
29 ; X32: movl {{.*}}(%esp), %eax
30 ; X32: calll *%gs:(%eax)
33 ; X64: callq *%gs:(%rdi)
38 define <2 x i64> @pmovsxwd_1(i64 addrspace(256)* %p) nounwind readonly {
40 %0 = load i64 addrspace(256)* %p
41 %tmp2 = insertelement <2 x i64> zeroinitializer, i64 %0, i32 0
42 %1 = bitcast <2 x i64> %tmp2 to <8 x i16>
43 %2 = tail call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> %1) nounwind readnone
44 %3 = bitcast <4 x i32> %2 to <2 x i64>
48 ; X32: movl 4(%esp), %eax
49 ; X32: pmovsxwd %gs:(%eax), %xmm0
53 ; X64: pmovsxwd %gs:(%rdi), %xmm0
57 declare <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16>) nounwind readnone