1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin10.0 | FileCheck %s --check-prefix=CHECK-X86
3 ; RUN: llc < %s -mtriple=x86_64-grtev4-linux-gnu | FileCheck %s --check-prefix=CHECK-X64
5 @g_14 = global i8 -6, align 1 ; <i8*> [#uses=1]
7 declare i32 @func_16(i8 signext %p_19, i32 %p_20) nounwind
9 define i32 @func_35(i64 %p_38) nounwind ssp {
10 ; CHECK-X86-LABEL: func_35:
11 ; CHECK-X86: ## %bb.0: ## %entry
12 ; CHECK-X86-NEXT: subl $12, %esp
13 ; CHECK-X86-NEXT: movsbl _g_14, %eax
14 ; CHECK-X86-NEXT: xorl %ecx, %ecx
15 ; CHECK-X86-NEXT: testl $255, %eax
16 ; CHECK-X86-NEXT: setg %cl
17 ; CHECK-X86-NEXT: subl $8, %esp
18 ; CHECK-X86-NEXT: pushl %ecx
19 ; CHECK-X86-NEXT: pushl %eax
20 ; CHECK-X86-NEXT: calll _func_16
21 ; CHECK-X86-NEXT: addl $16, %esp
22 ; CHECK-X86-NEXT: movl $1, %eax
23 ; CHECK-X86-NEXT: addl $12, %esp
24 ; CHECK-X86-NEXT: retl
26 ; CHECK-X64-LABEL: func_35:
27 ; CHECK-X64: # %bb.0: # %entry
28 ; CHECK-X64-NEXT: pushq %rax
29 ; CHECK-X64-NEXT: movsbl {{.*}}(%rip), %edi
30 ; CHECK-X64-NEXT: xorl %esi, %esi
31 ; CHECK-X64-NEXT: testl $255, %edi
32 ; CHECK-X64-NEXT: setg %sil
33 ; CHECK-X64-NEXT: callq func_16
34 ; CHECK-X64-NEXT: movl $1, %eax
35 ; CHECK-X64-NEXT: popq %rcx
36 ; CHECK-X64-NEXT: retq
38 %tmp = load i8, i8* @g_14 ; <i8> [#uses=2]
39 %conv = zext i8 %tmp to i32 ; <i32> [#uses=1]
40 %cmp = icmp sle i32 1, %conv ; <i1> [#uses=1]
41 %conv2 = zext i1 %cmp to i32 ; <i32> [#uses=1]
42 %call = call i32 @func_16(i8 signext %tmp, i32 %conv2) ssp ; <i32> [#uses=1]
46 define void @fail(i16 %a, <2 x i8> %b) {
47 ; CHECK-X86-LABEL: fail:
48 ; CHECK-X86: ## %bb.0:
49 ; CHECK-X86-NEXT: subl $12, %esp
50 ; CHECK-X86-NEXT: .cfi_def_cfa_offset 16
51 ; CHECK-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
52 ; CHECK-X86-NEXT: cmpb $123, {{[0-9]+}}(%esp)
53 ; CHECK-X86-NEXT: sete %al
54 ; CHECK-X86-NEXT: testl $263, %ecx ## imm = 0x107
55 ; CHECK-X86-NEXT: je LBB1_3
56 ; CHECK-X86-NEXT: ## %bb.1:
57 ; CHECK-X86-NEXT: testb %al, %al
58 ; CHECK-X86-NEXT: jne LBB1_3
59 ; CHECK-X86-NEXT: ## %bb.2: ## %no
60 ; CHECK-X86-NEXT: calll _bar
61 ; CHECK-X86-NEXT: LBB1_3: ## %yes
62 ; CHECK-X86-NEXT: addl $12, %esp
63 ; CHECK-X86-NEXT: retl
65 ; CHECK-X64-LABEL: fail:
67 ; CHECK-X64-NEXT: pushq %rax
68 ; CHECK-X64-NEXT: .cfi_def_cfa_offset 16
69 ; CHECK-X64-NEXT: testl $263, %edi # imm = 0x107
70 ; CHECK-X64-NEXT: je .LBB1_3
71 ; CHECK-X64-NEXT: # %bb.1:
72 ; CHECK-X64-NEXT: pand {{.*}}(%rip), %xmm0
73 ; CHECK-X64-NEXT: pcmpeqd {{.*}}(%rip), %xmm0
74 ; CHECK-X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
75 ; CHECK-X64-NEXT: pand %xmm0, %xmm1
76 ; CHECK-X64-NEXT: pextrw $4, %xmm1, %eax
77 ; CHECK-X64-NEXT: testb $1, %al
78 ; CHECK-X64-NEXT: jne .LBB1_3
79 ; CHECK-X64-NEXT: # %bb.2: # %no
80 ; CHECK-X64-NEXT: callq bar
81 ; CHECK-X64-NEXT: .LBB1_3: # %yes
82 ; CHECK-X64-NEXT: popq %rax
83 ; CHECK-X64-NEXT: .cfi_def_cfa_offset 8
84 ; CHECK-X64-NEXT: retq
85 %1 = icmp eq <2 x i8> %b, <i8 40, i8 123>
86 %2 = extractelement <2 x i1> %1, i32 1
88 %4 = icmp eq i16 %3, 0
90 br i1 %merge, label %yes, label %no