• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <clc/clc.h>
2#include "relational.h"
3
4_CLC_DEFINE_RELATIONAL_UNARY(int, signbit, __builtin_signbitf, float)
5
6#ifdef cl_khr_fp64
7
8#pragma OPENCL EXTENSION cl_khr_fp64 : enable
9
10// The scalar version of signbit(double) returns an int, but the vector versions
11// return long.
12
13_CLC_DEF _CLC_OVERLOAD int signbit(double x){
14	return __builtin_signbit(x);
15}
16
17_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(long, signbit, double)
18
19#endif
20#ifdef cl_khr_fp16
21
22#pragma OPENCL EXTENSION cl_khr_fp16 : enable
23
24// The scalar version of signbit(half) returns an int, but the vector versions
25// return short.
26
27_CLC_DEF _CLC_OVERLOAD int signbit(half x){
28	return __builtin_signbit(x);
29}
30
31_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(short, signbit, half)
32
33#endif
34