1//===----- hlsl_basic_types.h - HLSL definitions for basic types ----------===//
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_BASIC_TYPES_H_
10#define _HLSL_HLSL_BASIC_TYPES_H_
11
12namespace hlsl {
13// built-in scalar data types:
14
15#ifdef __HLSL_ENABLE_16_BIT
16// 16-bit integer.
17typedef unsigned short uint16_t;
18typedef short int16_t;
19#endif
20
21// unsigned 32-bit integer.
22typedef unsigned int uint;
23
24// 64-bit integer.
25typedef unsigned long uint64_t;
26typedef long int64_t;
27
28// built-in vector data types:
29
30#ifdef __HLSL_ENABLE_16_BIT
31typedef vector<int16_t, 2> int16_t2;
32typedef vector<int16_t, 3> int16_t3;
33typedef vector<int16_t, 4> int16_t4;
34typedef vector<uint16_t, 2> uint16_t2;
35typedef vector<uint16_t, 3> uint16_t3;
36typedef vector<uint16_t, 4> uint16_t4;
37#endif
38
39typedef vector<int, 2> int2;
40typedef vector<int, 3> int3;
41typedef vector<int, 4> int4;
42typedef vector<uint, 2> uint2;
43typedef vector<uint, 3> uint3;
44typedef vector<uint, 4> uint4;
45typedef vector<int64_t, 2> int64_t2;
46typedef vector<int64_t, 3> int64_t3;
47typedef vector<int64_t, 4> int64_t4;
48typedef vector<uint64_t, 2> uint64_t2;
49typedef vector<uint64_t, 3> uint64_t3;
50typedef vector<uint64_t, 4> uint64_t4;
51
52#ifdef __HLSL_ENABLE_16_BIT
53typedef vector<half, 2> half2;
54typedef vector<half, 3> half3;
55typedef vector<half, 4> half4;
56#endif
57
58typedef vector<float, 2> float2;
59typedef vector<float, 3> float3;
60typedef vector<float, 4> float4;
61typedef vector<double, 2> double2;
62typedef vector<double, 3> double3;
63typedef vector<double, 4> double4;
64
65} // namespace hlsl
66
67#endif //_HLSL_HLSL_BASIC_TYPES_H_
68