1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=i686-- -no-integrated-as | FileCheck %s -check-prefix=X32 3; RUN: llc < %s -mtriple=x86_64-- -no-integrated-as | FileCheck %s -check-prefix=X64 4 5define i32 @test_cca(i64 %nr, i64* %addr) nounwind { 6; X32-LABEL: test_cca: 7; X32: # %bb.0: # %entry 8; X32-NEXT: pushl %esi 9; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 10; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 11; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 12; X32-NEXT: xorl %eax, %eax 13; X32-NEXT: #APP 14; X32-NEXT: cmp %ecx,(%esi) 15; X32-NEXT: #NO_APP 16; X32-NEXT: seta %al 17; X32-NEXT: popl %esi 18; X32-NEXT: retl 19; 20; X64-LABEL: test_cca: 21; X64: # %bb.0: # %entry 22; X64-NEXT: xorl %eax, %eax 23; X64-NEXT: #APP 24; X64-NEXT: cmp %rdi,(%rsi) 25; X64-NEXT: #NO_APP 26; X64-NEXT: seta %al 27; X64-NEXT: retq 28entry: 29 %cc = tail call i32 asm "cmp $2,$1", "={@cca},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 30 %tobool = icmp ne i32 %cc, 0 31 %rv = zext i1 %tobool to i32 32 ret i32 %rv 33} 34 35 36define i32 @test_ccae(i64 %nr, i64* %addr) nounwind { 37; X32-LABEL: test_ccae: 38; X32: # %bb.0: # %entry 39; X32-NEXT: pushl %esi 40; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 41; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 42; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 43; X32-NEXT: xorl %eax, %eax 44; X32-NEXT: #APP 45; X32-NEXT: cmp %ecx,(%esi) 46; X32-NEXT: #NO_APP 47; X32-NEXT: setae %al 48; X32-NEXT: popl %esi 49; X32-NEXT: retl 50; 51; X64-LABEL: test_ccae: 52; X64: # %bb.0: # %entry 53; X64-NEXT: xorl %eax, %eax 54; X64-NEXT: #APP 55; X64-NEXT: cmp %rdi,(%rsi) 56; X64-NEXT: #NO_APP 57; X64-NEXT: setae %al 58; X64-NEXT: retq 59entry: 60 %cc = tail call i32 asm "cmp $2,$1", "={@ccae},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 61 %tobool = icmp ne i32 %cc, 0 62 %rv = zext i1 %tobool to i32 63 ret i32 %rv 64} 65 66 67define i32 @test_ccb(i64 %nr, i64* %addr) nounwind { 68; X32-LABEL: test_ccb: 69; X32: # %bb.0: # %entry 70; X32-NEXT: pushl %esi 71; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 72; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 73; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 74; X32-NEXT: xorl %eax, %eax 75; X32-NEXT: #APP 76; X32-NEXT: cmp %ecx,(%esi) 77; X32-NEXT: #NO_APP 78; X32-NEXT: setb %al 79; X32-NEXT: popl %esi 80; X32-NEXT: retl 81; 82; X64-LABEL: test_ccb: 83; X64: # %bb.0: # %entry 84; X64-NEXT: xorl %eax, %eax 85; X64-NEXT: #APP 86; X64-NEXT: cmp %rdi,(%rsi) 87; X64-NEXT: #NO_APP 88; X64-NEXT: setb %al 89; X64-NEXT: retq 90entry: 91 %cc = tail call i32 asm "cmp $2,$1", "={@ccb},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 92 %tobool = icmp ne i32 %cc, 0 93 %rv = zext i1 %tobool to i32 94 ret i32 %rv 95} 96 97 98define i32 @test_ccbe(i64 %nr, i64* %addr) nounwind { 99; X32-LABEL: test_ccbe: 100; X32: # %bb.0: # %entry 101; X32-NEXT: pushl %esi 102; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 103; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 104; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 105; X32-NEXT: xorl %eax, %eax 106; X32-NEXT: #APP 107; X32-NEXT: cmp %ecx,(%esi) 108; X32-NEXT: #NO_APP 109; X32-NEXT: setbe %al 110; X32-NEXT: popl %esi 111; X32-NEXT: retl 112; 113; X64-LABEL: test_ccbe: 114; X64: # %bb.0: # %entry 115; X64-NEXT: xorl %eax, %eax 116; X64-NEXT: #APP 117; X64-NEXT: cmp %rdi,(%rsi) 118; X64-NEXT: #NO_APP 119; X64-NEXT: setbe %al 120; X64-NEXT: retq 121entry: 122 %cc = tail call i32 asm "cmp $2,$1", "={@ccbe},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 123 %tobool = icmp ne i32 %cc, 0 124 %rv = zext i1 %tobool to i32 125 ret i32 %rv 126} 127 128 129define i32 @test_ccc(i64 %nr, i64* %addr) nounwind { 130; X32-LABEL: test_ccc: 131; X32: # %bb.0: # %entry 132; X32-NEXT: pushl %esi 133; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 134; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 135; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 136; X32-NEXT: xorl %eax, %eax 137; X32-NEXT: #APP 138; X32-NEXT: cmp %ecx,(%esi) 139; X32-NEXT: #NO_APP 140; X32-NEXT: setb %al 141; X32-NEXT: popl %esi 142; X32-NEXT: retl 143; 144; X64-LABEL: test_ccc: 145; X64: # %bb.0: # %entry 146; X64-NEXT: xorl %eax, %eax 147; X64-NEXT: #APP 148; X64-NEXT: cmp %rdi,(%rsi) 149; X64-NEXT: #NO_APP 150; X64-NEXT: setb %al 151; X64-NEXT: retq 152entry: 153 %cc = tail call i32 asm "cmp $2,$1", "={@ccc},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 154 %tobool = icmp ne i32 %cc, 0 155 %rv = zext i1 %tobool to i32 156 ret i32 %rv 157} 158 159 160define i32 @test_cce(i64 %nr, i64* %addr) nounwind { 161; X32-LABEL: test_cce: 162; X32: # %bb.0: # %entry 163; X32-NEXT: pushl %esi 164; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 165; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 166; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 167; X32-NEXT: xorl %eax, %eax 168; X32-NEXT: #APP 169; X32-NEXT: cmp %ecx,(%esi) 170; X32-NEXT: #NO_APP 171; X32-NEXT: sete %al 172; X32-NEXT: popl %esi 173; X32-NEXT: retl 174; 175; X64-LABEL: test_cce: 176; X64: # %bb.0: # %entry 177; X64-NEXT: xorl %eax, %eax 178; X64-NEXT: #APP 179; X64-NEXT: cmp %rdi,(%rsi) 180; X64-NEXT: #NO_APP 181; X64-NEXT: sete %al 182; X64-NEXT: retq 183entry: 184 %cc = tail call i32 asm "cmp $2,$1", "={@cce},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 185 %tobool = icmp ne i32 %cc, 0 186 %rv = zext i1 %tobool to i32 187 ret i32 %rv 188} 189 190 191define i32 @test_ccz(i64 %nr, i64* %addr) nounwind { 192; X32-LABEL: test_ccz: 193; X32: # %bb.0: # %entry 194; X32-NEXT: pushl %esi 195; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 196; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 197; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 198; X32-NEXT: xorl %eax, %eax 199; X32-NEXT: #APP 200; X32-NEXT: cmp %ecx,(%esi) 201; X32-NEXT: #NO_APP 202; X32-NEXT: sete %al 203; X32-NEXT: popl %esi 204; X32-NEXT: retl 205; 206; X64-LABEL: test_ccz: 207; X64: # %bb.0: # %entry 208; X64-NEXT: xorl %eax, %eax 209; X64-NEXT: #APP 210; X64-NEXT: cmp %rdi,(%rsi) 211; X64-NEXT: #NO_APP 212; X64-NEXT: sete %al 213; X64-NEXT: retq 214entry: 215 %cc = tail call i32 asm "cmp $2,$1", "={@ccz},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 216 %tobool = icmp ne i32 %cc, 0 217 %rv = zext i1 %tobool to i32 218 ret i32 %rv 219} 220 221 222define i32 @test_ccg(i64 %nr, i64* %addr) nounwind { 223; X32-LABEL: test_ccg: 224; X32: # %bb.0: # %entry 225; X32-NEXT: pushl %esi 226; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 227; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 228; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 229; X32-NEXT: xorl %eax, %eax 230; X32-NEXT: #APP 231; X32-NEXT: cmp %ecx,(%esi) 232; X32-NEXT: #NO_APP 233; X32-NEXT: setg %al 234; X32-NEXT: popl %esi 235; X32-NEXT: retl 236; 237; X64-LABEL: test_ccg: 238; X64: # %bb.0: # %entry 239; X64-NEXT: xorl %eax, %eax 240; X64-NEXT: #APP 241; X64-NEXT: cmp %rdi,(%rsi) 242; X64-NEXT: #NO_APP 243; X64-NEXT: setg %al 244; X64-NEXT: retq 245entry: 246 %cc = tail call i32 asm "cmp $2,$1", "={@ccg},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 247 %tobool = icmp ne i32 %cc, 0 248 %rv = zext i1 %tobool to i32 249 ret i32 %rv 250} 251 252 253define i32 @test_ccge(i64 %nr, i64* %addr) nounwind { 254; X32-LABEL: test_ccge: 255; X32: # %bb.0: # %entry 256; X32-NEXT: pushl %esi 257; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 258; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 259; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 260; X32-NEXT: xorl %eax, %eax 261; X32-NEXT: #APP 262; X32-NEXT: cmp %ecx,(%esi) 263; X32-NEXT: #NO_APP 264; X32-NEXT: setge %al 265; X32-NEXT: popl %esi 266; X32-NEXT: retl 267; 268; X64-LABEL: test_ccge: 269; X64: # %bb.0: # %entry 270; X64-NEXT: xorl %eax, %eax 271; X64-NEXT: #APP 272; X64-NEXT: cmp %rdi,(%rsi) 273; X64-NEXT: #NO_APP 274; X64-NEXT: setge %al 275; X64-NEXT: retq 276entry: 277 %cc = tail call i32 asm "cmp $2,$1", "={@ccge},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 278 %tobool = icmp ne i32 %cc, 0 279 %rv = zext i1 %tobool to i32 280 ret i32 %rv 281} 282 283 284define i32 @test_ccl(i64 %nr, i64* %addr) nounwind { 285; X32-LABEL: test_ccl: 286; X32: # %bb.0: # %entry 287; X32-NEXT: pushl %esi 288; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 289; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 290; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 291; X32-NEXT: xorl %eax, %eax 292; X32-NEXT: #APP 293; X32-NEXT: cmp %ecx,(%esi) 294; X32-NEXT: #NO_APP 295; X32-NEXT: setl %al 296; X32-NEXT: popl %esi 297; X32-NEXT: retl 298; 299; X64-LABEL: test_ccl: 300; X64: # %bb.0: # %entry 301; X64-NEXT: xorl %eax, %eax 302; X64-NEXT: #APP 303; X64-NEXT: cmp %rdi,(%rsi) 304; X64-NEXT: #NO_APP 305; X64-NEXT: setl %al 306; X64-NEXT: retq 307entry: 308 %cc = tail call i32 asm "cmp $2,$1", "={@ccl},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 309 %tobool = icmp ne i32 %cc, 0 310 %rv = zext i1 %tobool to i32 311 ret i32 %rv 312} 313 314 315define i32 @test_ccle(i64 %nr, i64* %addr) nounwind { 316; X32-LABEL: test_ccle: 317; X32: # %bb.0: # %entry 318; X32-NEXT: pushl %esi 319; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 320; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 321; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 322; X32-NEXT: xorl %eax, %eax 323; X32-NEXT: #APP 324; X32-NEXT: cmp %ecx,(%esi) 325; X32-NEXT: #NO_APP 326; X32-NEXT: setle %al 327; X32-NEXT: popl %esi 328; X32-NEXT: retl 329; 330; X64-LABEL: test_ccle: 331; X64: # %bb.0: # %entry 332; X64-NEXT: xorl %eax, %eax 333; X64-NEXT: #APP 334; X64-NEXT: cmp %rdi,(%rsi) 335; X64-NEXT: #NO_APP 336; X64-NEXT: setle %al 337; X64-NEXT: retq 338entry: 339 %cc = tail call i32 asm "cmp $2,$1", "={@ccle},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 340 %tobool = icmp ne i32 %cc, 0 341 %rv = zext i1 %tobool to i32 342 ret i32 %rv 343} 344 345 346define i32 @test_ccna(i64 %nr, i64* %addr) nounwind { 347; X32-LABEL: test_ccna: 348; X32: # %bb.0: # %entry 349; X32-NEXT: pushl %esi 350; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 351; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 352; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 353; X32-NEXT: xorl %eax, %eax 354; X32-NEXT: #APP 355; X32-NEXT: cmp %ecx,(%esi) 356; X32-NEXT: #NO_APP 357; X32-NEXT: setbe %al 358; X32-NEXT: popl %esi 359; X32-NEXT: retl 360; 361; X64-LABEL: test_ccna: 362; X64: # %bb.0: # %entry 363; X64-NEXT: xorl %eax, %eax 364; X64-NEXT: #APP 365; X64-NEXT: cmp %rdi,(%rsi) 366; X64-NEXT: #NO_APP 367; X64-NEXT: setbe %al 368; X64-NEXT: retq 369entry: 370 %cc = tail call i32 asm "cmp $2,$1", "={@ccna},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 371 %tobool = icmp ne i32 %cc, 0 372 %rv = zext i1 %tobool to i32 373 ret i32 %rv 374} 375 376 377define i32 @test_ccnae(i64 %nr, i64* %addr) nounwind { 378; X32-LABEL: test_ccnae: 379; X32: # %bb.0: # %entry 380; X32-NEXT: pushl %esi 381; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 382; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 383; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 384; X32-NEXT: xorl %eax, %eax 385; X32-NEXT: #APP 386; X32-NEXT: cmp %ecx,(%esi) 387; X32-NEXT: #NO_APP 388; X32-NEXT: setb %al 389; X32-NEXT: popl %esi 390; X32-NEXT: retl 391; 392; X64-LABEL: test_ccnae: 393; X64: # %bb.0: # %entry 394; X64-NEXT: xorl %eax, %eax 395; X64-NEXT: #APP 396; X64-NEXT: cmp %rdi,(%rsi) 397; X64-NEXT: #NO_APP 398; X64-NEXT: setb %al 399; X64-NEXT: retq 400entry: 401 %cc = tail call i32 asm "cmp $2,$1", "={@ccnae},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 402 %tobool = icmp ne i32 %cc, 0 403 %rv = zext i1 %tobool to i32 404 ret i32 %rv 405} 406 407 408define i32 @test_ccnb(i64 %nr, i64* %addr) nounwind { 409; X32-LABEL: test_ccnb: 410; X32: # %bb.0: # %entry 411; X32-NEXT: pushl %esi 412; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 413; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 414; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 415; X32-NEXT: xorl %eax, %eax 416; X32-NEXT: #APP 417; X32-NEXT: cmp %ecx,(%esi) 418; X32-NEXT: #NO_APP 419; X32-NEXT: setae %al 420; X32-NEXT: popl %esi 421; X32-NEXT: retl 422; 423; X64-LABEL: test_ccnb: 424; X64: # %bb.0: # %entry 425; X64-NEXT: xorl %eax, %eax 426; X64-NEXT: #APP 427; X64-NEXT: cmp %rdi,(%rsi) 428; X64-NEXT: #NO_APP 429; X64-NEXT: setae %al 430; X64-NEXT: retq 431entry: 432 %cc = tail call i32 asm "cmp $2,$1", "={@ccnb},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 433 %tobool = icmp ne i32 %cc, 0 434 %rv = zext i1 %tobool to i32 435 ret i32 %rv 436} 437 438 439define i32 @test_ccnbe(i64 %nr, i64* %addr) nounwind { 440; X32-LABEL: test_ccnbe: 441; X32: # %bb.0: # %entry 442; X32-NEXT: pushl %esi 443; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 444; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 445; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 446; X32-NEXT: xorl %eax, %eax 447; X32-NEXT: #APP 448; X32-NEXT: cmp %ecx,(%esi) 449; X32-NEXT: #NO_APP 450; X32-NEXT: seta %al 451; X32-NEXT: popl %esi 452; X32-NEXT: retl 453; 454; X64-LABEL: test_ccnbe: 455; X64: # %bb.0: # %entry 456; X64-NEXT: xorl %eax, %eax 457; X64-NEXT: #APP 458; X64-NEXT: cmp %rdi,(%rsi) 459; X64-NEXT: #NO_APP 460; X64-NEXT: seta %al 461; X64-NEXT: retq 462entry: 463 %cc = tail call i32 asm "cmp $2,$1", "={@ccnbe},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 464 %tobool = icmp ne i32 %cc, 0 465 %rv = zext i1 %tobool to i32 466 ret i32 %rv 467} 468 469 470define i32 @test_ccnc(i64 %nr, i64* %addr) nounwind { 471; X32-LABEL: test_ccnc: 472; X32: # %bb.0: # %entry 473; X32-NEXT: pushl %esi 474; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 475; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 476; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 477; X32-NEXT: xorl %eax, %eax 478; X32-NEXT: #APP 479; X32-NEXT: cmp %ecx,(%esi) 480; X32-NEXT: #NO_APP 481; X32-NEXT: setae %al 482; X32-NEXT: popl %esi 483; X32-NEXT: retl 484; 485; X64-LABEL: test_ccnc: 486; X64: # %bb.0: # %entry 487; X64-NEXT: xorl %eax, %eax 488; X64-NEXT: #APP 489; X64-NEXT: cmp %rdi,(%rsi) 490; X64-NEXT: #NO_APP 491; X64-NEXT: setae %al 492; X64-NEXT: retq 493entry: 494 %cc = tail call i32 asm "cmp $2,$1", "={@ccnc},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 495 %tobool = icmp ne i32 %cc, 0 496 %rv = zext i1 %tobool to i32 497 ret i32 %rv 498} 499 500 501define i32 @test_ccne(i64 %nr, i64* %addr) nounwind { 502; X32-LABEL: test_ccne: 503; X32: # %bb.0: # %entry 504; X32-NEXT: pushl %esi 505; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 506; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 507; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 508; X32-NEXT: xorl %eax, %eax 509; X32-NEXT: #APP 510; X32-NEXT: cmp %ecx,(%esi) 511; X32-NEXT: #NO_APP 512; X32-NEXT: setne %al 513; X32-NEXT: popl %esi 514; X32-NEXT: retl 515; 516; X64-LABEL: test_ccne: 517; X64: # %bb.0: # %entry 518; X64-NEXT: xorl %eax, %eax 519; X64-NEXT: #APP 520; X64-NEXT: cmp %rdi,(%rsi) 521; X64-NEXT: #NO_APP 522; X64-NEXT: setne %al 523; X64-NEXT: retq 524entry: 525 %cc = tail call i32 asm "cmp $2,$1", "={@ccne},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 526 %tobool = icmp ne i32 %cc, 0 527 %rv = zext i1 %tobool to i32 528 ret i32 %rv 529} 530 531 532define i32 @test_ccnz(i64 %nr, i64* %addr) nounwind { 533; X32-LABEL: test_ccnz: 534; X32: # %bb.0: # %entry 535; X32-NEXT: pushl %esi 536; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 537; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 538; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 539; X32-NEXT: xorl %eax, %eax 540; X32-NEXT: #APP 541; X32-NEXT: cmp %ecx,(%esi) 542; X32-NEXT: #NO_APP 543; X32-NEXT: setne %al 544; X32-NEXT: popl %esi 545; X32-NEXT: retl 546; 547; X64-LABEL: test_ccnz: 548; X64: # %bb.0: # %entry 549; X64-NEXT: xorl %eax, %eax 550; X64-NEXT: #APP 551; X64-NEXT: cmp %rdi,(%rsi) 552; X64-NEXT: #NO_APP 553; X64-NEXT: setne %al 554; X64-NEXT: retq 555entry: 556 %cc = tail call i32 asm "cmp $2,$1", "={@ccnz},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 557 %tobool = icmp ne i32 %cc, 0 558 %rv = zext i1 %tobool to i32 559 ret i32 %rv 560} 561 562 563define i32 @test_ccng(i64 %nr, i64* %addr) nounwind { 564; X32-LABEL: test_ccng: 565; X32: # %bb.0: # %entry 566; X32-NEXT: pushl %esi 567; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 568; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 569; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 570; X32-NEXT: xorl %eax, %eax 571; X32-NEXT: #APP 572; X32-NEXT: cmp %ecx,(%esi) 573; X32-NEXT: #NO_APP 574; X32-NEXT: setle %al 575; X32-NEXT: popl %esi 576; X32-NEXT: retl 577; 578; X64-LABEL: test_ccng: 579; X64: # %bb.0: # %entry 580; X64-NEXT: xorl %eax, %eax 581; X64-NEXT: #APP 582; X64-NEXT: cmp %rdi,(%rsi) 583; X64-NEXT: #NO_APP 584; X64-NEXT: setle %al 585; X64-NEXT: retq 586entry: 587 %cc = tail call i32 asm "cmp $2,$1", "={@ccng},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 588 %tobool = icmp ne i32 %cc, 0 589 %rv = zext i1 %tobool to i32 590 ret i32 %rv 591} 592 593 594define i32 @test_ccnge(i64 %nr, i64* %addr) nounwind { 595; X32-LABEL: test_ccnge: 596; X32: # %bb.0: # %entry 597; X32-NEXT: pushl %esi 598; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 599; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 600; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 601; X32-NEXT: xorl %eax, %eax 602; X32-NEXT: #APP 603; X32-NEXT: cmp %ecx,(%esi) 604; X32-NEXT: #NO_APP 605; X32-NEXT: setl %al 606; X32-NEXT: popl %esi 607; X32-NEXT: retl 608; 609; X64-LABEL: test_ccnge: 610; X64: # %bb.0: # %entry 611; X64-NEXT: xorl %eax, %eax 612; X64-NEXT: #APP 613; X64-NEXT: cmp %rdi,(%rsi) 614; X64-NEXT: #NO_APP 615; X64-NEXT: setl %al 616; X64-NEXT: retq 617entry: 618 %cc = tail call i32 asm "cmp $2,$1", "={@ccnge},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 619 %tobool = icmp ne i32 %cc, 0 620 %rv = zext i1 %tobool to i32 621 ret i32 %rv 622} 623 624 625define i32 @test_ccnl(i64 %nr, i64* %addr) nounwind { 626; X32-LABEL: test_ccnl: 627; X32: # %bb.0: # %entry 628; X32-NEXT: pushl %esi 629; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 630; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 631; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 632; X32-NEXT: xorl %eax, %eax 633; X32-NEXT: #APP 634; X32-NEXT: cmp %ecx,(%esi) 635; X32-NEXT: #NO_APP 636; X32-NEXT: setge %al 637; X32-NEXT: popl %esi 638; X32-NEXT: retl 639; 640; X64-LABEL: test_ccnl: 641; X64: # %bb.0: # %entry 642; X64-NEXT: xorl %eax, %eax 643; X64-NEXT: #APP 644; X64-NEXT: cmp %rdi,(%rsi) 645; X64-NEXT: #NO_APP 646; X64-NEXT: setge %al 647; X64-NEXT: retq 648entry: 649 %cc = tail call i32 asm "cmp $2,$1", "={@ccnl},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 650 %tobool = icmp ne i32 %cc, 0 651 %rv = zext i1 %tobool to i32 652 ret i32 %rv 653} 654 655 656define i32 @test_ccnle(i64 %nr, i64* %addr) nounwind { 657; X32-LABEL: test_ccnle: 658; X32: # %bb.0: # %entry 659; X32-NEXT: pushl %esi 660; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 661; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 662; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 663; X32-NEXT: xorl %eax, %eax 664; X32-NEXT: #APP 665; X32-NEXT: cmp %ecx,(%esi) 666; X32-NEXT: #NO_APP 667; X32-NEXT: setg %al 668; X32-NEXT: popl %esi 669; X32-NEXT: retl 670; 671; X64-LABEL: test_ccnle: 672; X64: # %bb.0: # %entry 673; X64-NEXT: xorl %eax, %eax 674; X64-NEXT: #APP 675; X64-NEXT: cmp %rdi,(%rsi) 676; X64-NEXT: #NO_APP 677; X64-NEXT: setg %al 678; X64-NEXT: retq 679entry: 680 %cc = tail call i32 asm "cmp $2,$1", "={@ccnle},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 681 %tobool = icmp ne i32 %cc, 0 682 %rv = zext i1 %tobool to i32 683 ret i32 %rv 684} 685 686 687define i32 @test_ccno(i64 %nr, i64* %addr) nounwind { 688; X32-LABEL: test_ccno: 689; X32: # %bb.0: # %entry 690; X32-NEXT: pushl %esi 691; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 692; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 693; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 694; X32-NEXT: xorl %eax, %eax 695; X32-NEXT: #APP 696; X32-NEXT: cmp %ecx,(%esi) 697; X32-NEXT: #NO_APP 698; X32-NEXT: setno %al 699; X32-NEXT: popl %esi 700; X32-NEXT: retl 701; 702; X64-LABEL: test_ccno: 703; X64: # %bb.0: # %entry 704; X64-NEXT: xorl %eax, %eax 705; X64-NEXT: #APP 706; X64-NEXT: cmp %rdi,(%rsi) 707; X64-NEXT: #NO_APP 708; X64-NEXT: setno %al 709; X64-NEXT: retq 710entry: 711 %cc = tail call i32 asm "cmp $2,$1", "={@ccno},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 712 %tobool = icmp ne i32 %cc, 0 713 %rv = zext i1 %tobool to i32 714 ret i32 %rv 715} 716 717 718define i32 @test_ccnp(i64 %nr, i64* %addr) nounwind { 719; X32-LABEL: test_ccnp: 720; X32: # %bb.0: # %entry 721; X32-NEXT: pushl %esi 722; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 723; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 724; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 725; X32-NEXT: xorl %eax, %eax 726; X32-NEXT: #APP 727; X32-NEXT: cmp %ecx,(%esi) 728; X32-NEXT: #NO_APP 729; X32-NEXT: setnp %al 730; X32-NEXT: popl %esi 731; X32-NEXT: retl 732; 733; X64-LABEL: test_ccnp: 734; X64: # %bb.0: # %entry 735; X64-NEXT: xorl %eax, %eax 736; X64-NEXT: #APP 737; X64-NEXT: cmp %rdi,(%rsi) 738; X64-NEXT: #NO_APP 739; X64-NEXT: setnp %al 740; X64-NEXT: retq 741entry: 742 %cc = tail call i32 asm "cmp $2,$1", "={@ccnp},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 743 %tobool = icmp ne i32 %cc, 0 744 %rv = zext i1 %tobool to i32 745 ret i32 %rv 746} 747 748 749define i32 @test_ccns(i64 %nr, i64* %addr) nounwind { 750; X32-LABEL: test_ccns: 751; X32: # %bb.0: # %entry 752; X32-NEXT: pushl %esi 753; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 754; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 755; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 756; X32-NEXT: xorl %eax, %eax 757; X32-NEXT: #APP 758; X32-NEXT: cmp %ecx,(%esi) 759; X32-NEXT: #NO_APP 760; X32-NEXT: setns %al 761; X32-NEXT: popl %esi 762; X32-NEXT: retl 763; 764; X64-LABEL: test_ccns: 765; X64: # %bb.0: # %entry 766; X64-NEXT: xorl %eax, %eax 767; X64-NEXT: #APP 768; X64-NEXT: cmp %rdi,(%rsi) 769; X64-NEXT: #NO_APP 770; X64-NEXT: setns %al 771; X64-NEXT: retq 772entry: 773 %cc = tail call i32 asm "cmp $2,$1", "={@ccns},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 774 %tobool = icmp ne i32 %cc, 0 775 %rv = zext i1 %tobool to i32 776 ret i32 %rv 777} 778 779 780define i32 @test_cco(i64 %nr, i64* %addr) nounwind { 781; X32-LABEL: test_cco: 782; X32: # %bb.0: # %entry 783; X32-NEXT: pushl %esi 784; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 785; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 786; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 787; X32-NEXT: xorl %eax, %eax 788; X32-NEXT: #APP 789; X32-NEXT: cmp %ecx,(%esi) 790; X32-NEXT: #NO_APP 791; X32-NEXT: seto %al 792; X32-NEXT: popl %esi 793; X32-NEXT: retl 794; 795; X64-LABEL: test_cco: 796; X64: # %bb.0: # %entry 797; X64-NEXT: xorl %eax, %eax 798; X64-NEXT: #APP 799; X64-NEXT: cmp %rdi,(%rsi) 800; X64-NEXT: #NO_APP 801; X64-NEXT: seto %al 802; X64-NEXT: retq 803entry: 804 %cc = tail call i32 asm "cmp $2,$1", "={@cco},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 805 %tobool = icmp ne i32 %cc, 0 806 %rv = zext i1 %tobool to i32 807 ret i32 %rv 808} 809 810 811define i32 @test_ccp(i64 %nr, i64* %addr) nounwind { 812; X32-LABEL: test_ccp: 813; X32: # %bb.0: # %entry 814; X32-NEXT: pushl %esi 815; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 816; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 817; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 818; X32-NEXT: xorl %eax, %eax 819; X32-NEXT: #APP 820; X32-NEXT: cmp %ecx,(%esi) 821; X32-NEXT: #NO_APP 822; X32-NEXT: setp %al 823; X32-NEXT: popl %esi 824; X32-NEXT: retl 825; 826; X64-LABEL: test_ccp: 827; X64: # %bb.0: # %entry 828; X64-NEXT: xorl %eax, %eax 829; X64-NEXT: #APP 830; X64-NEXT: cmp %rdi,(%rsi) 831; X64-NEXT: #NO_APP 832; X64-NEXT: setp %al 833; X64-NEXT: retq 834entry: 835 %cc = tail call i32 asm "cmp $2,$1", "={@ccp},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 836 %tobool = icmp ne i32 %cc, 0 837 %rv = zext i1 %tobool to i32 838 ret i32 %rv 839} 840 841 842define i32 @test_ccs(i64 %nr, i64* %addr) nounwind { 843; X32-LABEL: test_ccs: 844; X32: # %bb.0: # %entry 845; X32-NEXT: pushl %esi 846; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 847; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 848; X32-NEXT: movl {{[0-9]+}}(%esp), %esi 849; X32-NEXT: xorl %eax, %eax 850; X32-NEXT: #APP 851; X32-NEXT: cmp %ecx,(%esi) 852; X32-NEXT: #NO_APP 853; X32-NEXT: sets %al 854; X32-NEXT: popl %esi 855; X32-NEXT: retl 856; 857; X64-LABEL: test_ccs: 858; X64: # %bb.0: # %entry 859; X64-NEXT: xorl %eax, %eax 860; X64-NEXT: #APP 861; X64-NEXT: cmp %rdi,(%rsi) 862; X64-NEXT: #NO_APP 863; X64-NEXT: sets %al 864; X64-NEXT: retq 865entry: 866 %cc = tail call i32 asm "cmp $2,$1", "={@ccs},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 867 %tobool = icmp ne i32 %cc, 0 868 %rv = zext i1 %tobool to i32 869 ret i32 %rv 870} 871 872declare void @bar() 873 874define void @test_cca_branch(i64 %nr, i64* %addr) nounwind { 875; X32-LABEL: test_cca_branch: 876; X32: # %bb.0: # %entry 877; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 878; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 879; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 880; X32-NEXT: #APP 881; X32-NEXT: cmp %eax,(%edx) 882; X32-NEXT: #NO_APP 883; X32-NEXT: jbe .LBB28_2 884; X32-NEXT: # %bb.1: # %then 885; X32-NEXT: calll bar 886; X32-NEXT: .LBB28_2: # %exit 887; X32-NEXT: retl 888; 889; X64-LABEL: test_cca_branch: 890; X64: # %bb.0: # %entry 891; X64-NEXT: pushq %rax 892; X64-NEXT: #APP 893; X64-NEXT: cmp %rdi,(%rsi) 894; X64-NEXT: #NO_APP 895; X64-NEXT: jbe .LBB28_2 896; X64-NEXT: # %bb.1: # %then 897; X64-NEXT: callq bar 898; X64-NEXT: .LBB28_2: # %exit 899; X64-NEXT: popq %rax 900; X64-NEXT: retq 901entry: 902 %cc = tail call i8 asm "cmp $2,$1", "={@cca},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 903 %tobool = icmp ne i8 %cc, 0 904 br i1 %tobool, label %then, label %exit 905 906then: 907 call void @bar() 908 br label %exit 909 910exit: 911 ret void 912} 913 914define void @test_ccae_branch(i64 %nr, i64* %addr) nounwind { 915; X32-LABEL: test_ccae_branch: 916; X32: # %bb.0: # %entry 917; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 918; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 919; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 920; X32-NEXT: #APP 921; X32-NEXT: cmp %eax,(%edx) 922; X32-NEXT: #NO_APP 923; X32-NEXT: jb .LBB29_2 924; X32-NEXT: # %bb.1: # %then 925; X32-NEXT: calll bar 926; X32-NEXT: .LBB29_2: # %exit 927; X32-NEXT: retl 928; 929; X64-LABEL: test_ccae_branch: 930; X64: # %bb.0: # %entry 931; X64-NEXT: pushq %rax 932; X64-NEXT: #APP 933; X64-NEXT: cmp %rdi,(%rsi) 934; X64-NEXT: #NO_APP 935; X64-NEXT: jb .LBB29_2 936; X64-NEXT: # %bb.1: # %then 937; X64-NEXT: callq bar 938; X64-NEXT: .LBB29_2: # %exit 939; X64-NEXT: popq %rax 940; X64-NEXT: retq 941entry: 942 %cc = tail call i8 asm "cmp $2,$1", "={@ccae},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 943 %tobool = icmp ne i8 %cc, 0 944 br i1 %tobool, label %then, label %exit 945 946then: 947 call void @bar() 948 br label %exit 949 950exit: 951 ret void 952} 953 954define void @test_ccb_branch(i64 %nr, i64* %addr) nounwind { 955; X32-LABEL: test_ccb_branch: 956; X32: # %bb.0: # %entry 957; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 958; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 959; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 960; X32-NEXT: #APP 961; X32-NEXT: cmp %eax,(%edx) 962; X32-NEXT: #NO_APP 963; X32-NEXT: jae .LBB30_2 964; X32-NEXT: # %bb.1: # %then 965; X32-NEXT: calll bar 966; X32-NEXT: .LBB30_2: # %exit 967; X32-NEXT: retl 968; 969; X64-LABEL: test_ccb_branch: 970; X64: # %bb.0: # %entry 971; X64-NEXT: pushq %rax 972; X64-NEXT: #APP 973; X64-NEXT: cmp %rdi,(%rsi) 974; X64-NEXT: #NO_APP 975; X64-NEXT: jae .LBB30_2 976; X64-NEXT: # %bb.1: # %then 977; X64-NEXT: callq bar 978; X64-NEXT: .LBB30_2: # %exit 979; X64-NEXT: popq %rax 980; X64-NEXT: retq 981entry: 982 %cc = tail call i8 asm "cmp $2,$1", "={@ccb},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 983 %tobool = icmp ne i8 %cc, 0 984 br i1 %tobool, label %then, label %exit 985 986then: 987 call void @bar() 988 br label %exit 989 990exit: 991 ret void 992} 993 994define void @test_ccbe_branch(i64 %nr, i64* %addr) nounwind { 995; X32-LABEL: test_ccbe_branch: 996; X32: # %bb.0: # %entry 997; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 998; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 999; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1000; X32-NEXT: #APP 1001; X32-NEXT: cmp %eax,(%edx) 1002; X32-NEXT: #NO_APP 1003; X32-NEXT: ja .LBB31_2 1004; X32-NEXT: # %bb.1: # %then 1005; X32-NEXT: calll bar 1006; X32-NEXT: .LBB31_2: # %exit 1007; X32-NEXT: retl 1008; 1009; X64-LABEL: test_ccbe_branch: 1010; X64: # %bb.0: # %entry 1011; X64-NEXT: pushq %rax 1012; X64-NEXT: #APP 1013; X64-NEXT: cmp %rdi,(%rsi) 1014; X64-NEXT: #NO_APP 1015; X64-NEXT: ja .LBB31_2 1016; X64-NEXT: # %bb.1: # %then 1017; X64-NEXT: callq bar 1018; X64-NEXT: .LBB31_2: # %exit 1019; X64-NEXT: popq %rax 1020; X64-NEXT: retq 1021entry: 1022 %cc = tail call i8 asm "cmp $2,$1", "={@ccbe},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1023 %tobool = icmp ne i8 %cc, 0 1024 br i1 %tobool, label %then, label %exit 1025 1026then: 1027 call void @bar() 1028 br label %exit 1029 1030exit: 1031 ret void 1032} 1033 1034define void @test_ccc_branch(i64 %nr, i64* %addr) nounwind { 1035; X32-LABEL: test_ccc_branch: 1036; X32: # %bb.0: # %entry 1037; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1038; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1039; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1040; X32-NEXT: #APP 1041; X32-NEXT: cmp %eax,(%edx) 1042; X32-NEXT: #NO_APP 1043; X32-NEXT: jae .LBB32_2 1044; X32-NEXT: # %bb.1: # %then 1045; X32-NEXT: calll bar 1046; X32-NEXT: .LBB32_2: # %exit 1047; X32-NEXT: retl 1048; 1049; X64-LABEL: test_ccc_branch: 1050; X64: # %bb.0: # %entry 1051; X64-NEXT: pushq %rax 1052; X64-NEXT: #APP 1053; X64-NEXT: cmp %rdi,(%rsi) 1054; X64-NEXT: #NO_APP 1055; X64-NEXT: jae .LBB32_2 1056; X64-NEXT: # %bb.1: # %then 1057; X64-NEXT: callq bar 1058; X64-NEXT: .LBB32_2: # %exit 1059; X64-NEXT: popq %rax 1060; X64-NEXT: retq 1061entry: 1062 %cc = tail call i8 asm "cmp $2,$1", "={@ccc},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1063 %tobool = icmp ne i8 %cc, 0 1064 br i1 %tobool, label %then, label %exit 1065 1066then: 1067 call void @bar() 1068 br label %exit 1069 1070exit: 1071 ret void 1072} 1073 1074define void @test_cce_branch(i64 %nr, i64* %addr) nounwind { 1075; X32-LABEL: test_cce_branch: 1076; X32: # %bb.0: # %entry 1077; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1078; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1079; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1080; X32-NEXT: #APP 1081; X32-NEXT: cmp %eax,(%edx) 1082; X32-NEXT: #NO_APP 1083; X32-NEXT: jne .LBB33_2 1084; X32-NEXT: # %bb.1: # %then 1085; X32-NEXT: calll bar 1086; X32-NEXT: .LBB33_2: # %exit 1087; X32-NEXT: retl 1088; 1089; X64-LABEL: test_cce_branch: 1090; X64: # %bb.0: # %entry 1091; X64-NEXT: pushq %rax 1092; X64-NEXT: #APP 1093; X64-NEXT: cmp %rdi,(%rsi) 1094; X64-NEXT: #NO_APP 1095; X64-NEXT: jne .LBB33_2 1096; X64-NEXT: # %bb.1: # %then 1097; X64-NEXT: callq bar 1098; X64-NEXT: .LBB33_2: # %exit 1099; X64-NEXT: popq %rax 1100; X64-NEXT: retq 1101entry: 1102 %cc = tail call i8 asm "cmp $2,$1", "={@cce},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1103 %tobool = icmp ne i8 %cc, 0 1104 br i1 %tobool, label %then, label %exit 1105 1106then: 1107 call void @bar() 1108 br label %exit 1109 1110exit: 1111 ret void 1112} 1113 1114define void @test_ccz_branch(i64 %nr, i64* %addr) nounwind { 1115; X32-LABEL: test_ccz_branch: 1116; X32: # %bb.0: # %entry 1117; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1118; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1119; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1120; X32-NEXT: #APP 1121; X32-NEXT: cmp %eax,(%edx) 1122; X32-NEXT: #NO_APP 1123; X32-NEXT: jne .LBB34_2 1124; X32-NEXT: # %bb.1: # %then 1125; X32-NEXT: calll bar 1126; X32-NEXT: .LBB34_2: # %exit 1127; X32-NEXT: retl 1128; 1129; X64-LABEL: test_ccz_branch: 1130; X64: # %bb.0: # %entry 1131; X64-NEXT: pushq %rax 1132; X64-NEXT: #APP 1133; X64-NEXT: cmp %rdi,(%rsi) 1134; X64-NEXT: #NO_APP 1135; X64-NEXT: jne .LBB34_2 1136; X64-NEXT: # %bb.1: # %then 1137; X64-NEXT: callq bar 1138; X64-NEXT: .LBB34_2: # %exit 1139; X64-NEXT: popq %rax 1140; X64-NEXT: retq 1141entry: 1142 %cc = tail call i8 asm "cmp $2,$1", "={@ccz},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1143 %tobool = icmp ne i8 %cc, 0 1144 br i1 %tobool, label %then, label %exit 1145 1146then: 1147 call void @bar() 1148 br label %exit 1149 1150exit: 1151 ret void 1152} 1153 1154define void @test_ccg_branch(i64 %nr, i64* %addr) nounwind { 1155; X32-LABEL: test_ccg_branch: 1156; X32: # %bb.0: # %entry 1157; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1158; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1159; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1160; X32-NEXT: #APP 1161; X32-NEXT: cmp %eax,(%edx) 1162; X32-NEXT: #NO_APP 1163; X32-NEXT: jle .LBB35_2 1164; X32-NEXT: # %bb.1: # %then 1165; X32-NEXT: calll bar 1166; X32-NEXT: .LBB35_2: # %exit 1167; X32-NEXT: retl 1168; 1169; X64-LABEL: test_ccg_branch: 1170; X64: # %bb.0: # %entry 1171; X64-NEXT: pushq %rax 1172; X64-NEXT: #APP 1173; X64-NEXT: cmp %rdi,(%rsi) 1174; X64-NEXT: #NO_APP 1175; X64-NEXT: jle .LBB35_2 1176; X64-NEXT: # %bb.1: # %then 1177; X64-NEXT: callq bar 1178; X64-NEXT: .LBB35_2: # %exit 1179; X64-NEXT: popq %rax 1180; X64-NEXT: retq 1181entry: 1182 %cc = tail call i8 asm "cmp $2,$1", "={@ccg},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1183 %tobool = icmp ne i8 %cc, 0 1184 br i1 %tobool, label %then, label %exit 1185 1186then: 1187 call void @bar() 1188 br label %exit 1189 1190exit: 1191 ret void 1192} 1193 1194define void @test_ccge_branch(i64 %nr, i64* %addr) nounwind { 1195; X32-LABEL: test_ccge_branch: 1196; X32: # %bb.0: # %entry 1197; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1198; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1199; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1200; X32-NEXT: #APP 1201; X32-NEXT: cmp %eax,(%edx) 1202; X32-NEXT: #NO_APP 1203; X32-NEXT: jl .LBB36_2 1204; X32-NEXT: # %bb.1: # %then 1205; X32-NEXT: calll bar 1206; X32-NEXT: .LBB36_2: # %exit 1207; X32-NEXT: retl 1208; 1209; X64-LABEL: test_ccge_branch: 1210; X64: # %bb.0: # %entry 1211; X64-NEXT: pushq %rax 1212; X64-NEXT: #APP 1213; X64-NEXT: cmp %rdi,(%rsi) 1214; X64-NEXT: #NO_APP 1215; X64-NEXT: jl .LBB36_2 1216; X64-NEXT: # %bb.1: # %then 1217; X64-NEXT: callq bar 1218; X64-NEXT: .LBB36_2: # %exit 1219; X64-NEXT: popq %rax 1220; X64-NEXT: retq 1221entry: 1222 %cc = tail call i8 asm "cmp $2,$1", "={@ccge},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1223 %tobool = icmp ne i8 %cc, 0 1224 br i1 %tobool, label %then, label %exit 1225 1226then: 1227 call void @bar() 1228 br label %exit 1229 1230exit: 1231 ret void 1232} 1233 1234define void @test_ccl_branch(i64 %nr, i64* %addr) nounwind { 1235; X32-LABEL: test_ccl_branch: 1236; X32: # %bb.0: # %entry 1237; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1238; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1239; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1240; X32-NEXT: #APP 1241; X32-NEXT: cmp %eax,(%edx) 1242; X32-NEXT: #NO_APP 1243; X32-NEXT: jge .LBB37_2 1244; X32-NEXT: # %bb.1: # %then 1245; X32-NEXT: calll bar 1246; X32-NEXT: .LBB37_2: # %exit 1247; X32-NEXT: retl 1248; 1249; X64-LABEL: test_ccl_branch: 1250; X64: # %bb.0: # %entry 1251; X64-NEXT: pushq %rax 1252; X64-NEXT: #APP 1253; X64-NEXT: cmp %rdi,(%rsi) 1254; X64-NEXT: #NO_APP 1255; X64-NEXT: jge .LBB37_2 1256; X64-NEXT: # %bb.1: # %then 1257; X64-NEXT: callq bar 1258; X64-NEXT: .LBB37_2: # %exit 1259; X64-NEXT: popq %rax 1260; X64-NEXT: retq 1261entry: 1262 %cc = tail call i8 asm "cmp $2,$1", "={@ccl},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1263 %tobool = icmp ne i8 %cc, 0 1264 br i1 %tobool, label %then, label %exit 1265 1266then: 1267 call void @bar() 1268 br label %exit 1269 1270exit: 1271 ret void 1272} 1273 1274define void @test_ccle_branch(i64 %nr, i64* %addr) nounwind { 1275; X32-LABEL: test_ccle_branch: 1276; X32: # %bb.0: # %entry 1277; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1278; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1279; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1280; X32-NEXT: #APP 1281; X32-NEXT: cmp %eax,(%edx) 1282; X32-NEXT: #NO_APP 1283; X32-NEXT: jg .LBB38_2 1284; X32-NEXT: # %bb.1: # %then 1285; X32-NEXT: calll bar 1286; X32-NEXT: .LBB38_2: # %exit 1287; X32-NEXT: retl 1288; 1289; X64-LABEL: test_ccle_branch: 1290; X64: # %bb.0: # %entry 1291; X64-NEXT: pushq %rax 1292; X64-NEXT: #APP 1293; X64-NEXT: cmp %rdi,(%rsi) 1294; X64-NEXT: #NO_APP 1295; X64-NEXT: jg .LBB38_2 1296; X64-NEXT: # %bb.1: # %then 1297; X64-NEXT: callq bar 1298; X64-NEXT: .LBB38_2: # %exit 1299; X64-NEXT: popq %rax 1300; X64-NEXT: retq 1301entry: 1302 %cc = tail call i8 asm "cmp $2,$1", "={@ccle},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1303 %tobool = icmp ne i8 %cc, 0 1304 br i1 %tobool, label %then, label %exit 1305 1306then: 1307 call void @bar() 1308 br label %exit 1309 1310exit: 1311 ret void 1312} 1313 1314define void @test_ccna_branch(i64 %nr, i64* %addr) nounwind { 1315; X32-LABEL: test_ccna_branch: 1316; X32: # %bb.0: # %entry 1317; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1318; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1319; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1320; X32-NEXT: #APP 1321; X32-NEXT: cmp %eax,(%edx) 1322; X32-NEXT: #NO_APP 1323; X32-NEXT: ja .LBB39_2 1324; X32-NEXT: # %bb.1: # %then 1325; X32-NEXT: calll bar 1326; X32-NEXT: .LBB39_2: # %exit 1327; X32-NEXT: retl 1328; 1329; X64-LABEL: test_ccna_branch: 1330; X64: # %bb.0: # %entry 1331; X64-NEXT: pushq %rax 1332; X64-NEXT: #APP 1333; X64-NEXT: cmp %rdi,(%rsi) 1334; X64-NEXT: #NO_APP 1335; X64-NEXT: ja .LBB39_2 1336; X64-NEXT: # %bb.1: # %then 1337; X64-NEXT: callq bar 1338; X64-NEXT: .LBB39_2: # %exit 1339; X64-NEXT: popq %rax 1340; X64-NEXT: retq 1341entry: 1342 %cc = tail call i8 asm "cmp $2,$1", "={@ccna},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1343 %tobool = icmp ne i8 %cc, 0 1344 br i1 %tobool, label %then, label %exit 1345 1346then: 1347 call void @bar() 1348 br label %exit 1349 1350exit: 1351 ret void 1352} 1353 1354define void @test_ccnae_branch(i64 %nr, i64* %addr) nounwind { 1355; X32-LABEL: test_ccnae_branch: 1356; X32: # %bb.0: # %entry 1357; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1358; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1359; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1360; X32-NEXT: #APP 1361; X32-NEXT: cmp %eax,(%edx) 1362; X32-NEXT: #NO_APP 1363; X32-NEXT: jae .LBB40_2 1364; X32-NEXT: # %bb.1: # %then 1365; X32-NEXT: calll bar 1366; X32-NEXT: .LBB40_2: # %exit 1367; X32-NEXT: retl 1368; 1369; X64-LABEL: test_ccnae_branch: 1370; X64: # %bb.0: # %entry 1371; X64-NEXT: pushq %rax 1372; X64-NEXT: #APP 1373; X64-NEXT: cmp %rdi,(%rsi) 1374; X64-NEXT: #NO_APP 1375; X64-NEXT: jae .LBB40_2 1376; X64-NEXT: # %bb.1: # %then 1377; X64-NEXT: callq bar 1378; X64-NEXT: .LBB40_2: # %exit 1379; X64-NEXT: popq %rax 1380; X64-NEXT: retq 1381entry: 1382 %cc = tail call i8 asm "cmp $2,$1", "={@ccnae},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1383 %tobool = icmp ne i8 %cc, 0 1384 br i1 %tobool, label %then, label %exit 1385 1386then: 1387 call void @bar() 1388 br label %exit 1389 1390exit: 1391 ret void 1392} 1393 1394define void @test_ccnb_branch(i64 %nr, i64* %addr) nounwind { 1395; X32-LABEL: test_ccnb_branch: 1396; X32: # %bb.0: # %entry 1397; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1398; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1399; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1400; X32-NEXT: #APP 1401; X32-NEXT: cmp %eax,(%edx) 1402; X32-NEXT: #NO_APP 1403; X32-NEXT: jb .LBB41_2 1404; X32-NEXT: # %bb.1: # %then 1405; X32-NEXT: calll bar 1406; X32-NEXT: .LBB41_2: # %exit 1407; X32-NEXT: retl 1408; 1409; X64-LABEL: test_ccnb_branch: 1410; X64: # %bb.0: # %entry 1411; X64-NEXT: pushq %rax 1412; X64-NEXT: #APP 1413; X64-NEXT: cmp %rdi,(%rsi) 1414; X64-NEXT: #NO_APP 1415; X64-NEXT: jb .LBB41_2 1416; X64-NEXT: # %bb.1: # %then 1417; X64-NEXT: callq bar 1418; X64-NEXT: .LBB41_2: # %exit 1419; X64-NEXT: popq %rax 1420; X64-NEXT: retq 1421entry: 1422 %cc = tail call i8 asm "cmp $2,$1", "={@ccnb},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1423 %tobool = icmp ne i8 %cc, 0 1424 br i1 %tobool, label %then, label %exit 1425 1426then: 1427 call void @bar() 1428 br label %exit 1429 1430exit: 1431 ret void 1432} 1433 1434define void @test_ccnbe_branch(i64 %nr, i64* %addr) nounwind { 1435; X32-LABEL: test_ccnbe_branch: 1436; X32: # %bb.0: # %entry 1437; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1438; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1439; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1440; X32-NEXT: #APP 1441; X32-NEXT: cmp %eax,(%edx) 1442; X32-NEXT: #NO_APP 1443; X32-NEXT: jbe .LBB42_2 1444; X32-NEXT: # %bb.1: # %then 1445; X32-NEXT: calll bar 1446; X32-NEXT: .LBB42_2: # %exit 1447; X32-NEXT: retl 1448; 1449; X64-LABEL: test_ccnbe_branch: 1450; X64: # %bb.0: # %entry 1451; X64-NEXT: pushq %rax 1452; X64-NEXT: #APP 1453; X64-NEXT: cmp %rdi,(%rsi) 1454; X64-NEXT: #NO_APP 1455; X64-NEXT: jbe .LBB42_2 1456; X64-NEXT: # %bb.1: # %then 1457; X64-NEXT: callq bar 1458; X64-NEXT: .LBB42_2: # %exit 1459; X64-NEXT: popq %rax 1460; X64-NEXT: retq 1461entry: 1462 %cc = tail call i8 asm "cmp $2,$1", "={@ccnbe},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1463 %tobool = icmp ne i8 %cc, 0 1464 br i1 %tobool, label %then, label %exit 1465 1466then: 1467 call void @bar() 1468 br label %exit 1469 1470exit: 1471 ret void 1472} 1473 1474define void @test_ccnc_branch(i64 %nr, i64* %addr) nounwind { 1475; X32-LABEL: test_ccnc_branch: 1476; X32: # %bb.0: # %entry 1477; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1478; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1479; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1480; X32-NEXT: #APP 1481; X32-NEXT: cmp %eax,(%edx) 1482; X32-NEXT: #NO_APP 1483; X32-NEXT: jb .LBB43_2 1484; X32-NEXT: # %bb.1: # %then 1485; X32-NEXT: calll bar 1486; X32-NEXT: .LBB43_2: # %exit 1487; X32-NEXT: retl 1488; 1489; X64-LABEL: test_ccnc_branch: 1490; X64: # %bb.0: # %entry 1491; X64-NEXT: pushq %rax 1492; X64-NEXT: #APP 1493; X64-NEXT: cmp %rdi,(%rsi) 1494; X64-NEXT: #NO_APP 1495; X64-NEXT: jb .LBB43_2 1496; X64-NEXT: # %bb.1: # %then 1497; X64-NEXT: callq bar 1498; X64-NEXT: .LBB43_2: # %exit 1499; X64-NEXT: popq %rax 1500; X64-NEXT: retq 1501entry: 1502 %cc = tail call i8 asm "cmp $2,$1", "={@ccnc},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1503 %tobool = icmp ne i8 %cc, 0 1504 br i1 %tobool, label %then, label %exit 1505 1506then: 1507 call void @bar() 1508 br label %exit 1509 1510exit: 1511 ret void 1512} 1513 1514define void @test_ccne_branch(i64 %nr, i64* %addr) nounwind { 1515; X32-LABEL: test_ccne_branch: 1516; X32: # %bb.0: # %entry 1517; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1518; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1519; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1520; X32-NEXT: #APP 1521; X32-NEXT: cmp %eax,(%edx) 1522; X32-NEXT: #NO_APP 1523; X32-NEXT: je .LBB44_2 1524; X32-NEXT: # %bb.1: # %then 1525; X32-NEXT: calll bar 1526; X32-NEXT: .LBB44_2: # %exit 1527; X32-NEXT: retl 1528; 1529; X64-LABEL: test_ccne_branch: 1530; X64: # %bb.0: # %entry 1531; X64-NEXT: pushq %rax 1532; X64-NEXT: #APP 1533; X64-NEXT: cmp %rdi,(%rsi) 1534; X64-NEXT: #NO_APP 1535; X64-NEXT: je .LBB44_2 1536; X64-NEXT: # %bb.1: # %then 1537; X64-NEXT: callq bar 1538; X64-NEXT: .LBB44_2: # %exit 1539; X64-NEXT: popq %rax 1540; X64-NEXT: retq 1541entry: 1542 %cc = tail call i8 asm "cmp $2,$1", "={@ccne},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1543 %tobool = icmp ne i8 %cc, 0 1544 br i1 %tobool, label %then, label %exit 1545 1546then: 1547 call void @bar() 1548 br label %exit 1549 1550exit: 1551 ret void 1552} 1553 1554define void @test_ccnz_branch(i64 %nr, i64* %addr) nounwind { 1555; X32-LABEL: test_ccnz_branch: 1556; X32: # %bb.0: # %entry 1557; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1558; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1559; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1560; X32-NEXT: #APP 1561; X32-NEXT: cmp %eax,(%edx) 1562; X32-NEXT: #NO_APP 1563; X32-NEXT: je .LBB45_2 1564; X32-NEXT: # %bb.1: # %then 1565; X32-NEXT: calll bar 1566; X32-NEXT: .LBB45_2: # %exit 1567; X32-NEXT: retl 1568; 1569; X64-LABEL: test_ccnz_branch: 1570; X64: # %bb.0: # %entry 1571; X64-NEXT: pushq %rax 1572; X64-NEXT: #APP 1573; X64-NEXT: cmp %rdi,(%rsi) 1574; X64-NEXT: #NO_APP 1575; X64-NEXT: je .LBB45_2 1576; X64-NEXT: # %bb.1: # %then 1577; X64-NEXT: callq bar 1578; X64-NEXT: .LBB45_2: # %exit 1579; X64-NEXT: popq %rax 1580; X64-NEXT: retq 1581entry: 1582 %cc = tail call i8 asm "cmp $2,$1", "={@ccnz},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1583 %tobool = icmp ne i8 %cc, 0 1584 br i1 %tobool, label %then, label %exit 1585 1586then: 1587 call void @bar() 1588 br label %exit 1589 1590exit: 1591 ret void 1592} 1593 1594define void @test_ccng_branch(i64 %nr, i64* %addr) nounwind { 1595; X32-LABEL: test_ccng_branch: 1596; X32: # %bb.0: # %entry 1597; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1598; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1599; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1600; X32-NEXT: #APP 1601; X32-NEXT: cmp %eax,(%edx) 1602; X32-NEXT: #NO_APP 1603; X32-NEXT: jg .LBB46_2 1604; X32-NEXT: # %bb.1: # %then 1605; X32-NEXT: calll bar 1606; X32-NEXT: .LBB46_2: # %exit 1607; X32-NEXT: retl 1608; 1609; X64-LABEL: test_ccng_branch: 1610; X64: # %bb.0: # %entry 1611; X64-NEXT: pushq %rax 1612; X64-NEXT: #APP 1613; X64-NEXT: cmp %rdi,(%rsi) 1614; X64-NEXT: #NO_APP 1615; X64-NEXT: jg .LBB46_2 1616; X64-NEXT: # %bb.1: # %then 1617; X64-NEXT: callq bar 1618; X64-NEXT: .LBB46_2: # %exit 1619; X64-NEXT: popq %rax 1620; X64-NEXT: retq 1621entry: 1622 %cc = tail call i8 asm "cmp $2,$1", "={@ccng},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1623 %tobool = icmp ne i8 %cc, 0 1624 br i1 %tobool, label %then, label %exit 1625 1626then: 1627 call void @bar() 1628 br label %exit 1629 1630exit: 1631 ret void 1632} 1633 1634define void @test_ccnge_branch(i64 %nr, i64* %addr) nounwind { 1635; X32-LABEL: test_ccnge_branch: 1636; X32: # %bb.0: # %entry 1637; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1638; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1639; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1640; X32-NEXT: #APP 1641; X32-NEXT: cmp %eax,(%edx) 1642; X32-NEXT: #NO_APP 1643; X32-NEXT: jge .LBB47_2 1644; X32-NEXT: # %bb.1: # %then 1645; X32-NEXT: calll bar 1646; X32-NEXT: .LBB47_2: # %exit 1647; X32-NEXT: retl 1648; 1649; X64-LABEL: test_ccnge_branch: 1650; X64: # %bb.0: # %entry 1651; X64-NEXT: pushq %rax 1652; X64-NEXT: #APP 1653; X64-NEXT: cmp %rdi,(%rsi) 1654; X64-NEXT: #NO_APP 1655; X64-NEXT: jge .LBB47_2 1656; X64-NEXT: # %bb.1: # %then 1657; X64-NEXT: callq bar 1658; X64-NEXT: .LBB47_2: # %exit 1659; X64-NEXT: popq %rax 1660; X64-NEXT: retq 1661entry: 1662 %cc = tail call i8 asm "cmp $2,$1", "={@ccnge},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1663 %tobool = icmp ne i8 %cc, 0 1664 br i1 %tobool, label %then, label %exit 1665 1666then: 1667 call void @bar() 1668 br label %exit 1669 1670exit: 1671 ret void 1672} 1673 1674define void @test_ccnl_branch(i64 %nr, i64* %addr) nounwind { 1675; X32-LABEL: test_ccnl_branch: 1676; X32: # %bb.0: # %entry 1677; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1678; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1679; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1680; X32-NEXT: #APP 1681; X32-NEXT: cmp %eax,(%edx) 1682; X32-NEXT: #NO_APP 1683; X32-NEXT: jl .LBB48_2 1684; X32-NEXT: # %bb.1: # %then 1685; X32-NEXT: calll bar 1686; X32-NEXT: .LBB48_2: # %exit 1687; X32-NEXT: retl 1688; 1689; X64-LABEL: test_ccnl_branch: 1690; X64: # %bb.0: # %entry 1691; X64-NEXT: pushq %rax 1692; X64-NEXT: #APP 1693; X64-NEXT: cmp %rdi,(%rsi) 1694; X64-NEXT: #NO_APP 1695; X64-NEXT: jl .LBB48_2 1696; X64-NEXT: # %bb.1: # %then 1697; X64-NEXT: callq bar 1698; X64-NEXT: .LBB48_2: # %exit 1699; X64-NEXT: popq %rax 1700; X64-NEXT: retq 1701entry: 1702 %cc = tail call i8 asm "cmp $2,$1", "={@ccnl},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1703 %tobool = icmp ne i8 %cc, 0 1704 br i1 %tobool, label %then, label %exit 1705 1706then: 1707 call void @bar() 1708 br label %exit 1709 1710exit: 1711 ret void 1712} 1713 1714define void @test_ccnle_branch(i64 %nr, i64* %addr) nounwind { 1715; X32-LABEL: test_ccnle_branch: 1716; X32: # %bb.0: # %entry 1717; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1718; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1719; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1720; X32-NEXT: #APP 1721; X32-NEXT: cmp %eax,(%edx) 1722; X32-NEXT: #NO_APP 1723; X32-NEXT: jle .LBB49_2 1724; X32-NEXT: # %bb.1: # %then 1725; X32-NEXT: calll bar 1726; X32-NEXT: .LBB49_2: # %exit 1727; X32-NEXT: retl 1728; 1729; X64-LABEL: test_ccnle_branch: 1730; X64: # %bb.0: # %entry 1731; X64-NEXT: pushq %rax 1732; X64-NEXT: #APP 1733; X64-NEXT: cmp %rdi,(%rsi) 1734; X64-NEXT: #NO_APP 1735; X64-NEXT: jle .LBB49_2 1736; X64-NEXT: # %bb.1: # %then 1737; X64-NEXT: callq bar 1738; X64-NEXT: .LBB49_2: # %exit 1739; X64-NEXT: popq %rax 1740; X64-NEXT: retq 1741entry: 1742 %cc = tail call i8 asm "cmp $2,$1", "={@ccnle},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1743 %tobool = icmp ne i8 %cc, 0 1744 br i1 %tobool, label %then, label %exit 1745 1746then: 1747 call void @bar() 1748 br label %exit 1749 1750exit: 1751 ret void 1752} 1753 1754define void @test_ccno_branch(i64 %nr, i64* %addr) nounwind { 1755; X32-LABEL: test_ccno_branch: 1756; X32: # %bb.0: # %entry 1757; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1758; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1759; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1760; X32-NEXT: #APP 1761; X32-NEXT: cmp %eax,(%edx) 1762; X32-NEXT: #NO_APP 1763; X32-NEXT: jo .LBB50_2 1764; X32-NEXT: # %bb.1: # %then 1765; X32-NEXT: calll bar 1766; X32-NEXT: .LBB50_2: # %exit 1767; X32-NEXT: retl 1768; 1769; X64-LABEL: test_ccno_branch: 1770; X64: # %bb.0: # %entry 1771; X64-NEXT: pushq %rax 1772; X64-NEXT: #APP 1773; X64-NEXT: cmp %rdi,(%rsi) 1774; X64-NEXT: #NO_APP 1775; X64-NEXT: jo .LBB50_2 1776; X64-NEXT: # %bb.1: # %then 1777; X64-NEXT: callq bar 1778; X64-NEXT: .LBB50_2: # %exit 1779; X64-NEXT: popq %rax 1780; X64-NEXT: retq 1781entry: 1782 %cc = tail call i8 asm "cmp $2,$1", "={@ccno},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1783 %tobool = icmp ne i8 %cc, 0 1784 br i1 %tobool, label %then, label %exit 1785 1786then: 1787 call void @bar() 1788 br label %exit 1789 1790exit: 1791 ret void 1792} 1793 1794define void @test_ccnp_branch(i64 %nr, i64* %addr) nounwind { 1795; X32-LABEL: test_ccnp_branch: 1796; X32: # %bb.0: # %entry 1797; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1798; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1799; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1800; X32-NEXT: #APP 1801; X32-NEXT: cmp %eax,(%edx) 1802; X32-NEXT: #NO_APP 1803; X32-NEXT: jp .LBB51_2 1804; X32-NEXT: # %bb.1: # %then 1805; X32-NEXT: calll bar 1806; X32-NEXT: .LBB51_2: # %exit 1807; X32-NEXT: retl 1808; 1809; X64-LABEL: test_ccnp_branch: 1810; X64: # %bb.0: # %entry 1811; X64-NEXT: pushq %rax 1812; X64-NEXT: #APP 1813; X64-NEXT: cmp %rdi,(%rsi) 1814; X64-NEXT: #NO_APP 1815; X64-NEXT: jp .LBB51_2 1816; X64-NEXT: # %bb.1: # %then 1817; X64-NEXT: callq bar 1818; X64-NEXT: .LBB51_2: # %exit 1819; X64-NEXT: popq %rax 1820; X64-NEXT: retq 1821entry: 1822 %cc = tail call i8 asm "cmp $2,$1", "={@ccnp},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1823 %tobool = icmp ne i8 %cc, 0 1824 br i1 %tobool, label %then, label %exit 1825 1826then: 1827 call void @bar() 1828 br label %exit 1829 1830exit: 1831 ret void 1832} 1833 1834define void @test_ccns_branch(i64 %nr, i64* %addr) nounwind { 1835; X32-LABEL: test_ccns_branch: 1836; X32: # %bb.0: # %entry 1837; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1838; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1839; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1840; X32-NEXT: #APP 1841; X32-NEXT: cmp %eax,(%edx) 1842; X32-NEXT: #NO_APP 1843; X32-NEXT: js .LBB52_2 1844; X32-NEXT: # %bb.1: # %then 1845; X32-NEXT: calll bar 1846; X32-NEXT: .LBB52_2: # %exit 1847; X32-NEXT: retl 1848; 1849; X64-LABEL: test_ccns_branch: 1850; X64: # %bb.0: # %entry 1851; X64-NEXT: pushq %rax 1852; X64-NEXT: #APP 1853; X64-NEXT: cmp %rdi,(%rsi) 1854; X64-NEXT: #NO_APP 1855; X64-NEXT: js .LBB52_2 1856; X64-NEXT: # %bb.1: # %then 1857; X64-NEXT: callq bar 1858; X64-NEXT: .LBB52_2: # %exit 1859; X64-NEXT: popq %rax 1860; X64-NEXT: retq 1861entry: 1862 %cc = tail call i8 asm "cmp $2,$1", "={@ccns},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1863 %tobool = icmp ne i8 %cc, 0 1864 br i1 %tobool, label %then, label %exit 1865 1866then: 1867 call void @bar() 1868 br label %exit 1869 1870exit: 1871 ret void 1872} 1873 1874define void @test_cco_branch(i64 %nr, i64* %addr) nounwind { 1875; X32-LABEL: test_cco_branch: 1876; X32: # %bb.0: # %entry 1877; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1878; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1879; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1880; X32-NEXT: #APP 1881; X32-NEXT: cmp %eax,(%edx) 1882; X32-NEXT: #NO_APP 1883; X32-NEXT: jno .LBB53_2 1884; X32-NEXT: # %bb.1: # %then 1885; X32-NEXT: calll bar 1886; X32-NEXT: .LBB53_2: # %exit 1887; X32-NEXT: retl 1888; 1889; X64-LABEL: test_cco_branch: 1890; X64: # %bb.0: # %entry 1891; X64-NEXT: pushq %rax 1892; X64-NEXT: #APP 1893; X64-NEXT: cmp %rdi,(%rsi) 1894; X64-NEXT: #NO_APP 1895; X64-NEXT: jno .LBB53_2 1896; X64-NEXT: # %bb.1: # %then 1897; X64-NEXT: callq bar 1898; X64-NEXT: .LBB53_2: # %exit 1899; X64-NEXT: popq %rax 1900; X64-NEXT: retq 1901entry: 1902 %cc = tail call i8 asm "cmp $2,$1", "={@cco},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1903 %tobool = icmp ne i8 %cc, 0 1904 br i1 %tobool, label %then, label %exit 1905 1906then: 1907 call void @bar() 1908 br label %exit 1909 1910exit: 1911 ret void 1912} 1913 1914define void @test_ccp_branch(i64 %nr, i64* %addr) nounwind { 1915; X32-LABEL: test_ccp_branch: 1916; X32: # %bb.0: # %entry 1917; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1918; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1919; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1920; X32-NEXT: #APP 1921; X32-NEXT: cmp %eax,(%edx) 1922; X32-NEXT: #NO_APP 1923; X32-NEXT: jnp .LBB54_2 1924; X32-NEXT: # %bb.1: # %then 1925; X32-NEXT: calll bar 1926; X32-NEXT: .LBB54_2: # %exit 1927; X32-NEXT: retl 1928; 1929; X64-LABEL: test_ccp_branch: 1930; X64: # %bb.0: # %entry 1931; X64-NEXT: pushq %rax 1932; X64-NEXT: #APP 1933; X64-NEXT: cmp %rdi,(%rsi) 1934; X64-NEXT: #NO_APP 1935; X64-NEXT: jnp .LBB54_2 1936; X64-NEXT: # %bb.1: # %then 1937; X64-NEXT: callq bar 1938; X64-NEXT: .LBB54_2: # %exit 1939; X64-NEXT: popq %rax 1940; X64-NEXT: retq 1941entry: 1942 %cc = tail call i8 asm "cmp $2,$1", "={@ccp},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1943 %tobool = icmp ne i8 %cc, 0 1944 br i1 %tobool, label %then, label %exit 1945 1946then: 1947 call void @bar() 1948 br label %exit 1949 1950exit: 1951 ret void 1952} 1953 1954define void @test_ccs_branch(i64 %nr, i64* %addr) nounwind { 1955; X32-LABEL: test_ccs_branch: 1956; X32: # %bb.0: # %entry 1957; X32-NEXT: movl {{[0-9]+}}(%esp), %eax 1958; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx 1959; X32-NEXT: movl {{[0-9]+}}(%esp), %edx 1960; X32-NEXT: #APP 1961; X32-NEXT: cmp %eax,(%edx) 1962; X32-NEXT: #NO_APP 1963; X32-NEXT: jns .LBB55_2 1964; X32-NEXT: # %bb.1: # %then 1965; X32-NEXT: calll bar 1966; X32-NEXT: .LBB55_2: # %exit 1967; X32-NEXT: retl 1968; 1969; X64-LABEL: test_ccs_branch: 1970; X64: # %bb.0: # %entry 1971; X64-NEXT: pushq %rax 1972; X64-NEXT: #APP 1973; X64-NEXT: cmp %rdi,(%rsi) 1974; X64-NEXT: #NO_APP 1975; X64-NEXT: jns .LBB55_2 1976; X64-NEXT: # %bb.1: # %then 1977; X64-NEXT: callq bar 1978; X64-NEXT: .LBB55_2: # %exit 1979; X64-NEXT: popq %rax 1980; X64-NEXT: retq 1981entry: 1982 %cc = tail call i8 asm "cmp $2,$1", "={@ccs},=*m,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* %addr, i64 %nr) nounwind 1983 %tobool = icmp ne i8 %cc, 0 1984 br i1 %tobool, label %then, label %exit 1985 1986then: 1987 call void @bar() 1988 br label %exit 1989 1990exit: 1991 ret void 1992} 1993