1 /* Intel 387 floating point stuff.
2 Copyright (C) 1988, 1989, 1991, 1998 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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,
19 Boston, MA 02111-1307, USA. */
26 #include "floatformat.h"
28 void i387_to_double
PARAMS ((char *, char *));
30 void double_to_i387
PARAMS ((char *, char *));
32 /* FIXME: Eliminate these routines when we have the time to change all
36 i387_to_double (from
, to
)
40 floatformat_to_double (&floatformat_i387_ext
, from
, (double *) to
);
44 double_to_i387 (from
, to
)
48 floatformat_from_double (&floatformat_i387_ext
, (double *) from
, to
);
52 print_387_control_word (control
)
55 printf_unfiltered ("control %s: ", local_hex_string (control
));
56 printf_unfiltered ("compute to ");
57 switch ((control
>> 8) & 3)
60 printf_unfiltered ("24 bits; ");
63 printf_unfiltered ("(bad); ");
66 printf_unfiltered ("53 bits; ");
69 printf_unfiltered ("64 bits; ");
72 printf_unfiltered ("round ");
73 switch ((control
>> 10) & 3)
76 printf_unfiltered ("NEAREST; ");
79 printf_unfiltered ("DOWN; ");
82 printf_unfiltered ("UP; ");
85 printf_unfiltered ("CHOP; ");
90 printf_unfiltered ("mask:");
92 printf_unfiltered (" INVALID");
94 printf_unfiltered (" DENORM");
96 printf_unfiltered (" DIVZ");
98 printf_unfiltered (" OVERF");
100 printf_unfiltered (" UNDERF");
101 if (control
& 0x0020)
102 printf_unfiltered (" LOS");
103 printf_unfiltered (";");
105 printf_unfiltered ("\n");
106 if (control
& 0xe080)
107 warning ("reserved bits on: %s\n",
108 local_hex_string (control
& 0xe080));
112 print_387_status_word (status
)
115 printf_unfiltered ("status %s: ", local_hex_string (status
));
118 printf_unfiltered ("exceptions:");
120 printf_unfiltered (" INVALID");
122 printf_unfiltered (" DENORM");
124 printf_unfiltered (" DIVZ");
126 printf_unfiltered (" OVERF");
128 printf_unfiltered (" UNDERF");
130 printf_unfiltered (" LOS");
132 printf_unfiltered (" FPSTACK");
133 printf_unfiltered ("; ");
135 printf_unfiltered ("flags: %d%d%d%d; ",
136 (status
& 0x4000) != 0,
137 (status
& 0x0400) != 0,
138 (status
& 0x0200) != 0,
139 (status
& 0x0100) != 0);
141 printf_unfiltered ("top %d\n", (status
>> 11) & 7);
This page took 0.031599 seconds and 4 git commands to generate.