-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libclc/r600: Use target specific builtins to implement rsqrt and nati…
…ve_rsqrt Fixes OCL CTS rsqrt and half_rsqrt (1 thread, scalaer) tests on AMD Turks. Reviewer: awatry Differential Revision: https://reviews.llvm.org/D74016
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <clc/clc.h> | ||
|
||
#include "../../../generic/lib/clcmacro.h" | ||
|
||
_CLC_OVERLOAD _CLC_DEF float native_rsqrt(float x) | ||
{ | ||
return __builtin_r600_recipsqrt_ieeef(x); | ||
} | ||
|
||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, native_rsqrt, float); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <clc/clc.h> | ||
|
||
#include "../../../generic/lib/clcmacro.h" | ||
|
||
_CLC_OVERLOAD _CLC_DEF float rsqrt(float x) | ||
{ | ||
return __builtin_r600_recipsqrt_ieeef(x); | ||
} | ||
|
||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, rsqrt, float); | ||
|
||
#ifdef cl_khr_fp64 | ||
|
||
#pragma OPENCL EXTENSION cl_khr_fp64 : enable | ||
|
||
_CLC_OVERLOAD _CLC_DEF double rsqrt(double x) | ||
{ | ||
return __builtin_r600_recipsqrt_ieee(x); | ||
} | ||
|
||
_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, rsqrt, double); | ||
|
||
#endif |