1 ; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s 2 3 define i32 @fcmp_oeq1(float %x) { 4 ; CHECK-LABEL: fcmp_oeq1 5 ; CHECK: ucomiss %xmm0, %xmm0 6 ; CHECK-NEXT: jp {{LBB.+_1}} 7 %1 = fcmp oeq float %x, %x 8 br i1 %1, label %bb1, label %bb2 9 bb2: 10 ret i32 1 11 bb1: 12 ret i32 0 13 } 14 15 define i32 @fcmp_oeq2(float %x) { 16 ; CHECK-LABEL: fcmp_oeq2 17 ; CHECK: xorps %xmm1, %xmm1 18 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 19 ; CHECK-NEXT: jne {{LBB.+_1}} 20 ; CHECK-NEXT: jp {{LBB.+_1}} 21 %1 = fcmp oeq float %x, 0.000000e+00 22 br i1 %1, label %bb1, label %bb2 23 bb2: 24 ret i32 1 25 bb1: 26 ret i32 0 27 } 28 29 define i32 @fcmp_ogt1(float %x) { 30 ; CHECK-LABEL: fcmp_ogt1 31 ; CHECK-NOT: ucomiss 32 ; CHECK: movl $1, %eax 33 %1 = fcmp ogt float %x, %x 34 br i1 %1, label %bb1, label %bb2 35 bb2: 36 ret i32 1 37 bb1: 38 ret i32 0 39 } 40 41 define i32 @fcmp_ogt2(float %x) { 42 ; CHECK-LABEL: fcmp_ogt2 43 ; CHECK: xorps %xmm1, %xmm1 44 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 45 ; CHECK-NEXT: jbe {{LBB.+_1}} 46 %1 = fcmp ogt float %x, 0.000000e+00 47 br i1 %1, label %bb1, label %bb2 48 bb2: 49 ret i32 1 50 bb1: 51 ret i32 0 52 } 53 54 define i32 @fcmp_oge1(float %x) { 55 ; CHECK-LABEL: fcmp_oge1 56 ; CHECK: ucomiss %xmm0, %xmm0 57 ; CHECK-NEXT: jp {{LBB.+_1}} 58 %1 = fcmp oge float %x, %x 59 br i1 %1, label %bb1, label %bb2 60 bb2: 61 ret i32 1 62 bb1: 63 ret i32 0 64 } 65 66 define i32 @fcmp_oge2(float %x) { 67 ; CHECK-LABEL: fcmp_oge2 68 ; CHECK: xorps %xmm1, %xmm1 69 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 70 ; CHECK-NEXT: jb {{LBB.+_1}} 71 %1 = fcmp oge float %x, 0.000000e+00 72 br i1 %1, label %bb1, label %bb2 73 bb2: 74 ret i32 1 75 bb1: 76 ret i32 0 77 } 78 79 define i32 @fcmp_olt1(float %x) { 80 ; CHECK-LABEL: fcmp_olt1 81 ; CHECK-NOT: ucomiss 82 ; CHECK: movl $1, %eax 83 %1 = fcmp olt float %x, %x 84 br i1 %1, label %bb1, label %bb2 85 bb2: 86 ret i32 1 87 bb1: 88 ret i32 0 89 } 90 91 define i32 @fcmp_olt2(float %x) { 92 ; CHECK-LABEL: fcmp_olt2 93 ; CHECK: xorps %xmm1, %xmm1 94 ; CHECK-NEXT: ucomiss %xmm0, %xmm1 95 ; CHECK-NEXT: jbe {{LBB.+_1}} 96 %1 = fcmp olt float %x, 0.000000e+00 97 br i1 %1, label %bb1, label %bb2 98 bb2: 99 ret i32 1 100 bb1: 101 ret i32 0 102 } 103 104 define i32 @fcmp_ole1(float %x) { 105 ; CHECK-LABEL: fcmp_ole1 106 ; CHECK: ucomiss %xmm0, %xmm0 107 ; CHECK-NEXT: jp {{LBB.+_1}} 108 %1 = fcmp ole float %x, %x 109 br i1 %1, label %bb1, label %bb2 110 bb2: 111 ret i32 1 112 bb1: 113 ret i32 0 114 } 115 116 define i32 @fcmp_ole2(float %x) { 117 ; CHECK-LABEL: fcmp_ole2 118 ; CHECK: xorps %xmm1, %xmm1 119 ; CHECK-NEXT: ucomiss %xmm0, %xmm1 120 ; CHECK-NEXT: jb {{LBB.+_1}} 121 %1 = fcmp ole float %x, 0.000000e+00 122 br i1 %1, label %bb1, label %bb2 123 bb2: 124 ret i32 1 125 bb1: 126 ret i32 0 127 } 128 129 define i32 @fcmp_one1(float %x) { 130 ; CHECK-LABEL: fcmp_one1 131 ; CHECK-NOT: ucomiss 132 ; CHECK: movl $1, %eax 133 %1 = fcmp one float %x, %x 134 br i1 %1, label %bb1, label %bb2 135 bb2: 136 ret i32 1 137 bb1: 138 ret i32 0 139 } 140 141 define i32 @fcmp_one2(float %x) { 142 ; CHECK-LABEL: fcmp_one2 143 ; CHECK: xorps %xmm1, %xmm1 144 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 145 ; CHECK-NEXT: je {{LBB.+_1}} 146 %1 = fcmp one float %x, 0.000000e+00 147 br i1 %1, label %bb1, label %bb2 148 bb2: 149 ret i32 1 150 bb1: 151 ret i32 0 152 } 153 154 define i32 @fcmp_ord1(float %x) { 155 ; CHECK-LABEL: fcmp_ord1 156 ; CHECK: ucomiss %xmm0, %xmm0 157 ; CHECK-NEXT: jp {{LBB.+_1}} 158 %1 = fcmp ord float %x, %x 159 br i1 %1, label %bb1, label %bb2 160 bb2: 161 ret i32 1 162 bb1: 163 ret i32 0 164 } 165 166 define i32 @fcmp_ord2(float %x) { 167 ; CHECK-LABEL: fcmp_ord2 168 ; CHECK: ucomiss %xmm0, %xmm0 169 ; CHECK-NEXT: jp {{LBB.+_1}} 170 %1 = fcmp ord float %x, 0.000000e+00 171 br i1 %1, label %bb1, label %bb2 172 bb2: 173 ret i32 1 174 bb1: 175 ret i32 0 176 } 177 178 define i32 @fcmp_uno1(float %x) { 179 ; CHECK-LABEL: fcmp_uno1 180 ; CHECK: ucomiss %xmm0, %xmm0 181 ; CHECK-NEXT: jp {{LBB.+_2}} 182 %1 = fcmp uno float %x, %x 183 br i1 %1, label %bb1, label %bb2 184 bb2: 185 ret i32 1 186 bb1: 187 ret i32 0 188 } 189 190 define i32 @fcmp_uno2(float %x) { 191 ; CHECK-LABEL: fcmp_uno2 192 ; CHECK: ucomiss %xmm0, %xmm0 193 ; CHECK-NEXT: jp {{LBB.+_2}} 194 %1 = fcmp uno float %x, 0.000000e+00 195 br i1 %1, label %bb1, label %bb2 196 bb2: 197 ret i32 1 198 bb1: 199 ret i32 0 200 } 201 202 define i32 @fcmp_ueq1(float %x) { 203 ; CHECK-LABEL: fcmp_ueq1 204 ; CHECK-NOT: ucomiss 205 %1 = fcmp ueq float %x, %x 206 br i1 %1, label %bb1, label %bb2 207 bb2: 208 ret i32 1 209 bb1: 210 ret i32 0 211 } 212 213 define i32 @fcmp_ueq2(float %x) { 214 ; CHECK-LABEL: fcmp_ueq2 215 ; CHECK: xorps %xmm1, %xmm1 216 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 217 ; CHECK-NEXT: je {{LBB.+_2}} 218 %1 = fcmp ueq float %x, 0.000000e+00 219 br i1 %1, label %bb1, label %bb2 220 bb2: 221 ret i32 1 222 bb1: 223 ret i32 0 224 } 225 226 define i32 @fcmp_ugt1(float %x) { 227 ; CHECK-LABEL: fcmp_ugt1 228 ; CHECK: ucomiss %xmm0, %xmm0 229 ; CHECK-NEXT: jnp {{LBB.+_1}} 230 %1 = fcmp ugt float %x, %x 231 br i1 %1, label %bb1, label %bb2 232 bb2: 233 ret i32 1 234 bb1: 235 ret i32 0 236 } 237 238 define i32 @fcmp_ugt2(float %x) { 239 ; CHECK-LABEL: fcmp_ugt2 240 ; CHECK: xorps %xmm1, %xmm1 241 ; CHECK-NEXT: ucomiss %xmm0, %xmm1 242 ; CHECK-NEXT: jae {{LBB.+_1}} 243 %1 = fcmp ugt float %x, 0.000000e+00 244 br i1 %1, label %bb1, label %bb2 245 bb2: 246 ret i32 1 247 bb1: 248 ret i32 0 249 } 250 251 define i32 @fcmp_uge1(float %x) { 252 ; CHECK-LABEL: fcmp_uge1 253 ; CHECK-NOT: ucomiss 254 %1 = fcmp uge float %x, %x 255 br i1 %1, label %bb1, label %bb2 256 bb2: 257 ret i32 1 258 bb1: 259 ret i32 0 260 } 261 262 define i32 @fcmp_uge2(float %x) { 263 ; CHECK-LABEL: fcmp_uge2 264 ; CHECK: xorps %xmm1, %xmm1 265 ; CHECK-NEXT: ucomiss %xmm0, %xmm1 266 ; CHECK-NEXT: ja {{LBB.+_1}} 267 %1 = fcmp uge float %x, 0.000000e+00 268 br i1 %1, label %bb1, label %bb2 269 bb2: 270 ret i32 1 271 bb1: 272 ret i32 0 273 } 274 275 define i32 @fcmp_ult1(float %x) { 276 ; CHECK-LABEL: fcmp_ult1 277 ; CHECK: ucomiss %xmm0, %xmm0 278 ; CHECK-NEXT: jnp {{LBB.+_1}} 279 %1 = fcmp ult float %x, %x 280 br i1 %1, label %bb1, label %bb2 281 bb2: 282 ret i32 1 283 bb1: 284 ret i32 0 285 } 286 287 define i32 @fcmp_ult2(float %x) { 288 ; CHECK-LABEL: fcmp_ult2 289 ; CHECK: xorps %xmm1, %xmm1 290 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 291 ; CHECK-NEXT: jae {{LBB.+_1}} 292 %1 = fcmp ult float %x, 0.000000e+00 293 br i1 %1, label %bb1, label %bb2 294 bb2: 295 ret i32 1 296 bb1: 297 ret i32 0 298 } 299 300 define i32 @fcmp_ule1(float %x) { 301 ; CHECK-LABEL: fcmp_ule1 302 ; CHECK-NOT: ucomiss 303 %1 = fcmp ule float %x, %x 304 br i1 %1, label %bb1, label %bb2 305 bb2: 306 ret i32 1 307 bb1: 308 ret i32 0 309 } 310 311 define i32 @fcmp_ule2(float %x) { 312 ; CHECK-LABEL: fcmp_ule2 313 ; CHECK: xorps %xmm1, %xmm1 314 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 315 ; CHECK-NEXT: ja {{LBB.+_1}} 316 %1 = fcmp ule float %x, 0.000000e+00 317 br i1 %1, label %bb1, label %bb2 318 bb2: 319 ret i32 1 320 bb1: 321 ret i32 0 322 } 323 324 define i32 @fcmp_une1(float %x) { 325 ; CHECK-LABEL: fcmp_une1 326 ; CHECK: ucomiss %xmm0, %xmm0 327 ; CHECK-NEXT: jnp {{LBB.+_1}} 328 %1 = fcmp une float %x, %x 329 br i1 %1, label %bb1, label %bb2 330 bb2: 331 ret i32 1 332 bb1: 333 ret i32 0 334 } 335 336 define i32 @fcmp_une2(float %x) { 337 ; CHECK-LABEL: fcmp_une2 338 ; CHECK: xorps %xmm1, %xmm1 339 ; CHECK-NEXT: ucomiss %xmm1, %xmm0 340 ; CHECK-NEXT: jne {{LBB.+_2}} 341 ; CHECK-NEXT: jnp {{LBB.+_1}} 342 %1 = fcmp une float %x, 0.000000e+00 343 br i1 %1, label %bb1, label %bb2 344 bb2: 345 ret i32 1 346 bb1: 347 ret i32 0 348 } 349 350 define i32 @icmp_eq(i32 %x) { 351 ; CHECK-LABEL: icmp_eq 352 ; CHECK-NOT: cmpl 353 ; CHECK: xorl %eax, %eax 354 %1 = icmp eq i32 %x, %x 355 br i1 %1, label %bb1, label %bb2 356 bb2: 357 ret i32 1 358 bb1: 359 ret i32 0 360 } 361 362 define i32 @icmp_ne(i32 %x) { 363 ; CHECK-LABEL: icmp_ne 364 ; CHECK-NOT: cmpl 365 ; CHECK: movl $1, %eax 366 %1 = icmp ne i32 %x, %x 367 br i1 %1, label %bb1, label %bb2 368 bb2: 369 ret i32 1 370 bb1: 371 ret i32 0 372 } 373 374 define i32 @icmp_ugt(i32 %x) { 375 ; CHECK-LABEL: icmp_ugt 376 ; CHECK-NOT: cmpl 377 ; CHECK: movl $1, %eax 378 %1 = icmp ugt i32 %x, %x 379 br i1 %1, label %bb1, label %bb2 380 bb2: 381 ret i32 1 382 bb1: 383 ret i32 0 384 } 385 386 define i32 @icmp_uge(i32 %x) { 387 ; CHECK-LABEL: icmp_uge 388 ; CHECK-NOT: cmpl 389 ; CHECK: xorl %eax, %eax 390 %1 = icmp uge i32 %x, %x 391 br i1 %1, label %bb1, label %bb2 392 bb2: 393 ret i32 1 394 bb1: 395 ret i32 0 396 } 397 398 define i32 @icmp_ult(i32 %x) { 399 ; CHECK-LABEL: icmp_ult 400 ; CHECK-NOT: cmpl 401 ; CHECK: movl $1, %eax 402 %1 = icmp ult i32 %x, %x 403 br i1 %1, label %bb1, label %bb2 404 bb2: 405 ret i32 1 406 bb1: 407 ret i32 0 408 } 409 410 define i32 @icmp_ule(i32 %x) { 411 ; CHECK-LABEL: icmp_ule 412 ; CHECK-NOT: cmpl 413 ; CHECK: xorl %eax, %eax 414 %1 = icmp ule i32 %x, %x 415 br i1 %1, label %bb1, label %bb2 416 bb2: 417 ret i32 1 418 bb1: 419 ret i32 0 420 } 421 422 define i32 @icmp_sgt(i32 %x) { 423 ; CHECK-LABEL: icmp_sgt 424 ; CHECK-NOT: cmpl 425 ; CHECK: movl $1, %eax 426 %1 = icmp sgt i32 %x, %x 427 br i1 %1, label %bb1, label %bb2 428 bb2: 429 ret i32 1 430 bb1: 431 ret i32 0 432 } 433 434 define i32 @icmp_sge(i32 %x) { 435 ; CHECK-LABEL: icmp_sge 436 ; CHECK-NOT: cmpl 437 ; CHECK: xorl %eax, %eax 438 %1 = icmp sge i32 %x, %x 439 br i1 %1, label %bb1, label %bb2 440 bb2: 441 ret i32 1 442 bb1: 443 ret i32 0 444 } 445 446 define i32 @icmp_slt(i32 %x) { 447 ; CHECK-LABEL: icmp_slt 448 ; CHECK-NOT: cmpl 449 ; CHECK: movl $1, %eax 450 %1 = icmp slt i32 %x, %x 451 br i1 %1, label %bb1, label %bb2 452 bb2: 453 ret i32 1 454 bb1: 455 ret i32 0 456 } 457 458 define i32 @icmp_sle(i32 %x) { 459 ; CHECK-LABEL: icmp_sle 460 ; CHECK-NOT: cmpl 461 ; CHECK: xorl %eax, %eax 462 %1 = icmp sle i32 %x, %x 463 br i1 %1, label %bb1, label %bb2 464 bb2: 465 ret i32 1 466 bb1: 467 ret i32 0 468 } 469 470