[cfe-commits] [libclc] r157629 - in /libclc/trunk/generic/include/clc: clc.h math/binary_intrin.inc math/pow.h

Peter Collingbourne peter at pcc.me.uk
Tue May 29 10:42:57 PDT 2012


Author: pcc
Date: Tue May 29 12:42:56 2012
New Revision: 157629

URL: http://llvm.org/viewvc/llvm-project?rev=157629&view=rev
Log:
Add pow builtin.

Added:
    libclc/trunk/generic/include/clc/math/binary_intrin.inc
    libclc/trunk/generic/include/clc/math/pow.h
Modified:
    libclc/trunk/generic/include/clc/clc.h

Modified: libclc/trunk/generic/include/clc/clc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=157629&r1=157628&r2=157629&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Tue May 29 12:42:56 2012
@@ -41,6 +41,7 @@
 #include <clc/math/log.h>
 #include <clc/math/log2.h>
 #include <clc/math/mad.h>
+#include <clc/math/pow.h>
 #include <clc/math/sin.h>
 #include <clc/math/sqrt.h>
 #include <clc/math/native_cos.h>

Added: libclc/trunk/generic/include/clc/math/binary_intrin.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/binary_intrin.inc?rev=157629&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/math/binary_intrin.inc (added)
+++ libclc/trunk/generic/include/clc/math/binary_intrin.inc Tue May 29 12:42:56 2012
@@ -0,0 +1,18 @@
+_CLC_OVERLOAD float FUNCTION(float, float) __asm(INTRINSIC ".f32");
+_CLC_OVERLOAD float2 FUNCTION(float2, float2) __asm(INTRINSIC ".v2f32");
+_CLC_OVERLOAD float3 FUNCTION(float3, float3) __asm(INTRINSIC ".v3f32");
+_CLC_OVERLOAD float4 FUNCTION(float4, float4) __asm(INTRINSIC ".v4f32");
+_CLC_OVERLOAD float8 FUNCTION(float8, float8) __asm(INTRINSIC ".v8f32");
+_CLC_OVERLOAD float16 FUNCTION(float16, float16) __asm(INTRINSIC ".v16f32");
+
+#ifdef cl_khr_fp64
+_CLC_OVERLOAD double FUNCTION(double, double) __asm(INTRINSIC ".f64");
+_CLC_OVERLOAD double2 FUNCTION(double2, double2) __asm(INTRINSIC ".v2f64");
+_CLC_OVERLOAD double3 FUNCTION(double3, double3) __asm(INTRINSIC ".v3f64");
+_CLC_OVERLOAD double4 FUNCTION(double4, double4) __asm(INTRINSIC ".v4f64");
+_CLC_OVERLOAD double8 FUNCTION(double8, double8) __asm(INTRINSIC ".v8f64");
+_CLC_OVERLOAD double16 FUNCTION(double16, double16) __asm(INTRINSIC ".v16f64");
+#endif
+
+#undef FUNCTION
+#undef INTRINSIC

Added: libclc/trunk/generic/include/clc/math/pow.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/math/pow.h?rev=157629&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/math/pow.h (added)
+++ libclc/trunk/generic/include/clc/math/pow.h Tue May 29 12:42:56 2012
@@ -0,0 +1,6 @@
+#undef pow
+#define pow __clc_pow
+
+#define FUNCTION __clc_pow
+#define INTRINSIC "llvm.pow"
+#include <clc/math/binary_intrin.inc>





More information about the cfe-commits mailing list