1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
5 define zeroext i16 @t1(i16 zeroext %x) nounwind readnone ssp {
8 ; CHECK-NEXT: xorl %eax, %eax
9 ; CHECK-NEXT: cmpw $27, %di
10 ; CHECK-NEXT: setae %al
11 ; CHECK-NEXT: shll $5, %eax
13 %t0 = icmp ugt i16 %x, 26
14 %if = select i1 %t0, i16 32, i16 0
18 define zeroext i16 @t2(i16 zeroext %x) nounwind readnone ssp {
21 ; CHECK-NEXT: xorl %eax, %eax
22 ; CHECK-NEXT: cmpw $26, %di
23 ; CHECK-NEXT: setb %al
24 ; CHECK-NEXT: shll $5, %eax
26 %t0 = icmp ult i16 %x, 26
27 %if = select i1 %t0, i16 32, i16 0
31 define i64 @t3(i64 %x) nounwind readnone ssp {
34 ; CHECK-NEXT: xorl %eax, %eax
35 ; CHECK-NEXT: cmpq $18, %rdi
36 ; CHECK-NEXT: setb %al
37 ; CHECK-NEXT: shlq $6, %rax
39 %t0 = icmp ult i64 %x, 18
40 %if = select i1 %t0, i64 64, i64 0
44 @v4 = common global i32 0, align 4
46 define i32 @t4(i32 %a) {
49 ; CHECK-NEXT: movq _v4@GOTPCREL(%rip), %rax
50 ; CHECK-NEXT: cmpl $1, (%rax)
51 ; CHECK-NEXT: movw $1, %ax
52 ; CHECK-NEXT: adcw $0, %ax
53 ; CHECK-NEXT: shll $16, %eax
55 %t0 = load i32, i32* @v4, align 4
56 %not.tobool = icmp eq i32 %t0, 0
57 %conv.i = sext i1 %not.tobool to i16
58 %call.lobit = lshr i16 %conv.i, 15
59 %add.i.1 = add nuw nsw i16 %call.lobit, 1
60 %conv4.2 = zext i16 %add.i.1 to i32
61 %add = shl nuw nsw i32 %conv4.2, 16
65 define i8 @t5(i32 %a) #0 {
68 ; CHECK-NEXT: testl %edi, %edi
69 ; CHECK-NEXT: setns %al
71 %.lobit = lshr i32 %a, 31
72 %trunc = trunc i32 %.lobit to i8
73 %.not = xor i8 %trunc, 1
77 define zeroext i1 @t6(i32 %a) #0 {
80 ; CHECK-NEXT: testl %edi, %edi
81 ; CHECK-NEXT: setns %al
83 %.lobit = lshr i32 %a, 31
84 %trunc = trunc i32 %.lobit to i1
85 %.not = xor i1 %trunc, 1
89 define i16 @shift_and(i16 %a) {
90 ; CHECK-LABEL: shift_and:
92 ; CHECK-NEXT: movl %edi, %eax
93 ; CHECK-NEXT: shrl $10, %eax
94 ; CHECK-NEXT: andl $1, %eax
95 ; CHECK-NEXT: ## kill: def $ax killed $ax killed $eax
97 %and = and i16 %a, 1024
98 %cmp = icmp ne i16 %and, 0
99 %conv = zext i1 %cmp to i16
103 attributes #0 = { "target-cpu"="skylake-avx512" }