1 /* Register names and numbers for Alpha DWARF.
2 Copyright (C) 2007 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/>. */
36 #define BACKEND alpha_
37 #include "libebl_CPU.h"
40 alpha_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 > 66 || namelen < 7)
54 *type = DW_ATE_signed;
56 if (regno >= 32 && regno < 64)
72 name[1] = regno - 1 + '0';
78 name[1] = regno - 9 + '0';
84 name[1] = regno - 16 + '0';
90 name[1] = regno - 22 + '8';
97 name[2] = regno - 24 + '0';
102 *type = DW_ATE_address;
103 return stpcpy (name, "ra") + 1 - name;
106 return stpcpy (name, "t12") + 1 - name;
109 return stpcpy (name, "at") + 1 - name;
112 *type = DW_ATE_address;
113 return stpcpy (name, "gp") + 1 - name;
116 *type = DW_ATE_address;
117 return stpcpy (name, "sp") + 1 - name;
120 return stpcpy (name, "zero") + 1 - name;
124 name[1] = regno - 32 + '0';
128 case 32 + 10 ... 32 + 19:
131 name[2] = regno - 32 - 10 + '0';
135 case 32 + 20 ... 32 + 29:
138 name[2] = regno - 32 - 20 + '0';
143 return stpcpy (name, "f30") + 1 - name;
146 *type = DW_ATE_unsigned;
147 return stpcpy (name, "fpcr") + 1 - name;
150 *type = DW_ATE_address;
151 return stpcpy (name, "pc") + 1 - name;
154 *type = DW_ATE_address;
155 return stpcpy (name, "unique") + 1 - name;
162 name[namelen++] = '\0';