//===----- hlsl_detail.h - HLSL definitions for intrinsics ----------------===// // // 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 // //===----------------------------------------------------------------------===// #ifndef _HLSL_HLSL_DETAILS_H_ #define _HLSL_HLSL_DETAILS_H_ namespace hlsl { namespace __detail { template struct is_same { static const bool value = false; }; template struct is_same { static const bool value = true; }; template struct enable_if {}; template struct enable_if { using Type = T; }; template using enable_if_t = typename enable_if::Type; template constexpr enable_if_t> bit_cast(vector V) { return __builtin_bit_cast(vector, V); } template constexpr enable_if_t bit_cast(T F) { return __builtin_bit_cast(U, F); } template struct is_arithmetic { static const bool Value = __is_arithmetic(T); }; template using HLSL_FIXED_VECTOR = vector<__detail::enable_if_t<(N > 1 && N <= 4), T>, N>; } // namespace __detail } // namespace hlsl #endif //_HLSL_HLSL_DETAILS_H_