brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 2a62293 Raw
76 lines · plain
1; RUN: llc < %s -mtriple=arm64-apple-ios7 | FileCheck %s --check-prefix CHECK-IOS2; RUN: llc < %s -mtriple=arm64-linux-gnu | FileCheck %s --check-prefix CHECK-LINUX3; RUN: llc < %s -mtriple=arm64-linux-android | FileCheck %s --check-prefix CHECK-LINUX4 5; Combine sin / cos into a single call unless they may write errno (as6; captured by readnone attrbiute, controlled by clang -fmath-errno7; setting).8; rdar://128568739 10define float @test1(float %x) nounwind {11entry:12; CHECK-IOS-LABEL: test1:13; CHECK-IOS: bl ___sincosf_stret14; CHECK-IOS: fadd s0, s0, s115 16; CHECK-LINUX-LABEL: test1:17; CHECK-LINUX: bl sincosf18 19  %call = tail call float @sinf(float %x) readnone20  %call1 = tail call float @cosf(float %x) readnone21  %add = fadd float %call, %call122  ret float %add23}24 25define float @test1_errno(float %x) nounwind {26entry:27; CHECK-IOS-LABEL: test1_errno:28; CHECK-IOS: bl _sinf29; CHECK-IOS: bl _cosf30 31; CHECK-LINUX-LABEL: test1_errno:32; CHECK-LINUX: bl sinf33; CHECK-LINUX: bl cosf34 35  %call = tail call float @sinf(float %x)36  %call1 = tail call float @cosf(float %x)37  %add = fadd float %call, %call138  ret float %add39}40 41define double @test2(double %x) nounwind {42entry:43; CHECK-IOS-LABEL: test2:44; CHECK-IOS: bl ___sincos_stret45; CHECK-IOS: fadd d0, d0, d146 47; CHECK-LINUX-LABEL: test2:48; CHECK-LINUX: bl sincos49 50  %call = tail call double @sin(double %x) readnone51  %call1 = tail call double @cos(double %x) readnone52  %add = fadd double %call, %call153  ret double %add54}55 56define double @test2_errno(double %x) nounwind {57entry:58; CHECK-IOS-LABEL: test2_errno:59; CHECK-IOS: bl _sin60; CHECK-IOS: bl _cos61 62; CHECK-LINUX-LABEL: test2_errno:63; CHECK-LINUX: bl sin64; CHECK-LINUX: bl cos65 66  %call = tail call double @sin(double %x)67  %call1 = tail call double @cos(double %x)68  %add = fadd double %call, %call169  ret double %add70}71 72declare float  @sinf(float)73declare double @sin(double)74declare float @cosf(float)75declare double @cos(double)76