brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.8 KiB · ef0efa5 Raw
213 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefixes=ALL,i6863; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s -check-prefixes=ALL,x86_644 5 6%0 = type { x86_fp80, x86_fp80 }7 8; This is basically this code on x86-64:9; _Complex long double test() { return 1.0; }10define %0 @test() {11; ALL-LABEL: test:12; ALL:       # %bb.0:13; ALL-NEXT:    fldz14; ALL-NEXT:    fld115; ALL-NEXT:    ret{{[l|q]}}16  %A = fpext double 1.0 to x86_fp8017  %B = fpext double 0.0 to x86_fp8018  %mrv = insertvalue %0 undef, x86_fp80 %A, 019  %mrv1 = insertvalue %0 %mrv, x86_fp80 %B, 120  ret %0 %mrv121}22 23 24;_test2:25;	fld126;	fld	%st(0)27;	ret28define %0 @test2() {29; ALL-LABEL: test2:30; ALL:       # %bb.0:31; ALL-NEXT:    fld132; ALL-NEXT:    fld %st(0)33; ALL-NEXT:    ret{{[l|q]}}34  %A = fpext double 1.0 to x86_fp8035  %mrv = insertvalue %0 undef, x86_fp80 %A, 036  %mrv1 = insertvalue %0 %mrv, x86_fp80 %A, 137  ret %0 %mrv138}39 40; Uses both values.41define void @call1(ptr%P1, ptr%P2) {42; i686-LABEL: call1:43; i686:       # %bb.0:44; i686-NEXT:    pushl %edi45; i686-NEXT:    .cfi_def_cfa_offset 846; i686-NEXT:    pushl %esi47; i686-NEXT:    .cfi_def_cfa_offset 1248; i686-NEXT:    .cfi_offset %esi, -1249; i686-NEXT:    .cfi_offset %edi, -850; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi51; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi52; i686-NEXT:    calll test@PLT53; i686-NEXT:    fstpt (%edi)54; i686-NEXT:    fstpt (%esi)55; i686-NEXT:    popl %esi56; i686-NEXT:    .cfi_def_cfa_offset 857; i686-NEXT:    popl %edi58; i686-NEXT:    .cfi_def_cfa_offset 459; i686-NEXT:    retl60;61; x86_64-LABEL: call1:62; x86_64:       # %bb.0:63; x86_64-NEXT:    pushq %r1464; x86_64-NEXT:    .cfi_def_cfa_offset 1665; x86_64-NEXT:    pushq %rbx66; x86_64-NEXT:    .cfi_def_cfa_offset 2467; x86_64-NEXT:    pushq %rax68; x86_64-NEXT:    .cfi_def_cfa_offset 3269; x86_64-NEXT:    .cfi_offset %rbx, -2470; x86_64-NEXT:    .cfi_offset %r14, -1671; x86_64-NEXT:    movq %rsi, %rbx72; x86_64-NEXT:    movq %rdi, %r1473; x86_64-NEXT:    callq test@PLT74; x86_64-NEXT:    fstpt (%r14)75; x86_64-NEXT:    fstpt (%rbx)76; x86_64-NEXT:    addq $8, %rsp77; x86_64-NEXT:    .cfi_def_cfa_offset 2478; x86_64-NEXT:    popq %rbx79; x86_64-NEXT:    .cfi_def_cfa_offset 1680; x86_64-NEXT:    popq %r1481; x86_64-NEXT:    .cfi_def_cfa_offset 882; x86_64-NEXT:    retq83  %a = call %0 @test()84  %b = extractvalue %0 %a, 085  store x86_fp80 %b, ptr %P186 87  %c = extractvalue %0 %a, 188  store x86_fp80 %c, ptr %P289  ret void90}91 92; Uses both values, requires fxch93define void @call2(ptr%P1, ptr%P2) {94; i686-LABEL: call2:95; i686:       # %bb.0:96; i686-NEXT:    pushl %edi97; i686-NEXT:    .cfi_def_cfa_offset 898; i686-NEXT:    pushl %esi99; i686-NEXT:    .cfi_def_cfa_offset 12100; i686-NEXT:    .cfi_offset %esi, -12101; i686-NEXT:    .cfi_offset %edi, -8102; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi103; i686-NEXT:    movl {{[0-9]+}}(%esp), %edi104; i686-NEXT:    calll test@PLT105; i686-NEXT:    fxch %st(1)106; i686-NEXT:    fstpt (%edi)107; i686-NEXT:    fstpt (%esi)108; i686-NEXT:    popl %esi109; i686-NEXT:    .cfi_def_cfa_offset 8110; i686-NEXT:    popl %edi111; i686-NEXT:    .cfi_def_cfa_offset 4112; i686-NEXT:    retl113;114; x86_64-LABEL: call2:115; x86_64:       # %bb.0:116; x86_64-NEXT:    pushq %r14117; x86_64-NEXT:    .cfi_def_cfa_offset 16118; x86_64-NEXT:    pushq %rbx119; x86_64-NEXT:    .cfi_def_cfa_offset 24120; x86_64-NEXT:    pushq %rax121; x86_64-NEXT:    .cfi_def_cfa_offset 32122; x86_64-NEXT:    .cfi_offset %rbx, -24123; x86_64-NEXT:    .cfi_offset %r14, -16124; x86_64-NEXT:    movq %rsi, %rbx125; x86_64-NEXT:    movq %rdi, %r14126; x86_64-NEXT:    callq test@PLT127; x86_64-NEXT:    fxch %st(1)128; x86_64-NEXT:    fstpt (%r14)129; x86_64-NEXT:    fstpt (%rbx)130; x86_64-NEXT:    addq $8, %rsp131; x86_64-NEXT:    .cfi_def_cfa_offset 24132; x86_64-NEXT:    popq %rbx133; x86_64-NEXT:    .cfi_def_cfa_offset 16134; x86_64-NEXT:    popq %r14135; x86_64-NEXT:    .cfi_def_cfa_offset 8136; x86_64-NEXT:    retq137  %a = call %0 @test()138  %b = extractvalue %0 %a, 1139  store x86_fp80 %b, ptr %P1140 141  %c = extractvalue %0 %a, 0142  store x86_fp80 %c, ptr %P2143  ret void144}145 146; Uses ST(0), ST(1) is dead but must be popped.147define void @call3(ptr%P1, ptr%P2) {148; i686-LABEL: call3:149; i686:       # %bb.0:150; i686-NEXT:    pushl %esi151; i686-NEXT:    .cfi_def_cfa_offset 8152; i686-NEXT:    .cfi_offset %esi, -8153; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi154; i686-NEXT:    calll test@PLT155; i686-NEXT:    fstp %st(1)156; i686-NEXT:    fstpt (%esi)157; i686-NEXT:    popl %esi158; i686-NEXT:    .cfi_def_cfa_offset 4159; i686-NEXT:    retl160;161; x86_64-LABEL: call3:162; x86_64:       # %bb.0:163; x86_64-NEXT:    pushq %rbx164; x86_64-NEXT:    .cfi_def_cfa_offset 16165; x86_64-NEXT:    .cfi_offset %rbx, -16166; x86_64-NEXT:    movq %rdi, %rbx167; x86_64-NEXT:    callq test@PLT168; x86_64-NEXT:    fstp %st(1)169; x86_64-NEXT:    fstpt (%rbx)170; x86_64-NEXT:    popq %rbx171; x86_64-NEXT:    .cfi_def_cfa_offset 8172; x86_64-NEXT:    retq173  %a = call %0 @test()174  %b = extractvalue %0 %a, 0175  store x86_fp80 %b, ptr %P1176  ret void177}178 179; Uses ST(1), ST(0) is dead and must be popped.180define void @call4(ptr%P1, ptr%P2) {181; i686-LABEL: call4:182; i686:       # %bb.0:183; i686-NEXT:    pushl %esi184; i686-NEXT:    .cfi_def_cfa_offset 8185; i686-NEXT:    .cfi_offset %esi, -8186; i686-NEXT:    movl {{[0-9]+}}(%esp), %esi187; i686-NEXT:    calll test@PLT188; i686-NEXT:    fstp %st(0)189; i686-NEXT:    fstpt (%esi)190; i686-NEXT:    popl %esi191; i686-NEXT:    .cfi_def_cfa_offset 4192; i686-NEXT:    retl193;194; x86_64-LABEL: call4:195; x86_64:       # %bb.0:196; x86_64-NEXT:    pushq %rbx197; x86_64-NEXT:    .cfi_def_cfa_offset 16198; x86_64-NEXT:    .cfi_offset %rbx, -16199; x86_64-NEXT:    movq %rsi, %rbx200; x86_64-NEXT:    callq test@PLT201; x86_64-NEXT:    fstp %st(0)202; x86_64-NEXT:    fstpt (%rbx)203; x86_64-NEXT:    popq %rbx204; x86_64-NEXT:    .cfi_def_cfa_offset 8205; x86_64-NEXT:    retq206  %a = call %0 @test()207 208  %c = extractvalue %0 %a, 1209  store x86_fp80 %c, ptr %P2210  ret void211}212 213