1*e4b17023SJohn Marino/* This file contains the definitions and documentation for the 2*e4b17023SJohn Marino tree codes used in GCC. 3*e4b17023SJohn Marino Copyright (C) 1987, 1988, 1993, 1995, 1997, 1998, 2000, 2001, 2004, 2005, 4*e4b17023SJohn Marino 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 5*e4b17023SJohn Marino 6*e4b17023SJohn MarinoThis file is part of GCC. 7*e4b17023SJohn Marino 8*e4b17023SJohn MarinoGCC is free software; you can redistribute it and/or modify it under 9*e4b17023SJohn Marinothe terms of the GNU General Public License as published by the Free 10*e4b17023SJohn MarinoSoftware Foundation; either version 3, or (at your option) any later 11*e4b17023SJohn Marinoversion. 12*e4b17023SJohn Marino 13*e4b17023SJohn MarinoGCC is distributed in the hope that it will be useful, but WITHOUT ANY 14*e4b17023SJohn MarinoWARRANTY; without even the implied warranty of MERCHANTABILITY or 15*e4b17023SJohn MarinoFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16*e4b17023SJohn Marinofor more details. 17*e4b17023SJohn Marino 18*e4b17023SJohn MarinoYou should have received a copy of the GNU General Public License 19*e4b17023SJohn Marinoalong with GCC; see the file COPYING3. If not see 20*e4b17023SJohn Marino<http://www.gnu.org/licenses/>. */ 21*e4b17023SJohn Marino 22*e4b17023SJohn Marino 23*e4b17023SJohn Marino/* For tcc_references, tcc_expression, tcc_comparison, tcc_unary, 24*e4b17023SJohn Marino tcc_binary, and tcc_statement nodes, which use struct tree_exp, the 25*e4b17023SJohn Marino 4th element is the number of argument slots to allocate. This 26*e4b17023SJohn Marino determines the size of the tree node object. Other nodes use 27*e4b17023SJohn Marino different structures, and the size is determined by the tree_union 28*e4b17023SJohn Marino member structure; the 4th element should be zero. Languages that 29*e4b17023SJohn Marino define language-specific tcc_exceptional or tcc_constant codes must 30*e4b17023SJohn Marino define the tree_size langhook to say how big they are. 31*e4b17023SJohn Marino 32*e4b17023SJohn Marino These tree codes have been sorted so that the macros in tree.h that 33*e4b17023SJohn Marino check for various tree codes are optimized into range checks. This 34*e4b17023SJohn Marino gives a measurable performance improvement. When adding a new 35*e4b17023SJohn Marino code, consider its placement in relation to the other codes. */ 36*e4b17023SJohn Marino 37*e4b17023SJohn Marino/* Any erroneous construct is parsed into a node of this type. 38*e4b17023SJohn Marino This type of node is accepted without complaint in all contexts 39*e4b17023SJohn Marino by later parsing activities, to avoid multiple error messages 40*e4b17023SJohn Marino for one error. 41*e4b17023SJohn Marino No fields in these nodes are used except the TREE_CODE. */ 42*e4b17023SJohn MarinoDEFTREECODE (ERROR_MARK, "error_mark", tcc_exceptional, 0) 43*e4b17023SJohn Marino 44*e4b17023SJohn Marino/* Used to represent a name (such as, in the DECL_NAME of a decl node). 45*e4b17023SJohn Marino Internally it looks like a STRING_CST node. 46*e4b17023SJohn Marino There is only one IDENTIFIER_NODE ever made for any particular name. 47*e4b17023SJohn Marino Use `get_identifier' to get it (or create it, the first time). */ 48*e4b17023SJohn MarinoDEFTREECODE (IDENTIFIER_NODE, "identifier_node", tcc_exceptional, 0) 49*e4b17023SJohn Marino 50*e4b17023SJohn Marino/* Has the TREE_VALUE and TREE_PURPOSE fields. */ 51*e4b17023SJohn Marino/* These nodes are made into lists by chaining through the 52*e4b17023SJohn Marino TREE_CHAIN field. The elements of the list live in the 53*e4b17023SJohn Marino TREE_VALUE fields, while TREE_PURPOSE fields are occasionally 54*e4b17023SJohn Marino used as well to get the effect of Lisp association lists. */ 55*e4b17023SJohn MarinoDEFTREECODE (TREE_LIST, "tree_list", tcc_exceptional, 0) 56*e4b17023SJohn Marino 57*e4b17023SJohn Marino/* These nodes contain an array of tree nodes. */ 58*e4b17023SJohn MarinoDEFTREECODE (TREE_VEC, "tree_vec", tcc_exceptional, 0) 59*e4b17023SJohn Marino 60*e4b17023SJohn Marino/* A symbol binding block. These are arranged in a tree, 61*e4b17023SJohn Marino where the BLOCK_SUBBLOCKS field contains a chain of subblocks 62*e4b17023SJohn Marino chained through the BLOCK_CHAIN field. 63*e4b17023SJohn Marino BLOCK_SUPERCONTEXT points to the parent block. 64*e4b17023SJohn Marino For a block which represents the outermost scope of a function, it 65*e4b17023SJohn Marino points to the FUNCTION_DECL node. 66*e4b17023SJohn Marino BLOCK_VARS points to a chain of decl nodes. 67*e4b17023SJohn Marino BLOCK_CHAIN points to the next BLOCK at the same level. 68*e4b17023SJohn Marino BLOCK_ABSTRACT_ORIGIN points to the original (abstract) tree node which 69*e4b17023SJohn Marino this block is an instance of, or else is NULL to indicate that this 70*e4b17023SJohn Marino block is not an instance of anything else. When non-NULL, the value 71*e4b17023SJohn Marino could either point to another BLOCK node or it could point to a 72*e4b17023SJohn Marino FUNCTION_DECL node (e.g. in the case of a block representing the 73*e4b17023SJohn Marino outermost scope of a particular inlining of a function). 74*e4b17023SJohn Marino BLOCK_ABSTRACT is nonzero if the block represents an abstract 75*e4b17023SJohn Marino instance of a block (i.e. one which is nested within an abstract 76*e4b17023SJohn Marino instance of an inline function). 77*e4b17023SJohn Marino TREE_ASM_WRITTEN is nonzero if the block was actually referenced 78*e4b17023SJohn Marino in the generated assembly. */ 79*e4b17023SJohn MarinoDEFTREECODE (BLOCK, "block", tcc_exceptional, 0) 80*e4b17023SJohn Marino 81*e4b17023SJohn Marino/* Each data type is represented by a tree node whose code is one of 82*e4b17023SJohn Marino the following: */ 83*e4b17023SJohn Marino/* Each node that represents a data type has a component TYPE_SIZE 84*e4b17023SJohn Marino containing a tree that is an expression for the size in bits. 85*e4b17023SJohn Marino The TYPE_MODE contains the machine mode for values of this type. 86*e4b17023SJohn Marino The TYPE_POINTER_TO field contains a type for a pointer to this type, 87*e4b17023SJohn Marino or zero if no such has been created yet. 88*e4b17023SJohn Marino The TYPE_NEXT_VARIANT field is used to chain together types 89*e4b17023SJohn Marino that are variants made by type modifiers such as "const" and "volatile". 90*e4b17023SJohn Marino The TYPE_MAIN_VARIANT field, in any member of such a chain, 91*e4b17023SJohn Marino points to the start of the chain. 92*e4b17023SJohn Marino The TYPE_NAME field contains info on the name used in the program 93*e4b17023SJohn Marino for this type (for GDB symbol table output). It is either a 94*e4b17023SJohn Marino TYPE_DECL node, for types that are typedefs, or an IDENTIFIER_NODE 95*e4b17023SJohn Marino in the case of structs, unions or enums that are known with a tag, 96*e4b17023SJohn Marino or zero for types that have no special name. 97*e4b17023SJohn Marino The TYPE_CONTEXT for any sort of type which could have a name or 98*e4b17023SJohn Marino which could have named members (e.g. tagged types in C/C++) will 99*e4b17023SJohn Marino point to the node which represents the scope of the given type, or 100*e4b17023SJohn Marino will be NULL_TREE if the type has "file scope". For most types, this 101*e4b17023SJohn Marino will point to a BLOCK node or a FUNCTION_DECL node, but it could also 102*e4b17023SJohn Marino point to a FUNCTION_TYPE node (for types whose scope is limited to the 103*e4b17023SJohn Marino formal parameter list of some function type specification) or it 104*e4b17023SJohn Marino could point to a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE node 105*e4b17023SJohn Marino (for C++ "member" types). 106*e4b17023SJohn Marino For non-tagged-types, TYPE_CONTEXT need not be set to anything in 107*e4b17023SJohn Marino particular, since any type which is of some type category (e.g. 108*e4b17023SJohn Marino an array type or a function type) which cannot either have a name 109*e4b17023SJohn Marino itself or have named members doesn't really have a "scope" per se. 110*e4b17023SJohn Marino The TREE_CHAIN field is used as a forward-references to names for 111*e4b17023SJohn Marino ENUMERAL_TYPE, RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE nodes; 112*e4b17023SJohn Marino see below. */ 113*e4b17023SJohn Marino 114*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the checking 115*e4b17023SJohn Marino macros in tree.h. Changing the order will degrade the speed of the 116*e4b17023SJohn Marino compiler. OFFSET_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, 117*e4b17023SJohn Marino REAL_TYPE, POINTER_TYPE. */ 118*e4b17023SJohn Marino 119*e4b17023SJohn Marino/* An offset is a pointer relative to an object. 120*e4b17023SJohn Marino The TREE_TYPE field is the type of the object at the offset. 121*e4b17023SJohn Marino The TYPE_OFFSET_BASETYPE points to the node for the type of object 122*e4b17023SJohn Marino that the offset is relative to. */ 123*e4b17023SJohn MarinoDEFTREECODE (OFFSET_TYPE, "offset_type", tcc_type, 0) 124*e4b17023SJohn Marino 125*e4b17023SJohn Marino/* C enums. The type node looks just like an INTEGER_TYPE node. 126*e4b17023SJohn Marino The symbols for the values of the enum type are defined by 127*e4b17023SJohn Marino CONST_DECL nodes, but the type does not point to them; 128*e4b17023SJohn Marino however, the TYPE_VALUES is a list in which each element's TREE_PURPOSE 129*e4b17023SJohn Marino is a name and the TREE_VALUE is the value (an INTEGER_CST node). */ 130*e4b17023SJohn Marino/* A forward reference `enum foo' when no enum named foo is defined yet 131*e4b17023SJohn Marino has zero (a null pointer) in its TYPE_SIZE. The tag name is in 132*e4b17023SJohn Marino the TYPE_NAME field. If the type is later defined, the normal 133*e4b17023SJohn Marino fields are filled in. 134*e4b17023SJohn Marino RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE forward refs are 135*e4b17023SJohn Marino treated similarly. */ 136*e4b17023SJohn MarinoDEFTREECODE (ENUMERAL_TYPE, "enumeral_type", tcc_type, 0) 137*e4b17023SJohn Marino 138*e4b17023SJohn Marino/* Boolean type (true or false are the only values). Looks like an 139*e4b17023SJohn Marino INTEGRAL_TYPE. */ 140*e4b17023SJohn MarinoDEFTREECODE (BOOLEAN_TYPE, "boolean_type", tcc_type, 0) 141*e4b17023SJohn Marino 142*e4b17023SJohn Marino/* Integer types in all languages, including char in C. 143*e4b17023SJohn Marino Also used for sub-ranges of other discrete types. 144*e4b17023SJohn Marino Has components TYPE_MIN_VALUE, TYPE_MAX_VALUE (expressions, inclusive) 145*e4b17023SJohn Marino and TYPE_PRECISION (number of bits used by this type). 146*e4b17023SJohn Marino In the case of a subrange type in Pascal, the TREE_TYPE 147*e4b17023SJohn Marino of this will point at the supertype (another INTEGER_TYPE, 148*e4b17023SJohn Marino or an ENUMERAL_TYPE or BOOLEAN_TYPE). 149*e4b17023SJohn Marino Otherwise, the TREE_TYPE is zero. */ 150*e4b17023SJohn MarinoDEFTREECODE (INTEGER_TYPE, "integer_type", tcc_type, 0) 151*e4b17023SJohn Marino 152*e4b17023SJohn Marino/* C's float and double. Different floating types are distinguished 153*e4b17023SJohn Marino by machine mode and by the TYPE_SIZE and the TYPE_PRECISION. */ 154*e4b17023SJohn MarinoDEFTREECODE (REAL_TYPE, "real_type", tcc_type, 0) 155*e4b17023SJohn Marino 156*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the checking 157*e4b17023SJohn Marino macros in tree.h. Changing the order will degrade the speed of the 158*e4b17023SJohn Marino compiler. POINTER_TYPE, REFERENCE_TYPE. Note that this range 159*e4b17023SJohn Marino overlaps the previous range of ordered types. */ 160*e4b17023SJohn Marino 161*e4b17023SJohn Marino/* All pointer-to-x types have code POINTER_TYPE. 162*e4b17023SJohn Marino The TREE_TYPE points to the node for the type pointed to. */ 163*e4b17023SJohn MarinoDEFTREECODE (POINTER_TYPE, "pointer_type", tcc_type, 0) 164*e4b17023SJohn Marino 165*e4b17023SJohn Marino/* A reference is like a pointer except that it is coerced 166*e4b17023SJohn Marino automatically to the value it points to. Used in C++. */ 167*e4b17023SJohn MarinoDEFTREECODE (REFERENCE_TYPE, "reference_type", tcc_type, 0) 168*e4b17023SJohn Marino 169*e4b17023SJohn Marino/* The C++ decltype(nullptr) type. */ 170*e4b17023SJohn MarinoDEFTREECODE (NULLPTR_TYPE, "nullptr_type", tcc_type, 0) 171*e4b17023SJohn Marino 172*e4b17023SJohn Marino/* _Fract and _Accum types in Embedded-C. Different fixed-point types 173*e4b17023SJohn Marino are distinguished by machine mode and by the TYPE_SIZE and the 174*e4b17023SJohn Marino TYPE_PRECISION. */ 175*e4b17023SJohn MarinoDEFTREECODE (FIXED_POINT_TYPE, "fixed_point_type", tcc_type, 0) 176*e4b17023SJohn Marino 177*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the checking 178*e4b17023SJohn Marino macros in tree.h. Changing the order will degrade the speed of the 179*e4b17023SJohn Marino compiler. COMPLEX_TYPE, VECTOR_TYPE, ARRAY_TYPE. */ 180*e4b17023SJohn Marino 181*e4b17023SJohn Marino/* Complex number types. The TREE_TYPE field is the data type 182*e4b17023SJohn Marino of the real and imaginary parts. It must be of scalar 183*e4b17023SJohn Marino arithmetic type, not including pointer type. */ 184*e4b17023SJohn MarinoDEFTREECODE (COMPLEX_TYPE, "complex_type", tcc_type, 0) 185*e4b17023SJohn Marino 186*e4b17023SJohn Marino/* Vector types. The TREE_TYPE field is the data type of the vector 187*e4b17023SJohn Marino elements. The TYPE_PRECISION field is the number of subparts of 188*e4b17023SJohn Marino the vector. */ 189*e4b17023SJohn MarinoDEFTREECODE (VECTOR_TYPE, "vector_type", tcc_type, 0) 190*e4b17023SJohn Marino 191*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the checking 192*e4b17023SJohn Marino macros in tree.h. Changing the order will degrade the speed of the 193*e4b17023SJohn Marino compiler. ARRAY_TYPE, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE. 194*e4b17023SJohn Marino Note that this range overlaps the previous range. */ 195*e4b17023SJohn Marino 196*e4b17023SJohn Marino/* Types of arrays. Special fields: 197*e4b17023SJohn Marino TREE_TYPE Type of an array element. 198*e4b17023SJohn Marino TYPE_DOMAIN Type to index by. 199*e4b17023SJohn Marino Its range of values specifies the array length. 200*e4b17023SJohn Marino The field TYPE_POINTER_TO (TREE_TYPE (array_type)) is always nonzero 201*e4b17023SJohn Marino and holds the type to coerce a value of that array type to in C. 202*e4b17023SJohn Marino TYPE_STRING_FLAG indicates a string (in contrast to an array of chars) 203*e4b17023SJohn Marino in languages (such as Chill) that make a distinction. */ 204*e4b17023SJohn Marino/* Array types in C or Pascal */ 205*e4b17023SJohn MarinoDEFTREECODE (ARRAY_TYPE, "array_type", tcc_type, 0) 206*e4b17023SJohn Marino 207*e4b17023SJohn Marino/* Struct in C, or record in Pascal. */ 208*e4b17023SJohn Marino/* Special fields: 209*e4b17023SJohn Marino TYPE_FIELDS chain of FIELD_DECLs for the fields of the struct, 210*e4b17023SJohn Marino and VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables, 211*e4b17023SJohn Marino types and enumerators. 212*e4b17023SJohn Marino A few may need to be added for Pascal. */ 213*e4b17023SJohn Marino/* See the comment above, before ENUMERAL_TYPE, for how 214*e4b17023SJohn Marino forward references to struct tags are handled in C. */ 215*e4b17023SJohn MarinoDEFTREECODE (RECORD_TYPE, "record_type", tcc_type, 0) 216*e4b17023SJohn Marino 217*e4b17023SJohn Marino/* Union in C. Like a struct, except that the offsets of the fields 218*e4b17023SJohn Marino will all be zero. */ 219*e4b17023SJohn Marino/* See the comment above, before ENUMERAL_TYPE, for how 220*e4b17023SJohn Marino forward references to union tags are handled in C. */ 221*e4b17023SJohn MarinoDEFTREECODE (UNION_TYPE, "union_type", tcc_type, 0) /* C union type */ 222*e4b17023SJohn Marino 223*e4b17023SJohn Marino/* Similar to UNION_TYPE, except that the expressions in DECL_QUALIFIER 224*e4b17023SJohn Marino in each FIELD_DECL determine what the union contains. The first 225*e4b17023SJohn Marino field whose DECL_QUALIFIER expression is true is deemed to occupy 226*e4b17023SJohn Marino the union. */ 227*e4b17023SJohn MarinoDEFTREECODE (QUAL_UNION_TYPE, "qual_union_type", tcc_type, 0) 228*e4b17023SJohn Marino 229*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the checking 230*e4b17023SJohn Marino macros in tree.h. Changing the order will degrade the speed of the 231*e4b17023SJohn Marino compiler. VOID_TYPE, FUNCTION_TYPE, METHOD_TYPE. */ 232*e4b17023SJohn Marino 233*e4b17023SJohn Marino/* The void type in C */ 234*e4b17023SJohn MarinoDEFTREECODE (VOID_TYPE, "void_type", tcc_type, 0) 235*e4b17023SJohn Marino 236*e4b17023SJohn Marino/* Type of functions. Special fields: 237*e4b17023SJohn Marino TREE_TYPE type of value returned. 238*e4b17023SJohn Marino TYPE_ARG_TYPES list of types of arguments expected. 239*e4b17023SJohn Marino this list is made of TREE_LIST nodes. 240*e4b17023SJohn Marino Types of "Procedures" in languages where they are different from functions 241*e4b17023SJohn Marino have code FUNCTION_TYPE also, but then TREE_TYPE is zero or void type. */ 242*e4b17023SJohn MarinoDEFTREECODE (FUNCTION_TYPE, "function_type", tcc_type, 0) 243*e4b17023SJohn Marino 244*e4b17023SJohn Marino/* METHOD_TYPE is the type of a function which takes an extra first 245*e4b17023SJohn Marino argument for "self", which is not present in the declared argument list. 246*e4b17023SJohn Marino The TREE_TYPE is the return type of the method. The TYPE_METHOD_BASETYPE 247*e4b17023SJohn Marino is the type of "self". TYPE_ARG_TYPES is the real argument list, which 248*e4b17023SJohn Marino includes the hidden argument for "self". */ 249*e4b17023SJohn MarinoDEFTREECODE (METHOD_TYPE, "method_type", tcc_type, 0) 250*e4b17023SJohn Marino 251*e4b17023SJohn Marino/* This is a language-specific kind of type. 252*e4b17023SJohn Marino Its meaning is defined by the language front end. 253*e4b17023SJohn Marino layout_type does not know how to lay this out, 254*e4b17023SJohn Marino so the front-end must do so manually. */ 255*e4b17023SJohn MarinoDEFTREECODE (LANG_TYPE, "lang_type", tcc_type, 0) 256*e4b17023SJohn Marino 257*e4b17023SJohn Marino/* Expressions */ 258*e4b17023SJohn Marino 259*e4b17023SJohn Marino/* First, the constants. */ 260*e4b17023SJohn Marino 261*e4b17023SJohn Marino/* Contents are in TREE_INT_CST_LOW and TREE_INT_CST_HIGH fields, 262*e4b17023SJohn Marino 32 bits each, giving us a 64 bit constant capability. INTEGER_CST 263*e4b17023SJohn Marino nodes can be shared, and therefore should be considered read only. 264*e4b17023SJohn Marino They should be copied, before setting a flag such as TREE_OVERFLOW. 265*e4b17023SJohn Marino If an INTEGER_CST has TREE_OVERFLOW already set, it is known to be unique. 266*e4b17023SJohn Marino INTEGER_CST nodes are created for the integral types, for pointer 267*e4b17023SJohn Marino types and for vector and float types in some circumstances. */ 268*e4b17023SJohn MarinoDEFTREECODE (INTEGER_CST, "integer_cst", tcc_constant, 0) 269*e4b17023SJohn Marino 270*e4b17023SJohn Marino/* Contents are in TREE_REAL_CST field. */ 271*e4b17023SJohn MarinoDEFTREECODE (REAL_CST, "real_cst", tcc_constant, 0) 272*e4b17023SJohn Marino 273*e4b17023SJohn Marino/* Contents are in TREE_FIXED_CST field. */ 274*e4b17023SJohn MarinoDEFTREECODE (FIXED_CST, "fixed_cst", tcc_constant, 0) 275*e4b17023SJohn Marino 276*e4b17023SJohn Marino/* Contents are in TREE_REALPART and TREE_IMAGPART fields, 277*e4b17023SJohn Marino whose contents are other constant nodes. */ 278*e4b17023SJohn MarinoDEFTREECODE (COMPLEX_CST, "complex_cst", tcc_constant, 0) 279*e4b17023SJohn Marino 280*e4b17023SJohn Marino/* Contents are in TREE_VECTOR_CST_ELTS field. */ 281*e4b17023SJohn MarinoDEFTREECODE (VECTOR_CST, "vector_cst", tcc_constant, 0) 282*e4b17023SJohn Marino 283*e4b17023SJohn Marino/* Contents are TREE_STRING_LENGTH and the actual contents of the string. */ 284*e4b17023SJohn MarinoDEFTREECODE (STRING_CST, "string_cst", tcc_constant, 0) 285*e4b17023SJohn Marino 286*e4b17023SJohn Marino/* Declarations. All references to names are represented as ..._DECL 287*e4b17023SJohn Marino nodes. The decls in one binding context are chained through the 288*e4b17023SJohn Marino TREE_CHAIN field. Each DECL has a DECL_NAME field which contains 289*e4b17023SJohn Marino an IDENTIFIER_NODE. (Some decls, most often labels, may have zero 290*e4b17023SJohn Marino as the DECL_NAME). DECL_CONTEXT points to the node representing 291*e4b17023SJohn Marino the context in which this declaration has its scope. For 292*e4b17023SJohn Marino FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or 293*e4b17023SJohn Marino QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL, 294*e4b17023SJohn Marino PARM_DECL, FUNCTION_DECL, LABEL_DECL, and CONST_DECL nodes, this 295*e4b17023SJohn Marino points to either the FUNCTION_DECL for the containing function, the 296*e4b17023SJohn Marino RECORD_TYPE or UNION_TYPE for the containing type, or NULL_TREE or 297*e4b17023SJohn Marino a TRANSLATION_UNIT_DECL if the given decl has "file scope". 298*e4b17023SJohn Marino DECL_ABSTRACT_ORIGIN, if non-NULL, points to the original (abstract) 299*e4b17023SJohn Marino ..._DECL node of which this decl is an (inlined or template expanded) 300*e4b17023SJohn Marino instance. 301*e4b17023SJohn Marino The TREE_TYPE field holds the data type of the object, when relevant. 302*e4b17023SJohn Marino LABEL_DECLs have no data type. For TYPE_DECL, the TREE_TYPE field 303*e4b17023SJohn Marino contents are the type whose name is being declared. 304*e4b17023SJohn Marino The DECL_ALIGN, DECL_SIZE, 305*e4b17023SJohn Marino and DECL_MODE fields exist in decl nodes just as in type nodes. 306*e4b17023SJohn Marino They are unused in LABEL_DECL, TYPE_DECL and CONST_DECL nodes. 307*e4b17023SJohn Marino 308*e4b17023SJohn Marino DECL_FIELD_BIT_OFFSET holds an integer number of bits offset for 309*e4b17023SJohn Marino the location. DECL_VOFFSET holds an expression for a variable 310*e4b17023SJohn Marino offset; it is to be multiplied by DECL_VOFFSET_UNIT (an integer). 311*e4b17023SJohn Marino These fields are relevant only in FIELD_DECLs and PARM_DECLs. 312*e4b17023SJohn Marino 313*e4b17023SJohn Marino DECL_INITIAL holds the value to initialize a variable to, 314*e4b17023SJohn Marino or the value of a constant. For a function, it holds the body 315*e4b17023SJohn Marino (a node of type BLOCK representing the function's binding contour 316*e4b17023SJohn Marino and whose body contains the function's statements.) For a LABEL_DECL 317*e4b17023SJohn Marino in C, it is a flag, nonzero if the label's definition has been seen. 318*e4b17023SJohn Marino 319*e4b17023SJohn Marino PARM_DECLs use a special field: 320*e4b17023SJohn Marino DECL_ARG_TYPE is the type in which the argument is actually 321*e4b17023SJohn Marino passed, which may be different from its type within the function. 322*e4b17023SJohn Marino 323*e4b17023SJohn Marino FUNCTION_DECLs use four special fields: 324*e4b17023SJohn Marino DECL_ARGUMENTS holds a chain of PARM_DECL nodes for the arguments. 325*e4b17023SJohn Marino DECL_RESULT holds a RESULT_DECL node for the value of a function. 326*e4b17023SJohn Marino The DECL_RTL field is 0 for a function that returns no value. 327*e4b17023SJohn Marino (C functions returning void have zero here.) 328*e4b17023SJohn Marino The TREE_TYPE field is the type in which the result is actually 329*e4b17023SJohn Marino returned. This is usually the same as the return type of the 330*e4b17023SJohn Marino FUNCTION_DECL, but it may be a wider integer type because of 331*e4b17023SJohn Marino promotion. 332*e4b17023SJohn Marino DECL_FUNCTION_CODE is a code number that is nonzero for 333*e4b17023SJohn Marino built-in functions. Its value is an enum built_in_function 334*e4b17023SJohn Marino that says which built-in function it is. 335*e4b17023SJohn Marino 336*e4b17023SJohn Marino DECL_SOURCE_FILE holds a filename string and DECL_SOURCE_LINE 337*e4b17023SJohn Marino holds a line number. In some cases these can be the location of 338*e4b17023SJohn Marino a reference, if no definition has been seen. 339*e4b17023SJohn Marino 340*e4b17023SJohn Marino DECL_ABSTRACT is nonzero if the decl represents an abstract instance 341*e4b17023SJohn Marino of a decl (i.e. one which is nested within an abstract instance of a 342*e4b17023SJohn Marino inline function. */ 343*e4b17023SJohn Marino 344*e4b17023SJohn MarinoDEFTREECODE (FUNCTION_DECL, "function_decl", tcc_declaration, 0) 345*e4b17023SJohn MarinoDEFTREECODE (LABEL_DECL, "label_decl", tcc_declaration, 0) 346*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the checking 347*e4b17023SJohn Marino macros in tree.h. Changing the order will degrade the speed of the 348*e4b17023SJohn Marino compiler. FIELD_DECL, VAR_DECL, CONST_DECL, PARM_DECL, 349*e4b17023SJohn Marino TYPE_DECL. */ 350*e4b17023SJohn MarinoDEFTREECODE (FIELD_DECL, "field_decl", tcc_declaration, 0) 351*e4b17023SJohn MarinoDEFTREECODE (VAR_DECL, "var_decl", tcc_declaration, 0) 352*e4b17023SJohn MarinoDEFTREECODE (CONST_DECL, "const_decl", tcc_declaration, 0) 353*e4b17023SJohn MarinoDEFTREECODE (PARM_DECL, "parm_decl", tcc_declaration, 0) 354*e4b17023SJohn MarinoDEFTREECODE (TYPE_DECL, "type_decl", tcc_declaration, 0) 355*e4b17023SJohn MarinoDEFTREECODE (RESULT_DECL, "result_decl", tcc_declaration, 0) 356*e4b17023SJohn Marino 357*e4b17023SJohn Marino/* A "declaration" of a debug temporary. It should only appear in 358*e4b17023SJohn Marino DEBUG stmts. */ 359*e4b17023SJohn MarinoDEFTREECODE (DEBUG_EXPR_DECL, "debug_expr_decl", tcc_declaration, 0) 360*e4b17023SJohn Marino 361*e4b17023SJohn Marino/* A namespace declaration. Namespaces appear in DECL_CONTEXT of other 362*e4b17023SJohn Marino _DECLs, providing a hierarchy of names. */ 363*e4b17023SJohn MarinoDEFTREECODE (NAMESPACE_DECL, "namespace_decl", tcc_declaration, 0) 364*e4b17023SJohn Marino 365*e4b17023SJohn Marino/* A declaration import. 366*e4b17023SJohn Marino The C++ FE uses this to represent a using-directive; eg: 367*e4b17023SJohn Marino "using namespace foo". 368*e4b17023SJohn Marino But it could be used to represent any declaration import construct. 369*e4b17023SJohn Marino Whenever a declaration import appears in a lexical block, the BLOCK node 370*e4b17023SJohn Marino representing that lexical block in GIMPLE will contain an IMPORTED_DECL 371*e4b17023SJohn Marino node, linked via BLOCK_VARS accessor of the said BLOCK. 372*e4b17023SJohn Marino For a given NODE which code is IMPORTED_DECL, 373*e4b17023SJohn Marino IMPORTED_DECL_ASSOCIATED_DECL (NODE) accesses the imported declaration. */ 374*e4b17023SJohn MarinoDEFTREECODE (IMPORTED_DECL, "imported_decl", tcc_declaration, 0) 375*e4b17023SJohn Marino 376*e4b17023SJohn Marino/* A translation unit. This is not technically a declaration, since it 377*e4b17023SJohn Marino can't be looked up, but it's close enough. */ 378*e4b17023SJohn MarinoDEFTREECODE (TRANSLATION_UNIT_DECL, "translation_unit_decl",\ 379*e4b17023SJohn Marino tcc_declaration, 0) 380*e4b17023SJohn Marino 381*e4b17023SJohn Marino/* References to storage. */ 382*e4b17023SJohn Marino 383*e4b17023SJohn Marino/* The ordering of the following codes is optimized for the classification 384*e4b17023SJohn Marino in handled_component_p. Keep them in a consecutive group. */ 385*e4b17023SJohn Marino 386*e4b17023SJohn Marino/* Value is structure or union component. 387*e4b17023SJohn Marino Operand 0 is the structure or union (an expression). 388*e4b17023SJohn Marino Operand 1 is the field (a node of type FIELD_DECL). 389*e4b17023SJohn Marino Operand 2, if present, is the value of DECL_FIELD_OFFSET, measured 390*e4b17023SJohn Marino in units of DECL_OFFSET_ALIGN / BITS_PER_UNIT. */ 391*e4b17023SJohn MarinoDEFTREECODE (COMPONENT_REF, "component_ref", tcc_reference, 3) 392*e4b17023SJohn Marino 393*e4b17023SJohn Marino/* Reference to a group of bits within an object. Similar to COMPONENT_REF 394*e4b17023SJohn Marino except the position is given explicitly rather than via a FIELD_DECL. 395*e4b17023SJohn Marino Operand 0 is the structure or union expression; 396*e4b17023SJohn Marino operand 1 is a tree giving the constant number of bits being referenced; 397*e4b17023SJohn Marino operand 2 is a tree giving the constant position of the first referenced bit. 398*e4b17023SJohn Marino The result type width has to match the number of bits referenced. 399*e4b17023SJohn Marino If the result type is integral, its signedness specifies how it is extended 400*e4b17023SJohn Marino to its mode width. */ 401*e4b17023SJohn MarinoDEFTREECODE (BIT_FIELD_REF, "bit_field_ref", tcc_reference, 3) 402*e4b17023SJohn Marino 403*e4b17023SJohn Marino/* Used only on an operand of complex type, these return 404*e4b17023SJohn Marino a value of the corresponding component type. */ 405*e4b17023SJohn MarinoDEFTREECODE (REALPART_EXPR, "realpart_expr", tcc_reference, 1) 406*e4b17023SJohn MarinoDEFTREECODE (IMAGPART_EXPR, "imagpart_expr", tcc_reference, 1) 407*e4b17023SJohn Marino 408*e4b17023SJohn Marino/* Array indexing. 409*e4b17023SJohn Marino Operand 0 is the array; operand 1 is a (single) array index. 410*e4b17023SJohn Marino Operand 2, if present, is a copy of TYPE_MIN_VALUE of the index. 411*e4b17023SJohn Marino Operand 3, if present, is the element size, measured in units of 412*e4b17023SJohn Marino the alignment of the element type. */ 413*e4b17023SJohn MarinoDEFTREECODE (ARRAY_REF, "array_ref", tcc_reference, 4) 414*e4b17023SJohn Marino 415*e4b17023SJohn Marino/* Likewise, except that the result is a range ("slice") of the array. The 416*e4b17023SJohn Marino starting index of the resulting array is taken from operand 1 and the size 417*e4b17023SJohn Marino of the range is taken from the type of the expression. */ 418*e4b17023SJohn MarinoDEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4) 419*e4b17023SJohn Marino 420*e4b17023SJohn Marino/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ 421*e4b17023SJohn MarinoDEFTREECODE (INDIRECT_REF, "indirect_ref", tcc_reference, 1) 422*e4b17023SJohn Marino 423*e4b17023SJohn Marino/* Used to represent lookup in a virtual method table which is dependent on 424*e4b17023SJohn Marino the runtime type of an object. Operands are: 425*e4b17023SJohn Marino OBJ_TYPE_REF_EXPR: An expression that evaluates the value to use. 426*e4b17023SJohn Marino OBJ_TYPE_REF_OBJECT: Is the object on whose behalf the lookup is 427*e4b17023SJohn Marino being performed. Through this the optimizers may be able to statically 428*e4b17023SJohn Marino determine the dynamic type of the object. 429*e4b17023SJohn Marino OBJ_TYPE_REF_TOKEN: An integer index to the virtual method table. */ 430*e4b17023SJohn MarinoDEFTREECODE (OBJ_TYPE_REF, "obj_type_ref", tcc_expression, 3) 431*e4b17023SJohn Marino 432*e4b17023SJohn Marino/* Constructor: return an aggregate value made from specified components. 433*e4b17023SJohn Marino In C, this is used only for structure and array initializers. 434*e4b17023SJohn Marino The operand is a sequence of component values made out of a VEC of 435*e4b17023SJohn Marino struct constructor_elt. 436*e4b17023SJohn Marino 437*e4b17023SJohn Marino For ARRAY_TYPE: 438*e4b17023SJohn Marino The field INDEX of each constructor_elt is the corresponding index. 439*e4b17023SJohn Marino If the index is a RANGE_EXPR, it is a short-hand for many nodes, 440*e4b17023SJohn Marino one for each index in the range. (If the corresponding field VALUE 441*e4b17023SJohn Marino has side-effects, they are evaluated once for each element. Wrap the 442*e4b17023SJohn Marino value in a SAVE_EXPR if you want to evaluate side effects only once.) 443*e4b17023SJohn Marino 444*e4b17023SJohn Marino For RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE: 445*e4b17023SJohn Marino The field INDEX of each node is a FIELD_DECL. */ 446*e4b17023SJohn MarinoDEFTREECODE (CONSTRUCTOR, "constructor", tcc_exceptional, 0) 447*e4b17023SJohn Marino 448*e4b17023SJohn Marino/* The expression types are mostly straightforward, with the fourth argument 449*e4b17023SJohn Marino of DEFTREECODE saying how many operands there are. 450*e4b17023SJohn Marino Unless otherwise specified, the operands are expressions and the 451*e4b17023SJohn Marino types of all the operands and the expression must all be the same. */ 452*e4b17023SJohn Marino 453*e4b17023SJohn Marino/* Contains two expressions to compute, one followed by the other. 454*e4b17023SJohn Marino the first value is ignored. The second one's value is used. The 455*e4b17023SJohn Marino type of the first expression need not agree with the other types. */ 456*e4b17023SJohn MarinoDEFTREECODE (COMPOUND_EXPR, "compound_expr", tcc_expression, 2) 457*e4b17023SJohn Marino 458*e4b17023SJohn Marino/* Assignment expression. Operand 0 is the what to set; 1, the new value. */ 459*e4b17023SJohn MarinoDEFTREECODE (MODIFY_EXPR, "modify_expr", tcc_expression, 2) 460*e4b17023SJohn Marino 461*e4b17023SJohn Marino/* Initialization expression. Operand 0 is the variable to initialize; 462*e4b17023SJohn Marino Operand 1 is the initializer. This differs from MODIFY_EXPR in that any 463*e4b17023SJohn Marino reference to the referent of operand 0 within operand 1 is undefined. */ 464*e4b17023SJohn MarinoDEFTREECODE (INIT_EXPR, "init_expr", tcc_expression, 2) 465*e4b17023SJohn Marino 466*e4b17023SJohn Marino/* For TARGET_EXPR, operand 0 is the target of an initialization, 467*e4b17023SJohn Marino operand 1 is the initializer for the target, which may be void 468*e4b17023SJohn Marino if simply expanding it initializes the target. 469*e4b17023SJohn Marino operand 2 is the cleanup for this node, if any. 470*e4b17023SJohn Marino operand 3 is the saved initializer after this node has been 471*e4b17023SJohn Marino expanded once; this is so we can re-expand the tree later. */ 472*e4b17023SJohn MarinoDEFTREECODE (TARGET_EXPR, "target_expr", tcc_expression, 4) 473*e4b17023SJohn Marino 474*e4b17023SJohn Marino/* Conditional expression ( ... ? ... : ... in C). 475*e4b17023SJohn Marino Operand 0 is the condition. 476*e4b17023SJohn Marino Operand 1 is the then-value. 477*e4b17023SJohn Marino Operand 2 is the else-value. 478*e4b17023SJohn Marino Operand 0 may be of any type. 479*e4b17023SJohn Marino Operand 1 must have the same type as the entire expression, unless 480*e4b17023SJohn Marino it unconditionally throws an exception, in which case it should 481*e4b17023SJohn Marino have VOID_TYPE. The same constraints apply to operand 2. The 482*e4b17023SJohn Marino condition in operand 0 must be of integral type. 483*e4b17023SJohn Marino 484*e4b17023SJohn Marino In cfg gimple, if you do not have a selection expression, operands 485*e4b17023SJohn Marino 1 and 2 are NULL. The operands are then taken from the cfg edges. */ 486*e4b17023SJohn MarinoDEFTREECODE (COND_EXPR, "cond_expr", tcc_expression, 3) 487*e4b17023SJohn Marino 488*e4b17023SJohn Marino/* Vector conditional expression. It is like COND_EXPR, but with 489*e4b17023SJohn Marino vector operands. 490*e4b17023SJohn Marino 491*e4b17023SJohn Marino A = VEC_COND_EXPR ( X < Y, B, C) 492*e4b17023SJohn Marino 493*e4b17023SJohn Marino means 494*e4b17023SJohn Marino 495*e4b17023SJohn Marino for (i=0; i<N; i++) 496*e4b17023SJohn Marino A[i] = X[i] < Y[i] ? B[i] : C[i]; 497*e4b17023SJohn Marino*/ 498*e4b17023SJohn MarinoDEFTREECODE (VEC_COND_EXPR, "vec_cond_expr", tcc_expression, 3) 499*e4b17023SJohn Marino 500*e4b17023SJohn Marino/* Vector permutation expression. A = VEC_PERM_EXPR<v0, v1, mask> means 501*e4b17023SJohn Marino 502*e4b17023SJohn Marino N = length(mask) 503*e4b17023SJohn Marino foreach i in N: 504*e4b17023SJohn Marino M = mask[i] % (2*N) 505*e4b17023SJohn Marino A = M < N ? v0[M] : v1[M-N] 506*e4b17023SJohn Marino 507*e4b17023SJohn Marino V0 and V1 are vectors of the same type. MASK is an integer-typed 508*e4b17023SJohn Marino vector. The number of MASK elements must be the same with the 509*e4b17023SJohn Marino number of elements in V0 and V1. The size of the inner type 510*e4b17023SJohn Marino of the MASK and of the V0 and V1 must be the same. 511*e4b17023SJohn Marino*/ 512*e4b17023SJohn MarinoDEFTREECODE (VEC_PERM_EXPR, "vec_perm_expr", tcc_expression, 3) 513*e4b17023SJohn Marino 514*e4b17023SJohn Marino/* Declare local variables, including making RTL and allocating space. 515*e4b17023SJohn Marino BIND_EXPR_VARS is a chain of VAR_DECL nodes for the variables. 516*e4b17023SJohn Marino BIND_EXPR_BODY is the body, the expression to be computed using 517*e4b17023SJohn Marino the variables. The value of operand 1 becomes that of the BIND_EXPR. 518*e4b17023SJohn Marino BIND_EXPR_BLOCK is the BLOCK that corresponds to these bindings 519*e4b17023SJohn Marino for debugging purposes. If this BIND_EXPR is actually expanded, 520*e4b17023SJohn Marino that sets the TREE_USED flag in the BLOCK. 521*e4b17023SJohn Marino 522*e4b17023SJohn Marino The BIND_EXPR is not responsible for informing parsers 523*e4b17023SJohn Marino about these variables. If the body is coming from the input file, 524*e4b17023SJohn Marino then the code that creates the BIND_EXPR is also responsible for 525*e4b17023SJohn Marino informing the parser of the variables. 526*e4b17023SJohn Marino 527*e4b17023SJohn Marino If the BIND_EXPR is ever expanded, its TREE_USED flag is set. 528*e4b17023SJohn Marino This tells the code for debugging symbol tables not to ignore the BIND_EXPR. 529*e4b17023SJohn Marino If the BIND_EXPR should be output for debugging but will not be expanded, 530*e4b17023SJohn Marino set the TREE_USED flag by hand. 531*e4b17023SJohn Marino 532*e4b17023SJohn Marino In order for the BIND_EXPR to be known at all, the code that creates it 533*e4b17023SJohn Marino must also install it as a subblock in the tree of BLOCK 534*e4b17023SJohn Marino nodes for the function. */ 535*e4b17023SJohn MarinoDEFTREECODE (BIND_EXPR, "bind_expr", tcc_expression, 3) 536*e4b17023SJohn Marino 537*e4b17023SJohn Marino/* Function call. CALL_EXPRs are represented by variably-sized expression 538*e4b17023SJohn Marino nodes. There are at least three fixed operands. Operand 0 is an 539*e4b17023SJohn Marino INTEGER_CST node containing the total operand count, the number of 540*e4b17023SJohn Marino arguments plus 3. Operand 1 is the function, while operand 2 is 541*e4b17023SJohn Marino is static chain argument, or NULL. The remaining operands are the 542*e4b17023SJohn Marino arguments to the call. */ 543*e4b17023SJohn MarinoDEFTREECODE (CALL_EXPR, "call_expr", tcc_vl_exp, 3) 544*e4b17023SJohn Marino 545*e4b17023SJohn Marino/* Specify a value to compute along with its corresponding cleanup. 546*e4b17023SJohn Marino Operand 0 is the cleanup expression. 547*e4b17023SJohn Marino The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR, 548*e4b17023SJohn Marino which must exist. This differs from TRY_CATCH_EXPR in that operand 1 549*e4b17023SJohn Marino is always evaluated when cleanups are run. */ 550*e4b17023SJohn MarinoDEFTREECODE (WITH_CLEANUP_EXPR, "with_cleanup_expr", tcc_expression, 1) 551*e4b17023SJohn Marino 552*e4b17023SJohn Marino/* Specify a cleanup point. 553*e4b17023SJohn Marino Operand 0 is an expression that may have cleanups. If it does, those 554*e4b17023SJohn Marino cleanups are executed after the expression is expanded. 555*e4b17023SJohn Marino 556*e4b17023SJohn Marino Note that if the expression is a reference to storage, it is forced out 557*e4b17023SJohn Marino of memory before the cleanups are run. This is necessary to handle 558*e4b17023SJohn Marino cases where the cleanups modify the storage referenced; in the 559*e4b17023SJohn Marino expression 't.i', if 't' is a struct with an integer member 'i' and a 560*e4b17023SJohn Marino cleanup which modifies 'i', the value of the expression depends on 561*e4b17023SJohn Marino whether the cleanup is run before or after 't.i' is evaluated. When 562*e4b17023SJohn Marino expand_expr is run on 't.i', it returns a MEM. This is not good enough; 563*e4b17023SJohn Marino the value of 't.i' must be forced out of memory. 564*e4b17023SJohn Marino 565*e4b17023SJohn Marino As a consequence, the operand of a CLEANUP_POINT_EXPR must not have 566*e4b17023SJohn Marino BLKmode, because it will not be forced out of memory. */ 567*e4b17023SJohn MarinoDEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", tcc_expression, 1) 568*e4b17023SJohn Marino 569*e4b17023SJohn Marino/* The following code is used in languages that have types where some 570*e4b17023SJohn Marino field in an object of the type contains a value that is used in the 571*e4b17023SJohn Marino computation of another field's offset or size and/or the size of the 572*e4b17023SJohn Marino type. The positions and/or sizes of fields can vary from object to 573*e4b17023SJohn Marino object of the same type or even for one and the same object within 574*e4b17023SJohn Marino its scope. 575*e4b17023SJohn Marino 576*e4b17023SJohn Marino Record types with discriminants in Ada or schema types in Pascal are 577*e4b17023SJohn Marino examples of such types. This mechanism is also used to create "fat 578*e4b17023SJohn Marino pointers" for unconstrained array types in Ada; the fat pointer is a 579*e4b17023SJohn Marino structure one of whose fields is a pointer to the actual array type 580*e4b17023SJohn Marino and the other field is a pointer to a template, which is a structure 581*e4b17023SJohn Marino containing the bounds of the array. The bounds in the type pointed 582*e4b17023SJohn Marino to by the first field in the fat pointer refer to the values in the 583*e4b17023SJohn Marino template. 584*e4b17023SJohn Marino 585*e4b17023SJohn Marino When you wish to construct such a type you need "self-references" 586*e4b17023SJohn Marino that allow you to reference the object having this type from the 587*e4b17023SJohn Marino TYPE node, i.e. without having a variable instantiating this type. 588*e4b17023SJohn Marino 589*e4b17023SJohn Marino Such a "self-references" is done using a PLACEHOLDER_EXPR. This is 590*e4b17023SJohn Marino a node that will later be replaced with the object being referenced. 591*e4b17023SJohn Marino Its type is that of the object and selects which object to use from 592*e4b17023SJohn Marino a chain of references (see below). No other slots are used in the 593*e4b17023SJohn Marino PLACEHOLDER_EXPR. 594*e4b17023SJohn Marino 595*e4b17023SJohn Marino For example, if your type FOO is a RECORD_TYPE with a field BAR, 596*e4b17023SJohn Marino and you need the value of <variable>.BAR to calculate TYPE_SIZE 597*e4b17023SJohn Marino (FOO), just substitute <variable> above with a PLACEHOLDER_EXPR 598*e4b17023SJohn Marino whose TREE_TYPE is FOO. Then construct your COMPONENT_REF with 599*e4b17023SJohn Marino the PLACEHOLDER_EXPR as the first operand (which has the correct 600*e4b17023SJohn Marino type). Later, when the size is needed in the program, the back-end 601*e4b17023SJohn Marino will find this PLACEHOLDER_EXPR and generate code to calculate the 602*e4b17023SJohn Marino actual size at run-time. In the following, we describe how this 603*e4b17023SJohn Marino calculation is done. 604*e4b17023SJohn Marino 605*e4b17023SJohn Marino When we wish to evaluate a size or offset, we check whether it contains a 606*e4b17023SJohn Marino PLACEHOLDER_EXPR. If it does, we call substitute_placeholder_in_expr 607*e4b17023SJohn Marino passing both that tree and an expression within which the object may be 608*e4b17023SJohn Marino found. The latter expression is the object itself in the simple case of 609*e4b17023SJohn Marino an Ada record with discriminant, but it can be the array in the case of an 610*e4b17023SJohn Marino unconstrained array. 611*e4b17023SJohn Marino 612*e4b17023SJohn Marino In the latter case, we need the fat pointer, because the bounds of 613*e4b17023SJohn Marino the array can only be accessed from it. However, we rely here on the 614*e4b17023SJohn Marino fact that the expression for the array contains the dereference of 615*e4b17023SJohn Marino the fat pointer that obtained the array pointer. */ 616*e4b17023SJohn Marino 617*e4b17023SJohn Marino/* Denotes a record to later be substituted before evaluating this expression. 618*e4b17023SJohn Marino The type of this expression is used to find the record to replace it. */ 619*e4b17023SJohn MarinoDEFTREECODE (PLACEHOLDER_EXPR, "placeholder_expr", tcc_exceptional, 0) 620*e4b17023SJohn Marino 621*e4b17023SJohn Marino/* Simple arithmetic. */ 622*e4b17023SJohn MarinoDEFTREECODE (PLUS_EXPR, "plus_expr", tcc_binary, 2) 623*e4b17023SJohn MarinoDEFTREECODE (MINUS_EXPR, "minus_expr", tcc_binary, 2) 624*e4b17023SJohn MarinoDEFTREECODE (MULT_EXPR, "mult_expr", tcc_binary, 2) 625*e4b17023SJohn Marino 626*e4b17023SJohn Marino/* Pointer addition. The first operand is always a pointer and the 627*e4b17023SJohn Marino second operand is an integer of type sizetype. */ 628*e4b17023SJohn MarinoDEFTREECODE (POINTER_PLUS_EXPR, "pointer_plus_expr", tcc_binary, 2) 629*e4b17023SJohn Marino 630*e4b17023SJohn Marino/* Division for integer result that rounds the quotient toward zero. */ 631*e4b17023SJohn MarinoDEFTREECODE (TRUNC_DIV_EXPR, "trunc_div_expr", tcc_binary, 2) 632*e4b17023SJohn Marino 633*e4b17023SJohn Marino/* Division for integer result that rounds the quotient toward infinity. */ 634*e4b17023SJohn MarinoDEFTREECODE (CEIL_DIV_EXPR, "ceil_div_expr", tcc_binary, 2) 635*e4b17023SJohn Marino 636*e4b17023SJohn Marino/* Division for integer result that rounds toward minus infinity. */ 637*e4b17023SJohn MarinoDEFTREECODE (FLOOR_DIV_EXPR, "floor_div_expr", tcc_binary, 2) 638*e4b17023SJohn Marino 639*e4b17023SJohn Marino/* Division for integer result that rounds toward nearest integer. */ 640*e4b17023SJohn MarinoDEFTREECODE (ROUND_DIV_EXPR, "round_div_expr", tcc_binary, 2) 641*e4b17023SJohn Marino 642*e4b17023SJohn Marino/* Four kinds of remainder that go with the four kinds of division. */ 643*e4b17023SJohn MarinoDEFTREECODE (TRUNC_MOD_EXPR, "trunc_mod_expr", tcc_binary, 2) 644*e4b17023SJohn MarinoDEFTREECODE (CEIL_MOD_EXPR, "ceil_mod_expr", tcc_binary, 2) 645*e4b17023SJohn MarinoDEFTREECODE (FLOOR_MOD_EXPR, "floor_mod_expr", tcc_binary, 2) 646*e4b17023SJohn MarinoDEFTREECODE (ROUND_MOD_EXPR, "round_mod_expr", tcc_binary, 2) 647*e4b17023SJohn Marino 648*e4b17023SJohn Marino/* Division for real result. */ 649*e4b17023SJohn MarinoDEFTREECODE (RDIV_EXPR, "rdiv_expr", tcc_binary, 2) 650*e4b17023SJohn Marino 651*e4b17023SJohn Marino/* Division which is not supposed to need rounding. 652*e4b17023SJohn Marino Used for pointer subtraction in C. */ 653*e4b17023SJohn MarinoDEFTREECODE (EXACT_DIV_EXPR, "exact_div_expr", tcc_binary, 2) 654*e4b17023SJohn Marino 655*e4b17023SJohn Marino/* Conversion of real to fixed point by truncation. */ 656*e4b17023SJohn MarinoDEFTREECODE (FIX_TRUNC_EXPR, "fix_trunc_expr", tcc_unary, 1) 657*e4b17023SJohn Marino 658*e4b17023SJohn Marino/* Conversion of an integer to a real. */ 659*e4b17023SJohn MarinoDEFTREECODE (FLOAT_EXPR, "float_expr", tcc_unary, 1) 660*e4b17023SJohn Marino 661*e4b17023SJohn Marino/* Unary negation. */ 662*e4b17023SJohn MarinoDEFTREECODE (NEGATE_EXPR, "negate_expr", tcc_unary, 1) 663*e4b17023SJohn Marino 664*e4b17023SJohn Marino/* Minimum and maximum values. When used with floating point, if both 665*e4b17023SJohn Marino operands are zeros, or if either operand is NaN, then it is unspecified 666*e4b17023SJohn Marino which of the two operands is returned as the result. */ 667*e4b17023SJohn MarinoDEFTREECODE (MIN_EXPR, "min_expr", tcc_binary, 2) 668*e4b17023SJohn MarinoDEFTREECODE (MAX_EXPR, "max_expr", tcc_binary, 2) 669*e4b17023SJohn Marino 670*e4b17023SJohn Marino/* Represents the absolute value of the operand. 671*e4b17023SJohn Marino 672*e4b17023SJohn Marino An ABS_EXPR must have either an INTEGER_TYPE or a REAL_TYPE. The 673*e4b17023SJohn Marino operand of the ABS_EXPR must have the same type. */ 674*e4b17023SJohn MarinoDEFTREECODE (ABS_EXPR, "abs_expr", tcc_unary, 1) 675*e4b17023SJohn Marino 676*e4b17023SJohn Marino/* Shift operations for shift and rotate. 677*e4b17023SJohn Marino Shift means logical shift if done on an 678*e4b17023SJohn Marino unsigned type, arithmetic shift if done on a signed type. 679*e4b17023SJohn Marino The second operand is the number of bits to 680*e4b17023SJohn Marino shift by; it need not be the same type as the first operand and result. 681*e4b17023SJohn Marino Note that the result is undefined if the second operand is larger 682*e4b17023SJohn Marino than or equal to the first operand's type size. 683*e4b17023SJohn Marino 684*e4b17023SJohn Marino The first operand of a shift can have either an integer or a 685*e4b17023SJohn Marino (non-integer) fixed-point type. We follow the ISO/IEC TR 18037:2004 686*e4b17023SJohn Marino semantics for the latter. 687*e4b17023SJohn Marino 688*e4b17023SJohn Marino Rotates are defined for integer types only. */ 689*e4b17023SJohn MarinoDEFTREECODE (LSHIFT_EXPR, "lshift_expr", tcc_binary, 2) 690*e4b17023SJohn MarinoDEFTREECODE (RSHIFT_EXPR, "rshift_expr", tcc_binary, 2) 691*e4b17023SJohn MarinoDEFTREECODE (LROTATE_EXPR, "lrotate_expr", tcc_binary, 2) 692*e4b17023SJohn MarinoDEFTREECODE (RROTATE_EXPR, "rrotate_expr", tcc_binary, 2) 693*e4b17023SJohn Marino 694*e4b17023SJohn Marino/* Bitwise operations. Operands have same mode as result. */ 695*e4b17023SJohn MarinoDEFTREECODE (BIT_IOR_EXPR, "bit_ior_expr", tcc_binary, 2) 696*e4b17023SJohn MarinoDEFTREECODE (BIT_XOR_EXPR, "bit_xor_expr", tcc_binary, 2) 697*e4b17023SJohn MarinoDEFTREECODE (BIT_AND_EXPR, "bit_and_expr", tcc_binary, 2) 698*e4b17023SJohn MarinoDEFTREECODE (BIT_NOT_EXPR, "bit_not_expr", tcc_unary, 1) 699*e4b17023SJohn Marino 700*e4b17023SJohn Marino/* ANDIF and ORIF allow the second operand not to be computed if the 701*e4b17023SJohn Marino value of the expression is determined from the first operand. AND, 702*e4b17023SJohn Marino OR, and XOR always compute the second operand whether its value is 703*e4b17023SJohn Marino needed or not (for side effects). The operand may have 704*e4b17023SJohn Marino BOOLEAN_TYPE or INTEGER_TYPE. In either case, the argument will be 705*e4b17023SJohn Marino either zero or one. For example, a TRUTH_NOT_EXPR will never have 706*e4b17023SJohn Marino an INTEGER_TYPE VAR_DECL as its argument; instead, a NE_EXPR will be 707*e4b17023SJohn Marino used to compare the VAR_DECL to zero, thereby obtaining a node with 708*e4b17023SJohn Marino value zero or one. */ 709*e4b17023SJohn MarinoDEFTREECODE (TRUTH_ANDIF_EXPR, "truth_andif_expr", tcc_expression, 2) 710*e4b17023SJohn MarinoDEFTREECODE (TRUTH_ORIF_EXPR, "truth_orif_expr", tcc_expression, 2) 711*e4b17023SJohn MarinoDEFTREECODE (TRUTH_AND_EXPR, "truth_and_expr", tcc_expression, 2) 712*e4b17023SJohn MarinoDEFTREECODE (TRUTH_OR_EXPR, "truth_or_expr", tcc_expression, 2) 713*e4b17023SJohn MarinoDEFTREECODE (TRUTH_XOR_EXPR, "truth_xor_expr", tcc_expression, 2) 714*e4b17023SJohn MarinoDEFTREECODE (TRUTH_NOT_EXPR, "truth_not_expr", tcc_expression, 1) 715*e4b17023SJohn Marino 716*e4b17023SJohn Marino/* Relational operators. 717*e4b17023SJohn Marino `EQ_EXPR' and `NE_EXPR' are allowed for any types. 718*e4b17023SJohn Marino The others are allowed only for integer (or pointer or enumeral) 719*e4b17023SJohn Marino or real types. 720*e4b17023SJohn Marino In all cases the operands will have the same type, 721*e4b17023SJohn Marino and the value is either the type used by the language for booleans 722*e4b17023SJohn Marino or an integer vector type of the same size and with the same number 723*e4b17023SJohn Marino of elements as the comparison operands. True for a vector of 724*e4b17023SJohn Marino comparison results has all bits set while false is equal to zero. */ 725*e4b17023SJohn MarinoDEFTREECODE (LT_EXPR, "lt_expr", tcc_comparison, 2) 726*e4b17023SJohn MarinoDEFTREECODE (LE_EXPR, "le_expr", tcc_comparison, 2) 727*e4b17023SJohn MarinoDEFTREECODE (GT_EXPR, "gt_expr", tcc_comparison, 2) 728*e4b17023SJohn MarinoDEFTREECODE (GE_EXPR, "ge_expr", tcc_comparison, 2) 729*e4b17023SJohn MarinoDEFTREECODE (EQ_EXPR, "eq_expr", tcc_comparison, 2) 730*e4b17023SJohn MarinoDEFTREECODE (NE_EXPR, "ne_expr", tcc_comparison, 2) 731*e4b17023SJohn Marino 732*e4b17023SJohn Marino/* Additional relational operators for floating point unordered. */ 733*e4b17023SJohn MarinoDEFTREECODE (UNORDERED_EXPR, "unordered_expr", tcc_comparison, 2) 734*e4b17023SJohn MarinoDEFTREECODE (ORDERED_EXPR, "ordered_expr", tcc_comparison, 2) 735*e4b17023SJohn Marino 736*e4b17023SJohn Marino/* These are equivalent to unordered or ... */ 737*e4b17023SJohn MarinoDEFTREECODE (UNLT_EXPR, "unlt_expr", tcc_comparison, 2) 738*e4b17023SJohn MarinoDEFTREECODE (UNLE_EXPR, "unle_expr", tcc_comparison, 2) 739*e4b17023SJohn MarinoDEFTREECODE (UNGT_EXPR, "ungt_expr", tcc_comparison, 2) 740*e4b17023SJohn MarinoDEFTREECODE (UNGE_EXPR, "unge_expr", tcc_comparison, 2) 741*e4b17023SJohn MarinoDEFTREECODE (UNEQ_EXPR, "uneq_expr", tcc_comparison, 2) 742*e4b17023SJohn Marino 743*e4b17023SJohn Marino/* This is the reverse of uneq_expr. */ 744*e4b17023SJohn MarinoDEFTREECODE (LTGT_EXPR, "ltgt_expr", tcc_comparison, 2) 745*e4b17023SJohn Marino 746*e4b17023SJohn MarinoDEFTREECODE (RANGE_EXPR, "range_expr", tcc_binary, 2) 747*e4b17023SJohn Marino 748*e4b17023SJohn Marino/* Represents a re-association barrier for floating point expressions 749*e4b17023SJohn Marino like explicit parenthesis in fortran. */ 750*e4b17023SJohn MarinoDEFTREECODE (PAREN_EXPR, "paren_expr", tcc_unary, 1) 751*e4b17023SJohn Marino 752*e4b17023SJohn Marino/* Represents a conversion of type of a value. 753*e4b17023SJohn Marino All conversions, including implicit ones, must be 754*e4b17023SJohn Marino represented by CONVERT_EXPR or NOP_EXPR nodes. */ 755*e4b17023SJohn MarinoDEFTREECODE (CONVERT_EXPR, "convert_expr", tcc_unary, 1) 756*e4b17023SJohn Marino 757*e4b17023SJohn Marino/* Conversion of a pointer value to a pointer to a different 758*e4b17023SJohn Marino address space. */ 759*e4b17023SJohn MarinoDEFTREECODE (ADDR_SPACE_CONVERT_EXPR, "addr_space_convert_expr", tcc_unary, 1) 760*e4b17023SJohn Marino 761*e4b17023SJohn Marino/* Conversion of a fixed-point value to an integer, a real, or a fixed-point 762*e4b17023SJohn Marino value. Or conversion of a fixed-point value from an integer, a real, or 763*e4b17023SJohn Marino a fixed-point value. */ 764*e4b17023SJohn MarinoDEFTREECODE (FIXED_CONVERT_EXPR, "fixed_convert_expr", tcc_unary, 1) 765*e4b17023SJohn Marino 766*e4b17023SJohn Marino/* Represents a conversion expected to require no code to be generated. */ 767*e4b17023SJohn MarinoDEFTREECODE (NOP_EXPR, "nop_expr", tcc_unary, 1) 768*e4b17023SJohn Marino 769*e4b17023SJohn Marino/* Value is same as argument, but guaranteed not an lvalue. */ 770*e4b17023SJohn MarinoDEFTREECODE (NON_LVALUE_EXPR, "non_lvalue_expr", tcc_unary, 1) 771*e4b17023SJohn Marino 772*e4b17023SJohn Marino/* Represents viewing something of one type as being of a second type. 773*e4b17023SJohn Marino This corresponds to an "Unchecked Conversion" in Ada and roughly to 774*e4b17023SJohn Marino the idiom *(type2 *)&X in C. The only operand is the value to be 775*e4b17023SJohn Marino viewed as being of another type. It is undefined if the type of the 776*e4b17023SJohn Marino input and of the expression have different sizes. 777*e4b17023SJohn Marino 778*e4b17023SJohn Marino This code may also be used within the LHS of a MODIFY_EXPR, in which 779*e4b17023SJohn Marino case no actual data motion may occur. TREE_ADDRESSABLE will be set in 780*e4b17023SJohn Marino this case and GCC must abort if it could not do the operation without 781*e4b17023SJohn Marino generating insns. */ 782*e4b17023SJohn MarinoDEFTREECODE (VIEW_CONVERT_EXPR, "view_convert_expr", tcc_reference, 1) 783*e4b17023SJohn Marino 784*e4b17023SJohn Marino/* A COMPOUND_LITERAL_EXPR represents a literal that is placed in a DECL. The 785*e4b17023SJohn Marino COMPOUND_LITERAL_EXPR_DECL_EXPR is the a DECL_EXPR containing the decl 786*e4b17023SJohn Marino for the anonymous object represented by the COMPOUND_LITERAL; 787*e4b17023SJohn Marino the DECL_INITIAL of that decl is the CONSTRUCTOR that initializes 788*e4b17023SJohn Marino the compound literal. */ 789*e4b17023SJohn MarinoDEFTREECODE (COMPOUND_LITERAL_EXPR, "compound_literal_expr", tcc_expression, 1) 790*e4b17023SJohn Marino 791*e4b17023SJohn Marino/* Represents something we computed once and will use multiple times. 792*e4b17023SJohn Marino First operand is that expression. After it is evaluated once, it 793*e4b17023SJohn Marino will be replaced by the temporary variable that holds the value. */ 794*e4b17023SJohn MarinoDEFTREECODE (SAVE_EXPR, "save_expr", tcc_expression, 1) 795*e4b17023SJohn Marino 796*e4b17023SJohn Marino/* & in C. Value is the address at which the operand's value resides. 797*e4b17023SJohn Marino Operand may have any mode. Result mode is Pmode. */ 798*e4b17023SJohn MarinoDEFTREECODE (ADDR_EXPR, "addr_expr", tcc_expression, 1) 799*e4b17023SJohn Marino 800*e4b17023SJohn Marino/* Operand0 is a function constant; result is part N of a function 801*e4b17023SJohn Marino descriptor of type ptr_mode. */ 802*e4b17023SJohn MarinoDEFTREECODE (FDESC_EXPR, "fdesc_expr", tcc_expression, 2) 803*e4b17023SJohn Marino 804*e4b17023SJohn Marino/* Given two real or integer operands of the same type, 805*e4b17023SJohn Marino returns a complex value of the corresponding complex type. */ 806*e4b17023SJohn MarinoDEFTREECODE (COMPLEX_EXPR, "complex_expr", tcc_binary, 2) 807*e4b17023SJohn Marino 808*e4b17023SJohn Marino/* Complex conjugate of operand. Used only on complex types. */ 809*e4b17023SJohn MarinoDEFTREECODE (CONJ_EXPR, "conj_expr", tcc_unary, 1) 810*e4b17023SJohn Marino 811*e4b17023SJohn Marino/* Nodes for ++ and -- in C. 812*e4b17023SJohn Marino The second arg is how much to increment or decrement by. 813*e4b17023SJohn Marino For a pointer, it would be the size of the object pointed to. */ 814*e4b17023SJohn MarinoDEFTREECODE (PREDECREMENT_EXPR, "predecrement_expr", tcc_expression, 2) 815*e4b17023SJohn MarinoDEFTREECODE (PREINCREMENT_EXPR, "preincrement_expr", tcc_expression, 2) 816*e4b17023SJohn MarinoDEFTREECODE (POSTDECREMENT_EXPR, "postdecrement_expr", tcc_expression, 2) 817*e4b17023SJohn MarinoDEFTREECODE (POSTINCREMENT_EXPR, "postincrement_expr", tcc_expression, 2) 818*e4b17023SJohn Marino 819*e4b17023SJohn Marino/* Used to implement `va_arg'. */ 820*e4b17023SJohn MarinoDEFTREECODE (VA_ARG_EXPR, "va_arg_expr", tcc_expression, 1) 821*e4b17023SJohn Marino 822*e4b17023SJohn Marino/* Evaluate operand 1. If and only if an exception is thrown during 823*e4b17023SJohn Marino the evaluation of operand 1, evaluate operand 2. 824*e4b17023SJohn Marino 825*e4b17023SJohn Marino This differs from TRY_FINALLY_EXPR in that operand 2 is not evaluated 826*e4b17023SJohn Marino on a normal or jump exit, only on an exception. */ 827*e4b17023SJohn MarinoDEFTREECODE (TRY_CATCH_EXPR, "try_catch_expr", tcc_statement, 2) 828*e4b17023SJohn Marino 829*e4b17023SJohn Marino/* Evaluate the first operand. 830*e4b17023SJohn Marino The second operand is a cleanup expression which is evaluated 831*e4b17023SJohn Marino on any exit (normal, exception, or jump out) from this expression. */ 832*e4b17023SJohn MarinoDEFTREECODE (TRY_FINALLY_EXPR, "try_finally", tcc_statement, 2) 833*e4b17023SJohn Marino 834*e4b17023SJohn Marino/* These types of expressions have no useful value, 835*e4b17023SJohn Marino and always have side effects. */ 836*e4b17023SJohn Marino 837*e4b17023SJohn Marino/* Used to represent a local declaration. The operand is DECL_EXPR_DECL. */ 838*e4b17023SJohn MarinoDEFTREECODE (DECL_EXPR, "decl_expr", tcc_statement, 1) 839*e4b17023SJohn Marino 840*e4b17023SJohn Marino/* A label definition, encapsulated as a statement. 841*e4b17023SJohn Marino Operand 0 is the LABEL_DECL node for the label that appears here. 842*e4b17023SJohn Marino The type should be void and the value should be ignored. */ 843*e4b17023SJohn MarinoDEFTREECODE (LABEL_EXPR, "label_expr", tcc_statement, 1) 844*e4b17023SJohn Marino 845*e4b17023SJohn Marino/* GOTO. Operand 0 is a LABEL_DECL node or an expression. 846*e4b17023SJohn Marino The type should be void and the value should be ignored. */ 847*e4b17023SJohn MarinoDEFTREECODE (GOTO_EXPR, "goto_expr", tcc_statement, 1) 848*e4b17023SJohn Marino 849*e4b17023SJohn Marino/* RETURN. Evaluates operand 0, then returns from the current function. 850*e4b17023SJohn Marino Presumably that operand is an assignment that stores into the 851*e4b17023SJohn Marino RESULT_DECL that hold the value to be returned. 852*e4b17023SJohn Marino The operand may be null. 853*e4b17023SJohn Marino The type should be void and the value should be ignored. */ 854*e4b17023SJohn MarinoDEFTREECODE (RETURN_EXPR, "return_expr", tcc_statement, 1) 855*e4b17023SJohn Marino 856*e4b17023SJohn Marino/* Exit the inner most loop conditionally. Operand 0 is the condition. 857*e4b17023SJohn Marino The type should be void and the value should be ignored. */ 858*e4b17023SJohn MarinoDEFTREECODE (EXIT_EXPR, "exit_expr", tcc_statement, 1) 859*e4b17023SJohn Marino 860*e4b17023SJohn Marino/* A loop. Operand 0 is the body of the loop. 861*e4b17023SJohn Marino It must contain an EXIT_EXPR or is an infinite loop. 862*e4b17023SJohn Marino The type should be void and the value should be ignored. */ 863*e4b17023SJohn MarinoDEFTREECODE (LOOP_EXPR, "loop_expr", tcc_statement, 1) 864*e4b17023SJohn Marino 865*e4b17023SJohn Marino/* Switch expression. 866*e4b17023SJohn Marino 867*e4b17023SJohn Marino TREE_TYPE is the original type of the condition, before any 868*e4b17023SJohn Marino language required type conversions. It may be NULL, in which case 869*e4b17023SJohn Marino the original type and final types are assumed to be the same. 870*e4b17023SJohn Marino 871*e4b17023SJohn Marino Operand 0 is the expression used to perform the branch, 872*e4b17023SJohn Marino Operand 1 is the body of the switch, which probably contains 873*e4b17023SJohn Marino CASE_LABEL_EXPRs. It may also be NULL, in which case operand 2 874*e4b17023SJohn Marino must not be NULL. 875*e4b17023SJohn Marino Operand 2 is either NULL_TREE or a TREE_VEC of the CASE_LABEL_EXPRs 876*e4b17023SJohn Marino of all the cases. */ 877*e4b17023SJohn MarinoDEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statement, 3) 878*e4b17023SJohn Marino 879*e4b17023SJohn Marino/* Used to represent a case label. The operands are CASE_LOW and 880*e4b17023SJohn Marino CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a 881*e4b17023SJohn Marino 'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case 882*e4b17023SJohn Marino label. CASE_LABEL is the corresponding LABEL_DECL. */ 883*e4b17023SJohn MarinoDEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4) 884*e4b17023SJohn Marino 885*e4b17023SJohn Marino/* Used to represent an inline assembly statement. ASM_STRING returns a 886*e4b17023SJohn Marino STRING_CST for the instruction (e.g., "mov x, y"). ASM_OUTPUTS, 887*e4b17023SJohn Marino ASM_INPUTS, and ASM_CLOBBERS represent the outputs, inputs, and clobbers 888*e4b17023SJohn Marino for the statement. ASM_LABELS, if present, indicates various destinations 889*e4b17023SJohn Marino for the asm; labels cannot be combined with outputs. */ 890*e4b17023SJohn MarinoDEFTREECODE (ASM_EXPR, "asm_expr", tcc_statement, 5) 891*e4b17023SJohn Marino 892*e4b17023SJohn Marino/* Variable references for SSA analysis. New SSA names are created every 893*e4b17023SJohn Marino time a variable is assigned a new value. The SSA builder uses SSA_NAME 894*e4b17023SJohn Marino nodes to implement SSA versioning. */ 895*e4b17023SJohn MarinoDEFTREECODE (SSA_NAME, "ssa_name", tcc_exceptional, 0) 896*e4b17023SJohn Marino 897*e4b17023SJohn Marino/* Used to represent a typed exception handler. CATCH_TYPES is the type (or 898*e4b17023SJohn Marino list of types) handled, and CATCH_BODY is the code for the handler. */ 899*e4b17023SJohn MarinoDEFTREECODE (CATCH_EXPR, "catch_expr", tcc_statement, 2) 900*e4b17023SJohn Marino 901*e4b17023SJohn Marino/* Used to represent an exception specification. EH_FILTER_TYPES is a list 902*e4b17023SJohn Marino of allowed types, and EH_FILTER_FAILURE is an expression to evaluate on 903*e4b17023SJohn Marino failure. */ 904*e4b17023SJohn MarinoDEFTREECODE (EH_FILTER_EXPR, "eh_filter_expr", tcc_statement, 2) 905*e4b17023SJohn Marino 906*e4b17023SJohn Marino/* Node used for describing a property that is known at compile 907*e4b17023SJohn Marino time. */ 908*e4b17023SJohn MarinoDEFTREECODE (SCEV_KNOWN, "scev_known", tcc_expression, 0) 909*e4b17023SJohn Marino 910*e4b17023SJohn Marino/* Node used for describing a property that is not known at compile 911*e4b17023SJohn Marino time. */ 912*e4b17023SJohn MarinoDEFTREECODE (SCEV_NOT_KNOWN, "scev_not_known", tcc_expression, 0) 913*e4b17023SJohn Marino 914*e4b17023SJohn Marino/* Polynomial chains of recurrences. 915*e4b17023SJohn Marino Under the form: cr = {CHREC_LEFT (cr), +, CHREC_RIGHT (cr)}. */ 916*e4b17023SJohn MarinoDEFTREECODE (POLYNOMIAL_CHREC, "polynomial_chrec", tcc_expression, 3) 917*e4b17023SJohn Marino 918*e4b17023SJohn Marino/* Used to chain children of container statements together. 919*e4b17023SJohn Marino Use the interface in tree-iterator.h to access this node. */ 920*e4b17023SJohn MarinoDEFTREECODE (STATEMENT_LIST, "statement_list", tcc_exceptional, 0) 921*e4b17023SJohn Marino 922*e4b17023SJohn Marino/* Predicate assertion. Artificial expression generated by the optimizers 923*e4b17023SJohn Marino to keep track of predicate values. This expression may only appear on 924*e4b17023SJohn Marino the RHS of assignments. 925*e4b17023SJohn Marino 926*e4b17023SJohn Marino Given X = ASSERT_EXPR <Y, EXPR>, the optimizers can infer 927*e4b17023SJohn Marino two things: 928*e4b17023SJohn Marino 929*e4b17023SJohn Marino 1- X is a copy of Y. 930*e4b17023SJohn Marino 2- EXPR is a conditional expression and is known to be true. 931*e4b17023SJohn Marino 932*e4b17023SJohn Marino Valid and to be expected forms of conditional expressions are 933*e4b17023SJohn Marino valid GIMPLE conditional expressions (as defined by is_gimple_condexpr) 934*e4b17023SJohn Marino and conditional expressions with the first operand being a 935*e4b17023SJohn Marino PLUS_EXPR with a variable possibly wrapped in a NOP_EXPR first 936*e4b17023SJohn Marino operand and an integer constant second operand. 937*e4b17023SJohn Marino 938*e4b17023SJohn Marino The type of the expression is the same as Y. */ 939*e4b17023SJohn MarinoDEFTREECODE (ASSERT_EXPR, "assert_expr", tcc_expression, 2) 940*e4b17023SJohn Marino 941*e4b17023SJohn Marino/* Base class information. Holds information about a class as a 942*e4b17023SJohn Marino baseclass of itself or another class. */ 943*e4b17023SJohn MarinoDEFTREECODE (TREE_BINFO, "tree_binfo", tcc_exceptional, 0) 944*e4b17023SJohn Marino 945*e4b17023SJohn Marino/* Records the size for an expression of variable size type. This is 946*e4b17023SJohn Marino for use in contexts in which we are accessing the entire object, 947*e4b17023SJohn Marino such as for a function call, or block copy. 948*e4b17023SJohn Marino Operand 0 is the real expression. 949*e4b17023SJohn Marino Operand 1 is the size of the type in the expression. */ 950*e4b17023SJohn MarinoDEFTREECODE (WITH_SIZE_EXPR, "with_size_expr", tcc_expression, 2) 951*e4b17023SJohn Marino 952*e4b17023SJohn Marino/* Extract elements from two input vectors Operand 0 and Operand 1 953*e4b17023SJohn Marino size VS, according to the offset OFF defined by Operand 2 as 954*e4b17023SJohn Marino follows: 955*e4b17023SJohn Marino If OFF > 0, the last VS - OFF elements of vector OP0 are concatenated to 956*e4b17023SJohn Marino the first OFF elements of the vector OP1. 957*e4b17023SJohn Marino If OFF == 0, then the returned vector is OP1. 958*e4b17023SJohn Marino On different targets OFF may take different forms; It can be an address, in 959*e4b17023SJohn Marino which case its low log2(VS)-1 bits define the offset, or it can be a mask 960*e4b17023SJohn Marino generated by the builtin targetm.vectorize.mask_for_load_builtin_decl. */ 961*e4b17023SJohn MarinoDEFTREECODE (REALIGN_LOAD_EXPR, "realign_load", tcc_expression, 3) 962*e4b17023SJohn Marino 963*e4b17023SJohn Marino/* Low-level memory addressing. Operands are BASE (address of static or 964*e4b17023SJohn Marino global variable or register), OFFSET (integer constant), 965*e4b17023SJohn Marino INDEX (register), STEP (integer constant), INDEX2 (register), 966*e4b17023SJohn Marino The corresponding address is BASE + STEP * INDEX + INDEX2 + OFFSET. 967*e4b17023SJohn Marino Only variations and values valid on the target are allowed. 968*e4b17023SJohn Marino 969*e4b17023SJohn Marino The type of STEP, INDEX and INDEX2 is sizetype. 970*e4b17023SJohn Marino 971*e4b17023SJohn Marino The type of BASE is a pointer type. If BASE is not an address of 972*e4b17023SJohn Marino a static or global variable INDEX2 will be NULL. 973*e4b17023SJohn Marino 974*e4b17023SJohn Marino The type of OFFSET is a pointer type and determines TBAA the same as 975*e4b17023SJohn Marino the constant offset operand in MEM_REF. */ 976*e4b17023SJohn Marino 977*e4b17023SJohn MarinoDEFTREECODE (TARGET_MEM_REF, "target_mem_ref", tcc_reference, 5) 978*e4b17023SJohn Marino 979*e4b17023SJohn Marino/* Memory addressing. Operands are a pointer and a tree constant integer 980*e4b17023SJohn Marino byte offset of the pointer type that when dereferenced yields the 981*e4b17023SJohn Marino type of the base object the pointer points into and which is used for 982*e4b17023SJohn Marino TBAA purposes. 983*e4b17023SJohn Marino The type of the MEM_REF is the type the bytes at the memory location 984*e4b17023SJohn Marino are interpreted as. 985*e4b17023SJohn Marino MEM_REF <p, c> is equivalent to ((typeof(c))p)->x... where x... is a 986*e4b17023SJohn Marino chain of component references offsetting p by c. */ 987*e4b17023SJohn MarinoDEFTREECODE (MEM_REF, "mem_ref", tcc_reference, 2) 988*e4b17023SJohn Marino 989*e4b17023SJohn Marino/* The ordering of the codes between OMP_PARALLEL and OMP_CRITICAL is 990*e4b17023SJohn Marino exposed to TREE_RANGE_CHECK. */ 991*e4b17023SJohn Marino/* OpenMP - #pragma omp parallel [clause1 ... clauseN] 992*e4b17023SJohn Marino Operand 0: OMP_PARALLEL_BODY: Code to be executed by all threads. 993*e4b17023SJohn Marino Operand 1: OMP_PARALLEL_CLAUSES: List of clauses. */ 994*e4b17023SJohn Marino 995*e4b17023SJohn MarinoDEFTREECODE (OMP_PARALLEL, "omp_parallel", tcc_statement, 2) 996*e4b17023SJohn Marino 997*e4b17023SJohn Marino/* OpenMP - #pragma omp task [clause1 ... clauseN] 998*e4b17023SJohn Marino Operand 0: OMP_TASK_BODY: Code to be executed by all threads. 999*e4b17023SJohn Marino Operand 1: OMP_TASK_CLAUSES: List of clauses. */ 1000*e4b17023SJohn Marino 1001*e4b17023SJohn MarinoDEFTREECODE (OMP_TASK, "omp_task", tcc_statement, 2) 1002*e4b17023SJohn Marino 1003*e4b17023SJohn Marino/* OpenMP - #pragma omp for [clause1 ... clauseN] 1004*e4b17023SJohn Marino Operand 0: OMP_FOR_BODY: Loop body. 1005*e4b17023SJohn Marino Operand 1: OMP_FOR_CLAUSES: List of clauses. 1006*e4b17023SJohn Marino Operand 2: OMP_FOR_INIT: Initialization code of the form 1007*e4b17023SJohn Marino VAR = N1. 1008*e4b17023SJohn Marino Operand 3: OMP_FOR_COND: Loop conditional expression of the form 1009*e4b17023SJohn Marino VAR { <, >, <=, >= } N2. 1010*e4b17023SJohn Marino Operand 4: OMP_FOR_INCR: Loop index increment of the form 1011*e4b17023SJohn Marino VAR { +=, -= } INCR. 1012*e4b17023SJohn Marino Operand 5: OMP_FOR_PRE_BODY: Filled by the gimplifier with things 1013*e4b17023SJohn Marino from INIT, COND, and INCR that are technically part of the 1014*e4b17023SJohn Marino OMP_FOR structured block, but are evaluated before the loop 1015*e4b17023SJohn Marino body begins. 1016*e4b17023SJohn Marino 1017*e4b17023SJohn Marino VAR must be an integer or pointer variable, which is implicitly thread 1018*e4b17023SJohn Marino private. N1, N2 and INCR are required to be loop invariant integer 1019*e4b17023SJohn Marino expressions that are evaluated without any synchronization. 1020*e4b17023SJohn Marino The evaluation order, frequency of evaluation and side-effects are 1021*e4b17023SJohn Marino unspecified by the standard. */ 1022*e4b17023SJohn MarinoDEFTREECODE (OMP_FOR, "omp_for", tcc_statement, 6) 1023*e4b17023SJohn Marino 1024*e4b17023SJohn Marino/* OpenMP - #pragma omp sections [clause1 ... clauseN] 1025*e4b17023SJohn Marino Operand 0: OMP_SECTIONS_BODY: Sections body. 1026*e4b17023SJohn Marino Operand 1: OMP_SECTIONS_CLAUSES: List of clauses. */ 1027*e4b17023SJohn MarinoDEFTREECODE (OMP_SECTIONS, "omp_sections", tcc_statement, 2) 1028*e4b17023SJohn Marino 1029*e4b17023SJohn Marino/* OpenMP - #pragma omp single 1030*e4b17023SJohn Marino Operand 0: OMP_SINGLE_BODY: Single section body. 1031*e4b17023SJohn Marino Operand 1: OMP_SINGLE_CLAUSES: List of clauses. */ 1032*e4b17023SJohn MarinoDEFTREECODE (OMP_SINGLE, "omp_single", tcc_statement, 2) 1033*e4b17023SJohn Marino 1034*e4b17023SJohn Marino/* OpenMP - #pragma omp section 1035*e4b17023SJohn Marino Operand 0: OMP_SECTION_BODY: Section body. */ 1036*e4b17023SJohn MarinoDEFTREECODE (OMP_SECTION, "omp_section", tcc_statement, 1) 1037*e4b17023SJohn Marino 1038*e4b17023SJohn Marino/* OpenMP - #pragma omp master 1039*e4b17023SJohn Marino Operand 0: OMP_MASTER_BODY: Master section body. */ 1040*e4b17023SJohn MarinoDEFTREECODE (OMP_MASTER, "omp_master", tcc_statement, 1) 1041*e4b17023SJohn Marino 1042*e4b17023SJohn Marino/* OpenMP - #pragma omp ordered 1043*e4b17023SJohn Marino Operand 0: OMP_ORDERED_BODY: Master section body. */ 1044*e4b17023SJohn MarinoDEFTREECODE (OMP_ORDERED, "omp_ordered", tcc_statement, 1) 1045*e4b17023SJohn Marino 1046*e4b17023SJohn Marino/* OpenMP - #pragma omp critical [name] 1047*e4b17023SJohn Marino Operand 0: OMP_CRITICAL_BODY: Critical section body. 1048*e4b17023SJohn Marino Operand 1: OMP_CRITICAL_NAME: Identifier for critical section. */ 1049*e4b17023SJohn MarinoDEFTREECODE (OMP_CRITICAL, "omp_critical", tcc_statement, 2) 1050*e4b17023SJohn Marino 1051*e4b17023SJohn Marino/* OpenMP - #pragma omp atomic 1052*e4b17023SJohn Marino Operand 0: The address at which the atomic operation is to be performed. 1053*e4b17023SJohn Marino This address should be stabilized with save_expr. 1054*e4b17023SJohn Marino Operand 1: The expression to evaluate. When the old value of the object 1055*e4b17023SJohn Marino at the address is used in the expression, it should appear as if 1056*e4b17023SJohn Marino build_fold_indirect_ref of the address. */ 1057*e4b17023SJohn MarinoDEFTREECODE (OMP_ATOMIC, "omp_atomic", tcc_statement, 2) 1058*e4b17023SJohn Marino 1059*e4b17023SJohn Marino/* OpenMP - #pragma omp atomic read 1060*e4b17023SJohn Marino Operand 0: The address at which the atomic operation is to be performed. 1061*e4b17023SJohn Marino This address should be stabilized with save_expr. */ 1062*e4b17023SJohn MarinoDEFTREECODE (OMP_ATOMIC_READ, "omp_atomic_read", tcc_statement, 1) 1063*e4b17023SJohn Marino 1064*e4b17023SJohn Marino/* OpenMP - #pragma omp atomic capture 1065*e4b17023SJohn Marino Operand 0: The address at which the atomic operation is to be performed. 1066*e4b17023SJohn Marino This address should be stabilized with save_expr. 1067*e4b17023SJohn Marino Operand 1: The expression to evaluate. When the old value of the object 1068*e4b17023SJohn Marino at the address is used in the expression, it should appear as if 1069*e4b17023SJohn Marino build_fold_indirect_ref of the address. 1070*e4b17023SJohn Marino OMP_ATOMIC_CAPTURE_OLD returns the old memory content, 1071*e4b17023SJohn Marino OMP_ATOMIC_CAPTURE_NEW the new value. */ 1072*e4b17023SJohn MarinoDEFTREECODE (OMP_ATOMIC_CAPTURE_OLD, "omp_atomic_capture_old", tcc_statement, 2) 1073*e4b17023SJohn MarinoDEFTREECODE (OMP_ATOMIC_CAPTURE_NEW, "omp_atomic_capture_new", tcc_statement, 2) 1074*e4b17023SJohn Marino 1075*e4b17023SJohn Marino/* OpenMP clauses. */ 1076*e4b17023SJohn MarinoDEFTREECODE (OMP_CLAUSE, "omp_clause", tcc_exceptional, 0) 1077*e4b17023SJohn Marino 1078*e4b17023SJohn Marino/* TRANSACTION_EXPR tree code. 1079*e4b17023SJohn Marino Operand 0: BODY: contains body of the transaction. */ 1080*e4b17023SJohn MarinoDEFTREECODE (TRANSACTION_EXPR, "transaction_expr", tcc_expression, 1) 1081*e4b17023SJohn Marino 1082*e4b17023SJohn Marino/* Reduction operations. 1083*e4b17023SJohn Marino Operations that take a vector of elements and "reduce" it to a scalar 1084*e4b17023SJohn Marino result (e.g. summing the elements of the vector, finding the minimum over 1085*e4b17023SJohn Marino the vector elements, etc). 1086*e4b17023SJohn Marino Operand 0 is a vector; the first element in the vector has the result. 1087*e4b17023SJohn Marino Operand 1 is a vector. */ 1088*e4b17023SJohn MarinoDEFTREECODE (REDUC_MAX_EXPR, "reduc_max_expr", tcc_unary, 1) 1089*e4b17023SJohn MarinoDEFTREECODE (REDUC_MIN_EXPR, "reduc_min_expr", tcc_unary, 1) 1090*e4b17023SJohn MarinoDEFTREECODE (REDUC_PLUS_EXPR, "reduc_plus_expr", tcc_unary, 1) 1091*e4b17023SJohn Marino 1092*e4b17023SJohn Marino/* Widening dot-product. 1093*e4b17023SJohn Marino The first two arguments are of type t1. 1094*e4b17023SJohn Marino The third argument and the result are of type t2, such that t2 is at least 1095*e4b17023SJohn Marino twice the size of t1. DOT_PROD_EXPR(arg1,arg2,arg3) is equivalent to: 1096*e4b17023SJohn Marino tmp = WIDEN_MULT_EXPR(arg1, arg2); 1097*e4b17023SJohn Marino arg3 = PLUS_EXPR (tmp, arg3); 1098*e4b17023SJohn Marino or: 1099*e4b17023SJohn Marino tmp = WIDEN_MULT_EXPR(arg1, arg2); 1100*e4b17023SJohn Marino arg3 = WIDEN_SUM_EXPR (tmp, arg3); */ 1101*e4b17023SJohn MarinoDEFTREECODE (DOT_PROD_EXPR, "dot_prod_expr", tcc_expression, 3) 1102*e4b17023SJohn Marino 1103*e4b17023SJohn Marino/* Widening summation. 1104*e4b17023SJohn Marino The first argument is of type t1. 1105*e4b17023SJohn Marino The second argument is of type t2, such that t2 is at least twice 1106*e4b17023SJohn Marino the size of t1. The type of the entire expression is also t2. 1107*e4b17023SJohn Marino WIDEN_SUM_EXPR is equivalent to first widening (promoting) 1108*e4b17023SJohn Marino the first argument from type t1 to type t2, and then summing it 1109*e4b17023SJohn Marino with the second argument. */ 1110*e4b17023SJohn MarinoDEFTREECODE (WIDEN_SUM_EXPR, "widen_sum_expr", tcc_binary, 2) 1111*e4b17023SJohn Marino 1112*e4b17023SJohn Marino/* Widening multiplication. 1113*e4b17023SJohn Marino The two arguments are of type t1. 1114*e4b17023SJohn Marino The result is of type t2, such that t2 is at least twice 1115*e4b17023SJohn Marino the size of t1. WIDEN_MULT_EXPR is equivalent to first widening (promoting) 1116*e4b17023SJohn Marino the arguments from type t1 to type t2, and then multiplying them. */ 1117*e4b17023SJohn MarinoDEFTREECODE (WIDEN_MULT_EXPR, "widen_mult_expr", tcc_binary, 2) 1118*e4b17023SJohn Marino 1119*e4b17023SJohn Marino/* Widening multiply-accumulate. 1120*e4b17023SJohn Marino The first two arguments are of type t1. 1121*e4b17023SJohn Marino The third argument and the result are of type t2, such as t2 is at least 1122*e4b17023SJohn Marino twice the size of t1. t1 and t2 must be integral or fixed-point types. 1123*e4b17023SJohn Marino The expression is equivalent to a WIDEN_MULT_EXPR operation 1124*e4b17023SJohn Marino of the first two operands followed by an add or subtract of the third 1125*e4b17023SJohn Marino operand. */ 1126*e4b17023SJohn MarinoDEFTREECODE (WIDEN_MULT_PLUS_EXPR, "widen_mult_plus_expr", tcc_expression, 3) 1127*e4b17023SJohn Marino/* This is like the above, except in the final expression the multiply result 1128*e4b17023SJohn Marino is subtracted from t3. */ 1129*e4b17023SJohn MarinoDEFTREECODE (WIDEN_MULT_MINUS_EXPR, "widen_mult_minus_expr", tcc_expression, 3) 1130*e4b17023SJohn Marino 1131*e4b17023SJohn Marino/* Widening shift left. 1132*e4b17023SJohn Marino The first operand is of type t1. 1133*e4b17023SJohn Marino The second operand is the number of bits to shift by; it need not be the 1134*e4b17023SJohn Marino same type as the first operand and result. 1135*e4b17023SJohn Marino Note that the result is undefined if the second operand is larger 1136*e4b17023SJohn Marino than or equal to the first operand's type size. 1137*e4b17023SJohn Marino The type of the entire expression is t2, such that t2 is at least twice 1138*e4b17023SJohn Marino the size of t1. 1139*e4b17023SJohn Marino WIDEN_LSHIFT_EXPR is equivalent to first widening (promoting) 1140*e4b17023SJohn Marino the first argument from type t1 to type t2, and then shifting it 1141*e4b17023SJohn Marino by the second argument. */ 1142*e4b17023SJohn MarinoDEFTREECODE (WIDEN_LSHIFT_EXPR, "widen_lshift_expr", tcc_binary, 2) 1143*e4b17023SJohn Marino 1144*e4b17023SJohn Marino/* Fused multiply-add. 1145*e4b17023SJohn Marino All operands and the result are of the same type. No intermediate 1146*e4b17023SJohn Marino rounding is performed after multiplying operand one with operand two 1147*e4b17023SJohn Marino before adding operand three. */ 1148*e4b17023SJohn MarinoDEFTREECODE (FMA_EXPR, "fma_expr", tcc_expression, 3) 1149*e4b17023SJohn Marino 1150*e4b17023SJohn Marino/* Whole vector left/right shift in bits. 1151*e4b17023SJohn Marino Operand 0 is a vector to be shifted. 1152*e4b17023SJohn Marino Operand 1 is an integer shift amount in bits. */ 1153*e4b17023SJohn MarinoDEFTREECODE (VEC_LSHIFT_EXPR, "vec_lshift_expr", tcc_binary, 2) 1154*e4b17023SJohn MarinoDEFTREECODE (VEC_RSHIFT_EXPR, "vec_rshift_expr", tcc_binary, 2) 1155*e4b17023SJohn Marino 1156*e4b17023SJohn Marino/* Widening vector multiplication. 1157*e4b17023SJohn Marino The two operands are vectors with N elements of size S. Multiplying the 1158*e4b17023SJohn Marino elements of the two vectors will result in N products of size 2*S. 1159*e4b17023SJohn Marino VEC_WIDEN_MULT_HI_EXPR computes the N/2 high products. 1160*e4b17023SJohn Marino VEC_WIDEN_MULT_LO_EXPR computes the N/2 low products. */ 1161*e4b17023SJohn MarinoDEFTREECODE (VEC_WIDEN_MULT_HI_EXPR, "widen_mult_hi_expr", tcc_binary, 2) 1162*e4b17023SJohn MarinoDEFTREECODE (VEC_WIDEN_MULT_LO_EXPR, "widen_mult_lo_expr", tcc_binary, 2) 1163*e4b17023SJohn Marino 1164*e4b17023SJohn Marino/* Unpack (extract and promote/widen) the high/low elements of the input 1165*e4b17023SJohn Marino vector into the output vector. The input vector has twice as many 1166*e4b17023SJohn Marino elements as the output vector, that are half the size of the elements 1167*e4b17023SJohn Marino of the output vector. This is used to support type promotion. */ 1168*e4b17023SJohn MarinoDEFTREECODE (VEC_UNPACK_HI_EXPR, "vec_unpack_hi_expr", tcc_unary, 1) 1169*e4b17023SJohn MarinoDEFTREECODE (VEC_UNPACK_LO_EXPR, "vec_unpack_lo_expr", tcc_unary, 1) 1170*e4b17023SJohn Marino 1171*e4b17023SJohn Marino/* Unpack (extract) the high/low elements of the input vector, convert 1172*e4b17023SJohn Marino fixed point values to floating point and widen elements into the 1173*e4b17023SJohn Marino output vector. The input vector has twice as many elements as the output 1174*e4b17023SJohn Marino vector, that are half the size of the elements of the output vector. */ 1175*e4b17023SJohn MarinoDEFTREECODE (VEC_UNPACK_FLOAT_HI_EXPR, "vec_unpack_float_hi_expr", tcc_unary, 1) 1176*e4b17023SJohn MarinoDEFTREECODE (VEC_UNPACK_FLOAT_LO_EXPR, "vec_unpack_float_lo_expr", tcc_unary, 1) 1177*e4b17023SJohn Marino 1178*e4b17023SJohn Marino/* Pack (demote/narrow and merge) the elements of the two input vectors 1179*e4b17023SJohn Marino into the output vector using truncation/saturation. 1180*e4b17023SJohn Marino The elements of the input vectors are twice the size of the elements of the 1181*e4b17023SJohn Marino output vector. This is used to support type demotion. */ 1182*e4b17023SJohn MarinoDEFTREECODE (VEC_PACK_TRUNC_EXPR, "vec_pack_trunc_expr", tcc_binary, 2) 1183*e4b17023SJohn MarinoDEFTREECODE (VEC_PACK_SAT_EXPR, "vec_pack_sat_expr", tcc_binary, 2) 1184*e4b17023SJohn Marino 1185*e4b17023SJohn Marino/* Convert floating point values of the two input vectors to integer 1186*e4b17023SJohn Marino and pack (narrow and merge) the elements into the output vector. The 1187*e4b17023SJohn Marino elements of the input vector are twice the size of the elements of 1188*e4b17023SJohn Marino the output vector. */ 1189*e4b17023SJohn MarinoDEFTREECODE (VEC_PACK_FIX_TRUNC_EXPR, "vec_pack_fix_trunc_expr", tcc_binary, 2) 1190*e4b17023SJohn Marino 1191*e4b17023SJohn Marino/* Widening vector shift left in bits. 1192*e4b17023SJohn Marino Operand 0 is a vector to be shifted with N elements of size S. 1193*e4b17023SJohn Marino Operand 1 is an integer shift amount in bits. 1194*e4b17023SJohn Marino The result of the operation is N elements of size 2*S. 1195*e4b17023SJohn Marino VEC_WIDEN_LSHIFT_HI_EXPR computes the N/2 high results. 1196*e4b17023SJohn Marino VEC_WIDEN_LSHIFT_LO_EXPR computes the N/2 low results. 1197*e4b17023SJohn Marino */ 1198*e4b17023SJohn MarinoDEFTREECODE (VEC_WIDEN_LSHIFT_HI_EXPR, "widen_lshift_hi_expr", tcc_binary, 2) 1199*e4b17023SJohn MarinoDEFTREECODE (VEC_WIDEN_LSHIFT_LO_EXPR, "widen_lshift_lo_expr", tcc_binary, 2) 1200*e4b17023SJohn Marino 1201*e4b17023SJohn Marino/* PREDICT_EXPR. Specify hint for branch prediction. The 1202*e4b17023SJohn Marino PREDICT_EXPR_PREDICTOR specify predictor and PREDICT_EXPR_OUTCOME the 1203*e4b17023SJohn Marino outcome (0 for not taken and 1 for taken). Once the profile is guessed 1204*e4b17023SJohn Marino all conditional branches leading to execution paths executing the 1205*e4b17023SJohn Marino PREDICT_EXPR will get predicted by the specified predictor. */ 1206*e4b17023SJohn MarinoDEFTREECODE (PREDICT_EXPR, "predict_expr", tcc_expression, 1) 1207*e4b17023SJohn Marino 1208*e4b17023SJohn Marino/* OPTIMIZATION_NODE. Node to store the optimization options. */ 1209*e4b17023SJohn MarinoDEFTREECODE (OPTIMIZATION_NODE, "optimization_node", tcc_exceptional, 0) 1210*e4b17023SJohn Marino 1211*e4b17023SJohn Marino/* TARGET_OPTION_NODE. Node to store the target specific options. */ 1212*e4b17023SJohn MarinoDEFTREECODE (TARGET_OPTION_NODE, "target_option_node", tcc_exceptional, 0) 1213*e4b17023SJohn Marino 1214*e4b17023SJohn Marino/* 1215*e4b17023SJohn MarinoLocal variables: 1216*e4b17023SJohn Marinomode:c 1217*e4b17023SJohn MarinoEnd: 1218*e4b17023SJohn Marino*/ 1219