Update copyrights.
[gcc.git] / gcc / config / pa / long_double.h
1 /* Definitions of long double support for GNU compiler.
2 Copyright (C) 2000 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC 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, or (at your option)
9 any later version.
10
11 GNU CC 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 GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #define LONG_DOUBLE_TYPE_SIZE 128
22
23 #undef ASM_OUTPUT_LONG_DOUBLE
24 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
25 do { long value[4]; \
26 REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
27 fprintf((FILE), "%s\t0x%x\n", "\t.word", value[0]); \
28 fprintf((FILE), "%s\t0x%x\n", "\t.word", value[1]); \
29 fprintf((FILE), "%s\t0x%x\n", "\t.word", value[2]); \
30 fprintf((FILE), "%s\t0x%x\n", "\t.word", value[3]); \
31 } while (0)
32
33
34 /* Define library calls for quad FP operations. These are all part of the
35 PA32 and PA64 ABIs. */
36 #define ADDTF3_LIBCALL "_U_Qfadd"
37 #define SUBTF3_LIBCALL "_U_Qfsub"
38 #define MULTF3_LIBCALL "_U_Qfmpy"
39 #define DIVTF3_LIBCALL "_U_Qfdiv"
40 #define NEGTF2_LIBCALL "_U_Qfneg"
41 #define SQRTTF2_LIBCALL "_U_Qfsqrt"
42 #define ABSTF2_LIBCALL "_U_Qfabs"
43 #define SMINTF3_LIBCALL "_U_Qfmin"
44 #define SMAXTF3_LIBCALL "_U_Qfmax"
45 #define EXTENDSFTF2_LIBCALL "_U_Qfcnvff_sgl_to_quad"
46 #define EXTENDDFTF2_LIBCALL "_U_Qfcnvff_dbl_to_quad"
47 #define TRUNCTFSF2_LIBCALL "_U_Qfcnvff_quad_to_sgl"
48 #define TRUNCTFDF2_LIBCALL "_U_Qfcnvff_quad_to_dbl"
49 #define FLOATSITF2_LIBCALL "_U_Qfcnvxf_sgl_to_quad"
50 #define FLOATDITF2_LIBCALL "_U_Qfcnvxf_dbl_to_quad"
51 /* We need to put a wrapper function around _U_Qfcnvfxt_quad_to_sgl so that
52 we can massage its return value for PA64. */
53 #define FIX_TRUNCTFSI2_LIBCALL \
54 (TARGET_64BIT ? "__U_Qfcnvfxt_quad_to_sgl" : "_U_Qfcnvfxt_quad_to_sgl")
55 #define FIX_TRUNCTFDI2_LIBCALL "_U_Qfcnvfxt_quad_to_dbl"
56 #define EQTF2_LIBCALL "_U_Qfeq"
57 #define NETF2_LIBCALL "_U_Qfne"
58 #define GTTF2_LIBCALL "_U_Qfgt"
59 #define GETF2_LIBCALL "_U_Qfge"
60 #define LTTF2_LIBCALL "_U_Qflt"
61 #define LETF2_LIBCALL "_U_Qfle"
62
63
64 #define INIT_TARGET_OPTABS \
65 do { \
66 add_optab->handlers[(int) TFmode].libfunc \
67 = gen_rtx_SYMBOL_REF (Pmode, ADDTF3_LIBCALL); \
68 sub_optab->handlers[(int) TFmode].libfunc \
69 = gen_rtx_SYMBOL_REF (Pmode, SUBTF3_LIBCALL); \
70 smul_optab->handlers[(int) TFmode].libfunc \
71 = gen_rtx_SYMBOL_REF (Pmode, MULTF3_LIBCALL); \
72 flodiv_optab->handlers[(int) TFmode].libfunc \
73 = gen_rtx_SYMBOL_REF (Pmode, DIVTF3_LIBCALL); \
74 smin_optab->handlers[(int) TFmode].libfunc \
75 = gen_rtx_SYMBOL_REF (Pmode, SMINTF3_LIBCALL); \
76 smax_optab->handlers[(int) TFmode].libfunc \
77 = gen_rtx_SYMBOL_REF (Pmode, SMAXTF3_LIBCALL); \
78 sqrt_optab->handlers[(int) TFmode].libfunc \
79 = gen_rtx_SYMBOL_REF (Pmode, SQRTTF2_LIBCALL); \
80 abs_optab->handlers[(int) TFmode].libfunc \
81 = gen_rtx_SYMBOL_REF (Pmode, ABSTF2_LIBCALL); \
82 neg_optab->handlers[(int) TFmode].libfunc \
83 = gen_rtx_SYMBOL_REF (Pmode, NEGTF2_LIBCALL); \
84 extendsftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EXTENDSFTF2_LIBCALL); \
85 extenddftf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EXTENDDFTF2_LIBCALL); \
86 trunctfsf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, TRUNCTFSF2_LIBCALL); \
87 trunctfdf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, TRUNCTFDF2_LIBCALL); \
88 floatsitf_libfunc = gen_rtx_SYMBOL_REF (Pmode, FLOATSITF2_LIBCALL); \
89 floatditf_libfunc = gen_rtx_SYMBOL_REF (Pmode, FLOATDITF2_LIBCALL); \
90 fixtfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL);\
91 fixtfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL);\
92 fixunstfsi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFSI2_LIBCALL); \
93 fixunstfdi_libfunc = gen_rtx_SYMBOL_REF (Pmode, FIX_TRUNCTFDI2_LIBCALL); \
94 eqtf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, EQTF2_LIBCALL); \
95 netf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, NETF2_LIBCALL); \
96 gttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, GTTF2_LIBCALL); \
97 getf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, GETF2_LIBCALL); \
98 lttf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, LTTF2_LIBCALL); \
99 letf2_libfunc = gen_rtx_SYMBOL_REF (Pmode, LETF2_LIBCALL); \
100 INIT_SUBTARGET_OPTABS; \
101 } while (0)
102
103 /* This is meant to be redefined in the host dependent files */
104 #define INIT_SUBTARGET_OPTABS
105
106 /* Nonzero if a floating point comparison library call for
107 mode MODE that will return a boolean value. Zero if one
108 of the libgcc2 functions is used. */
109 #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)