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 /* Directly map a 32/64bit register quantity into the sim_fpu internal
34 type ready for various arithmetic and conversion operations. */
36 INLINE_SIM_FPU (sim_fpu
) sim_fpu_32to (unsigned32 s
);
37 INLINE_SIM_FPU (sim_fpu
) sim_fpu_64to (unsigned64 s
);
39 INLINE_SIM_FPU (unsigned32
) sim_fpu_to32 (sim_fpu s
);
40 INLINE_SIM_FPU (unsigned64
) sim_fpu_to64 (sim_fpu s
);
43 /* Arrithmetic operators */
45 INLINE_SIM_FPU (sim_fpu
) sim_fpu_add (sim_fpu l
, sim_fpu r
);
46 INLINE_SIM_FPU (sim_fpu
) sim_fpu_sub (sim_fpu l
, sim_fpu r
);
47 INLINE_SIM_FPU (sim_fpu
) sim_fpu_mul (sim_fpu l
, sim_fpu r
);
48 INLINE_SIM_FPU (sim_fpu
) sim_fpu_div (sim_fpu l
, sim_fpu r
);
49 INLINE_SIM_FPU (sim_fpu
) sim_fpu_inv (sim_fpu l
);
50 INLINE_SIM_FPU (sim_fpu
) sim_fpu_sqrt (sim_fpu sqr
);
53 /* Conversion of integer value into floating point types */
55 INLINE_SIM_FPU (sim_fpu
) sim_fpu_i32to (signed32 s
);
56 INLINE_SIM_FPU (sim_fpu
) sim_fpu_u32to (unsigned32 s
);
57 INLINE_SIM_FPU (sim_fpu
) sim_fpu_i64to (signed64 s
);
58 INLINE_SIM_FPU (sim_fpu
) sim_fpu_u64to (unsigned64 s
);
61 /* Conversion of internal sim_fpu type to host float and double
62 formats - for debuging/tracing */
64 INLINE_SIM_FPU (float) sim_fpu_2f (sim_fpu f
);
65 INLINE_SIM_FPU (double) sim_fpu_2d (sim_fpu d
);
68 INLINE_SIM_FPU (sim_fpu
) sim_fpu_f2 (float f
);
69 INLINE_SIM_FPU (sim_fpu
) sim_fpu_d2 (double d
);
73 /* Signalling or NonSignalling NaN */
75 INLINE_SIM_FPU (int) sim_fpu_is_nan (sim_fpu s
);
78 /* compare l with r; return <0, ==0, >0 accordingly */
80 INLINE_SIM_FPU (int) sim_fpu_is_lt (sim_fpu l
, sim_fpu r
);
81 INLINE_SIM_FPU (int) sim_fpu_is_le (sim_fpu l
, sim_fpu r
);
82 INLINE_SIM_FPU (int) sim_fpu_is_eq (sim_fpu l
, sim_fpu r
);
83 INLINE_SIM_FPU (int) sim_fpu_is_ne (sim_fpu l
, sim_fpu r
);
84 INLINE_SIM_FPU (int) sim_fpu_is_ge (sim_fpu l
, sim_fpu r
);
85 INLINE_SIM_FPU (int) sim_fpu_is_gt (sim_fpu l
, sim_fpu r
);
This page took 0.056747 seconds and 5 git commands to generate.