54 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/clc_convert.h>10#include <clc/integer/clc_clz.h>11#include <clc/integer/clc_mul_hi.h>12#include <clc/internal/clc.h>13#include <clc/math/clc_fma.h>14#include <clc/math/clc_mad.h>15#include <clc/math/clc_native_divide.h>16#include <clc/math/clc_trunc.h>17#include <clc/math/math.h>18 19#define bitalign(hi, lo, shift) ((hi) << (32 - (shift))) | ((lo) >> (shift));20 21#define __CLC_FULL_MUL(A, B, HI, LO) \22 LO = A * B; \23 HI = __clc_mul_hi(A, B)24 25#define __CLC_FULL_MAD(A, B, C, HI, LO) \26 LO = ((A) * (B) + (C)); \27 HI = __clc_mul_hi(A, B); \28 HI += LO < C ? 1U : 0U;29 30#define __CLC_FLOAT_ONLY31#define __CLC_BODY <clc_sincos_helpers.inc>32 33#include <clc/math/gentype.inc>34 35#ifdef cl_khr_fp6436 37#pragma OPENCL EXTENSION cl_khr_fp64 : enable38 39#include <clc/math/clc_fract.h>40#include <clc/math/tables.h>41#include <clc/shared/clc_max.h>42 43#define bytealign(src0, src1, src2) \44 (__CLC_CONVERT_UINTN( \45 ((__CLC_CONVERT_LONGN((src0)) << 32) | __CLC_CONVERT_LONGN((src1))) >> \46 (((src2) & 3) * 8)))47 48#define __CLC_DOUBLE_ONLY49#define __CLC_BODY <clc_sincos_helpers_fp64.inc>50 51#include <clc/math/gentype.inc>52 53#endif54