| 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-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
#include <clc/clcmacro.h> |
| 10 |
#include <clc/internal/clc.h> |
| 11 |
#include <clc/math/clc_ldexp.h> |
| 12 |
|
| 13 |
#define FUNCTION __clc_ldexp |
| 14 |
#define __CLC_ARG2_TYPE int |
| 15 |
#define __CLC_MIN_VECSIZE 1 |
| 16 |
|
| 17 |
#ifdef __HAS_LDEXPF__ |
| 18 |
// This defines all the ldexp(floatN, intN) variants. |
| 19 |
#define __FLOAT_ONLY |
| 20 |
#define __IMPL_FUNCTION __builtin_amdgcn_ldexpf |
| 21 |
#define __CLC_BODY <clc/shared/binary_def_scalarize.inc> |
| 22 |
#include <clc/math/gentype.inc> |
| 23 |
#undef __IMPL_FUNCTION |
| 24 |
#endif |
| 25 |
|
| 26 |
#ifdef cl_khr_fp64 |
| 27 |
#pragma OPENCL EXTENSION cl_khr_fp64 : enable |
| 28 |
// This defines all the ldexp(doubleN, intN) variants. |
| 29 |
#define __DOUBLE_ONLY |
| 30 |
#define __IMPL_FUNCTION __builtin_amdgcn_ldexp |
| 31 |
#define __CLC_BODY <clc/shared/binary_def_scalarize.inc> |
| 32 |
#include <clc/math/gentype.inc> |
| 33 |
#undef __IMPL_FUNCTION |
| 34 |
#endif |