1; FIXME: FastISel currently returns false if it hits code that uses VSX 2; registers and with -fast-isel-abort=1 turned on the test case will then fail. 3; When fastisel better supports VSX fix up this test case. 4; 5; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64 6define void @t1a(float %a) nounwind { 7entry: 8; ELF64: t1a 9 %cmp = fcmp oeq float %a, 0.000000e+00 10; ELF64: addis 11; ELF64: lfs 12; ELF64: fcmpu 13 br i1 %cmp, label %if.then, label %if.end 14 15if.then: ; preds = %entry 16 call void @foo() 17 br label %if.end 18 19if.end: ; preds = %if.then, %entry 20 ret void 21} 22 23declare void @foo() 24 25define void @t1b(float %a) nounwind { 26entry: 27; ELF64: t1b 28 %cmp = fcmp oeq float %a, -0.000000e+00 29; ELF64: addis 30; ELF64: lfs 31; ELF64: fcmpu 32 br i1 %cmp, label %if.then, label %if.end 33 34if.then: ; preds = %entry 35 call void @foo() 36 br label %if.end 37 38if.end: ; preds = %if.then, %entry 39 ret void 40} 41 42define void @t2a(double %a) nounwind { 43entry: 44; ELF64: t2a 45 %cmp = fcmp oeq double %a, 0.000000e+00 46; ELF64: addis 47; ELF64: lfd 48; ELF64: fcmpu 49 br i1 %cmp, label %if.then, label %if.end 50 51if.then: ; preds = %entry 52 call void @foo() 53 br label %if.end 54 55if.end: ; preds = %if.then, %entry 56 ret void 57} 58 59define void @t2b(double %a) nounwind { 60entry: 61; ELF64: t2b 62 %cmp = fcmp oeq double %a, -0.000000e+00 63; ELF64: addis 64; ELF64: lfd 65; ELF64: fcmpu 66 br i1 %cmp, label %if.then, label %if.end 67 68if.then: ; preds = %entry 69 call void @foo() 70 br label %if.end 71 72if.end: ; preds = %if.then, %entry 73 ret void 74} 75 76define void @t4(i8 signext %a) nounwind { 77entry: 78; ELF64: t4 79 %cmp = icmp eq i8 %a, -1 80; ELF64: extsb 81; ELF64: cmpwi 82 br i1 %cmp, label %if.then, label %if.end 83 84if.then: ; preds = %entry 85 call void @foo() 86 br label %if.end 87 88if.end: ; preds = %if.then, %entry 89 ret void 90} 91 92define void @t5(i8 zeroext %a) nounwind { 93entry: 94; ELF64: t5 95 %cmp = icmp eq i8 %a, 1 96; ELF64: extsb 97; ELF64: cmpwi 98 br i1 %cmp, label %if.then, label %if.end 99 100if.then: ; preds = %entry 101 call void @foo() 102 br label %if.end 103 104if.end: ; preds = %if.then, %entry 105 ret void 106} 107 108define void @t6(i16 signext %a) nounwind { 109entry: 110; ELF64: t6 111 %cmp = icmp eq i16 %a, -1 112; ELF64: extsh 113; ELF64: cmpwi 114 br i1 %cmp, label %if.then, label %if.end 115 116if.then: ; preds = %entry 117 call void @foo() 118 br label %if.end 119 120if.end: ; preds = %if.then, %entry 121 ret void 122} 123 124define void @t7(i16 zeroext %a) nounwind { 125entry: 126; ELF64: t7 127 %cmp = icmp eq i16 %a, 1 128; ELF64: extsh 129; ELF64: cmpwi 130 br i1 %cmp, label %if.then, label %if.end 131 132if.then: ; preds = %entry 133 call void @foo() 134 br label %if.end 135 136if.end: ; preds = %if.then, %entry 137 ret void 138} 139 140define void @t8(i32 %a) nounwind { 141entry: 142; ELF64: t8 143 %cmp = icmp eq i32 %a, -1 144; ELF64: cmpwi 145 br i1 %cmp, label %if.then, label %if.end 146 147if.then: ; preds = %entry 148 call void @foo() 149 br label %if.end 150 151if.end: ; preds = %if.then, %entry 152 ret void 153} 154 155define void @t9(i32 %a) nounwind { 156entry: 157; ELF64: t9 158 %cmp = icmp eq i32 %a, 1 159; ELF64: cmpwi 160 br i1 %cmp, label %if.then, label %if.end 161 162if.then: ; preds = %entry 163 call void @foo() 164 br label %if.end 165 166if.end: ; preds = %if.then, %entry 167 ret void 168} 169 170define void @t10(i32 %a) nounwind { 171entry: 172; ELF64: t10 173 %cmp = icmp eq i32 %a, 384 174; ELF64: cmpwi 175 br i1 %cmp, label %if.then, label %if.end 176 177if.then: ; preds = %entry 178 call void @foo() 179 br label %if.end 180 181if.end: ; preds = %if.then, %entry 182 ret void 183} 184 185define void @t11(i32 %a) nounwind { 186entry: 187; ELF64: t11 188 %cmp = icmp eq i32 %a, 4096 189; ELF64: cmpwi 190 br i1 %cmp, label %if.then, label %if.end 191 192if.then: ; preds = %entry 193 call void @foo() 194 br label %if.end 195 196if.end: ; preds = %if.then, %entry 197 ret void 198} 199 200define void @t12(i8 %a) nounwind { 201entry: 202; ELF64: t12 203 %cmp = icmp ugt i8 %a, -113 204; ELF64: clrlwi 205; ELF64: cmplwi 206 br i1 %cmp, label %if.then, label %if.end 207 208if.then: ; preds = %entry 209 call void @foo() 210 br label %if.end 211 212if.end: ; preds = %if.then, %entry 213 ret void 214} 215 216define void @t13() nounwind ssp { 217entry: 218; ELF64: t13 219 %cmp = icmp slt i32 -123, -2147483648 220; ELF64: li 221; ELF64: lis 222; ELF64: cmpw 223 br i1 %cmp, label %if.then, label %if.end 224 225if.then: ; preds = %entry 226 ret void 227 228if.end: ; preds = %entry 229 ret void 230} 231 232define void @t14(i64 %a) nounwind { 233entry: 234; ELF64: t14 235 %cmp = icmp eq i64 %a, -1 236; ELF64: cmpdi 237 br i1 %cmp, label %if.then, label %if.end 238 239if.then: ; preds = %entry 240 call void @foo() 241 br label %if.end 242 243if.end: ; preds = %if.then, %entry 244 ret void 245} 246 247define void @t15(i64 %a) nounwind { 248entry: 249; ELF64: t15 250 %cmp = icmp eq i64 %a, 1 251; ELF64: cmpdi 252 br i1 %cmp, label %if.then, label %if.end 253 254if.then: ; preds = %entry 255 call void @foo() 256 br label %if.end 257 258if.end: ; preds = %if.then, %entry 259 ret void 260} 261 262define void @t16(i64 %a) nounwind { 263entry: 264; ELF64: t16 265 %cmp = icmp eq i64 %a, 384 266; ELF64: cmpdi 267 br i1 %cmp, label %if.then, label %if.end 268 269if.then: ; preds = %entry 270 call void @foo() 271 br label %if.end 272 273if.end: ; preds = %if.then, %entry 274 ret void 275} 276 277define void @t17(i64 %a) nounwind { 278entry: 279; ELF64: t17 280 %cmp = icmp eq i64 %a, 32768 281; Extra operand so we don't match on cmpdi. 282; ELF64: cmpd {{[0-9]+}} 283 br i1 %cmp, label %if.then, label %if.end 284 285if.then: ; preds = %entry 286 call void @foo() 287 br label %if.end 288 289if.end: ; preds = %if.then, %entry 290 ret void 291} 292 293