1 /* Register names and numbers for TILE-Gx DWARF.
2 Copyright (C) 2012 Tilera Corporation
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 #define BACKEND tilegx_
38 #include "libebl_CPU.h"
41 tilegx_register_info (Ebl *ebl __attribute__ ((unused)),
42 int regno, char *name, size_t namelen,
43 const char **prefix, const char **setname,
49 if (regno < 0 || regno > 64 || namelen < 5)
59 *type = DW_ATE_signed;
61 name[1] = regno + '0';
66 *type = DW_ATE_signed;
68 name[1] = regno / 10 + '0';
69 name[2] = regno % 10 + '0';
74 *type = DW_ATE_address;
75 return stpcpy (name, "tp") + 1 - name;
78 *type = DW_ATE_address;
79 return stpcpy (name, "sp") + 1 - name;
82 *type = DW_ATE_address;
83 return stpcpy (name, "lr") + 1 - name;
86 *type = DW_ATE_unsigned;
87 return stpcpy (name, "sn") + 1 - name;
90 *type = DW_ATE_unsigned;
91 return stpcpy (name, "idn0") + 1 - name;
94 *type = DW_ATE_unsigned;
95 return stpcpy (name, "idn1") + 1 - name;
98 *type = DW_ATE_unsigned;
99 return stpcpy (name, "udn0") + 1 - name;
102 *type = DW_ATE_unsigned;
103 return stpcpy (name, "udn1") + 1 - name;
106 *type = DW_ATE_unsigned;
107 return stpcpy (name, "udn2") + 1 - name;
110 *type = DW_ATE_unsigned;
111 return stpcpy (name, "udn3") + 1 - name;
114 *type = DW_ATE_unsigned;
115 return stpcpy (name, "zero") + 1 - name;
118 *type = DW_ATE_address;
119 return stpcpy (name, "pc") + 1 - name;
127 name[namelen++] = '\0';