1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefix=SDAG 3; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefixes=FAST,FAST_NOAVX 4; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -mattr=avx | FileCheck %s --check-prefixes=FAST,FAST_AVX 5; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -mattr=avx512f | FileCheck %s --check-prefixes=FAST,FAST_AVX 6 7define zeroext i1 @fcmp_oeq(float %x, float %y) { 8; SDAG-LABEL: fcmp_oeq: 9; SDAG: ## %bb.0: 10; SDAG-NEXT: cmpeqss %xmm1, %xmm0 11; SDAG-NEXT: movd %xmm0, %eax 12; SDAG-NEXT: andl $1, %eax 13; SDAG-NEXT: ## kill: def $al killed $al killed $eax 14; SDAG-NEXT: retq 15; 16; FAST_NOAVX-LABEL: fcmp_oeq: 17; FAST_NOAVX: ## %bb.0: 18; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 19; FAST_NOAVX-NEXT: sete %al 20; FAST_NOAVX-NEXT: setnp %cl 21; FAST_NOAVX-NEXT: andb %al, %cl 22; FAST_NOAVX-NEXT: andb $1, %cl 23; FAST_NOAVX-NEXT: movzbl %cl, %eax 24; FAST_NOAVX-NEXT: retq 25; 26; FAST_AVX-LABEL: fcmp_oeq: 27; FAST_AVX: ## %bb.0: 28; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 29; FAST_AVX-NEXT: sete %al 30; FAST_AVX-NEXT: setnp %cl 31; FAST_AVX-NEXT: andb %al, %cl 32; FAST_AVX-NEXT: andb $1, %cl 33; FAST_AVX-NEXT: movzbl %cl, %eax 34; FAST_AVX-NEXT: retq 35 %1 = fcmp oeq float %x, %y 36 ret i1 %1 37} 38 39define zeroext i1 @fcmp_ogt(float %x, float %y) { 40; SDAG-LABEL: fcmp_ogt: 41; SDAG: ## %bb.0: 42; SDAG-NEXT: ucomiss %xmm1, %xmm0 43; SDAG-NEXT: seta %al 44; SDAG-NEXT: retq 45; 46; FAST_NOAVX-LABEL: fcmp_ogt: 47; FAST_NOAVX: ## %bb.0: 48; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 49; FAST_NOAVX-NEXT: seta %al 50; FAST_NOAVX-NEXT: andb $1, %al 51; FAST_NOAVX-NEXT: movzbl %al, %eax 52; FAST_NOAVX-NEXT: retq 53; 54; FAST_AVX-LABEL: fcmp_ogt: 55; FAST_AVX: ## %bb.0: 56; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 57; FAST_AVX-NEXT: seta %al 58; FAST_AVX-NEXT: andb $1, %al 59; FAST_AVX-NEXT: movzbl %al, %eax 60; FAST_AVX-NEXT: retq 61 %1 = fcmp ogt float %x, %y 62 ret i1 %1 63} 64 65define zeroext i1 @fcmp_oge(float %x, float %y) { 66; SDAG-LABEL: fcmp_oge: 67; SDAG: ## %bb.0: 68; SDAG-NEXT: ucomiss %xmm1, %xmm0 69; SDAG-NEXT: setae %al 70; SDAG-NEXT: retq 71; 72; FAST_NOAVX-LABEL: fcmp_oge: 73; FAST_NOAVX: ## %bb.0: 74; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 75; FAST_NOAVX-NEXT: setae %al 76; FAST_NOAVX-NEXT: andb $1, %al 77; FAST_NOAVX-NEXT: movzbl %al, %eax 78; FAST_NOAVX-NEXT: retq 79; 80; FAST_AVX-LABEL: fcmp_oge: 81; FAST_AVX: ## %bb.0: 82; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 83; FAST_AVX-NEXT: setae %al 84; FAST_AVX-NEXT: andb $1, %al 85; FAST_AVX-NEXT: movzbl %al, %eax 86; FAST_AVX-NEXT: retq 87 %1 = fcmp oge float %x, %y 88 ret i1 %1 89} 90 91define zeroext i1 @fcmp_olt(float %x, float %y) { 92; SDAG-LABEL: fcmp_olt: 93; SDAG: ## %bb.0: 94; SDAG-NEXT: ucomiss %xmm0, %xmm1 95; SDAG-NEXT: seta %al 96; SDAG-NEXT: retq 97; 98; FAST_NOAVX-LABEL: fcmp_olt: 99; FAST_NOAVX: ## %bb.0: 100; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 101; FAST_NOAVX-NEXT: seta %al 102; FAST_NOAVX-NEXT: andb $1, %al 103; FAST_NOAVX-NEXT: movzbl %al, %eax 104; FAST_NOAVX-NEXT: retq 105; 106; FAST_AVX-LABEL: fcmp_olt: 107; FAST_AVX: ## %bb.0: 108; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 109; FAST_AVX-NEXT: seta %al 110; FAST_AVX-NEXT: andb $1, %al 111; FAST_AVX-NEXT: movzbl %al, %eax 112; FAST_AVX-NEXT: retq 113 %1 = fcmp olt float %x, %y 114 ret i1 %1 115} 116 117define zeroext i1 @fcmp_ole(float %x, float %y) { 118; SDAG-LABEL: fcmp_ole: 119; SDAG: ## %bb.0: 120; SDAG-NEXT: ucomiss %xmm0, %xmm1 121; SDAG-NEXT: setae %al 122; SDAG-NEXT: retq 123; 124; FAST_NOAVX-LABEL: fcmp_ole: 125; FAST_NOAVX: ## %bb.0: 126; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 127; FAST_NOAVX-NEXT: setae %al 128; FAST_NOAVX-NEXT: andb $1, %al 129; FAST_NOAVX-NEXT: movzbl %al, %eax 130; FAST_NOAVX-NEXT: retq 131; 132; FAST_AVX-LABEL: fcmp_ole: 133; FAST_AVX: ## %bb.0: 134; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 135; FAST_AVX-NEXT: setae %al 136; FAST_AVX-NEXT: andb $1, %al 137; FAST_AVX-NEXT: movzbl %al, %eax 138; FAST_AVX-NEXT: retq 139 %1 = fcmp ole float %x, %y 140 ret i1 %1 141} 142 143define zeroext i1 @fcmp_one(float %x, float %y) { 144; SDAG-LABEL: fcmp_one: 145; SDAG: ## %bb.0: 146; SDAG-NEXT: ucomiss %xmm1, %xmm0 147; SDAG-NEXT: setne %al 148; SDAG-NEXT: retq 149; 150; FAST_NOAVX-LABEL: fcmp_one: 151; FAST_NOAVX: ## %bb.0: 152; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 153; FAST_NOAVX-NEXT: setne %al 154; FAST_NOAVX-NEXT: andb $1, %al 155; FAST_NOAVX-NEXT: movzbl %al, %eax 156; FAST_NOAVX-NEXT: retq 157; 158; FAST_AVX-LABEL: fcmp_one: 159; FAST_AVX: ## %bb.0: 160; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 161; FAST_AVX-NEXT: setne %al 162; FAST_AVX-NEXT: andb $1, %al 163; FAST_AVX-NEXT: movzbl %al, %eax 164; FAST_AVX-NEXT: retq 165 %1 = fcmp one float %x, %y 166 ret i1 %1 167} 168 169define zeroext i1 @fcmp_ord(float %x, float %y) { 170; SDAG-LABEL: fcmp_ord: 171; SDAG: ## %bb.0: 172; SDAG-NEXT: ucomiss %xmm1, %xmm0 173; SDAG-NEXT: setnp %al 174; SDAG-NEXT: retq 175; 176; FAST_NOAVX-LABEL: fcmp_ord: 177; FAST_NOAVX: ## %bb.0: 178; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 179; FAST_NOAVX-NEXT: setnp %al 180; FAST_NOAVX-NEXT: andb $1, %al 181; FAST_NOAVX-NEXT: movzbl %al, %eax 182; FAST_NOAVX-NEXT: retq 183; 184; FAST_AVX-LABEL: fcmp_ord: 185; FAST_AVX: ## %bb.0: 186; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 187; FAST_AVX-NEXT: setnp %al 188; FAST_AVX-NEXT: andb $1, %al 189; FAST_AVX-NEXT: movzbl %al, %eax 190; FAST_AVX-NEXT: retq 191 %1 = fcmp ord float %x, %y 192 ret i1 %1 193} 194 195define zeroext i1 @fcmp_uno(float %x, float %y) { 196; SDAG-LABEL: fcmp_uno: 197; SDAG: ## %bb.0: 198; SDAG-NEXT: ucomiss %xmm1, %xmm0 199; SDAG-NEXT: setp %al 200; SDAG-NEXT: retq 201; 202; FAST_NOAVX-LABEL: fcmp_uno: 203; FAST_NOAVX: ## %bb.0: 204; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 205; FAST_NOAVX-NEXT: setp %al 206; FAST_NOAVX-NEXT: andb $1, %al 207; FAST_NOAVX-NEXT: movzbl %al, %eax 208; FAST_NOAVX-NEXT: retq 209; 210; FAST_AVX-LABEL: fcmp_uno: 211; FAST_AVX: ## %bb.0: 212; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 213; FAST_AVX-NEXT: setp %al 214; FAST_AVX-NEXT: andb $1, %al 215; FAST_AVX-NEXT: movzbl %al, %eax 216; FAST_AVX-NEXT: retq 217 %1 = fcmp uno float %x, %y 218 ret i1 %1 219} 220 221define zeroext i1 @fcmp_ueq(float %x, float %y) { 222; SDAG-LABEL: fcmp_ueq: 223; SDAG: ## %bb.0: 224; SDAG-NEXT: ucomiss %xmm1, %xmm0 225; SDAG-NEXT: sete %al 226; SDAG-NEXT: retq 227; 228; FAST_NOAVX-LABEL: fcmp_ueq: 229; FAST_NOAVX: ## %bb.0: 230; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 231; FAST_NOAVX-NEXT: sete %al 232; FAST_NOAVX-NEXT: andb $1, %al 233; FAST_NOAVX-NEXT: movzbl %al, %eax 234; FAST_NOAVX-NEXT: retq 235; 236; FAST_AVX-LABEL: fcmp_ueq: 237; FAST_AVX: ## %bb.0: 238; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 239; FAST_AVX-NEXT: sete %al 240; FAST_AVX-NEXT: andb $1, %al 241; FAST_AVX-NEXT: movzbl %al, %eax 242; FAST_AVX-NEXT: retq 243 %1 = fcmp ueq float %x, %y 244 ret i1 %1 245} 246 247define zeroext i1 @fcmp_ugt(float %x, float %y) { 248; SDAG-LABEL: fcmp_ugt: 249; SDAG: ## %bb.0: 250; SDAG-NEXT: ucomiss %xmm0, %xmm1 251; SDAG-NEXT: setb %al 252; SDAG-NEXT: retq 253; 254; FAST_NOAVX-LABEL: fcmp_ugt: 255; FAST_NOAVX: ## %bb.0: 256; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 257; FAST_NOAVX-NEXT: setb %al 258; FAST_NOAVX-NEXT: andb $1, %al 259; FAST_NOAVX-NEXT: movzbl %al, %eax 260; FAST_NOAVX-NEXT: retq 261; 262; FAST_AVX-LABEL: fcmp_ugt: 263; FAST_AVX: ## %bb.0: 264; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 265; FAST_AVX-NEXT: setb %al 266; FAST_AVX-NEXT: andb $1, %al 267; FAST_AVX-NEXT: movzbl %al, %eax 268; FAST_AVX-NEXT: retq 269 %1 = fcmp ugt float %x, %y 270 ret i1 %1 271} 272 273define zeroext i1 @fcmp_uge(float %x, float %y) { 274; SDAG-LABEL: fcmp_uge: 275; SDAG: ## %bb.0: 276; SDAG-NEXT: ucomiss %xmm0, %xmm1 277; SDAG-NEXT: setbe %al 278; SDAG-NEXT: retq 279; 280; FAST_NOAVX-LABEL: fcmp_uge: 281; FAST_NOAVX: ## %bb.0: 282; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 283; FAST_NOAVX-NEXT: setbe %al 284; FAST_NOAVX-NEXT: andb $1, %al 285; FAST_NOAVX-NEXT: movzbl %al, %eax 286; FAST_NOAVX-NEXT: retq 287; 288; FAST_AVX-LABEL: fcmp_uge: 289; FAST_AVX: ## %bb.0: 290; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 291; FAST_AVX-NEXT: setbe %al 292; FAST_AVX-NEXT: andb $1, %al 293; FAST_AVX-NEXT: movzbl %al, %eax 294; FAST_AVX-NEXT: retq 295 %1 = fcmp uge float %x, %y 296 ret i1 %1 297} 298 299define zeroext i1 @fcmp_ult(float %x, float %y) { 300; SDAG-LABEL: fcmp_ult: 301; SDAG: ## %bb.0: 302; SDAG-NEXT: ucomiss %xmm1, %xmm0 303; SDAG-NEXT: setb %al 304; SDAG-NEXT: retq 305; 306; FAST_NOAVX-LABEL: fcmp_ult: 307; FAST_NOAVX: ## %bb.0: 308; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 309; FAST_NOAVX-NEXT: setb %al 310; FAST_NOAVX-NEXT: andb $1, %al 311; FAST_NOAVX-NEXT: movzbl %al, %eax 312; FAST_NOAVX-NEXT: retq 313; 314; FAST_AVX-LABEL: fcmp_ult: 315; FAST_AVX: ## %bb.0: 316; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 317; FAST_AVX-NEXT: setb %al 318; FAST_AVX-NEXT: andb $1, %al 319; FAST_AVX-NEXT: movzbl %al, %eax 320; FAST_AVX-NEXT: retq 321 %1 = fcmp ult float %x, %y 322 ret i1 %1 323} 324 325define zeroext i1 @fcmp_ule(float %x, float %y) { 326; SDAG-LABEL: fcmp_ule: 327; SDAG: ## %bb.0: 328; SDAG-NEXT: ucomiss %xmm1, %xmm0 329; SDAG-NEXT: setbe %al 330; SDAG-NEXT: retq 331; 332; FAST_NOAVX-LABEL: fcmp_ule: 333; FAST_NOAVX: ## %bb.0: 334; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 335; FAST_NOAVX-NEXT: setbe %al 336; FAST_NOAVX-NEXT: andb $1, %al 337; FAST_NOAVX-NEXT: movzbl %al, %eax 338; FAST_NOAVX-NEXT: retq 339; 340; FAST_AVX-LABEL: fcmp_ule: 341; FAST_AVX: ## %bb.0: 342; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 343; FAST_AVX-NEXT: setbe %al 344; FAST_AVX-NEXT: andb $1, %al 345; FAST_AVX-NEXT: movzbl %al, %eax 346; FAST_AVX-NEXT: retq 347 %1 = fcmp ule float %x, %y 348 ret i1 %1 349} 350 351define zeroext i1 @fcmp_une(float %x, float %y) { 352; SDAG-LABEL: fcmp_une: 353; SDAG: ## %bb.0: 354; SDAG-NEXT: cmpneqss %xmm1, %xmm0 355; SDAG-NEXT: movd %xmm0, %eax 356; SDAG-NEXT: andl $1, %eax 357; SDAG-NEXT: ## kill: def $al killed $al killed $eax 358; SDAG-NEXT: retq 359; 360; FAST_NOAVX-LABEL: fcmp_une: 361; FAST_NOAVX: ## %bb.0: 362; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 363; FAST_NOAVX-NEXT: setne %al 364; FAST_NOAVX-NEXT: setp %cl 365; FAST_NOAVX-NEXT: orb %al, %cl 366; FAST_NOAVX-NEXT: andb $1, %cl 367; FAST_NOAVX-NEXT: movzbl %cl, %eax 368; FAST_NOAVX-NEXT: retq 369; 370; FAST_AVX-LABEL: fcmp_une: 371; FAST_AVX: ## %bb.0: 372; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 373; FAST_AVX-NEXT: setne %al 374; FAST_AVX-NEXT: setp %cl 375; FAST_AVX-NEXT: orb %al, %cl 376; FAST_AVX-NEXT: andb $1, %cl 377; FAST_AVX-NEXT: movzbl %cl, %eax 378; FAST_AVX-NEXT: retq 379 %1 = fcmp une float %x, %y 380 ret i1 %1 381} 382 383define zeroext i1 @icmp_eq(i32 %x, i32 %y) { 384; SDAG-LABEL: icmp_eq: 385; SDAG: ## %bb.0: 386; SDAG-NEXT: cmpl %esi, %edi 387; SDAG-NEXT: sete %al 388; SDAG-NEXT: retq 389; 390; FAST-LABEL: icmp_eq: 391; FAST: ## %bb.0: 392; FAST-NEXT: cmpl %esi, %edi 393; FAST-NEXT: sete %al 394; FAST-NEXT: andb $1, %al 395; FAST-NEXT: movzbl %al, %eax 396; FAST-NEXT: retq 397 %1 = icmp eq i32 %x, %y 398 ret i1 %1 399} 400 401define zeroext i1 @icmp_ne(i32 %x, i32 %y) { 402; SDAG-LABEL: icmp_ne: 403; SDAG: ## %bb.0: 404; SDAG-NEXT: cmpl %esi, %edi 405; SDAG-NEXT: setne %al 406; SDAG-NEXT: retq 407; 408; FAST-LABEL: icmp_ne: 409; FAST: ## %bb.0: 410; FAST-NEXT: cmpl %esi, %edi 411; FAST-NEXT: setne %al 412; FAST-NEXT: andb $1, %al 413; FAST-NEXT: movzbl %al, %eax 414; FAST-NEXT: retq 415 %1 = icmp ne i32 %x, %y 416 ret i1 %1 417} 418 419define zeroext i1 @icmp_ugt(i32 %x, i32 %y) { 420; SDAG-LABEL: icmp_ugt: 421; SDAG: ## %bb.0: 422; SDAG-NEXT: cmpl %esi, %edi 423; SDAG-NEXT: seta %al 424; SDAG-NEXT: retq 425; 426; FAST-LABEL: icmp_ugt: 427; FAST: ## %bb.0: 428; FAST-NEXT: cmpl %esi, %edi 429; FAST-NEXT: seta %al 430; FAST-NEXT: andb $1, %al 431; FAST-NEXT: movzbl %al, %eax 432; FAST-NEXT: retq 433 %1 = icmp ugt i32 %x, %y 434 ret i1 %1 435} 436 437define zeroext i1 @icmp_uge(i32 %x, i32 %y) { 438; SDAG-LABEL: icmp_uge: 439; SDAG: ## %bb.0: 440; SDAG-NEXT: cmpl %esi, %edi 441; SDAG-NEXT: setae %al 442; SDAG-NEXT: retq 443; 444; FAST-LABEL: icmp_uge: 445; FAST: ## %bb.0: 446; FAST-NEXT: cmpl %esi, %edi 447; FAST-NEXT: setae %al 448; FAST-NEXT: andb $1, %al 449; FAST-NEXT: movzbl %al, %eax 450; FAST-NEXT: retq 451 %1 = icmp uge i32 %x, %y 452 ret i1 %1 453} 454 455define zeroext i1 @icmp_ult(i32 %x, i32 %y) { 456; SDAG-LABEL: icmp_ult: 457; SDAG: ## %bb.0: 458; SDAG-NEXT: cmpl %esi, %edi 459; SDAG-NEXT: setb %al 460; SDAG-NEXT: retq 461; 462; FAST-LABEL: icmp_ult: 463; FAST: ## %bb.0: 464; FAST-NEXT: cmpl %esi, %edi 465; FAST-NEXT: setb %al 466; FAST-NEXT: andb $1, %al 467; FAST-NEXT: movzbl %al, %eax 468; FAST-NEXT: retq 469 %1 = icmp ult i32 %x, %y 470 ret i1 %1 471} 472 473define zeroext i1 @icmp_ule(i32 %x, i32 %y) { 474; SDAG-LABEL: icmp_ule: 475; SDAG: ## %bb.0: 476; SDAG-NEXT: cmpl %esi, %edi 477; SDAG-NEXT: setbe %al 478; SDAG-NEXT: retq 479; 480; FAST-LABEL: icmp_ule: 481; FAST: ## %bb.0: 482; FAST-NEXT: cmpl %esi, %edi 483; FAST-NEXT: setbe %al 484; FAST-NEXT: andb $1, %al 485; FAST-NEXT: movzbl %al, %eax 486; FAST-NEXT: retq 487 %1 = icmp ule i32 %x, %y 488 ret i1 %1 489} 490 491define zeroext i1 @icmp_sgt(i32 %x, i32 %y) { 492; SDAG-LABEL: icmp_sgt: 493; SDAG: ## %bb.0: 494; SDAG-NEXT: cmpl %esi, %edi 495; SDAG-NEXT: setg %al 496; SDAG-NEXT: retq 497; 498; FAST-LABEL: icmp_sgt: 499; FAST: ## %bb.0: 500; FAST-NEXT: cmpl %esi, %edi 501; FAST-NEXT: setg %al 502; FAST-NEXT: andb $1, %al 503; FAST-NEXT: movzbl %al, %eax 504; FAST-NEXT: retq 505 %1 = icmp sgt i32 %x, %y 506 ret i1 %1 507} 508 509define zeroext i1 @icmp_sge(i32 %x, i32 %y) { 510; SDAG-LABEL: icmp_sge: 511; SDAG: ## %bb.0: 512; SDAG-NEXT: cmpl %esi, %edi 513; SDAG-NEXT: setge %al 514; SDAG-NEXT: retq 515; 516; FAST-LABEL: icmp_sge: 517; FAST: ## %bb.0: 518; FAST-NEXT: cmpl %esi, %edi 519; FAST-NEXT: setge %al 520; FAST-NEXT: andb $1, %al 521; FAST-NEXT: movzbl %al, %eax 522; FAST-NEXT: retq 523 %1 = icmp sge i32 %x, %y 524 ret i1 %1 525} 526 527define zeroext i1 @icmp_slt(i32 %x, i32 %y) { 528; SDAG-LABEL: icmp_slt: 529; SDAG: ## %bb.0: 530; SDAG-NEXT: cmpl %esi, %edi 531; SDAG-NEXT: setl %al 532; SDAG-NEXT: retq 533; 534; FAST-LABEL: icmp_slt: 535; FAST: ## %bb.0: 536; FAST-NEXT: cmpl %esi, %edi 537; FAST-NEXT: setl %al 538; FAST-NEXT: andb $1, %al 539; FAST-NEXT: movzbl %al, %eax 540; FAST-NEXT: retq 541 %1 = icmp slt i32 %x, %y 542 ret i1 %1 543} 544 545define zeroext i1 @icmp_sle(i32 %x, i32 %y) { 546; SDAG-LABEL: icmp_sle: 547; SDAG: ## %bb.0: 548; SDAG-NEXT: cmpl %esi, %edi 549; SDAG-NEXT: setle %al 550; SDAG-NEXT: retq 551; 552; FAST-LABEL: icmp_sle: 553; FAST: ## %bb.0: 554; FAST-NEXT: cmpl %esi, %edi 555; FAST-NEXT: setle %al 556; FAST-NEXT: andb $1, %al 557; FAST-NEXT: movzbl %al, %eax 558; FAST-NEXT: retq 559 %1 = icmp sle i32 %x, %y 560 ret i1 %1 561} 562 563; Test cmp folding and condition optimization. 564define zeroext i1 @fcmp_oeq2(float %x) { 565; SDAG-LABEL: fcmp_oeq2: 566; SDAG: ## %bb.0: 567; SDAG-NEXT: ucomiss %xmm0, %xmm0 568; SDAG-NEXT: setnp %al 569; SDAG-NEXT: retq 570; 571; FAST_NOAVX-LABEL: fcmp_oeq2: 572; FAST_NOAVX: ## %bb.0: 573; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 574; FAST_NOAVX-NEXT: setnp %al 575; FAST_NOAVX-NEXT: andb $1, %al 576; FAST_NOAVX-NEXT: movzbl %al, %eax 577; FAST_NOAVX-NEXT: retq 578; 579; FAST_AVX-LABEL: fcmp_oeq2: 580; FAST_AVX: ## %bb.0: 581; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 582; FAST_AVX-NEXT: setnp %al 583; FAST_AVX-NEXT: andb $1, %al 584; FAST_AVX-NEXT: movzbl %al, %eax 585; FAST_AVX-NEXT: retq 586 %1 = fcmp oeq float %x, %x 587 ret i1 %1 588} 589 590define zeroext i1 @fcmp_oeq3(float %x) { 591; SDAG-LABEL: fcmp_oeq3: 592; SDAG: ## %bb.0: 593; SDAG-NEXT: xorps %xmm1, %xmm1 594; SDAG-NEXT: cmpeqss %xmm0, %xmm1 595; SDAG-NEXT: movd %xmm1, %eax 596; SDAG-NEXT: andl $1, %eax 597; SDAG-NEXT: ## kill: def $al killed $al killed $eax 598; SDAG-NEXT: retq 599; 600; FAST_NOAVX-LABEL: fcmp_oeq3: 601; FAST_NOAVX: ## %bb.0: 602; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 603; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 604; FAST_NOAVX-NEXT: sete %al 605; FAST_NOAVX-NEXT: setnp %cl 606; FAST_NOAVX-NEXT: andb %al, %cl 607; FAST_NOAVX-NEXT: andb $1, %cl 608; FAST_NOAVX-NEXT: movzbl %cl, %eax 609; FAST_NOAVX-NEXT: retq 610; 611; FAST_AVX-LABEL: fcmp_oeq3: 612; FAST_AVX: ## %bb.0: 613; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 614; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 615; FAST_AVX-NEXT: sete %al 616; FAST_AVX-NEXT: setnp %cl 617; FAST_AVX-NEXT: andb %al, %cl 618; FAST_AVX-NEXT: andb $1, %cl 619; FAST_AVX-NEXT: movzbl %cl, %eax 620; FAST_AVX-NEXT: retq 621 %1 = fcmp oeq float %x, 0.000000e+00 622 ret i1 %1 623} 624 625define zeroext i1 @fcmp_ogt2(float %x) { 626; SDAG-LABEL: fcmp_ogt2: 627; SDAG: ## %bb.0: 628; SDAG-NEXT: xorl %eax, %eax 629; SDAG-NEXT: retq 630; 631; FAST-LABEL: fcmp_ogt2: 632; FAST: ## %bb.0: 633; FAST-NEXT: xorl %eax, %eax 634; FAST-NEXT: andb $1, %al 635; FAST-NEXT: movzbl %al, %eax 636; FAST-NEXT: retq 637 %1 = fcmp ogt float %x, %x 638 ret i1 %1 639} 640 641define zeroext i1 @fcmp_ogt3(float %x) { 642; SDAG-LABEL: fcmp_ogt3: 643; SDAG: ## %bb.0: 644; SDAG-NEXT: xorps %xmm1, %xmm1 645; SDAG-NEXT: ucomiss %xmm1, %xmm0 646; SDAG-NEXT: seta %al 647; SDAG-NEXT: retq 648; 649; FAST_NOAVX-LABEL: fcmp_ogt3: 650; FAST_NOAVX: ## %bb.0: 651; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 652; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 653; FAST_NOAVX-NEXT: seta %al 654; FAST_NOAVX-NEXT: andb $1, %al 655; FAST_NOAVX-NEXT: movzbl %al, %eax 656; FAST_NOAVX-NEXT: retq 657; 658; FAST_AVX-LABEL: fcmp_ogt3: 659; FAST_AVX: ## %bb.0: 660; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 661; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 662; FAST_AVX-NEXT: seta %al 663; FAST_AVX-NEXT: andb $1, %al 664; FAST_AVX-NEXT: movzbl %al, %eax 665; FAST_AVX-NEXT: retq 666 %1 = fcmp ogt float %x, 0.000000e+00 667 ret i1 %1 668} 669 670define zeroext i1 @fcmp_oge2(float %x) { 671; SDAG-LABEL: fcmp_oge2: 672; SDAG: ## %bb.0: 673; SDAG-NEXT: ucomiss %xmm0, %xmm0 674; SDAG-NEXT: setnp %al 675; SDAG-NEXT: retq 676; 677; FAST_NOAVX-LABEL: fcmp_oge2: 678; FAST_NOAVX: ## %bb.0: 679; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 680; FAST_NOAVX-NEXT: setnp %al 681; FAST_NOAVX-NEXT: andb $1, %al 682; FAST_NOAVX-NEXT: movzbl %al, %eax 683; FAST_NOAVX-NEXT: retq 684; 685; FAST_AVX-LABEL: fcmp_oge2: 686; FAST_AVX: ## %bb.0: 687; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 688; FAST_AVX-NEXT: setnp %al 689; FAST_AVX-NEXT: andb $1, %al 690; FAST_AVX-NEXT: movzbl %al, %eax 691; FAST_AVX-NEXT: retq 692 %1 = fcmp oge float %x, %x 693 ret i1 %1 694} 695 696define zeroext i1 @fcmp_oge3(float %x) { 697; SDAG-LABEL: fcmp_oge3: 698; SDAG: ## %bb.0: 699; SDAG-NEXT: xorps %xmm1, %xmm1 700; SDAG-NEXT: ucomiss %xmm1, %xmm0 701; SDAG-NEXT: setae %al 702; SDAG-NEXT: retq 703; 704; FAST_NOAVX-LABEL: fcmp_oge3: 705; FAST_NOAVX: ## %bb.0: 706; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 707; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 708; FAST_NOAVX-NEXT: setae %al 709; FAST_NOAVX-NEXT: andb $1, %al 710; FAST_NOAVX-NEXT: movzbl %al, %eax 711; FAST_NOAVX-NEXT: retq 712; 713; FAST_AVX-LABEL: fcmp_oge3: 714; FAST_AVX: ## %bb.0: 715; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 716; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 717; FAST_AVX-NEXT: setae %al 718; FAST_AVX-NEXT: andb $1, %al 719; FAST_AVX-NEXT: movzbl %al, %eax 720; FAST_AVX-NEXT: retq 721 %1 = fcmp oge float %x, 0.000000e+00 722 ret i1 %1 723} 724 725define zeroext i1 @fcmp_olt2(float %x) { 726; SDAG-LABEL: fcmp_olt2: 727; SDAG: ## %bb.0: 728; SDAG-NEXT: xorl %eax, %eax 729; SDAG-NEXT: retq 730; 731; FAST-LABEL: fcmp_olt2: 732; FAST: ## %bb.0: 733; FAST-NEXT: xorl %eax, %eax 734; FAST-NEXT: andb $1, %al 735; FAST-NEXT: movzbl %al, %eax 736; FAST-NEXT: retq 737 %1 = fcmp olt float %x, %x 738 ret i1 %1 739} 740 741define zeroext i1 @fcmp_olt3(float %x) { 742; SDAG-LABEL: fcmp_olt3: 743; SDAG: ## %bb.0: 744; SDAG-NEXT: xorps %xmm1, %xmm1 745; SDAG-NEXT: ucomiss %xmm0, %xmm1 746; SDAG-NEXT: seta %al 747; SDAG-NEXT: retq 748; 749; FAST_NOAVX-LABEL: fcmp_olt3: 750; FAST_NOAVX: ## %bb.0: 751; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 752; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 753; FAST_NOAVX-NEXT: seta %al 754; FAST_NOAVX-NEXT: andb $1, %al 755; FAST_NOAVX-NEXT: movzbl %al, %eax 756; FAST_NOAVX-NEXT: retq 757; 758; FAST_AVX-LABEL: fcmp_olt3: 759; FAST_AVX: ## %bb.0: 760; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 761; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 762; FAST_AVX-NEXT: seta %al 763; FAST_AVX-NEXT: andb $1, %al 764; FAST_AVX-NEXT: movzbl %al, %eax 765; FAST_AVX-NEXT: retq 766 %1 = fcmp olt float %x, 0.000000e+00 767 ret i1 %1 768} 769 770define zeroext i1 @fcmp_ole2(float %x) { 771; SDAG-LABEL: fcmp_ole2: 772; SDAG: ## %bb.0: 773; SDAG-NEXT: ucomiss %xmm0, %xmm0 774; SDAG-NEXT: setnp %al 775; SDAG-NEXT: retq 776; 777; FAST_NOAVX-LABEL: fcmp_ole2: 778; FAST_NOAVX: ## %bb.0: 779; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 780; FAST_NOAVX-NEXT: setnp %al 781; FAST_NOAVX-NEXT: andb $1, %al 782; FAST_NOAVX-NEXT: movzbl %al, %eax 783; FAST_NOAVX-NEXT: retq 784; 785; FAST_AVX-LABEL: fcmp_ole2: 786; FAST_AVX: ## %bb.0: 787; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 788; FAST_AVX-NEXT: setnp %al 789; FAST_AVX-NEXT: andb $1, %al 790; FAST_AVX-NEXT: movzbl %al, %eax 791; FAST_AVX-NEXT: retq 792 %1 = fcmp ole float %x, %x 793 ret i1 %1 794} 795 796define zeroext i1 @fcmp_ole3(float %x) { 797; SDAG-LABEL: fcmp_ole3: 798; SDAG: ## %bb.0: 799; SDAG-NEXT: xorps %xmm1, %xmm1 800; SDAG-NEXT: ucomiss %xmm0, %xmm1 801; SDAG-NEXT: setae %al 802; SDAG-NEXT: retq 803; 804; FAST_NOAVX-LABEL: fcmp_ole3: 805; FAST_NOAVX: ## %bb.0: 806; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 807; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 808; FAST_NOAVX-NEXT: setae %al 809; FAST_NOAVX-NEXT: andb $1, %al 810; FAST_NOAVX-NEXT: movzbl %al, %eax 811; FAST_NOAVX-NEXT: retq 812; 813; FAST_AVX-LABEL: fcmp_ole3: 814; FAST_AVX: ## %bb.0: 815; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 816; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 817; FAST_AVX-NEXT: setae %al 818; FAST_AVX-NEXT: andb $1, %al 819; FAST_AVX-NEXT: movzbl %al, %eax 820; FAST_AVX-NEXT: retq 821 %1 = fcmp ole float %x, 0.000000e+00 822 ret i1 %1 823} 824 825define zeroext i1 @fcmp_one2(float %x) { 826; SDAG-LABEL: fcmp_one2: 827; SDAG: ## %bb.0: 828; SDAG-NEXT: xorl %eax, %eax 829; SDAG-NEXT: retq 830; 831; FAST-LABEL: fcmp_one2: 832; FAST: ## %bb.0: 833; FAST-NEXT: xorl %eax, %eax 834; FAST-NEXT: andb $1, %al 835; FAST-NEXT: movzbl %al, %eax 836; FAST-NEXT: retq 837 %1 = fcmp one float %x, %x 838 ret i1 %1 839} 840 841define zeroext i1 @fcmp_one3(float %x) { 842; SDAG-LABEL: fcmp_one3: 843; SDAG: ## %bb.0: 844; SDAG-NEXT: xorps %xmm1, %xmm1 845; SDAG-NEXT: ucomiss %xmm1, %xmm0 846; SDAG-NEXT: setne %al 847; SDAG-NEXT: retq 848; 849; FAST_NOAVX-LABEL: fcmp_one3: 850; FAST_NOAVX: ## %bb.0: 851; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 852; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 853; FAST_NOAVX-NEXT: setne %al 854; FAST_NOAVX-NEXT: andb $1, %al 855; FAST_NOAVX-NEXT: movzbl %al, %eax 856; FAST_NOAVX-NEXT: retq 857; 858; FAST_AVX-LABEL: fcmp_one3: 859; FAST_AVX: ## %bb.0: 860; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 861; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 862; FAST_AVX-NEXT: setne %al 863; FAST_AVX-NEXT: andb $1, %al 864; FAST_AVX-NEXT: movzbl %al, %eax 865; FAST_AVX-NEXT: retq 866 %1 = fcmp one float %x, 0.000000e+00 867 ret i1 %1 868} 869 870define zeroext i1 @fcmp_ord2(float %x) { 871; SDAG-LABEL: fcmp_ord2: 872; SDAG: ## %bb.0: 873; SDAG-NEXT: ucomiss %xmm0, %xmm0 874; SDAG-NEXT: setnp %al 875; SDAG-NEXT: retq 876; 877; FAST_NOAVX-LABEL: fcmp_ord2: 878; FAST_NOAVX: ## %bb.0: 879; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 880; FAST_NOAVX-NEXT: setnp %al 881; FAST_NOAVX-NEXT: andb $1, %al 882; FAST_NOAVX-NEXT: movzbl %al, %eax 883; FAST_NOAVX-NEXT: retq 884; 885; FAST_AVX-LABEL: fcmp_ord2: 886; FAST_AVX: ## %bb.0: 887; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 888; FAST_AVX-NEXT: setnp %al 889; FAST_AVX-NEXT: andb $1, %al 890; FAST_AVX-NEXT: movzbl %al, %eax 891; FAST_AVX-NEXT: retq 892 %1 = fcmp ord float %x, %x 893 ret i1 %1 894} 895 896define zeroext i1 @fcmp_ord3(float %x) { 897; SDAG-LABEL: fcmp_ord3: 898; SDAG: ## %bb.0: 899; SDAG-NEXT: ucomiss %xmm0, %xmm0 900; SDAG-NEXT: setnp %al 901; SDAG-NEXT: retq 902; 903; FAST_NOAVX-LABEL: fcmp_ord3: 904; FAST_NOAVX: ## %bb.0: 905; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 906; FAST_NOAVX-NEXT: setnp %al 907; FAST_NOAVX-NEXT: andb $1, %al 908; FAST_NOAVX-NEXT: movzbl %al, %eax 909; FAST_NOAVX-NEXT: retq 910; 911; FAST_AVX-LABEL: fcmp_ord3: 912; FAST_AVX: ## %bb.0: 913; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 914; FAST_AVX-NEXT: setnp %al 915; FAST_AVX-NEXT: andb $1, %al 916; FAST_AVX-NEXT: movzbl %al, %eax 917; FAST_AVX-NEXT: retq 918 %1 = fcmp ord float %x, 0.000000e+00 919 ret i1 %1 920} 921 922define zeroext i1 @fcmp_uno2(float %x) { 923; SDAG-LABEL: fcmp_uno2: 924; SDAG: ## %bb.0: 925; SDAG-NEXT: ucomiss %xmm0, %xmm0 926; SDAG-NEXT: setp %al 927; SDAG-NEXT: retq 928; 929; FAST_NOAVX-LABEL: fcmp_uno2: 930; FAST_NOAVX: ## %bb.0: 931; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 932; FAST_NOAVX-NEXT: setp %al 933; FAST_NOAVX-NEXT: andb $1, %al 934; FAST_NOAVX-NEXT: movzbl %al, %eax 935; FAST_NOAVX-NEXT: retq 936; 937; FAST_AVX-LABEL: fcmp_uno2: 938; FAST_AVX: ## %bb.0: 939; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 940; FAST_AVX-NEXT: setp %al 941; FAST_AVX-NEXT: andb $1, %al 942; FAST_AVX-NEXT: movzbl %al, %eax 943; FAST_AVX-NEXT: retq 944 %1 = fcmp uno float %x, %x 945 ret i1 %1 946} 947 948define zeroext i1 @fcmp_uno3(float %x) { 949; SDAG-LABEL: fcmp_uno3: 950; SDAG: ## %bb.0: 951; SDAG-NEXT: ucomiss %xmm0, %xmm0 952; SDAG-NEXT: setp %al 953; SDAG-NEXT: retq 954; 955; FAST_NOAVX-LABEL: fcmp_uno3: 956; FAST_NOAVX: ## %bb.0: 957; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 958; FAST_NOAVX-NEXT: setp %al 959; FAST_NOAVX-NEXT: andb $1, %al 960; FAST_NOAVX-NEXT: movzbl %al, %eax 961; FAST_NOAVX-NEXT: retq 962; 963; FAST_AVX-LABEL: fcmp_uno3: 964; FAST_AVX: ## %bb.0: 965; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 966; FAST_AVX-NEXT: setp %al 967; FAST_AVX-NEXT: andb $1, %al 968; FAST_AVX-NEXT: movzbl %al, %eax 969; FAST_AVX-NEXT: retq 970 %1 = fcmp uno float %x, 0.000000e+00 971 ret i1 %1 972} 973 974define zeroext i1 @fcmp_ueq2(float %x) { 975; SDAG-LABEL: fcmp_ueq2: 976; SDAG: ## %bb.0: 977; SDAG-NEXT: movb $1, %al 978; SDAG-NEXT: retq 979; 980; FAST-LABEL: fcmp_ueq2: 981; FAST: ## %bb.0: 982; FAST-NEXT: movb $1, %al 983; FAST-NEXT: andb $1, %al 984; FAST-NEXT: movzbl %al, %eax 985; FAST-NEXT: retq 986 %1 = fcmp ueq float %x, %x 987 ret i1 %1 988} 989 990define zeroext i1 @fcmp_ueq3(float %x) { 991; SDAG-LABEL: fcmp_ueq3: 992; SDAG: ## %bb.0: 993; SDAG-NEXT: xorps %xmm1, %xmm1 994; SDAG-NEXT: ucomiss %xmm1, %xmm0 995; SDAG-NEXT: sete %al 996; SDAG-NEXT: retq 997; 998; FAST_NOAVX-LABEL: fcmp_ueq3: 999; FAST_NOAVX: ## %bb.0: 1000; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 1001; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 1002; FAST_NOAVX-NEXT: sete %al 1003; FAST_NOAVX-NEXT: andb $1, %al 1004; FAST_NOAVX-NEXT: movzbl %al, %eax 1005; FAST_NOAVX-NEXT: retq 1006; 1007; FAST_AVX-LABEL: fcmp_ueq3: 1008; FAST_AVX: ## %bb.0: 1009; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 1010; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 1011; FAST_AVX-NEXT: sete %al 1012; FAST_AVX-NEXT: andb $1, %al 1013; FAST_AVX-NEXT: movzbl %al, %eax 1014; FAST_AVX-NEXT: retq 1015 %1 = fcmp ueq float %x, 0.000000e+00 1016 ret i1 %1 1017} 1018 1019define zeroext i1 @fcmp_ugt2(float %x) { 1020; SDAG-LABEL: fcmp_ugt2: 1021; SDAG: ## %bb.0: 1022; SDAG-NEXT: ucomiss %xmm0, %xmm0 1023; SDAG-NEXT: setp %al 1024; SDAG-NEXT: retq 1025; 1026; FAST_NOAVX-LABEL: fcmp_ugt2: 1027; FAST_NOAVX: ## %bb.0: 1028; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 1029; FAST_NOAVX-NEXT: setp %al 1030; FAST_NOAVX-NEXT: andb $1, %al 1031; FAST_NOAVX-NEXT: movzbl %al, %eax 1032; FAST_NOAVX-NEXT: retq 1033; 1034; FAST_AVX-LABEL: fcmp_ugt2: 1035; FAST_AVX: ## %bb.0: 1036; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 1037; FAST_AVX-NEXT: setp %al 1038; FAST_AVX-NEXT: andb $1, %al 1039; FAST_AVX-NEXT: movzbl %al, %eax 1040; FAST_AVX-NEXT: retq 1041 %1 = fcmp ugt float %x, %x 1042 ret i1 %1 1043} 1044 1045define zeroext i1 @fcmp_ugt3(float %x) { 1046; SDAG-LABEL: fcmp_ugt3: 1047; SDAG: ## %bb.0: 1048; SDAG-NEXT: xorps %xmm1, %xmm1 1049; SDAG-NEXT: ucomiss %xmm0, %xmm1 1050; SDAG-NEXT: setb %al 1051; SDAG-NEXT: retq 1052; 1053; FAST_NOAVX-LABEL: fcmp_ugt3: 1054; FAST_NOAVX: ## %bb.0: 1055; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 1056; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 1057; FAST_NOAVX-NEXT: setb %al 1058; FAST_NOAVX-NEXT: andb $1, %al 1059; FAST_NOAVX-NEXT: movzbl %al, %eax 1060; FAST_NOAVX-NEXT: retq 1061; 1062; FAST_AVX-LABEL: fcmp_ugt3: 1063; FAST_AVX: ## %bb.0: 1064; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 1065; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 1066; FAST_AVX-NEXT: setb %al 1067; FAST_AVX-NEXT: andb $1, %al 1068; FAST_AVX-NEXT: movzbl %al, %eax 1069; FAST_AVX-NEXT: retq 1070 %1 = fcmp ugt float %x, 0.000000e+00 1071 ret i1 %1 1072} 1073 1074define zeroext i1 @fcmp_uge2(float %x) { 1075; SDAG-LABEL: fcmp_uge2: 1076; SDAG: ## %bb.0: 1077; SDAG-NEXT: movb $1, %al 1078; SDAG-NEXT: retq 1079; 1080; FAST-LABEL: fcmp_uge2: 1081; FAST: ## %bb.0: 1082; FAST-NEXT: movb $1, %al 1083; FAST-NEXT: andb $1, %al 1084; FAST-NEXT: movzbl %al, %eax 1085; FAST-NEXT: retq 1086 %1 = fcmp uge float %x, %x 1087 ret i1 %1 1088} 1089 1090define zeroext i1 @fcmp_uge3(float %x) { 1091; SDAG-LABEL: fcmp_uge3: 1092; SDAG: ## %bb.0: 1093; SDAG-NEXT: xorps %xmm1, %xmm1 1094; SDAG-NEXT: ucomiss %xmm0, %xmm1 1095; SDAG-NEXT: setbe %al 1096; SDAG-NEXT: retq 1097; 1098; FAST_NOAVX-LABEL: fcmp_uge3: 1099; FAST_NOAVX: ## %bb.0: 1100; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 1101; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm1 1102; FAST_NOAVX-NEXT: setbe %al 1103; FAST_NOAVX-NEXT: andb $1, %al 1104; FAST_NOAVX-NEXT: movzbl %al, %eax 1105; FAST_NOAVX-NEXT: retq 1106; 1107; FAST_AVX-LABEL: fcmp_uge3: 1108; FAST_AVX: ## %bb.0: 1109; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 1110; FAST_AVX-NEXT: vucomiss %xmm0, %xmm1 1111; FAST_AVX-NEXT: setbe %al 1112; FAST_AVX-NEXT: andb $1, %al 1113; FAST_AVX-NEXT: movzbl %al, %eax 1114; FAST_AVX-NEXT: retq 1115 %1 = fcmp uge float %x, 0.000000e+00 1116 ret i1 %1 1117} 1118 1119define zeroext i1 @fcmp_ult2(float %x) { 1120; SDAG-LABEL: fcmp_ult2: 1121; SDAG: ## %bb.0: 1122; SDAG-NEXT: ucomiss %xmm0, %xmm0 1123; SDAG-NEXT: setp %al 1124; SDAG-NEXT: retq 1125; 1126; FAST_NOAVX-LABEL: fcmp_ult2: 1127; FAST_NOAVX: ## %bb.0: 1128; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 1129; FAST_NOAVX-NEXT: setp %al 1130; FAST_NOAVX-NEXT: andb $1, %al 1131; FAST_NOAVX-NEXT: movzbl %al, %eax 1132; FAST_NOAVX-NEXT: retq 1133; 1134; FAST_AVX-LABEL: fcmp_ult2: 1135; FAST_AVX: ## %bb.0: 1136; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 1137; FAST_AVX-NEXT: setp %al 1138; FAST_AVX-NEXT: andb $1, %al 1139; FAST_AVX-NEXT: movzbl %al, %eax 1140; FAST_AVX-NEXT: retq 1141 %1 = fcmp ult float %x, %x 1142 ret i1 %1 1143} 1144 1145define zeroext i1 @fcmp_ult3(float %x) { 1146; SDAG-LABEL: fcmp_ult3: 1147; SDAG: ## %bb.0: 1148; SDAG-NEXT: xorps %xmm1, %xmm1 1149; SDAG-NEXT: ucomiss %xmm1, %xmm0 1150; SDAG-NEXT: setb %al 1151; SDAG-NEXT: retq 1152; 1153; FAST_NOAVX-LABEL: fcmp_ult3: 1154; FAST_NOAVX: ## %bb.0: 1155; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 1156; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 1157; FAST_NOAVX-NEXT: setb %al 1158; FAST_NOAVX-NEXT: andb $1, %al 1159; FAST_NOAVX-NEXT: movzbl %al, %eax 1160; FAST_NOAVX-NEXT: retq 1161; 1162; FAST_AVX-LABEL: fcmp_ult3: 1163; FAST_AVX: ## %bb.0: 1164; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 1165; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 1166; FAST_AVX-NEXT: setb %al 1167; FAST_AVX-NEXT: andb $1, %al 1168; FAST_AVX-NEXT: movzbl %al, %eax 1169; FAST_AVX-NEXT: retq 1170 %1 = fcmp ult float %x, 0.000000e+00 1171 ret i1 %1 1172} 1173 1174define zeroext i1 @fcmp_ule2(float %x) { 1175; SDAG-LABEL: fcmp_ule2: 1176; SDAG: ## %bb.0: 1177; SDAG-NEXT: movb $1, %al 1178; SDAG-NEXT: retq 1179; 1180; FAST-LABEL: fcmp_ule2: 1181; FAST: ## %bb.0: 1182; FAST-NEXT: movb $1, %al 1183; FAST-NEXT: andb $1, %al 1184; FAST-NEXT: movzbl %al, %eax 1185; FAST-NEXT: retq 1186 %1 = fcmp ule float %x, %x 1187 ret i1 %1 1188} 1189 1190define zeroext i1 @fcmp_ule3(float %x) { 1191; SDAG-LABEL: fcmp_ule3: 1192; SDAG: ## %bb.0: 1193; SDAG-NEXT: xorps %xmm1, %xmm1 1194; SDAG-NEXT: ucomiss %xmm1, %xmm0 1195; SDAG-NEXT: setbe %al 1196; SDAG-NEXT: retq 1197; 1198; FAST_NOAVX-LABEL: fcmp_ule3: 1199; FAST_NOAVX: ## %bb.0: 1200; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 1201; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 1202; FAST_NOAVX-NEXT: setbe %al 1203; FAST_NOAVX-NEXT: andb $1, %al 1204; FAST_NOAVX-NEXT: movzbl %al, %eax 1205; FAST_NOAVX-NEXT: retq 1206; 1207; FAST_AVX-LABEL: fcmp_ule3: 1208; FAST_AVX: ## %bb.0: 1209; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 1210; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 1211; FAST_AVX-NEXT: setbe %al 1212; FAST_AVX-NEXT: andb $1, %al 1213; FAST_AVX-NEXT: movzbl %al, %eax 1214; FAST_AVX-NEXT: retq 1215 %1 = fcmp ule float %x, 0.000000e+00 1216 ret i1 %1 1217} 1218 1219define zeroext i1 @fcmp_une2(float %x) { 1220; SDAG-LABEL: fcmp_une2: 1221; SDAG: ## %bb.0: 1222; SDAG-NEXT: ucomiss %xmm0, %xmm0 1223; SDAG-NEXT: setp %al 1224; SDAG-NEXT: retq 1225; 1226; FAST_NOAVX-LABEL: fcmp_une2: 1227; FAST_NOAVX: ## %bb.0: 1228; FAST_NOAVX-NEXT: ucomiss %xmm0, %xmm0 1229; FAST_NOAVX-NEXT: setp %al 1230; FAST_NOAVX-NEXT: andb $1, %al 1231; FAST_NOAVX-NEXT: movzbl %al, %eax 1232; FAST_NOAVX-NEXT: retq 1233; 1234; FAST_AVX-LABEL: fcmp_une2: 1235; FAST_AVX: ## %bb.0: 1236; FAST_AVX-NEXT: vucomiss %xmm0, %xmm0 1237; FAST_AVX-NEXT: setp %al 1238; FAST_AVX-NEXT: andb $1, %al 1239; FAST_AVX-NEXT: movzbl %al, %eax 1240; FAST_AVX-NEXT: retq 1241 %1 = fcmp une float %x, %x 1242 ret i1 %1 1243} 1244 1245define zeroext i1 @fcmp_une3(float %x) { 1246; SDAG-LABEL: fcmp_une3: 1247; SDAG: ## %bb.0: 1248; SDAG-NEXT: xorps %xmm1, %xmm1 1249; SDAG-NEXT: cmpneqss %xmm0, %xmm1 1250; SDAG-NEXT: movd %xmm1, %eax 1251; SDAG-NEXT: andl $1, %eax 1252; SDAG-NEXT: ## kill: def $al killed $al killed $eax 1253; SDAG-NEXT: retq 1254; 1255; FAST_NOAVX-LABEL: fcmp_une3: 1256; FAST_NOAVX: ## %bb.0: 1257; FAST_NOAVX-NEXT: xorps %xmm1, %xmm1 1258; FAST_NOAVX-NEXT: ucomiss %xmm1, %xmm0 1259; FAST_NOAVX-NEXT: setne %al 1260; FAST_NOAVX-NEXT: setp %cl 1261; FAST_NOAVX-NEXT: orb %al, %cl 1262; FAST_NOAVX-NEXT: andb $1, %cl 1263; FAST_NOAVX-NEXT: movzbl %cl, %eax 1264; FAST_NOAVX-NEXT: retq 1265; 1266; FAST_AVX-LABEL: fcmp_une3: 1267; FAST_AVX: ## %bb.0: 1268; FAST_AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1 1269; FAST_AVX-NEXT: vucomiss %xmm1, %xmm0 1270; FAST_AVX-NEXT: setne %al 1271; FAST_AVX-NEXT: setp %cl 1272; FAST_AVX-NEXT: orb %al, %cl 1273; FAST_AVX-NEXT: andb $1, %cl 1274; FAST_AVX-NEXT: movzbl %cl, %eax 1275; FAST_AVX-NEXT: retq 1276 %1 = fcmp une float %x, 0.000000e+00 1277 ret i1 %1 1278} 1279 1280define zeroext i1 @icmp_eq2(i32 %x) { 1281; SDAG-LABEL: icmp_eq2: 1282; SDAG: ## %bb.0: 1283; SDAG-NEXT: movb $1, %al 1284; SDAG-NEXT: retq 1285; 1286; FAST-LABEL: icmp_eq2: 1287; FAST: ## %bb.0: 1288; FAST-NEXT: movb $1, %al 1289; FAST-NEXT: andb $1, %al 1290; FAST-NEXT: movzbl %al, %eax 1291; FAST-NEXT: retq 1292 %1 = icmp eq i32 %x, %x 1293 ret i1 %1 1294} 1295 1296define zeroext i1 @icmp_ne2(i32 %x) { 1297; SDAG-LABEL: icmp_ne2: 1298; SDAG: ## %bb.0: 1299; SDAG-NEXT: xorl %eax, %eax 1300; SDAG-NEXT: retq 1301; 1302; FAST-LABEL: icmp_ne2: 1303; FAST: ## %bb.0: 1304; FAST-NEXT: xorl %eax, %eax 1305; FAST-NEXT: andb $1, %al 1306; FAST-NEXT: movzbl %al, %eax 1307; FAST-NEXT: retq 1308 %1 = icmp ne i32 %x, %x 1309 ret i1 %1 1310} 1311 1312define zeroext i1 @icmp_ugt2(i32 %x) { 1313; SDAG-LABEL: icmp_ugt2: 1314; SDAG: ## %bb.0: 1315; SDAG-NEXT: xorl %eax, %eax 1316; SDAG-NEXT: retq 1317; 1318; FAST-LABEL: icmp_ugt2: 1319; FAST: ## %bb.0: 1320; FAST-NEXT: xorl %eax, %eax 1321; FAST-NEXT: andb $1, %al 1322; FAST-NEXT: movzbl %al, %eax 1323; FAST-NEXT: retq 1324 %1 = icmp ugt i32 %x, %x 1325 ret i1 %1 1326} 1327 1328define zeroext i1 @icmp_uge2(i32 %x) { 1329; SDAG-LABEL: icmp_uge2: 1330; SDAG: ## %bb.0: 1331; SDAG-NEXT: movb $1, %al 1332; SDAG-NEXT: retq 1333; 1334; FAST-LABEL: icmp_uge2: 1335; FAST: ## %bb.0: 1336; FAST-NEXT: movb $1, %al 1337; FAST-NEXT: andb $1, %al 1338; FAST-NEXT: movzbl %al, %eax 1339; FAST-NEXT: retq 1340 %1 = icmp uge i32 %x, %x 1341 ret i1 %1 1342} 1343 1344define zeroext i1 @icmp_ult2(i32 %x) { 1345; SDAG-LABEL: icmp_ult2: 1346; SDAG: ## %bb.0: 1347; SDAG-NEXT: xorl %eax, %eax 1348; SDAG-NEXT: retq 1349; 1350; FAST-LABEL: icmp_ult2: 1351; FAST: ## %bb.0: 1352; FAST-NEXT: xorl %eax, %eax 1353; FAST-NEXT: andb $1, %al 1354; FAST-NEXT: movzbl %al, %eax 1355; FAST-NEXT: retq 1356 %1 = icmp ult i32 %x, %x 1357 ret i1 %1 1358} 1359 1360define zeroext i1 @icmp_ule2(i32 %x) { 1361; SDAG-LABEL: icmp_ule2: 1362; SDAG: ## %bb.0: 1363; SDAG-NEXT: movb $1, %al 1364; SDAG-NEXT: retq 1365; 1366; FAST-LABEL: icmp_ule2: 1367; FAST: ## %bb.0: 1368; FAST-NEXT: movb $1, %al 1369; FAST-NEXT: andb $1, %al 1370; FAST-NEXT: movzbl %al, %eax 1371; FAST-NEXT: retq 1372 %1 = icmp ule i32 %x, %x 1373 ret i1 %1 1374} 1375 1376define zeroext i1 @icmp_sgt2(i32 %x) { 1377; SDAG-LABEL: icmp_sgt2: 1378; SDAG: ## %bb.0: 1379; SDAG-NEXT: xorl %eax, %eax 1380; SDAG-NEXT: retq 1381; 1382; FAST-LABEL: icmp_sgt2: 1383; FAST: ## %bb.0: 1384; FAST-NEXT: xorl %eax, %eax 1385; FAST-NEXT: andb $1, %al 1386; FAST-NEXT: movzbl %al, %eax 1387; FAST-NEXT: retq 1388 %1 = icmp sgt i32 %x, %x 1389 ret i1 %1 1390} 1391 1392define zeroext i1 @icmp_sge2(i32 %x) { 1393; SDAG-LABEL: icmp_sge2: 1394; SDAG: ## %bb.0: 1395; SDAG-NEXT: movb $1, %al 1396; SDAG-NEXT: retq 1397; 1398; FAST-LABEL: icmp_sge2: 1399; FAST: ## %bb.0: 1400; FAST-NEXT: movb $1, %al 1401; FAST-NEXT: andb $1, %al 1402; FAST-NEXT: movzbl %al, %eax 1403; FAST-NEXT: retq 1404 %1 = icmp sge i32 %x, %x 1405 ret i1 %1 1406} 1407 1408define zeroext i1 @icmp_slt2(i32 %x) { 1409; SDAG-LABEL: icmp_slt2: 1410; SDAG: ## %bb.0: 1411; SDAG-NEXT: xorl %eax, %eax 1412; SDAG-NEXT: retq 1413; 1414; FAST-LABEL: icmp_slt2: 1415; FAST: ## %bb.0: 1416; FAST-NEXT: xorl %eax, %eax 1417; FAST-NEXT: andb $1, %al 1418; FAST-NEXT: movzbl %al, %eax 1419; FAST-NEXT: retq 1420 %1 = icmp slt i32 %x, %x 1421 ret i1 %1 1422} 1423 1424define zeroext i1 @icmp_sle2(i32 %x) { 1425; SDAG-LABEL: icmp_sle2: 1426; SDAG: ## %bb.0: 1427; SDAG-NEXT: movb $1, %al 1428; SDAG-NEXT: retq 1429; 1430; FAST-LABEL: icmp_sle2: 1431; FAST: ## %bb.0: 1432; FAST-NEXT: movb $1, %al 1433; FAST-NEXT: andb $1, %al 1434; FAST-NEXT: movzbl %al, %eax 1435; FAST-NEXT: retq 1436 %1 = icmp sle i32 %x, %x 1437 ret i1 %1 1438} 1439 1440