mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Add rsqrt builtin. Based on patch by Cassie Epps!
llvm-svn: 162274
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include <clc/math/native_log2.h>
|
||||
#include <clc/math/native_sin.h>
|
||||
#include <clc/math/native_sqrt.h>
|
||||
#include <clc/math/rsqrt.h>
|
||||
|
||||
/* 6.11.3 Integer Functions */
|
||||
#include <clc/integer/abs.h>
|
||||
|
||||
1
libclc/generic/include/clc/math/rsqrt.h
Normal file
1
libclc/generic/include/clc/math/rsqrt.h
Normal file
@@ -0,0 +1 @@
|
||||
#define rsqrt(x) (1.f/sqrt(x))
|
||||
6
libclc/test/rsqrt.cl
Normal file
6
libclc/test/rsqrt.cl
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||
|
||||
__kernel void foo(float4 *x, double4 *y) {
|
||||
x[1] = rsqrt(x[0]);
|
||||
y[1] = rsqrt(y[0]);
|
||||
}
|
||||
Reference in New Issue
Block a user