1 ; RUN: llc < %s -march=x86 -mattr=sse41 | FileCheck %s --check-prefix=X32
2 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=sse41 | FileCheck %s --check-prefix=X64
3 ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=sse41 | FileCheck %s --check-prefix=X64
5 define i32 @test1() nounwind readonly {
7 %tmp = load i32* addrspace(256)* getelementptr (i32* addrspace(256)* inttoptr (i32 72 to i32* addrspace(256)*), i32 31) ; <i32*> [#uses=1]
8 %tmp1 = load i32* %tmp ; <i32> [#uses=1]
12 ; X32: movl %gs:196, %eax
13 ; X32: movl (%eax), %eax
17 ; X64: movq %gs:320, %rax
18 ; X64: movl (%rax), %eax
21 define i64 @test2(void (i8*)* addrspace(256)* %tmp8) nounwind {
23 %tmp9 = load void (i8*)* addrspace(256)* %tmp8, align 8
24 tail call void %tmp9(i8* undef) nounwind optsize
30 ; X32: movl {{.*}}(%esp), %eax
31 ; X32: calll *%gs:(%eax)
34 ; X64: callq *%gs:([[A0:%rdi|%rcx]])
39 define <2 x i64> @pmovsxwd_1(i64 addrspace(256)* %p) nounwind readonly {
41 %0 = load i64 addrspace(256)* %p
42 %tmp2 = insertelement <2 x i64> zeroinitializer, i64 %0, i32 0
43 %1 = bitcast <2 x i64> %tmp2 to <8 x i16>
44 %2 = tail call <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16> %1) nounwind readnone
45 %3 = bitcast <4 x i32> %2 to <2 x i64>
49 ; X32: movl 4(%esp), %eax
50 ; X32: pmovsxwd %gs:(%eax), %xmm0
54 ; X64: pmovsxwd %gs:([[A0]]), %xmm0
58 declare <4 x i32> @llvm.x86.sse41.pmovsxwd(<8 x i16>) nounwind readnone