1 /* Simulator Floating-point support.
2 Copyright (C) 1997 Free Software Foundation, Inc.
3 Contributed by Cygnus Support.
5 This file is part of GDB, the GNU debugger.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 /* the FPU intermediate type */
28 typedef struct _sim_fpu {
33 /* Arrithmetic operators */
35 INLINE_SIM_FPU (sim_fpu) sim_fpu_add (sim_fpu l, sim_fpu r);
36 INLINE_SIM_FPU (sim_fpu) sim_fpu_sub (sim_fpu l, sim_fpu r);
37 INLINE_SIM_FPU (sim_fpu) sim_fpu_mul (sim_fpu l, sim_fpu r);
38 INLINE_SIM_FPU (sim_fpu) sim_fpu_div (sim_fpu l, sim_fpu r);
39 INLINE_SIM_FPU (sim_fpu) sim_fpu_inv (sim_fpu l);
40 INLINE_SIM_FPU (sim_fpu) sim_fpu_sqrt (sim_fpu sqr);
43 /* Conversions single/double to/from fpu type */
45 INLINE_SIM_FPU (sim_fpu) sim_fpu_32to (unsigned32 s);
46 INLINE_SIM_FPU (sim_fpu) sim_fpu_64to (unsigned64 s);
48 INLINE_SIM_FPU (unsigned32) sim_fpu_to32 (sim_fpu s);
49 INLINE_SIM_FPU (unsigned64) sim_fpu_to64 (sim_fpu s);
51 INLINE_SIM_FPU (float) sim_fpu_2f (sim_fpu f);
52 INLINE_SIM_FPU (double) sim_fpu_2d (sim_fpu d);
54 INLINE_SIM_FPU (sim_fpu) sim_fpu_f2 (float f);
55 INLINE_SIM_FPU (sim_fpu) sim_fpu_d2 (double d);
58 /* Signalling or NonSignalling NaN */
60 INLINE_SIM_FPU (int) sim_fpu_is_nan (sim_fpu s);
63 /* compare l with r; return <0, ==0, >0 accordingly */
65 INLINE_SIM_FPU (int) sim_fpu_cmp (sim_fpu l, sim_fpu r);