1 /* Register names and numbers for S/390 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"
57 s390_register_info (Ebl *ebl __attribute__ ((unused)),
58 int regno, char *name, size_t namelen,
59 const char **prefix, const char **setname,
65 if (regno < 0 || regno > 65 || namelen < 7)
70 *bits = ebl->class == ELFCLASS64 ? 64 : 32;
71 *type = DW_ATE_unsigned;
75 *type = DW_ATE_signed;
83 else if (regno < 48 || regno > 63)
95 name[1] = regno + '0';
102 name[2] = regno - 10 + '0';
108 regno = (regno & 8) | ((regno & 4) >> 2) | ((regno & 3) << 1);
113 name[namelen++] = '1';
115 name[namelen++] = regno + '0';
118 case 32 + 0 ... 32 + 9:
119 case 48 + 0 ... 48 + 9:
120 name[0] = regno < 48 ? 'c' : 'a';
121 name[1] = (regno & 15) + '0';
125 case 32 + 10 ... 32 + 15:
126 case 48 + 10 ... 48 + 15:
127 name[0] = regno < 48 ? 'c' : 'a';
129 name[2] = (regno & 15) - 10 + '0';
134 return stpcpy (name, "pswm") + 1 - name;
136 *type = DW_ATE_address;
137 return stpcpy (name, "pswa") + 1 - name;
144 name[namelen++] = '\0';