1/*========================== begin_copyright_notice ============================
2
3Copyright (C) 2017-2021 Intel Corporation
4
5SPDX-License-Identifier: MIT
6
7============================= end_copyright_notice ===========================*/
8
9#include "../include/BiF_Definitions.cl"
10
11INLINE int OVERLOADABLE islessgreater( float x, float y )
12{
13    return (x < y) | (x > y) ? 1 : 0;
14}
15
16static INLINE int OVERLOADABLE __intel_vector_islessgreater_helper( float x, float y )
17{
18    return (x < y) | (x > y) ? -1 : 0;
19}
20
21GENERATE_VECTOR_FUNCTIONS_2ARGS_EXPLICIT( islessgreater, __intel_vector_islessgreater_helper, int, float )
22
23#if defined(cl_khr_fp64)
24
25INLINE int OVERLOADABLE islessgreater( double x, double y )
26{
27    return (x < y) | (x > y) ? 1 : 0;
28}
29
30static INLINE long OVERLOADABLE __intel_vector_islessgreater_helper( double x, double y )
31{
32    return (x < y) | (x > y) ? -1 : 0;
33}
34
35GENERATE_VECTOR_FUNCTIONS_2ARGS_EXPLICIT( islessgreater, __intel_vector_islessgreater_helper, long, double )
36
37#endif // defined(cl_khr_fp64)
38
39#if defined(cl_khr_fp16)
40
41INLINE int OVERLOADABLE islessgreater( half x, half y )
42{
43    return (x < y) | (x > y) ? 1 : 0;
44}
45
46static INLINE short OVERLOADABLE __intel_vector_islessgreater_helper( half x, half y )
47{
48    return (x < y) | (x > y) ? -1 : 0;
49}
50
51GENERATE_VECTOR_FUNCTIONS_2ARGS_EXPLICIT( islessgreater, __intel_vector_islessgreater_helper, short, half )
52
53#endif // defined(cl_khr_fp16)
54