clang
20.0.0git
lib
Headers
hlsl
hlsl_detail.h
Go to the documentation of this file.
1
//===----- detail.h - HLSL definitions for intrinsics ----------===//
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
#ifndef _HLSL_HLSL_DETAILS_H_
10
#define _HLSL_HLSL_DETAILS_H_
11
12
namespace
hlsl
{
13
14
namespace
__detail {
15
16
template
<
bool
B,
typename
T>
struct
enable_if
{};
17
18
template
<
typename
T>
struct
enable_if
<
true
, T> {
19
using
Type
= T;
20
};
21
22
template
<
bool
B,
class
T =
void
>
23
using
enable_if_t
=
typename
enable_if<B, T>::Type
;
24
25
template
<
typename
U,
typename
T,
int
N>
26
constexpr
enable_if_t
<
sizeof
(
U
) ==
sizeof
(T), vector<U, N>>
27
bit_cast
(vector<T, N>
V
) {
28
return
__builtin_bit_cast(vector<U, N>,
V
);
29
}
30
31
template
<
typename
U,
typename
T>
32
constexpr
enable_if_t
<
sizeof
(
U
) ==
sizeof
(T),
U
>
bit_cast
(T F) {
33
return
__builtin_bit_cast(
U
, F);
34
}
35
36
}
// namespace __detail
37
}
// namespace hlsl
38
#endif
//_HLSL_HLSL_DETAILS_H_
V
#define V(N, I)
Definition:
ASTContext.h:3443
U
hlsl::__detail::enable_if_t
typename enable_if< B, T >::Type enable_if_t
Definition:
hlsl_detail.h:23
hlsl::__detail::bit_cast
constexpr enable_if_t< sizeof(U)==sizeof(T), vector< U, N > > bit_cast(vector< T, N > V)
Definition:
hlsl_detail.h:27
hlsl
Definition:
hlsl_basic_types.h:12
true
#define true
Definition:
stdbool.h:25
hlsl::__detail::enable_if< true, T >::Type
T Type
Definition:
hlsl_detail.h:19
hlsl::__detail::enable_if
Definition:
hlsl_detail.h:16
Generated on Fri Dec 20 2024 17:42:42 for clang by
1.9.6