Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gdb / gdb / config / i386 / tm-i386aix.h
1 /* Macro defintions for IBM AIX PS/2 (i386).
2    Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19
20 /* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com).  */
21
22 #ifndef TM_I386AIX_H
23 #define TM_I386AIX_H 1
24
25 #include "i386/tm-i386.h"
26 #include <sys/reg.h>
27
28 #ifndef I386
29 # define I386 1
30 #endif
31 #ifndef I386_AIX_TARGET
32 # define I386_AIX_TARGET 1
33 #endif
34
35 /* Nonzero if register N requires conversion
36    from raw format to virtual format.  */
37
38 #undef  REGISTER_CONVERTIBLE
39 #define REGISTER_CONVERTIBLE(N) \
40   ((N < FP0_REGNUM) ? 0 : 1)
41
42 /* Convert data from raw format for register REGNUM in buffer FROM
43    to virtual format with type TYPE in buffer TO.  */
44
45 #undef REGISTER_CONVERT_TO_VIRTUAL
46 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
47 { \
48   double val; \
49   i387_to_double ((FROM), (char *)&val); \
50   store_floating ((TO), TYPE_LENGTH (TYPE), val); \
51 }
52 extern void
53 i387_to_double PARAMS ((char *, char *));
54
55 /* Convert data from virtual format with type TYPE in buffer FROM
56    to raw format for register REGNUM in buffer TO.  */
57
58 #undef REGISTER_CONVERT_TO_RAW
59 #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
60 { \
61   double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
62   double_to_i387((char *)&val, (TO)); \
63 }
64 extern void
65 double_to_i387 PARAMS ((char *, char *));
66
67 #endif /* TM_I386AIX_H */