mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 07:58:23 +08:00
Add fabs builtin.
llvm-svn: 157595
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
/* 6.11.2 Math Functions */
|
||||
#include <clc/math/cos.h>
|
||||
#include <clc/math/fabs.h>
|
||||
#include <clc/math/sin.h>
|
||||
#include <clc/math/sqrt.h>
|
||||
#include <clc/math/native_cos.h>
|
||||
|
||||
6
libclc/generic/include/clc/math/fabs.h
Normal file
6
libclc/generic/include/clc/math/fabs.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#undef fabs
|
||||
#define fabs __clc_fabs
|
||||
|
||||
#define FUNCTION __clc_fabs
|
||||
#define INTRINSIC "llvm.fabs"
|
||||
#include <clc/math/unary_intrin.inc>
|
||||
3
libclc/test/fabs.cl
Normal file
3
libclc/test/fabs.cl
Normal file
@@ -0,0 +1,3 @@
|
||||
__kernel void foo(float *f) {
|
||||
*f = fabs(*f);
|
||||
}
|
||||
Reference in New Issue
Block a user