]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/gofast.h
host-hpux.c: Change copyright header to refer to version 3 of the GNU General Public...
[thirdparty/gcc.git] / gcc / config / gofast.h
CommitLineData
627b12bc 1/* US Software GOFAST floating point library support.
2f83c7d6 2 Copyright (C) 1994, 1998, 1999, 2002, 2003, 2004, 2007
caec2cfc 3 Free Software Foundation, Inc.
627b12bc 4
2a71dcad 5This file is part of GCC.
627b12bc 6
2a71dcad 7GCC is free software; you can redistribute it and/or modify
627b12bc 8it under the terms of the GNU General Public License as published by
2f83c7d6 9the Free Software Foundation; either version 3, or (at your option)
627b12bc
DE
10any later version.
11
2a71dcad 12GCC is distributed in the hope that it will be useful,
627b12bc
DE
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
2f83c7d6
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
627b12bc 20
627b12bc 21/* The US Software GOFAST library requires special optabs support.
c15c90bb
ZW
22 This file is intended to be included by config/ARCH/ARCH.c. It
23 defines one function, gofast_maybe_init_libfuncs, which should be
24 called from the TARGET_INIT_LIBFUNCS hook. When tm.h has defined
25 US_SOFTWARE_GOFAST, this function will adjust all the optabs and
26 libfuncs appropriately. Otherwise it will do nothing. */
27
28static void
29gofast_maybe_init_libfuncs (void)
30{
31#ifdef US_SOFTWARE_GOFAST
32 int mode;
33
34 set_optab_libfunc (add_optab, SFmode, "fpadd");
35 set_optab_libfunc (add_optab, DFmode, "dpadd");
36 set_optab_libfunc (sub_optab, SFmode, "fpsub");
37 set_optab_libfunc (sub_optab, DFmode, "dpsub");
38 set_optab_libfunc (smul_optab, SFmode, "fpmul");
39 set_optab_libfunc (smul_optab, DFmode, "dpmul");
40 set_optab_libfunc (sdiv_optab, SFmode, "fpdiv");
41 set_optab_libfunc (sdiv_optab, DFmode, "dpdiv");
42 set_optab_libfunc (cmp_optab, SFmode, "fpcmp");
43 set_optab_libfunc (cmp_optab, DFmode, "dpcmp");
44
45 /* GOFAST does not provide libfuncs for negation, so we use the
46 standard names. */
627b12bc 47
c15c90bb
ZW
48 /* GCC does not use fpcmp/dpcmp for gt or ge because its own
49 FP-emulation library returns +1 for both > and unord. So we
50 leave gt and ge unset, such that, instead of fpcmp(a,b) >[=], we
51 generate fpcmp(b,a) <[=] 0, which is unambiguous. For unord
52 libfuncs, we use our own functions, since GOFAST doesn't supply
53 them. */
627b12bc 54
c9034561
ZW
55 set_optab_libfunc (eq_optab, SFmode, "fpcmp");
56 set_optab_libfunc (ne_optab, SFmode, "fpcmp");
57 set_optab_libfunc (gt_optab, SFmode, 0);
58 set_optab_libfunc (ge_optab, SFmode, 0);
59 set_optab_libfunc (lt_optab, SFmode, "fpcmp");
60 set_optab_libfunc (le_optab, SFmode, "fpcmp");
627b12bc 61
c9034561
ZW
62 set_optab_libfunc (eq_optab, DFmode, "dpcmp");
63 set_optab_libfunc (ne_optab, DFmode, "dpcmp");
64 set_optab_libfunc (gt_optab, DFmode, 0);
65 set_optab_libfunc (ge_optab, DFmode, 0);
66 set_optab_libfunc (lt_optab, DFmode, "dpcmp");
67 set_optab_libfunc (le_optab, DFmode, "dpcmp");
627b12bc 68
85363ca0
ZW
69 set_conv_libfunc (sext_optab, DFmode, SFmode, "fptodp");
70 set_conv_libfunc (trunc_optab, SFmode, DFmode, "dptofp");
627b12bc 71
85363ca0
ZW
72 set_conv_libfunc (sfix_optab, SImode, SFmode, "fptosi");
73 set_conv_libfunc (sfix_optab, SImode, DFmode, "dptoli");
74 set_conv_libfunc (ufix_optab, SImode, SFmode, "fptoui");
75 set_conv_libfunc (ufix_optab, SImode, DFmode, "dptoul");
76
77 set_conv_libfunc (sfloat_optab, SFmode, SImode, "sitofp");
8242b64a 78 set_conv_libfunc (sfloat_optab, DFmode, SImode, "litodp");
c15c90bb
ZW
79#endif
80}