[PATCH] D52025: [TargetLowering] Android has sincos functions
John Brawn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 18 06:23:46 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL342471: [TargetLowering] Android has sincos functions (authored by john.brawn, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52025?vs=165246&id=165950#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52025
Files:
llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll
llvm/trunk/test/CodeGen/ARM/sincos.ll
Index: llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll
===================================================================
--- llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll
+++ llvm/trunk/test/CodeGen/AArch64/arm64-sincos.ll
@@ -1,5 +1,6 @@
; RUN: llc < %s -mtriple=arm64-apple-ios7 | FileCheck %s --check-prefix CHECK-IOS
; RUN: llc < %s -mtriple=arm64-linux-gnu | FileCheck %s --check-prefix CHECK-LINUX
+; RUN: llc < %s -mtriple=arm64-linux-android | FileCheck %s --check-prefix CHECK-LINUX
; Combine sin / cos into a single call unless they may write errno (as
; captured by readnone attrbiute, controlled by clang -fmath-errno
Index: llvm/trunk/test/CodeGen/ARM/sincos.ll
===================================================================
--- llvm/trunk/test/CodeGen/ARM/sincos.ll
+++ llvm/trunk/test/CodeGen/ARM/sincos.ll
@@ -3,6 +3,8 @@
; RUN: llc < %s -mtriple=armv7-linux-gnu -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU
; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a8 \
; RUN: --enable-unsafe-fp-math | FileCheck %s --check-prefix=SINCOS-GNU
+; RUN: llc < %s -mtriple=armv7-linux-android -mcpu=cortex-a8 | FileCheck %s --check-prefix=NOOPT-ANDROID
+; RUN: llc < %s -mtriple=armv7-linux-android9 -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU
; Combine sin / cos into a single call unless they may write errno (as
; captured by readnone attrbiute, controlled by clang -fmath-errno
@@ -21,6 +23,10 @@
; NOOPT: bl _sinf
; NOOPT: bl _cosf
+; NOOPT-ANDROID-LABEL: test1:
+; NOOPT-ANDROID: bl sinf
+; NOOPT-ANDROID: bl cosf
+
%call = tail call float @sinf(float %x) readnone
%call1 = tail call float @cosf(float %x) readnone
%add = fadd float %call, %call1
@@ -41,6 +47,10 @@
; NOOPT: bl _sinf
; NOOPT: bl _cosf
+; NOOPT-ANDROID-LABEL: test1_errno:
+; NOOPT-ANDROID: bl sinf
+; NOOPT-ANDROID: bl cosf
+
%call = tail call float @sinf(float %x)
%call1 = tail call float @cosf(float %x)
%add = fadd float %call, %call1
@@ -59,6 +69,10 @@
; NOOPT: bl _sin
; NOOPT: bl _cos
+; NOOPT-ANDROID-LABEL: test2:
+; NOOPT-ANDROID: bl sin
+; NOOPT-ANDROID: bl cos
+
%call = tail call double @sin(double %x) readnone
%call1 = tail call double @cos(double %x) readnone
%add = fadd double %call, %call1
@@ -79,6 +93,10 @@
; NOOPT: bl _sin
; NOOPT: bl _cos
+; NOOPT-ANDROID-LABEL: test2_errno:
+; NOOPT-ANDROID: bl sin
+; NOOPT-ANDROID: bl cos
+
%call = tail call double @sin(double %x)
%call1 = tail call double @cos(double %x)
%add = fadd double %call, %call1
Index: llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
+++ llvm/trunk/lib/CodeGen/TargetLoweringBase.cpp
@@ -161,7 +161,8 @@
setLibcallName(RTLIB::FPROUND_F32_F16, "__gnu_f2h_ieee");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia()) {
+ if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52025.165950.patch
Type: text/x-patch
Size: 3176 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/69ae2ae2/attachment.bin>
More information about the llvm-commits
mailing list