1 /* Copyright (C) 2018-2022 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #include "gdbsupport/tdesc.h"
20 /* This function is NOT auto generated from xml. Create the aarch64 with SVE
21 feature into RESULT, where SCALE is the number of 128 bit chunks in a Z
25 create_feature_aarch64_sve (struct target_desc
*result
, long regnum
,
28 struct tdesc_feature
*feature
;
29 tdesc_type
*element_type
, *field_type
;
30 tdesc_type_with_fields
*type_with_fields
;
32 feature
= tdesc_create_feature (result
, "org.gnu.gdb.aarch64.sve");
34 element_type
= tdesc_named_type (feature
, "uint128");
35 tdesc_create_vector (feature
, "svevqu", element_type
, scale
);
37 element_type
= tdesc_named_type (feature
, "int128");
38 tdesc_create_vector (feature
, "svevqs", element_type
, scale
);
40 element_type
= tdesc_named_type (feature
, "ieee_double");
41 tdesc_create_vector (feature
, "svevdf", element_type
, 2 * scale
);
43 element_type
= tdesc_named_type (feature
, "uint64");
44 tdesc_create_vector (feature
, "svevdu", element_type
, 2 * scale
);
46 element_type
= tdesc_named_type (feature
, "int64");
47 tdesc_create_vector (feature
, "svevds", element_type
, 2 * scale
);
49 element_type
= tdesc_named_type (feature
, "ieee_single");
50 tdesc_create_vector (feature
, "svevsf", element_type
, 4 * scale
);
52 element_type
= tdesc_named_type (feature
, "uint32");
53 tdesc_create_vector (feature
, "svevsu", element_type
, 4 * scale
);
55 element_type
= tdesc_named_type (feature
, "int32");
56 tdesc_create_vector (feature
, "svevss", element_type
, 4 * scale
);
58 element_type
= tdesc_named_type (feature
, "ieee_half");
59 tdesc_create_vector (feature
, "svevhf", element_type
, 8 * scale
);
61 element_type
= tdesc_named_type (feature
, "uint16");
62 tdesc_create_vector (feature
, "svevhu", element_type
, 8 * scale
);
64 element_type
= tdesc_named_type (feature
, "int16");
65 tdesc_create_vector (feature
, "svevhs", element_type
, 8 * scale
);
67 element_type
= tdesc_named_type (feature
, "uint8");
68 tdesc_create_vector (feature
, "svevbu", element_type
, 16 * scale
);
70 element_type
= tdesc_named_type (feature
, "int8");
71 tdesc_create_vector (feature
, "svevbs", element_type
, 16 * scale
);
73 type_with_fields
= tdesc_create_union (feature
, "svevnq");
74 field_type
= tdesc_named_type (feature
, "svevqu");
75 tdesc_add_field (type_with_fields
, "u", field_type
);
76 field_type
= tdesc_named_type (feature
, "svevqs");
77 tdesc_add_field (type_with_fields
, "s", field_type
);
79 type_with_fields
= tdesc_create_union (feature
, "svevnd");
80 field_type
= tdesc_named_type (feature
, "svevdf");
81 tdesc_add_field (type_with_fields
, "f", field_type
);
82 field_type
= tdesc_named_type (feature
, "svevdu");
83 tdesc_add_field (type_with_fields
, "u", field_type
);
84 field_type
= tdesc_named_type (feature
, "svevds");
85 tdesc_add_field (type_with_fields
, "s", field_type
);
87 type_with_fields
= tdesc_create_union (feature
, "svevns");
88 field_type
= tdesc_named_type (feature
, "svevsf");
89 tdesc_add_field (type_with_fields
, "f", field_type
);
90 field_type
= tdesc_named_type (feature
, "svevsu");
91 tdesc_add_field (type_with_fields
, "u", field_type
);
92 field_type
= tdesc_named_type (feature
, "svevss");
93 tdesc_add_field (type_with_fields
, "s", field_type
);
95 type_with_fields
= tdesc_create_union (feature
, "svevnh");
96 field_type
= tdesc_named_type (feature
, "svevhf");
97 tdesc_add_field (type_with_fields
, "f", field_type
);
98 field_type
= tdesc_named_type (feature
, "svevhu");
99 tdesc_add_field (type_with_fields
, "u", field_type
);
100 field_type
= tdesc_named_type (feature
, "svevhs");
101 tdesc_add_field (type_with_fields
, "s", field_type
);
103 type_with_fields
= tdesc_create_union (feature
, "svevnb");
104 field_type
= tdesc_named_type (feature
, "svevbu");
105 tdesc_add_field (type_with_fields
, "u", field_type
);
106 field_type
= tdesc_named_type (feature
, "svevbs");
107 tdesc_add_field (type_with_fields
, "s", field_type
);
109 type_with_fields
= tdesc_create_union (feature
, "svev");
110 field_type
= tdesc_named_type (feature
, "svevnq");
111 tdesc_add_field (type_with_fields
, "q", field_type
);
112 field_type
= tdesc_named_type (feature
, "svevnd");
113 tdesc_add_field (type_with_fields
, "d", field_type
);
114 field_type
= tdesc_named_type (feature
, "svevns");
115 tdesc_add_field (type_with_fields
, "s", field_type
);
116 field_type
= tdesc_named_type (feature
, "svevnh");
117 tdesc_add_field (type_with_fields
, "h", field_type
);
118 field_type
= tdesc_named_type (feature
, "svevnb");
119 tdesc_add_field (type_with_fields
, "b", field_type
);
121 field_type
= tdesc_named_type (feature
, "uint8");
122 tdesc_create_vector (feature
, "svep", field_type
, 2 * scale
);
124 tdesc_create_reg (feature
, "z0", regnum
++, 1, NULL
, 128 * scale
, "svev");
125 tdesc_create_reg (feature
, "z1", regnum
++, 1, NULL
, 128 * scale
, "svev");
126 tdesc_create_reg (feature
, "z2", regnum
++, 1, NULL
, 128 * scale
, "svev");
127 tdesc_create_reg (feature
, "z3", regnum
++, 1, NULL
, 128 * scale
, "svev");
128 tdesc_create_reg (feature
, "z4", regnum
++, 1, NULL
, 128 * scale
, "svev");
129 tdesc_create_reg (feature
, "z5", regnum
++, 1, NULL
, 128 * scale
, "svev");
130 tdesc_create_reg (feature
, "z6", regnum
++, 1, NULL
, 128 * scale
, "svev");
131 tdesc_create_reg (feature
, "z7", regnum
++, 1, NULL
, 128 * scale
, "svev");
132 tdesc_create_reg (feature
, "z8", regnum
++, 1, NULL
, 128 * scale
, "svev");
133 tdesc_create_reg (feature
, "z9", regnum
++, 1, NULL
, 128 * scale
, "svev");
134 tdesc_create_reg (feature
, "z10", regnum
++, 1, NULL
, 128 * scale
, "svev");
135 tdesc_create_reg (feature
, "z11", regnum
++, 1, NULL
, 128 * scale
, "svev");
136 tdesc_create_reg (feature
, "z12", regnum
++, 1, NULL
, 128 * scale
, "svev");
137 tdesc_create_reg (feature
, "z13", regnum
++, 1, NULL
, 128 * scale
, "svev");
138 tdesc_create_reg (feature
, "z14", regnum
++, 1, NULL
, 128 * scale
, "svev");
139 tdesc_create_reg (feature
, "z15", regnum
++, 1, NULL
, 128 * scale
, "svev");
140 tdesc_create_reg (feature
, "z16", regnum
++, 1, NULL
, 128 * scale
, "svev");
141 tdesc_create_reg (feature
, "z17", regnum
++, 1, NULL
, 128 * scale
, "svev");
142 tdesc_create_reg (feature
, "z18", regnum
++, 1, NULL
, 128 * scale
, "svev");
143 tdesc_create_reg (feature
, "z19", regnum
++, 1, NULL
, 128 * scale
, "svev");
144 tdesc_create_reg (feature
, "z20", regnum
++, 1, NULL
, 128 * scale
, "svev");
145 tdesc_create_reg (feature
, "z21", regnum
++, 1, NULL
, 128 * scale
, "svev");
146 tdesc_create_reg (feature
, "z22", regnum
++, 1, NULL
, 128 * scale
, "svev");
147 tdesc_create_reg (feature
, "z23", regnum
++, 1, NULL
, 128 * scale
, "svev");
148 tdesc_create_reg (feature
, "z24", regnum
++, 1, NULL
, 128 * scale
, "svev");
149 tdesc_create_reg (feature
, "z25", regnum
++, 1, NULL
, 128 * scale
, "svev");
150 tdesc_create_reg (feature
, "z26", regnum
++, 1, NULL
, 128 * scale
, "svev");
151 tdesc_create_reg (feature
, "z27", regnum
++, 1, NULL
, 128 * scale
, "svev");
152 tdesc_create_reg (feature
, "z28", regnum
++, 1, NULL
, 128 * scale
, "svev");
153 tdesc_create_reg (feature
, "z29", regnum
++, 1, NULL
, 128 * scale
, "svev");
154 tdesc_create_reg (feature
, "z30", regnum
++, 1, NULL
, 128 * scale
, "svev");
155 tdesc_create_reg (feature
, "z31", regnum
++, 1, NULL
, 128 * scale
, "svev");
156 tdesc_create_reg (feature
, "fpsr", regnum
++, 1, NULL
, 32, "int");
157 tdesc_create_reg (feature
, "fpcr", regnum
++, 1, NULL
, 32, "int");
158 tdesc_create_reg (feature
, "p0", regnum
++, 1, NULL
, 16 * scale
, "svep");
159 tdesc_create_reg (feature
, "p1", regnum
++, 1, NULL
, 16 * scale
, "svep");
160 tdesc_create_reg (feature
, "p2", regnum
++, 1, NULL
, 16 * scale
, "svep");
161 tdesc_create_reg (feature
, "p3", regnum
++, 1, NULL
, 16 * scale
, "svep");
162 tdesc_create_reg (feature
, "p4", regnum
++, 1, NULL
, 16 * scale
, "svep");
163 tdesc_create_reg (feature
, "p5", regnum
++, 1, NULL
, 16 * scale
, "svep");
164 tdesc_create_reg (feature
, "p6", regnum
++, 1, NULL
, 16 * scale
, "svep");
165 tdesc_create_reg (feature
, "p7", regnum
++, 1, NULL
, 16 * scale
, "svep");
166 tdesc_create_reg (feature
, "p8", regnum
++, 1, NULL
, 16 * scale
, "svep");
167 tdesc_create_reg (feature
, "p9", regnum
++, 1, NULL
, 16 * scale
, "svep");
168 tdesc_create_reg (feature
, "p10", regnum
++, 1, NULL
, 16 * scale
, "svep");
169 tdesc_create_reg (feature
, "p11", regnum
++, 1, NULL
, 16 * scale
, "svep");
170 tdesc_create_reg (feature
, "p12", regnum
++, 1, NULL
, 16 * scale
, "svep");
171 tdesc_create_reg (feature
, "p13", regnum
++, 1, NULL
, 16 * scale
, "svep");
172 tdesc_create_reg (feature
, "p14", regnum
++, 1, NULL
, 16 * scale
, "svep");
173 tdesc_create_reg (feature
, "p15", regnum
++, 1, NULL
, 16 * scale
, "svep");
174 tdesc_create_reg (feature
, "ffr", regnum
++, 1, NULL
, 16 * scale
, "svep");
175 tdesc_create_reg (feature
, "vg", regnum
++, 1, NULL
, 64, "int");