[libclc] r219087 - Implement fmod

Jan Vesely jan.vesely at rutgers.edu
Sun Oct 5 13:24:53 PDT 2014


Author: jvesely
Date: Sun Oct  5 15:24:52 2014
New Revision: 219087

URL: http://llvm.org/viewvc/llvm-project?rev=219087&view=rev
Log:
Implement fmod

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
Reviewed-by: Tom Stellard <tom at stellard.net>
Reviewed-by: Aaron Watry <awatry at gmail.com>

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

Modified: libclc/trunk/generic/include/clc/clc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=219087&r1=219086&r2=219087&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Sun Oct  5 15:24:52 2014
@@ -47,6 +47,7 @@
 #include <clc/math/fma.h>
 #include <clc/math/fmax.h>
 #include <clc/math/fmin.h>
+#include <clc/math/fmod.h>
 #include <clc/math/hypot.h>
 #include <clc/math/log.h>
 #include <clc/math/log2.h>

Added: libclc/trunk/generic/include/clc/math/fmod.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fmod.h?rev=219087&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/math/fmod.h (added)
+++ libclc/trunk/generic/include/clc/math/fmod.h Sun Oct  5 15:24:52 2014
@@ -0,0 +1,2 @@
+#define __CLC_BODY <clc/math/fmod.inc>
+#include <clc/math/gentype.inc>

Added: libclc/trunk/generic/include/clc/math/fmod.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/fmod.inc?rev=219087&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/math/fmod.inc (added)
+++ libclc/trunk/generic/include/clc/math/fmod.inc Sun Oct  5 15:24:52 2014
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fmod(__CLC_GENTYPE a, __CLC_GENTYPE b);

Modified: libclc/trunk/generic/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/SOURCES?rev=219087&r1=219086&r2=219087&view=diff
==============================================================================
--- libclc/trunk/generic/lib/SOURCES (original)
+++ libclc/trunk/generic/lib/SOURCES Sun Oct  5 15:24:52 2014
@@ -61,6 +61,7 @@ math/exp.cl
 math/exp10.cl
 math/fmax.cl
 math/fmin.cl
+math/fmod.cl
 math/hypot.cl
 math/mad.cl
 math/mix.cl

Added: libclc/trunk/generic/lib/math/fmod.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/fmod.cl?rev=219087&view=auto
==============================================================================
--- libclc/trunk/generic/lib/math/fmod.cl (added)
+++ libclc/trunk/generic/lib/math/fmod.cl Sun Oct  5 15:24:52 2014
@@ -0,0 +1,12 @@
+#include <clc/clc.h>
+#include "../clcmacro.h"
+
+_CLC_DEFINE_BINARY_BUILTIN(float, fmod, __builtin_fmodf, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+_CLC_DEFINE_BINARY_BUILTIN(double, fmod, __builtin_fmod, double, double)
+
+#endif





More information about the cfe-commits mailing list