1 /* Register names and numbers for IA64 DWARF.
2 Copyright (C) 2006 Red Hat, Inc.
3 This file is part of Red Hat elfutils.
5 Red Hat elfutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by the
7 Free Software Foundation; version 2 of the License.
9 Red Hat elfutils is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with Red Hat elfutils; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
18 Red Hat elfutils is an included package of the Open Invention Network.
19 An included package of the Open Invention Network is a package for which
20 Open Invention Network licensees cross-license their patents. No patent
21 license is granted, either expressly or impliedly, by designation as an
22 included package. Should you wish to participate in the Open Invention
23 Network licensing program, please visit www.openinventionnetwork.com
24 <http://www.openinventionnetwork.com>. */
34 #include "libebl_CPU.h"
37 ia64_register_info (Ebl *ebl __attribute__ ((unused)),
38 int regno, char *name, size_t namelen,
39 const char **prefix, const char **setname,
45 if (regno < 0 || regno > 687 + 63 || namelen < 12)
49 *setname = "application";
51 *type = DW_ATE_signed;
56 name[1] = (regno - 0) + '0';
64 name[1] = (regno - 0) / 10 + '0';
65 name[2] = (regno - 0) % 10 + '0';
74 name[2] = (regno - 100) / 10 + '0';
75 name[3] = (regno - 0) % 10 + '0';
81 case 128 + 0 ... 128 + 9:
83 name[1] = (regno - 128) + '0';
91 case 128 + 10 ... 128 + 99:
93 name[1] = (regno - 128) / 10 + '0';
94 name[2] = (regno - 128) % 10 + '0';
100 case 128 + 100 ... 128 + 127:
103 name[2] = (regno - 128 - 100) / 10 + '0';
104 name[3] = (regno - 128) % 10 + '0';
106 *type = DW_ATE_float;
112 case 320 + 0 ... 320 + 7:
114 name[1] = (regno - 320) + '0';
116 *type = DW_ATE_address;
123 static const char named_special[][5] =
125 "vfp", "vrap", "pr", "ip", "psr", "cfm"
127 *setname = "special";
129 *type = regno == 331 ? DW_ATE_address : DW_ATE_unsigned;
130 return stpcpy (name, named_special[regno - 328]) + 1 - name;
134 *setname = "special";
136 *type = DW_ATE_unsigned;
137 return stpcpy (name, "bof") + 1 - name;
139 case 334 + 0 ... 334 + 7:
142 name[2] = (regno - 334) + '0';
147 case 334 + 8 ... 334 + 127:
149 static const char named_ar[][9] =
153 [18 - 8] = "bspstore",
171 const size_t idx = regno - (334 + 8);
172 *type = DW_ATE_unsigned;
173 if (idx == 1 || idx == 2)
174 *type = DW_ATE_address;
175 if (idx < sizeof named_ar / sizeof named_ar[0]
176 && named_ar[idx][0] != '\0')
177 return stpcpy (name, named_ar[idx]) + 1 - name;
184 name[2] = (regno - 334) + '0';
188 name[2] = (regno - 334) / 10 + '0';
189 name[3] = (regno - 334) % 10 + '0';
194 name[3] = (regno - 334 - 100) / 10 + '0';
195 name[4] = (regno - 334) % 10 + '0';
203 case 462 + 0 ... 462 + 9:
207 name[3] = (regno - 462) + '0';
210 *type = DW_ATE_boolean;
215 case 462 + 10 ... 462 + 99:
219 name[3] = (regno - 462) / 10 + '0';
220 name[4] = (regno - 462) % 10 + '0';
223 *type = DW_ATE_boolean;
228 case 462 + 100 ... 462 + 127:
233 name[4] = (regno - 462 - 100) / 10 + '0';
234 name[5] = (regno - 462) % 10 + '0';
237 *type = DW_ATE_boolean;
242 case 687 + 0 ... 687 + 9:
244 name[1] = (regno - 687) + '0';
246 *setname = "predicate";
247 *type = DW_ATE_boolean;
252 case 687 + 10 ... 687 + 63:
254 name[1] = (regno - 687) / 10 + '0';
255 name[2] = (regno - 687) % 10 + '0';
257 *setname = "predicate";
258 *type = DW_ATE_boolean;
268 name[namelen++] = '\0';