OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
targ_const_private.h
Go to the documentation of this file.
1 /*
2 
3  Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of version 2 of the GNU General Public License as
7  published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it would be useful, but
10  WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13  Further, this software is distributed without any warranty that it is
14  free of the rightful claim of any third person regarding infringement
15  or the like. Any license provided herein, whether implied or
16  otherwise, applies only to this software file. Patent licenses, if
17  any, provided herein do not apply to combinations of this program with
18  other software, or any other product whatsoever.
19 
20  You should have received a copy of the GNU General Public License along
21  with this program; if not, write the Free Software Foundation, Inc., 59
22  Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 
24  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
25  Mountain View, CA 94043, or:
26 
27  http://www.sgi.com
28 
29  For further information regarding this notice, see:
30 
31  http://oss.sgi.com/projects/GenInfo/NoticeExplan
32 
33 */
34 
35 
36 /* ====================================================================
37  * ====================================================================
38  *
39  *
40  * Revision history:
41  * 10-Feb-95 - Original Version
42  *
43  * Description:
44  *
45  * Field access macros for type TCON
46  *
47  * ====================================================================
48  * ====================================================================
49  */
50 
51 #ifndef targ_const_private_INCLUDED
52 #define targ_const_private_INCLUDED
53 
54 #undef TCON_ty
55 #define TCON_ty(c) ((c).ty)
56 
57 #define TCON_v0(c) ((c).vals.ival.v0)
58 #define TCON_v1(c) ((c).vals.ival.v1)
59 #define TCON_v2(c) ((c).vals.ival.v2)
60 #define TCON_v3(c) ((c).vals.ival.v3)
61 #define TCON_iv0(c) ((c).cmplxval.ival.v0)
62 #define TCON_iv1(c) ((c).cmplxval.ival.v1)
63 #define TCON_iv2(c) ((c).cmplxval.ival.v2)
64 #define TCON_iv3(c) ((c).cmplxval.ival.v3)
65 #define TCON_u0(c) ((c).vals.uval.u0)
66 #define TCON_u1(c) ((c).vals.uval.u1)
67 #define TCON_u2(c) ((c).vals.uval.u2)
68 #define TCON_u3(c) ((c).vals.uval.u3)
69 #define TCON_I4(c) TCON_v0(c)
70 #define TCON_U4(c) TCON_u0(c)
71 #define TCON_I8(c) ((c).vals.i0)
72 #define TCON_U8(c) ((c).vals.k0)
73 
74 /* special TCON accessors for simplifier:
75  I8I4CVT and U8I4CVT are nops for MIPS III and above and are removed.
76  It is possible for kids to have a types I8, U8, I4, U4. */
77 #define TCON_I8U8I4U4(c) (MTYPE_is_signed(TCON_ty(c)) ? \
78  ((TCON_ty(c) == MTYPE_I8) ? TCON_I8(c) : TCON_I4(c)) : \
79  ((TCON_ty(c) == MTYPE_U8) ? TCON_U8(c) : TCON_U4(c)))
80 
81 #define TCON_R8(c) ((c).vals.dval)
82 #define TCON_R16(c) ((c).vals.qval)
83 
84 #define TCON_IR8(c) ((c).cmplxval.dival)
85 #define TCON_IR16(c) ((c).cmplxval.qival)
86 /* The internal representation of 32-bit floats may be double: */
87 #ifdef TCON_R4_IS_DOUBLE
88 #define TCON_R4(c) TCON_R8(c)
89 #define TCON_IR4(c) TCON_IR8(c)
90 #else
91 #define TCON_R4(c) ((c).vals.fval)
92 #define TCON_IR4(c) ((c).cmplxval.fival)
93 #endif
94 /* Complex imaginary parts */
95 
96 
97 
98 #define Set_TCON_R4(c,v) (TCON_R4(c) = v)
99 #define Set_TCON_R8(c,v) (TCON_R8(c) = v)
100 #define Set_TCON_R16(c,v) (TCON_R16(c) = v)
101 #define Set_TCON_IR4(c,v) (TCON_IR4(c) = v)
102 #define Set_TCON_IR8(c,v) (TCON_IR8(c) = v)
103 #define Set_TCON_IR16(c,v) (TCON_IR16(c) = v)
104 /* WARNING: We haven't carefully checked the implications of using
105  * doubles for 32-bit floats -- must be done if turned on.
106  */
107 
108 #define TCON_cp(c) ((c).vals.sval.cp)
109 #define TCON_len(c) ((c).vals.sval.len)
110 
111 #ifdef __cplusplus
112 extern "C" {
113 #endif
114 extern char *Targ_Append_To_Dbuf (char *, char);
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif /* targ_const_private_INCLUDED */