//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include #include #include #include #include #include #include #include #include #define bitalign(hi, lo, shift) ((hi) << (32 - (shift))) | ((lo) >> (shift)); #define FULL_MUL(A, B, HI, LO) \ LO = A * B; \ HI = __clc_mul_hi(A, B) #define FULL_MAD(A, B, C, HI, LO) \ LO = ((A) * (B) + (C)); \ HI = __clc_mul_hi(A, B); \ HI += LO < C ? 1U : 0U; #define __FLOAT_ONLY #define __CLC_BODY #include #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable #include #include #include #define bytealign(src0, src1, src2) \ (__CLC_CONVERT_UINTN( \ ((__CLC_CONVERT_LONGN((src0)) << 32) | __CLC_CONVERT_LONGN((src1))) >> \ (((src2) & 3) * 8))) #define __DOUBLE_ONLY #define __CLC_BODY #include #endif