• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifdef LOAD_ALGO_PRIMARY_TYPE
17#undef LOAD_ALGO_PRIMARY_TYPE
18// NOTE: this ordering needs to be in sync with ptypesizetable[] in maplevm/src/vmfunc.cpp
19  PRIMTYPE(void)
20  PRIMTYPE(i8)
21  PRIMTYPE(i16)
22  PRIMTYPE(i32)
23  PRIMTYPE(i64)
24  PRIMTYPE(u8)
25  PRIMTYPE(u16)
26  PRIMTYPE(u32)
27  PRIMTYPE(u64)
28  PRIMTYPE(u1)
29  PRIMTYPE(ptr)
30  PRIMTYPE(ref)
31  PRIMTYPE(a64)
32  PRIMTYPE(f32)
33  PRIMTYPE(f64)
34  PRIMTYPE(dynany)
35  PRIMTYPE(unknown)
36#endif // ~LOAD_ALGO_PRIMARY_TYPE
37
38
39#ifdef LOAD_PRIMARY_TYPE_PROPERTY
40#undef LOAD_PRIMARY_TYPE_PROPERTY
41
42static const PrimitiveTypeProperty PTProperty_begin = {
43  /*type=*/PTY_begin, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
44  /*isPointer=*/false, /*isSimple=*/false
45};
46
47static const PrimitiveTypeProperty PTProperty_void = {
48  /*type=*/PTY_void, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
49  /*isPointer=*/false, /*isSimple=*/false
50};
51
52static const PrimitiveTypeProperty PTProperty_i8 = {
53  /*type=*/PTY_i8, /*isInteger=*/true, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
54  /*isPointer=*/false, /*isSimple=*/false
55};
56
57static const PrimitiveTypeProperty PTProperty_i16 = {
58  /*type=*/PTY_i16, /*isInteger=*/true, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
59  /*isPointer=*/false, /*isSimple=*/false
60};
61
62static const PrimitiveTypeProperty PTProperty_i32 = {
63  /*type=*/PTY_i32, /*isInteger=*/true, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
64  /*isPointer=*/false, /*isSimple=*/false
65};
66
67static const PrimitiveTypeProperty PTProperty_i64 = {
68  /*type=*/PTY_i64, /*isInteger=*/true, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
69  /*isPointer=*/false, /*isSimple=*/false
70};
71
72static const PrimitiveTypeProperty PTProperty_u8 = {
73  /*type=*/PTY_u8, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/false, /*isFloat=*/false,
74  /*isPointer=*/false, /*isSimple=*/false
75};
76
77static const PrimitiveTypeProperty PTProperty_u16 = {
78  /*type=*/PTY_u16, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/false, /*isFloat=*/false,
79  /*isPointer=*/false, /*isSimple=*/false
80};
81
82/* isAddress and isPointer are overloaded in getter method for PTProperty_u32 */
83static const PrimitiveTypeProperty PTProperty_u32 = {
84  /*type=*/PTY_u32, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/false, /*isFloat=*/false,
85  /*isPointer=*/false, /*isSimple=*/false
86};
87
88/* isAddress and isPointer are overloaded in getter method for PTProperty_64 */
89static const PrimitiveTypeProperty PTProperty_u64 = {
90  /*type=*/PTY_u64, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/true, /*isFloat=*/false,
91  /*isPointer=*/true, /*isSimple=*/false,
92};
93
94static const PrimitiveTypeProperty PTProperty_u1 = {
95  /*type=*/PTY_u1, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/false, /*isFloat=*/false,
96  /*isPointer=*/false, /*isSimple=*/false
97};
98
99static const PrimitiveTypeProperty PTProperty_ptr = {
100  /*type=*/PTY_ptr, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/true, /*isFloat=*/false,
101  /*isPointer=*/true, /*isSimple=*/false
102};
103
104static const PrimitiveTypeProperty PTProperty_ref = {
105  /*type=*/PTY_ref, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/true, /*isFloat=*/false,
106  /*isPointer=*/true, /*isSimple=*/false
107};
108
109static const PrimitiveTypeProperty PTProperty_a64 = {
110  /*type=*/PTY_a64, /*isInteger=*/true, /*isUnsigned=*/true, /*isAddress=*/true, /*isFloat=*/false,
111  /*isPointer=*/true, /*isSimple=*/false
112};
113
114static const PrimitiveTypeProperty PTProperty_f32 = {
115  /*type=*/PTY_f32, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/true,
116  /*isPointer=*/false, /*isSimple=*/false
117};
118
119static const PrimitiveTypeProperty PTProperty_f64 = {
120  /*type=*/PTY_f64, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/true,
121  /*isPointer=*/false, /*isSimple=*/false
122};
123
124static const PrimitiveTypeProperty PTProperty_dynany = {
125  /*type=*/PTY_dynany, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
126  /*isPointer=*/false, /*isSimple=*/false
127};
128
129static const PrimitiveTypeProperty PTProperty_unknown = {
130  /*type=*/PTY_unknown, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
131  /*isPointer=*/false, /*isSimple=*/false
132};
133
134static const PrimitiveTypeProperty PTProperty_end = {
135  /*type=*/PTY_end, /*isInteger=*/false, /*isUnsigned=*/false, /*isAddress=*/false, /*isFloat=*/false,
136  /*isPointer=*/false, /*isSimple=*/false
137};
138
139#endif // ~LOAD_PRIMARY_TYPE_PROPERTY
140