70 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=+f16c < %s | FileCheck %s --check-prefix=ALL3; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=+avx < %s | FileCheck %s --check-prefix=ALL4 5define zeroext i16 @test1_fast(double %d) #0 {6; ALL-LABEL: test1_fast:7; ALL: # %bb.0: # %entry8; ALL-NEXT: pushq %rax9; ALL-NEXT: callq __truncdfhf2@PLT10; ALL-NEXT: vpextrw $0, %xmm0, %eax11; ALL-NEXT: # kill: def $ax killed $ax killed $eax12; ALL-NEXT: popq %rcx13; ALL-NEXT: retq14entry:15 %0 = tail call i16 @llvm.convert.to.fp16.f64(double %d)16 ret i16 %017}18 19define zeroext i16 @test2_fast(x86_fp80 %d) #0 {20; ALL-LABEL: test2_fast:21; ALL: # %bb.0: # %entry22; ALL-NEXT: subq $24, %rsp23; ALL-NEXT: fldt {{[0-9]+}}(%rsp)24; ALL-NEXT: fstpt (%rsp)25; ALL-NEXT: callq __truncxfhf2@PLT26; ALL-NEXT: vpextrw $0, %xmm0, %eax27; ALL-NEXT: # kill: def $ax killed $ax killed $eax28; ALL-NEXT: addq $24, %rsp29; ALL-NEXT: retq30entry:31 %0 = tail call i16 @llvm.convert.to.fp16.f80(x86_fp80 %d)32 ret i16 %033}34 35define zeroext i16 @test1(double %d) #1 {36; ALL-LABEL: test1:37; ALL: # %bb.0: # %entry38; ALL-NEXT: pushq %rax39; ALL-NEXT: callq __truncdfhf2@PLT40; ALL-NEXT: vpextrw $0, %xmm0, %eax41; ALL-NEXT: # kill: def $ax killed $ax killed $eax42; ALL-NEXT: popq %rcx43; ALL-NEXT: retq44entry:45 %0 = tail call i16 @llvm.convert.to.fp16.f64(double %d)46 ret i16 %047}48 49define zeroext i16 @test2(x86_fp80 %d) #1 {50; ALL-LABEL: test2:51; ALL: # %bb.0: # %entry52; ALL-NEXT: subq $24, %rsp53; ALL-NEXT: fldt {{[0-9]+}}(%rsp)54; ALL-NEXT: fstpt (%rsp)55; ALL-NEXT: callq __truncxfhf2@PLT56; ALL-NEXT: vpextrw $0, %xmm0, %eax57; ALL-NEXT: # kill: def $ax killed $ax killed $eax58; ALL-NEXT: addq $24, %rsp59; ALL-NEXT: retq60entry:61 %0 = tail call i16 @llvm.convert.to.fp16.f80(x86_fp80 %d)62 ret i16 %063}64 65declare i16 @llvm.convert.to.fp16.f64(double)66declare i16 @llvm.convert.to.fp16.f80(x86_fp80)67 68attributes #0 = { nounwind readnone "use-soft-float"="false" }69attributes #1 = { nounwind readnone "use-soft-float"="false" }70