1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=m68k-linux -mcpu=M68020 --verify-machineinstrs | FileCheck %s
4 define internal void @select_i32(i32 %self, ptr nonnull %value) {
5 ; CHECK-LABEL: select_i32:
6 ; CHECK: .cfi_startproc
7 ; CHECK-NEXT: ; %bb.0: ; %start
8 ; CHECK-NEXT: suba.l #4, %sp
9 ; CHECK-NEXT: .cfi_def_cfa_offset -8
10 ; CHECK-NEXT: movem.l %d2, (0,%sp) ; 8-byte Folded Spill
11 ; CHECK-NEXT: cmpi.l #0, (8,%sp)
12 ; CHECK-NEXT: move.w %ccr, %d2
14 ; CHECK-NEXT: move.l (12,%sp), %d0
15 ; CHECK-NEXT: move.w %d2, %ccr
16 ; CHECK-NEXT: bne .LBB0_2
17 ; CHECK-NEXT: ; %bb.1: ; %start
18 ; CHECK-NEXT: and.l #255, %d1
19 ; CHECK-NEXT: cmpi.l #0, %d1
20 ; CHECK-NEXT: bne .LBB0_3
21 ; CHECK-NEXT: .LBB0_2: ; %null
22 ; CHECK-NEXT: suba.l %a0, %a0
23 ; CHECK-NEXT: move.l %d0, (%a0)
24 ; CHECK-NEXT: .LBB0_3: ; %exit
25 ; CHECK-NEXT: movem.l (0,%sp), %d2 ; 8-byte Folded Reload
26 ; CHECK-NEXT: adda.l #4, %sp
29 %2 = icmp eq i32 %self, 0
30 %3 = select i1 %2, i32 0, i32 1
31 switch i32 %3, label %exit [
36 nonnull: ; preds = %start
37 store ptr %value, ptr null, align 2
40 null: ; preds = %start
41 store ptr %value, ptr null, align 2
44 exit: ; preds = %nonnull, %null
48 define internal void @select_i16(i16 %self, ptr nonnull %value) {
49 ; CHECK-LABEL: select_i16:
50 ; CHECK: .cfi_startproc
51 ; CHECK-NEXT: ; %bb.0: ; %start
52 ; CHECK-NEXT: suba.l #4, %sp
53 ; CHECK-NEXT: .cfi_def_cfa_offset -8
54 ; CHECK-NEXT: movem.l %d2, (0,%sp) ; 8-byte Folded Spill
55 ; CHECK-NEXT: cmpi.w #0, (10,%sp)
56 ; CHECK-NEXT: move.w %ccr, %d2
58 ; CHECK-NEXT: move.l (12,%sp), %d0
59 ; CHECK-NEXT: move.w %d2, %ccr
60 ; CHECK-NEXT: bne .LBB1_2
61 ; CHECK-NEXT: ; %bb.1: ; %start
62 ; CHECK-NEXT: and.l #255, %d1
63 ; CHECK-NEXT: cmpi.w #0, %d1
64 ; CHECK-NEXT: bne .LBB1_3
65 ; CHECK-NEXT: .LBB1_2: ; %null
66 ; CHECK-NEXT: suba.l %a0, %a0
67 ; CHECK-NEXT: move.l %d0, (%a0)
68 ; CHECK-NEXT: .LBB1_3: ; %exit
69 ; CHECK-NEXT: movem.l (0,%sp), %d2 ; 8-byte Folded Reload
70 ; CHECK-NEXT: adda.l #4, %sp
73 %2 = icmp eq i16 %self, 0
74 %3 = select i1 %2, i16 0, i16 1
75 switch i16 %3, label %exit [
80 nonnull: ; preds = %start
81 store ptr %value, ptr null, align 2
84 null: ; preds = %start
85 store ptr %value, ptr null, align 2
88 exit: ; preds = %nonnull, %null
92 define internal void @select_i8(i8 %self, ptr nonnull %value) {
93 ; CHECK-LABEL: select_i8:
94 ; CHECK: .cfi_startproc
95 ; CHECK-NEXT: ; %bb.0: ; %start
96 ; CHECK-NEXT: move.l (8,%sp), %d0
97 ; CHECK-NEXT: cmpi.b #0, (7,%sp)
99 ; CHECK-NEXT: bne .LBB2_2
100 ; CHECK-NEXT: ; %bb.1: ; %start
101 ; CHECK-NEXT: cmpi.b #0, %d1
102 ; CHECK-NEXT: bne .LBB2_3
103 ; CHECK-NEXT: .LBB2_2: ; %null
104 ; CHECK-NEXT: suba.l %a0, %a0
105 ; CHECK-NEXT: move.l %d0, (%a0)
106 ; CHECK-NEXT: .LBB2_3: ; %exit
109 %2 = icmp eq i8 %self, 0
110 %3 = select i1 %2, i8 0, i8 1
111 switch i8 %3, label %exit [
116 nonnull: ; preds = %start
117 store ptr %value, ptr null, align 2
120 null: ; preds = %start
121 store ptr %value, ptr null, align 2
124 exit: ; preds = %nonnull, %null