1 /* Register names and numbers for IA64 DWARF.
2 Copyright (C) 2006 Red Hat, Inc.
3 This file is part of elfutils.
5 This file is free software; you can redistribute it and/or modify
6 it under the terms of either
8 * the GNU Lesser General Public License as published by the Free
9 Software Foundation; either version 3 of the License, or (at
10 your option) any later version
14 * the GNU General Public License as published by the Free
15 Software Foundation; either version 2 of the License, or (at
16 your option) any later version
18 or both in parallel, as here.
20 elfutils is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received copies of the GNU General Public License and
26 the GNU Lesser General Public License along with this program. If
27 not, see <http://www.gnu.org/licenses/>. */
37 #include "libebl_CPU.h"
40 ia64_register_info (Ebl *ebl __attribute__ ((unused)),
41 int regno, char *name, size_t namelen,
42 const char **prefix, const char **setname,
48 if (regno < 0 || regno > 687 + 63 || namelen < 12)
52 *setname = "application";
54 *type = DW_ATE_signed;
59 name[1] = (regno - 0) + '0';
67 name[1] = (regno - 0) / 10 + '0';
68 name[2] = (regno - 0) % 10 + '0';
77 name[2] = (regno - 100) / 10 + '0';
78 name[3] = (regno - 0) % 10 + '0';
84 case 128 + 0 ... 128 + 9:
86 name[1] = (regno - 128) + '0';
94 case 128 + 10 ... 128 + 99:
96 name[1] = (regno - 128) / 10 + '0';
97 name[2] = (regno - 128) % 10 + '0';
103 case 128 + 100 ... 128 + 127:
106 name[2] = (regno - 128 - 100) / 10 + '0';
107 name[3] = (regno - 128) % 10 + '0';
109 *type = DW_ATE_float;
115 case 320 + 0 ... 320 + 7:
117 name[1] = (regno - 320) + '0';
119 *type = DW_ATE_address;
126 static const char named_special[][5] =
128 "vfp", "vrap", "pr", "ip", "psr", "cfm"
130 *setname = "special";
132 *type = regno == 331 ? DW_ATE_address : DW_ATE_unsigned;
133 return stpcpy (name, named_special[regno - 328]) + 1 - name;
137 *setname = "special";
139 *type = DW_ATE_unsigned;
140 return stpcpy (name, "bof") + 1 - name;
142 case 334 + 0 ... 334 + 7:
145 name[2] = (regno - 334) + '0';
150 case 334 + 8 ... 334 + 127:
152 static const char named_ar[][9] =
156 [18 - 8] = "bspstore",
174 const size_t idx = regno - (334 + 8);
175 *type = DW_ATE_unsigned;
176 if (idx == 1 || idx == 2)
177 *type = DW_ATE_address;
178 if (idx < sizeof named_ar / sizeof named_ar[0]
179 && named_ar[idx][0] != '\0')
180 return stpcpy (name, named_ar[idx]) + 1 - name;
187 name[2] = (regno - 334) + '0';
191 name[2] = (regno - 334) / 10 + '0';
192 name[3] = (regno - 334) % 10 + '0';
197 name[3] = (regno - 334 - 100) / 10 + '0';
198 name[4] = (regno - 334) % 10 + '0';
206 case 462 + 0 ... 462 + 9:
210 name[3] = (regno - 462) + '0';
213 *type = DW_ATE_boolean;
218 case 462 + 10 ... 462 + 99:
222 name[3] = (regno - 462) / 10 + '0';
223 name[4] = (regno - 462) % 10 + '0';
226 *type = DW_ATE_boolean;
231 case 462 + 100 ... 462 + 127:
236 name[4] = (regno - 462 - 100) / 10 + '0';
237 name[5] = (regno - 462) % 10 + '0';
240 *type = DW_ATE_boolean;
245 case 687 + 0 ... 687 + 9:
247 name[1] = (regno - 687) + '0';
249 *setname = "predicate";
250 *type = DW_ATE_boolean;
255 case 687 + 10 ... 687 + 63:
257 name[1] = (regno - 687) / 10 + '0';
258 name[2] = (regno - 687) % 10 + '0';
260 *setname = "predicate";
261 *type = DW_ATE_boolean;
271 name[namelen++] = '\0';