brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · b58fb8d Raw
52 lines · plain
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include <clc/internal/clc.h>10 11#define __CLC_BODY <clc_bitselect.inc>12#include <clc/integer/gentype.inc>13 14#define __CLC_FLOAT_BITSELECT(f_type, i_type, width)                           \15  _CLC_OVERLOAD _CLC_DEF f_type##width __clc_bitselect(                        \16      f_type##width x, f_type##width y, f_type##width z) {                     \17    return __clc_as_##f_type##width(__clc_bitselect(                           \18        __clc_as_##i_type##width(x), __clc_as_##i_type##width(y),              \19        __clc_as_##i_type##width(z)));                                         \20  }21 22__CLC_FLOAT_BITSELECT(float, uint, )23__CLC_FLOAT_BITSELECT(float, uint, 2)24__CLC_FLOAT_BITSELECT(float, uint, 3)25__CLC_FLOAT_BITSELECT(float, uint, 4)26__CLC_FLOAT_BITSELECT(float, uint, 8)27__CLC_FLOAT_BITSELECT(float, uint, 16)28 29#ifdef cl_khr_fp6430#pragma OPENCL EXTENSION cl_khr_fp64 : enable31 32__CLC_FLOAT_BITSELECT(double, ulong, )33__CLC_FLOAT_BITSELECT(double, ulong, 2)34__CLC_FLOAT_BITSELECT(double, ulong, 3)35__CLC_FLOAT_BITSELECT(double, ulong, 4)36__CLC_FLOAT_BITSELECT(double, ulong, 8)37__CLC_FLOAT_BITSELECT(double, ulong, 16)38 39#endif40 41#ifdef cl_khr_fp1642#pragma OPENCL EXTENSION cl_khr_fp16 : enable43 44__CLC_FLOAT_BITSELECT(half, ushort, )45__CLC_FLOAT_BITSELECT(half, ushort, 2)46__CLC_FLOAT_BITSELECT(half, ushort, 3)47__CLC_FLOAT_BITSELECT(half, ushort, 4)48__CLC_FLOAT_BITSELECT(half, ushort, 8)49__CLC_FLOAT_BITSELECT(half, ushort, 16)50 51#endif52