| //===----------------------------------------------------------------------===// |
| // 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 |
| //===----------------------------------------------------------------------===// |
| #define MIN_CONSTANT 0x1.fffffffffffffp-1 |
| #define MIN_CONSTANT 0x1.fffffep-1f |
| #define MIN_CONSTANT 0x1.ffcp-1h |
| _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fract(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr) { |
| __CLC_GENTYPE r = fmin(x - *iptr, MIN_CONSTANT); |
| #define FRACT_DEF(addrspace) \ |
| _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fract(__CLC_GENTYPE x, addrspace __CLC_GENTYPE *iptr) { \ |
| __CLC_GENTYPE private_iptr; \ |
| __CLC_GENTYPE ret = fract(x, &private_iptr); \ |