native_tan: Switch implementation to use native_sin/native_cos

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 318064
This commit is contained in:
Jan Vesely 2017-11-13 18:28:48 +00:00
parent 79b7566210
commit 541a3f0758
4 changed files with 17 additions and 9 deletions

View File

@ -1,10 +1,9 @@
//===-- generic/include/clc/math/native_tan.h -----------------------------===//
#define __CLC_BODY <clc/math/unary_decl.inc>
#define __CLC_FUNCTION native_tan
#define __FLOAT_ONLY
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under both the University of Illinois Open Source
// License and the MIT license. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#define native_tan tan
#include <clc/math/gentype.inc>
#undef __FLOAT_ONLY
#undef __CLC_BODY
#undef __CLC_FUNCTION

View File

@ -128,6 +128,7 @@ math/native_log10.cl
math/native_log2.cl
math/native_sin.cl
math/native_sqrt.cl
math/native_tan.cl
math/tables.cl
math/clc_nextafter.cl
math/nextafter.cl

View File

@ -0,0 +1,5 @@
#include <clc/clc.h>
#define __CLC_BODY <native_tan.inc>
#define __FLOAT_ONLY
#include <clc/math/gentype.inc>

View File

@ -0,0 +1,3 @@
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_tan(__CLC_GENTYPE val) {
return native_sin(val) / native_cos(val);
}