brintos

brintos / llvm-project-archived public Read only

0
0
Text · 15.4 KiB · ee20394 Raw
495 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=i686-linux-gnu -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=X863; RUN: llc -mtriple=i686-linux-gnu -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=X864; TODO: enable when x87 is supported5; llc -mtriple=i686-linux-gnu -global-isel -global-isel-abort=1 -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=X86,GLOBAL-X866; RUN: llc -mtriple=x86_64-linux-gnu -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=X64,DAG-X647; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel -fast-isel-abort=1 -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=X64,DAG-X648; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -global-isel-abort=1 -verify-machineinstrs < %s -o - | FileCheck %s --check-prefixes=X64,GLOBAL-X649 10define i1 @test_i1(i1 %a, i1 %b, i1 %c, i1 %pred0, i1 %pred1) {11; X86-LABEL: test_i1:12; X86:       # %bb.0: # %entry13; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)14; X86-NEXT:    je .LBB0_115; X86-NEXT:  # %bb.2: # %cond16; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)17; X86-NEXT:    je .LBB0_418; X86-NEXT:  # %bb.3:19; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax20; X86-NEXT:    retl21; X86-NEXT:  .LBB0_1:22; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax23; X86-NEXT:    retl24; X86-NEXT:  .LBB0_4: # %cond.false25; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax26; X86-NEXT:    retl27;28; X64-LABEL: test_i1:29; X64:       # %bb.0: # %entry30; X64-NEXT:    testb $1, %cl31; X64-NEXT:    je .LBB0_132; X64-NEXT:  # %bb.2: # %cond33; X64-NEXT:    movl %esi, %eax34; X64-NEXT:    testb $1, %r8b35; X64-NEXT:    jne .LBB0_436; X64-NEXT:  # %bb.3: # %cond.false37; X64-NEXT:    movl %edx, %eax38; X64-NEXT:  .LBB0_4: # %cond.end39; X64-NEXT:    # kill: def $al killed $al killed $eax40; X64-NEXT:    retq41; X64-NEXT:  .LBB0_1:42; X64-NEXT:    movl %edi, %eax43; X64-NEXT:    # kill: def $al killed $al killed $eax44; X64-NEXT:    retq45entry:46  br i1 %pred0, label %cond, label %cond.end47 48cond:49  br i1 %pred1, label %cond.true, label %cond.false50 51cond.true:52  br label %cond.end53 54cond.false:55  br label %cond.end56 57cond.end:58  %res = phi i1 [ %a, %entry ], [ %b, %cond.true ], [ %c, %cond.false ]59  ret i1 %res60}61 62define i8 @test_i8(i8 %f, i8 %t, i1 %pred) {63; X86-LABEL: test_i8:64; X86:       # %bb.0: # %entry65; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)66; X86-NEXT:    je .LBB1_267; X86-NEXT:  # %bb.1:68; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax69; X86-NEXT:    retl70; X86-NEXT:  .LBB1_2: # %cond.false71; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax72; X86-NEXT:    retl73;74; X64-LABEL: test_i8:75; X64:       # %bb.0: # %entry76; X64-NEXT:    testb $1, %dl77; X64-NEXT:    je .LBB1_278; X64-NEXT:  # %bb.1:79; X64-NEXT:    movl %edi, %eax80; X64-NEXT:    # kill: def $al killed $al killed $eax81; X64-NEXT:    retq82; X64-NEXT:  .LBB1_2: # %cond.false83; X64-NEXT:    movl %esi, %eax84; X64-NEXT:    # kill: def $al killed $al killed $eax85; X64-NEXT:    retq86entry:87  br i1 %pred, label %cond.true, label %cond.false88 89cond.true:                                        ; preds = %entry90  br label %cond.end91 92cond.false:                                       ; preds = %entry93  br label %cond.end94 95cond.end:                                         ; preds = %cond.false, %cond.true96  %cond = phi i8 [ %f, %cond.true ], [ %t, %cond.false ]97  ret i8 %cond98}99 100define i16 @test_i16(i16 %f, i16 %t, i1 %pred) {101; X86-LABEL: test_i16:102; X86:       # %bb.0: # %entry103; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)104; X86-NEXT:    je .LBB2_2105; X86-NEXT:  # %bb.1:106; X86-NEXT:    movzwl {{[0-9]+}}(%esp), %eax107; X86-NEXT:    retl108; X86-NEXT:  .LBB2_2: # %cond.false109; X86-NEXT:    movzwl {{[0-9]+}}(%esp), %eax110; X86-NEXT:    retl111;112; X64-LABEL: test_i16:113; X64:       # %bb.0: # %entry114; X64-NEXT:    testb $1, %dl115; X64-NEXT:    je .LBB2_2116; X64-NEXT:  # %bb.1:117; X64-NEXT:    movl %edi, %eax118; X64-NEXT:    # kill: def $ax killed $ax killed $eax119; X64-NEXT:    retq120; X64-NEXT:  .LBB2_2: # %cond.false121; X64-NEXT:    movl %esi, %eax122; X64-NEXT:    # kill: def $ax killed $ax killed $eax123; X64-NEXT:    retq124entry:125  br i1 %pred, label %cond.true, label %cond.false126 127cond.true:                                        ; preds = %entry128  br label %cond.end129 130cond.false:                                       ; preds = %entry131  br label %cond.end132 133cond.end:                                         ; preds = %cond.false, %cond.true134  %cond = phi i16 [ %f, %cond.true ], [ %t, %cond.false ]135  ret i16 %cond136}137 138define i32 @test_i32(i32 %f, i32 %t, i1 %pred) {139; X86-LABEL: test_i32:140; X86:       # %bb.0: # %entry141; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)142; X86-NEXT:    je .LBB3_2143; X86-NEXT:  # %bb.1:144; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax145; X86-NEXT:    retl146; X86-NEXT:  .LBB3_2: # %cond.false147; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax148; X86-NEXT:    retl149;150; X64-LABEL: test_i32:151; X64:       # %bb.0: # %entry152; X64-NEXT:    movl %edi, %eax153; X64-NEXT:    testb $1, %dl154; X64-NEXT:    jne .LBB3_2155; X64-NEXT:  # %bb.1: # %cond.false156; X64-NEXT:    movl %esi, %eax157; X64-NEXT:  .LBB3_2: # %cond.end158; X64-NEXT:    retq159entry:160  br i1 %pred, label %cond.true, label %cond.false161 162cond.true:                                        ; preds = %entry163  br label %cond.end164 165cond.false:                                       ; preds = %entry166  br label %cond.end167 168cond.end:                                         ; preds = %cond.false, %cond.true169  %cond = phi i32 [ %f, %cond.true ], [ %t, %cond.false ]170  ret i32 %cond171}172 173define i64 @test_i64(i64 %f, i64 %t, i1 %pred) {174; X86-LABEL: test_i64:175; X86:       # %bb.0: # %entry176; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)177; X86-NEXT:    je .LBB4_2178; X86-NEXT:  # %bb.1:179; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx180; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax181; X86-NEXT:    retl182; X86-NEXT:  .LBB4_2: # %cond.false183; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx184; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax185; X86-NEXT:    retl186;187; X64-LABEL: test_i64:188; X64:       # %bb.0: # %entry189; X64-NEXT:    movq %rdi, %rax190; X64-NEXT:    testb $1, %dl191; X64-NEXT:    jne .LBB4_2192; X64-NEXT:  # %bb.1: # %cond.false193; X64-NEXT:    movq %rsi, %rax194; X64-NEXT:  .LBB4_2: # %cond.end195; X64-NEXT:    retq196entry:197  br i1 %pred, label %cond.true, label %cond.false198 199cond.true:                                        ; preds = %entry200  br label %cond.end201 202cond.false:                                       ; preds = %entry203  br label %cond.end204 205cond.end:                                         ; preds = %cond.false, %cond.true206  %cond = phi i64 [ %f, %cond.true ], [ %t, %cond.false ]207  ret i64 %cond208}209 210define float @test_float(float %f, float %t, i1 %pred) {211; X86-LABEL: test_float:212; X86:       # %bb.0: # %entry213; X86-NEXT:    flds {{[0-9]+}}(%esp)214; X86-NEXT:    flds {{[0-9]+}}(%esp)215; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)216; X86-NEXT:    jne .LBB5_2217; X86-NEXT:  # %bb.1: # %cond.false218; X86-NEXT:    fstp %st(0)219; X86-NEXT:    fldz220; X86-NEXT:    fxch %st(1)221; X86-NEXT:  .LBB5_2: # %cond.end222; X86-NEXT:    fstp %st(1)223; X86-NEXT:    retl224;225; X64-LABEL: test_float:226; X64:       # %bb.0: # %entry227; X64-NEXT:    testb $1, %dil228; X64-NEXT:    jne .LBB5_2229; X64-NEXT:  # %bb.1: # %cond.false230; X64-NEXT:    movaps %xmm1, %xmm0231; X64-NEXT:  .LBB5_2: # %cond.end232; X64-NEXT:    retq233entry:234  br i1 %pred, label %cond.true, label %cond.false235 236cond.true:                                        ; preds = %entry237  br label %cond.end238 239cond.false:                                       ; preds = %entry240  br label %cond.end241 242cond.end:                                         ; preds = %cond.false, %cond.true243  %cond = phi float [ %f, %cond.true ], [ %t, %cond.false ]244  ret float %cond245}246 247define double @test_double(i32 %a, double %f, double %t, i1 %pred) {248; X86-LABEL: test_double:249; X86:       # %bb.0: # %entry250; X86-NEXT:    fldl {{[0-9]+}}(%esp)251; X86-NEXT:    fldl {{[0-9]+}}(%esp)252; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)253; X86-NEXT:    jne .LBB6_2254; X86-NEXT:  # %bb.1: # %cond.false255; X86-NEXT:    fstp %st(0)256; X86-NEXT:    fldz257; X86-NEXT:    fxch %st(1)258; X86-NEXT:  .LBB6_2: # %cond.end259; X86-NEXT:    fstp %st(1)260; X86-NEXT:    retl261;262; X64-LABEL: test_double:263; X64:       # %bb.0: # %entry264; X64-NEXT:    testb $1, %sil265; X64-NEXT:    jne .LBB6_2266; X64-NEXT:  # %bb.1: # %cond.false267; X64-NEXT:    movaps %xmm1, %xmm0268; X64-NEXT:  .LBB6_2: # %cond.end269; X64-NEXT:    retq270entry:271  br i1 %pred, label %cond.true, label %cond.false272 273cond.true:                                        ; preds = %entry274  br label %cond.end275 276cond.false:                                       ; preds = %entry277  br label %cond.end278 279cond.end:                                         ; preds = %cond.false, %cond.true280  %cond = phi double [ %f, %cond.true ], [ %t, %cond.false ]281  ret double %cond282}283 284define ptr @test_ptr(ptr %a, ptr %b, ptr %c, ptr %d, ptr %e, ptr %f, ptr %g, i1 %pred0, i1 %pred1, i1 %pred2) {285; X86-LABEL: test_ptr:286; X86:       # %bb.0: # %entry287; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax288; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %ecx289; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)290; X86-NEXT:    je .LBB7_6291; X86-NEXT:  # %bb.1: # %cond.true292; X86-NEXT:    testb $1, %cl293; X86-NEXT:    je .LBB7_3294; X86-NEXT:  # %bb.2:295; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax296; X86-NEXT:    retl297; X86-NEXT:  .LBB7_6: # %cond.false298; X86-NEXT:    testb $1, %cl299; X86-NEXT:    je .LBB7_10300; X86-NEXT:  # %bb.7: # %cond.false.true301; X86-NEXT:    testb $1, %al302; X86-NEXT:    je .LBB7_9303; X86-NEXT:  # %bb.8:304; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax305; X86-NEXT:    retl306; X86-NEXT:  .LBB7_3: # %cond.true.false307; X86-NEXT:    testb $1, %al308; X86-NEXT:    je .LBB7_5309; X86-NEXT:  # %bb.4:310; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax311; X86-NEXT:    retl312; X86-NEXT:  .LBB7_10: # %cond.false.false313; X86-NEXT:    testb $1, %al314; X86-NEXT:    je .LBB7_12315; X86-NEXT:  # %bb.11:316; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax317; X86-NEXT:    retl318; X86-NEXT:  .LBB7_9: # %cond.false.true.false319; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax320; X86-NEXT:    retl321; X86-NEXT:  .LBB7_5: # %cond.true.false.false322; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax323; X86-NEXT:    retl324; X86-NEXT:  .LBB7_12: # %cond.false.false.false325; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax326; X86-NEXT:    retl327;328; DAG-X64-LABEL: test_ptr:329; DAG-X64:       # %bb.0: # %entry330; DAG-X64-NEXT:    movq %rdi, %rax331; DAG-X64-NEXT:    movzbl {{[0-9]+}}(%rsp), %edi332; DAG-X64-NEXT:    movzbl {{[0-9]+}}(%rsp), %r10d333; DAG-X64-NEXT:    testb $1, {{[0-9]+}}(%rsp)334; DAG-X64-NEXT:    je .LBB7_4335; DAG-X64-NEXT:  # %bb.1: # %cond.true336; DAG-X64-NEXT:    testb $1, %r10b337; DAG-X64-NEXT:    jne .LBB7_9338; DAG-X64-NEXT:  # %bb.2: # %cond.true.false339; DAG-X64-NEXT:    testb $1, %dil340; DAG-X64-NEXT:    movq %rsi, %rax341; DAG-X64-NEXT:    jne .LBB7_9342; DAG-X64-NEXT:  # %bb.3: # %cond.true.false.false343; DAG-X64-NEXT:    movq %rdx, %rax344; DAG-X64-NEXT:    retq345; DAG-X64-NEXT:  .LBB7_4: # %cond.false346; DAG-X64-NEXT:    testb $1, %r10b347; DAG-X64-NEXT:    je .LBB7_7348; DAG-X64-NEXT:  # %bb.5: # %cond.false.true349; DAG-X64-NEXT:    testb $1, %dil350; DAG-X64-NEXT:    movq %rcx, %rax351; DAG-X64-NEXT:    jne .LBB7_9352; DAG-X64-NEXT:  # %bb.6: # %cond.false.true.false353; DAG-X64-NEXT:    movq %r8, %rax354; DAG-X64-NEXT:    retq355; DAG-X64-NEXT:  .LBB7_7: # %cond.false.false356; DAG-X64-NEXT:    testb $1, %dil357; DAG-X64-NEXT:    movq %r9, %rax358; DAG-X64-NEXT:    jne .LBB7_9359; DAG-X64-NEXT:  # %bb.8: # %cond.false.false.false360; DAG-X64-NEXT:    movq {{[0-9]+}}(%rsp), %rax361; DAG-X64-NEXT:  .LBB7_9: # %cond.end362; DAG-X64-NEXT:    retq363;364; GLOBAL-X64-LABEL: test_ptr:365; GLOBAL-X64:       # %bb.0: # %entry366; GLOBAL-X64-NEXT:    movq %rdi, %rax367; GLOBAL-X64-NEXT:    movzbl {{[0-9]+}}(%rsp), %r11d368; GLOBAL-X64-NEXT:    movzbl {{[0-9]+}}(%rsp), %r10d369; GLOBAL-X64-NEXT:    movzbl {{[0-9]+}}(%rsp), %edi370; GLOBAL-X64-NEXT:    testb $1, %r11b371; GLOBAL-X64-NEXT:    je .LBB7_4372; GLOBAL-X64-NEXT:  # %bb.1: # %cond.true373; GLOBAL-X64-NEXT:    testb $1, %r10b374; GLOBAL-X64-NEXT:    jne .LBB7_9375; GLOBAL-X64-NEXT:  # %bb.2: # %cond.true.false376; GLOBAL-X64-NEXT:    testb $1, %dil377; GLOBAL-X64-NEXT:    movq %rsi, %rax378; GLOBAL-X64-NEXT:    jne .LBB7_9379; GLOBAL-X64-NEXT:  # %bb.3: # %cond.true.false.false380; GLOBAL-X64-NEXT:    movq %rdx, %rax381; GLOBAL-X64-NEXT:    retq382; GLOBAL-X64-NEXT:  .LBB7_4: # %cond.false383; GLOBAL-X64-NEXT:    testb $1, %r10b384; GLOBAL-X64-NEXT:    je .LBB7_7385; GLOBAL-X64-NEXT:  # %bb.5: # %cond.false.true386; GLOBAL-X64-NEXT:    testb $1, %dil387; GLOBAL-X64-NEXT:    movq %rcx, %rax388; GLOBAL-X64-NEXT:    jne .LBB7_9389; GLOBAL-X64-NEXT:  # %bb.6: # %cond.false.true.false390; GLOBAL-X64-NEXT:    movq %r8, %rax391; GLOBAL-X64-NEXT:    retq392; GLOBAL-X64-NEXT:  .LBB7_7: # %cond.false.false393; GLOBAL-X64-NEXT:    testb $1, %dil394; GLOBAL-X64-NEXT:    movq %r9, %rax395; GLOBAL-X64-NEXT:    jne .LBB7_9396; GLOBAL-X64-NEXT:  # %bb.8: # %cond.false.false.false397; GLOBAL-X64-NEXT:    movq {{[0-9]+}}(%rsp), %rax398; GLOBAL-X64-NEXT:  .LBB7_9: # %cond.end399; GLOBAL-X64-NEXT:    retq400entry:401  br i1 %pred0, label %cond.true, label %cond.false402 403cond.true:404  br i1 %pred1, label %cond.end, label %cond.true.false405 406cond.true.false:407  br i1 %pred2, label %cond.true.false.true, label %cond.true.false.false408 409cond.true.false.true:410  br label %cond.end411 412cond.true.false.false:413  br label %cond.end414 415cond.false:416  br i1 %pred1, label %cond.false.true, label %cond.false.false417 418cond.false.true:419  br i1 %pred2, label %cond.false.true.true, label %cond.false.true.false420 421cond.false.true.true:422  br label %cond.end423 424cond.false.true.false:425  br label %cond.end426 427cond.false.false:428  br i1 %pred2, label %cond.false.false.true, label %cond.false.false.false429 430cond.false.false.true:431  br label %cond.end432 433cond.false.false.false:434  br label %cond.end435 436cond.end:437  %res = phi ptr [ %a, %cond.true ], [ %b, %cond.true.false.true ], [ %c, %cond.true.false.false ], [ %d, %cond.false.true.true ], [ %e, %cond.false.true.false ], [ %f, %cond.false.false.true ], [ %g, %cond.false.false.false ]438  ret ptr %res439}440 441define x86_fp80 @test_fp80(x86_fp80 %f, x86_fp80 %t, i1 %pred) {442; X86-LABEL: test_fp80:443; X86:       # %bb.0: # %entry444; X86-NEXT:    fldt {{[0-9]+}}(%esp)445; X86-NEXT:    fldt {{[0-9]+}}(%esp)446; X86-NEXT:    testb $1, {{[0-9]+}}(%esp)447; X86-NEXT:    jne .LBB8_2448; X86-NEXT:  # %bb.1: # %cond.false449; X86-NEXT:    fstp %st(0)450; X86-NEXT:    fldz451; X86-NEXT:    fxch %st(1)452; X86-NEXT:  .LBB8_2: # %cond.end453; X86-NEXT:    fstp %st(1)454; X86-NEXT:    retl455;456; DAG-X64-LABEL: test_fp80:457; DAG-X64:       # %bb.0: # %entry458; DAG-X64-NEXT:    fldt {{[0-9]+}}(%rsp)459; DAG-X64-NEXT:    fldt {{[0-9]+}}(%rsp)460; DAG-X64-NEXT:    testb $1, %dil461; DAG-X64-NEXT:    jne .LBB8_2462; DAG-X64-NEXT:  # %bb.1: # %cond.false463; DAG-X64-NEXT:    fstp %st(0)464; DAG-X64-NEXT:    fldz465; DAG-X64-NEXT:    fxch %st(1)466; DAG-X64-NEXT:  .LBB8_2: # %cond.end467; DAG-X64-NEXT:    fstp %st(1)468; DAG-X64-NEXT:    retq469;470; GLOBAL-X64-LABEL: test_fp80:471; GLOBAL-X64:       # %bb.0: # %entry472; GLOBAL-X64-NEXT:    fldt {{[0-9]+}}(%rsp)473; GLOBAL-X64-NEXT:    fldt {{[0-9]+}}(%rsp)474; GLOBAL-X64-NEXT:    testb $1, %dil475; GLOBAL-X64-NEXT:    jne .LBB8_2476; GLOBAL-X64-NEXT:  # %bb.1: # %cond.false477; GLOBAL-X64-NEXT:    fstp %st(1)478; GLOBAL-X64-NEXT:    fldz479; GLOBAL-X64-NEXT:  .LBB8_2: # %cond.end480; GLOBAL-X64-NEXT:    fstp %st(0)481; GLOBAL-X64-NEXT:    retq482entry:483  br i1 %pred, label %cond.true, label %cond.false484 485cond.true:                                        ; preds = %entry486  br label %cond.end487 488cond.false:                                       ; preds = %entry489  br label %cond.end490 491cond.end:                                         ; preds = %cond.false, %cond.true492  %cond = phi x86_fp80 [ %f, %cond.true ], [ %t, %cond.false ]493  ret x86_fp80 %cond494}495