[libclc] r318064 - native_tan: Switch implementation to use native_sin/native_cos

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 10:28:49 PST 2017


Author: jvesely
Date: Mon Nov 13 10:28:48 2017
New Revision: 318064

URL: http://llvm.org/viewvc/llvm-project?rev=318064&view=rev
Log:
native_tan: Switch implementation to use native_sin/native_cos

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

Added:
    libclc/trunk/generic/lib/math/native_tan.cl
    libclc/trunk/generic/lib/math/native_tan.inc
Modified:
    libclc/trunk/generic/include/clc/math/native_tan.h
    libclc/trunk/generic/lib/SOURCES

Modified: libclc/trunk/generic/include/clc/math/native_tan.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/native_tan.h?rev=318064&r1=318063&r2=318064&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/math/native_tan.h (original)
+++ libclc/trunk/generic/include/clc/math/native_tan.h Mon Nov 13 10:28:48 2017
@@ -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

Modified: libclc/trunk/generic/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=318064&r1=318063&r2=318064&view=diff
==============================================================================
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Mon Nov 13 10:28:48 2017
@@ -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

Added: libclc/trunk/generic/lib/math/native_tan.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/native_tan.cl?rev=318064&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/native_tan.cl (added)
+++ libclc/trunk/generic/lib/math/native_tan.cl Mon Nov 13 10:28:48 2017
@@ -0,0 +1,5 @@
+#include <clc/clc.h>
+
+#define __CLC_BODY <native_tan.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>

Added: libclc/trunk/generic/lib/math/native_tan.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/native_tan.inc?rev=318064&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/native_tan.inc (added)
+++ libclc/trunk/generic/lib/math/native_tan.inc Mon Nov 13 10:28:48 2017
@@ -0,0 +1,3 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_tan(__CLC_GENTYPE val) {
+  return native_sin(val) / native_cos(val);
+}




More information about the cfe-commits mailing list