expr.h revision 90075
1139825Simp/* Definitions for code generation pass of GNU compiler. 248006Skato Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 348006Skato 1999, 2000 Free Software Foundation, Inc. 448006Skato 548006SkatoThis file is part of GCC. 648006Skato 748006SkatoGCC is free software; you can redistribute it and/or modify it under 848006Skatothe terms of the GNU General Public License as published by the Free 948006SkatoSoftware Foundation; either version 2, or (at your option) any later 1048006Skatoversion. 1148006Skato 1248006SkatoGCC is distributed in the hope that it will be useful, but WITHOUT ANY 1348006SkatoWARRANTY; without even the implied warranty of MERCHANTABILITY or 1448006SkatoFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1548006Skatofor more details. 1648006Skato 1748006SkatoYou should have received a copy of the GNU General Public License 1848006Skatoalong with GCC; see the file COPYING. If not, write to the Free 1948006SkatoSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA 2048006Skato02111-1307, USA. */ 2148006Skato 2248006Skato/* The default branch cost is 1. */ 2348006Skato#ifndef BRANCH_COST 2448006Skato#define BRANCH_COST 1 2548006Skato#endif 2648006Skato 2748006Skato/* Macros to access the slots of a QUEUED rtx. 2848006Skato Here rather than in rtl.h because only the expansion pass 2948006Skato should ever encounter a QUEUED. */ 3048006Skato 3148006Skato/* The variable for which an increment is queued. */ 3248006Skato#define QUEUED_VAR(P) XEXP (P, 0) 3348006Skato/* If the increment has been emitted, this is the insn 3448006Skato that does the increment. It is zero before the increment is emitted. 3548006Skato If more than one insn is emitted, this is the first insn. */ 3648006Skato#define QUEUED_INSN(P) XEXP (P, 1) 3748006Skato/* If a pre-increment copy has been generated, this is the copy 3848006Skato (it is a temporary reg). Zero if no copy made yet. */ 3948006Skato#define QUEUED_COPY(P) XEXP (P, 2) 4048006Skato/* This is the body to use for the insn to do the increment. 4148006Skato It is used to emit the increment. */ 4248006Skato#define QUEUED_BODY(P) XEXP (P, 3) 4348006Skato/* Next QUEUED in the queue. */ 4448006Skato#define QUEUED_NEXT(P) XEXP (P, 4) 4548006Skato 4648006Skato/* This is the 4th arg to `expand_expr'. 4748006Skato EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx. 4848006Skato EXPAND_INITIALIZER is similar but also record any labels on forced_labels. 4950477Speter EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address 5048006Skato is a constant that is not a legitimate address. 5148006Skato EXPAND_WRITE means we are only going to write to the resulting rtx. */ 5248006Skatoenum expand_modifier {EXPAND_NORMAL, EXPAND_SUM, EXPAND_CONST_ADDRESS, 5348006Skato EXPAND_INITIALIZER, EXPAND_WRITE}; 5448006Skato 5548006Skato/* Prevent the compiler from deferring stack pops. See 5648006Skato inhibit_defer_pop for more information. */ 5748006Skato#define NO_DEFER_POP (inhibit_defer_pop += 1) 5848006Skato 5948006Skato/* Allow the compiler to defer stack pops. See inhibit_defer_pop for 6048006Skato more information. */ 6148006Skato#define OK_DEFER_POP (inhibit_defer_pop -= 1) 6248006Skato 6348006Skato#ifdef TREE_CODE /* Don't lose if tree.h not included. */ 6448006Skato/* Structure to record the size of a sequence of arguments 65108470Sschweikh as the sum of a tree-expression and a constant. This structure is 6648006Skato also used to store offsets from the stack, which might be negative, 6748006Skato so the variable part must be ssizetype, not sizetype. */ 6848006Skato 6948006Skatostruct args_size 7048006Skato{ 7148006Skato HOST_WIDE_INT constant; 7248006Skato tree var; 7348006Skato}; 7448006Skato#endif 7548006Skato 7648006Skato/* Add the value of the tree INC to the `struct args_size' TO. */ 7748006Skato 7848006Skato#define ADD_PARM_SIZE(TO, INC) \ 7948006Skato{ tree inc = (INC); \ 8048006Skato if (host_integerp (inc, 0)) \ 8148006Skato (TO).constant += tree_low_cst (inc, 0); \ 8248006Skato else if ((TO).var == 0) \ 8348006Skato (TO).var = inc; \ 8448006Skato else \ 8548006Skato (TO).var = size_binop (PLUS_EXPR, (TO).var, inc); } 8648006Skato 8748006Skato#define SUB_PARM_SIZE(TO, DEC) \ 8848006Skato{ tree dec = (DEC); \ 8948006Skato if (host_integerp (dec, 0)) \ 9048006Skato (TO).constant -= tree_low_cst (dec, 0); \ 9148006Skato else if ((TO).var == 0) \ 9248006Skato (TO).var = size_binop (MINUS_EXPR, ssize_int (0), dec); \ 9348006Skato else \ 9448006Skato (TO).var = size_binop (MINUS_EXPR, (TO).var, dec); } 9548006Skato 9648006Skato/* Convert the implicit sum in a `struct args_size' into a tree 9748006Skato of type ssizetype. */ 9848006Skato#define ARGS_SIZE_TREE(SIZE) \ 9948006Skato((SIZE).var == 0 ? ssize_int ((SIZE).constant) \ 10048006Skato : size_binop (PLUS_EXPR, (SIZE).var, ssize_int ((SIZE).constant))) 10148006Skato 10248006Skato/* Convert the implicit sum in a `struct args_size' into an rtx. */ 10348006Skato#define ARGS_SIZE_RTX(SIZE) \ 10448006Skato((SIZE).var == 0 ? GEN_INT ((SIZE).constant) \ 10548006Skato : expand_expr (ARGS_SIZE_TREE (SIZE), NULL_RTX, VOIDmode, 0)) 10648006Skato 10761116Snyan/* Supply a default definition for FUNCTION_ARG_PADDING: 10848006Skato usually pad upward, but pad short args downward on 109130174Sphk big-endian machines. */ 11048006Skato 11148006Skatoenum direction {none, upward, downward}; /* Value has this type. */ 112116431Sphk 11348006Skato#ifndef FUNCTION_ARG_PADDING 11480537Snyan#define FUNCTION_ARG_PADDING(MODE, TYPE) \ 11580537Snyan (! BYTES_BIG_ENDIAN \ 11680537Snyan ? upward \ 11780537Snyan : (((MODE) == BLKmode \ 11880537Snyan ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ 11980537Snyan && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ 120146051Snyan : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ 12160950Snyan ? downward : upward)) 12248006Skato#endif 12348006Skato 12448006Skato/* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let 12548006Skato FUNCTION_ARG_PADDING, which also pads the length, handle any needed 12648006Skato alignment. */ 12748006Skato 12848006Skato#ifndef FUNCTION_ARG_BOUNDARY 12948006Skato#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY 13048006Skato#endif 13148006Skato 13248006Skato/* Provide a default value for STRICT_ARGUMENT_NAMING. */ 13348006Skato#ifndef STRICT_ARGUMENT_NAMING 13448006Skato#define STRICT_ARGUMENT_NAMING 0 13548006Skato#endif 13648006Skato 13748006Skato/* Provide a default value for PRETEND_OUTGOING_VARARGS_NAMED. */ 13848006Skato#ifdef SETUP_INCOMING_VARARGS 13980537Snyan#ifndef PRETEND_OUTGOING_VARARGS_NAMED 14080537Snyan#define PRETEND_OUTGOING_VARARGS_NAMED 1 14180537Snyan#endif 14280537Snyan#else 14380537Snyan/* It is an error to define PRETEND_OUTGOING_VARARGS_NAMED without 14448006Skato defining SETUP_INCOMING_VARARGS. */ 14548006Skato#define PRETEND_OUTGOING_VARARGS_NAMED 0 14648006Skato#endif 14748006Skato 14848006Skato/* Nonzero if we do not know how to pass TYPE solely in registers. 14948006Skato We cannot do so in the following cases: 15048006Skato 15148006Skato - if the type has variable size 15248006Skato - if the type is marked as addressable (it is required to be constructed 15348006Skato into the stack) 15448006Skato - if the padding and mode of the type is such that a copy into a register 15548006Skato would put it into the wrong part of the register. 156116431Sphk 15748006Skato Which padding can't be supported depends on the byte endianness. 15848006Skato 15948006Skato A value in a register is implicitly padded at the most significant end. 16048006Skato On a big-endian machine, that is the lower end in memory. 16148006Skato So a value padded in memory at the upper end can't go in a register. 16248006Skato For a little-endian machine, the reverse is true. */ 16348006Skato 16448006Skato#ifndef MUST_PASS_IN_STACK 16580537Snyan#define MUST_PASS_IN_STACK(MODE,TYPE) \ 16648006Skato ((TYPE) != 0 \ 16748006Skato && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ 16848006Skato || TREE_ADDRESSABLE (TYPE) \ 16948006Skato || ((MODE) == BLKmode \ 17048006Skato && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ 17148006Skato && 0 == (int_size_in_bytes (TYPE) \ 17248006Skato % (PARM_BOUNDARY / BITS_PER_UNIT))) \ 17348006Skato && (FUNCTION_ARG_PADDING (MODE, TYPE) \ 17448006Skato == (BYTES_BIG_ENDIAN ? upward : downward))))) 17548006Skato#endif 17648006Skato 17748006Skato/* Nonzero if type TYPE should be returned in memory. 17848006Skato Most machines can use the following default definition. */ 17948006Skato 18048006Skato#ifndef RETURN_IN_MEMORY 18148006Skato#define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode) 18248006Skato#endif 18348006Skato 18448006Skato/* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save. 18548006Skato Normally move_insn, so Pmode stack pointer. */ 18648006Skato 18748006Skato#ifndef STACK_SAVEAREA_MODE 18848006Skato#define STACK_SAVEAREA_MODE(LEVEL) Pmode 18948006Skato#endif 19080537Snyan 19180537Snyan/* Supply a default definition of STACK_SIZE_MODE for 19280537Snyan allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */ 19348006Skato 19480537Snyan#ifndef STACK_SIZE_MODE 19580537Snyan#define STACK_SIZE_MODE word_mode 19680537Snyan#endif 19780537Snyan 19880537Snyan/* Provide default values for the macros controlling stack checking. */ 19980537Snyan 20048006Skato#ifndef STACK_CHECK_BUILTIN 20148006Skato#define STACK_CHECK_BUILTIN 0 20280537Snyan#endif 20380537Snyan 20480537Snyan/* The default interval is one page. */ 20580537Snyan#ifndef STACK_CHECK_PROBE_INTERVAL 20680537Snyan#define STACK_CHECK_PROBE_INTERVAL 4096 20780537Snyan#endif 20880537Snyan 20980537Snyan/* The default is to do a store into the stack. */ 21048006Skato#ifndef STACK_CHECK_PROBE_LOAD 21148006Skato#define STACK_CHECK_PROBE_LOAD 0 21248006Skato#endif 21348006Skato 21448006Skato/* This value is arbitrary, but should be sufficient for most machines. */ 21548006Skato#ifndef STACK_CHECK_PROTECT 216126080Sphk#define STACK_CHECK_PROTECT (75 * UNITS_PER_WORD) 217126080Sphk#endif 218111815Sphk 219111815Sphk/* Make the maximum frame size be the largest we can and still only need 220111815Sphk one probe per function. */ 221111815Sphk#ifndef STACK_CHECK_MAX_FRAME_SIZE 222111815Sphk#define STACK_CHECK_MAX_FRAME_SIZE \ 22348006Skato (STACK_CHECK_PROBE_INTERVAL - UNITS_PER_WORD) 22448006Skato#endif 22580537Snyan 22680537Snyan/* This is arbitrary, but should be large enough everywhere. */ 22748006Skato#ifndef STACK_CHECK_FIXED_FRAME_SIZE 22848006Skato#define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD) 22948006Skato#endif 23048006Skato 23148006Skato/* Provide a reasonable default for the maximum size of an object to 23248006Skato allocate in the fixed frame. We may need to be able to make this 23348006Skato controllable by the user at some point. */ 23448006Skato#ifndef STACK_CHECK_MAX_VAR_SIZE 23548006Skato#define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) 23648006Skato#endif 23748006Skato 23848006Skato/* Functions from optabs.c, commonly used, and without need for the optabs 23948006Skato tables: */ 24048006Skato 24148006Skato/* Passed to expand_simple_binop and expand_binop to say which options 24248006Skato to try to use if the requested operation can't be open-coded on the 24348006Skato requisite mode. Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using 24448006Skato a library call. Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try 24548006Skato using a wider mode. OPTAB_MUST_WIDEN says try widening and don't 24648006Skato try anything else. */ 24748006Skato 24848006Skatoenum optab_methods 24948006Skato{ 25048006Skato OPTAB_DIRECT, 25148006Skato OPTAB_LIB, 25248006Skato OPTAB_WIDEN, 25348006Skato OPTAB_LIB_WIDEN, 25448006Skato OPTAB_MUST_WIDEN 25548006Skato}; 25648006Skato 25748006Skato/* Generate code for a simple binary or unary operation. "Simple" in 25848006Skato this case means "can be unambiguously described by a (mode, code) 25948006Skato pair and mapped to a single optab." */ 26048006Skatoextern rtx expand_simple_binop PARAMS ((enum machine_mode, enum rtx_code, rtx, 26148006Skato rtx, rtx, int, enum optab_methods)); 26248006Skatoextern rtx expand_simple_unop PARAMS ((enum machine_mode, enum rtx_code, 26348006Skato rtx, rtx, int)); 26448006Skato 26548006Skato/* Report whether the machine description contains an insn which can 26648006Skato perform the operation described by CODE and MODE. */ 26748006Skatoextern int have_insn_for PARAMS ((enum rtx_code, enum machine_mode)); 26848006Skato 26948006Skato/* Emit code to make a call to a constant function or a library call. */ 27048006Skatoextern void emit_libcall_block PARAMS ((rtx, rtx, rtx, rtx)); 27148006Skato 27248006Skato/* Create but don't emit one rtl instruction to perform certain operations. 27380537Snyan Modes must match; operands must meet the operation's predicates. 27448006Skato Likewise for subtraction and for just copying. 27548006Skato These do not call protect_from_queue; caller must do so. */ 27648006Skatoextern rtx gen_add2_insn PARAMS ((rtx, rtx)); 27780537Snyanextern rtx gen_add3_insn PARAMS ((rtx, rtx, rtx)); 27880537Snyanextern rtx gen_sub2_insn PARAMS ((rtx, rtx)); 27948006Skatoextern rtx gen_sub3_insn PARAMS ((rtx, rtx, rtx)); 28080537Snyanextern rtx gen_move_insn PARAMS ((rtx, rtx)); 28180537Snyanextern int have_add2_insn PARAMS ((rtx, rtx)); 28280537Snyanextern int have_sub2_insn PARAMS ((rtx, rtx)); 28380537Snyan 28480537Snyan/* Emit a pair of rtl insns to compare two rtx's and to jump 28580537Snyan to a label if the comparison is true. */ 28680537Snyanextern void emit_cmp_and_jump_insns PARAMS ((rtx, rtx, enum rtx_code, rtx, 28780537Snyan enum machine_mode, int, rtx)); 28880537Snyan 28980537Snyan/* Generate code to indirectly jump to a location given in the rtx LOC. */ 29080537Snyanextern void emit_indirect_jump PARAMS ((rtx)); 29180537Snyan 29280537Snyan#ifdef HAVE_conditional_move 29380537Snyan/* Emit a conditional move operation. */ 29448006Skatortx emit_conditional_move PARAMS ((rtx, enum rtx_code, rtx, rtx, 29548006Skato enum machine_mode, rtx, rtx, 29648006Skato enum machine_mode, int)); 29748006Skato 29848006Skato/* Return non-zero if the conditional move is supported. */ 29948006Skatoint can_conditionally_move_p PARAMS ((enum machine_mode mode)); 30048006Skato 30180537Snyan#endif 30280537Snyan 30380537Snyan 30448006Skato/* Functions from expmed.c: */ 30548006Skato 30648006Skato/* Arguments MODE, RTX: return an rtx for the negation of that value. 30780537Snyan May emit insns. */ 30880537Snyanextern rtx negate_rtx PARAMS ((enum machine_mode, rtx)); 30980537Snyan 31048006Skato/* Expand a logical AND operation. */ 31148006Skatoextern rtx expand_and PARAMS ((rtx, rtx, rtx)); 31248006Skato 31348006Skato/* Emit a store-flag operation. */ 31480537Snyanextern rtx emit_store_flag PARAMS ((rtx, enum rtx_code, rtx, rtx, 31548006Skato enum machine_mode, int, int)); 31680537Snyan 31748006Skato/* Like emit_store_flag, but always succeeds. */ 318191114Sedextern rtx emit_store_flag_force PARAMS ((rtx, enum rtx_code, rtx, rtx, 31948006Skato enum machine_mode, int, int)); 32080537Snyan 32180537Snyan/* Functions from loop.c: */ 32280537Snyan 32380537Snyan/* Given an insn and condition, return a canonical description of 32480537Snyan the test being made. */ 32580537Snyanextern rtx canonicalize_condition PARAMS ((rtx, rtx, int, rtx *, rtx)); 32680537Snyan 32780537Snyan/* Given a JUMP_INSN, return a canonical description of the test 32880537Snyan being made. */ 32980537Snyanextern rtx get_condition PARAMS ((rtx, rtx *)); 33080537Snyan 33148006Skato/* Generate a conditional trap instruction. */ 332145012Snyanextern rtx gen_cond_trap PARAMS ((enum rtx_code, rtx, rtx, rtx)); 33348006Skato 33448006Skato/* Functions from builtins.c: */ 33548006Skato#ifdef TREE_CODE 33648006Skatoextern rtx expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int)); 33748006Skatoextern void std_expand_builtin_va_start PARAMS ((int, tree, rtx)); 33848006Skatoextern rtx std_expand_builtin_va_arg PARAMS ((tree, tree)); 33980537Snyanextern rtx expand_builtin_va_arg PARAMS ((tree, tree)); 34080537Snyanextern void default_init_builtins PARAMS ((void)); 34180537Snyanextern rtx default_expand_builtin PARAMS ((tree, rtx, rtx, 342127135Snjl enum machine_mode, int)); 343127135Snjl#endif 34480537Snyan 34580537Snyanextern void expand_builtin_setjmp_setup PARAMS ((rtx, rtx)); 34680537Snyanextern void expand_builtin_setjmp_receiver PARAMS ((rtx)); 34780537Snyanextern void expand_builtin_longjmp PARAMS ((rtx, rtx)); 34880537Snyanextern rtx expand_builtin_saveregs PARAMS ((void)); 349166923Spisoextern HOST_WIDE_INT get_varargs_alias_set PARAMS ((void)); 35080537Snyanextern HOST_WIDE_INT get_frame_alias_set PARAMS ((void)); 35180537Snyanextern void record_base_value PARAMS ((unsigned int, rtx, int)); 35280537Snyanextern void record_alias_subset PARAMS ((HOST_WIDE_INT, 35380537Snyan HOST_WIDE_INT)); 35480537Snyanextern HOST_WIDE_INT new_alias_set PARAMS ((void)); 35580537Snyanextern int can_address_p PARAMS ((tree)); 35680537Snyan 35748006Skato/* Functions from expr.c: */ 35880537Snyan 35948006Skato/* This is run once per compilation to set up which modes can be used 36048006Skato directly in memory and to initialize the block move optab. */ 361191114Sedextern void init_expr_once PARAMS ((void)); 362191114Sed 363191114Sed/* This is run at the start of compiling a function. */ 364191114Sedextern void init_expr PARAMS ((void)); 36550436Sjulian 366191114Sed/* This function is run once to initialize stor-layout.c. */ 36758142Snyan 36880537Snyanextern void init_stor_layout_once PARAMS ((void)); 36948006Skato 37048006Skato/* This is run at the end of compiling a function. */ 37148006Skatoextern void finish_expr_for_function PARAMS ((void)); 37248006Skato 37348006Skato/* Use protect_from_queue to convert a QUEUED expression 37448006Skato into something that you can put immediately into an instruction. */ 37548006Skatoextern rtx protect_from_queue PARAMS ((rtx, int)); 37648006Skato 37748006Skato/* Perform all the pending incrementations. */ 378130585Sphkextern void emit_queue PARAMS ((void)); 37948006Skato 380191114Sed/* Tell if something has a queued subexpression. */ 38148006Skatoextern int queued_subexp_p PARAMS ((rtx)); 38248006Skato 38348006Skato/* Emit some rtl insns to move data between rtx's, converting machine modes. 38480537Snyan Both modes must be floating or both fixed. */ 38548006Skatoextern void convert_move PARAMS ((rtx, rtx, int)); 38648006Skato 38748006Skato/* Convert an rtx to specified machine mode and return the result. */ 38848006Skatoextern rtx convert_to_mode PARAMS ((enum machine_mode, rtx, int)); 38948006Skato 39048006Skato/* Convert an rtx to MODE from OLDMODE and return the result. */ 39148006Skatoextern rtx convert_modes PARAMS ((enum machine_mode, enum machine_mode, 39248006Skato rtx, int)); 393191114Sed 39448006Skato/* Emit code to move a block Y to a block X. */ 39548006Skatoextern rtx emit_block_move PARAMS ((rtx, rtx, rtx)); 39648006Skato 39748006Skato/* Copy all or part of a value X into registers starting at REGNO. 39848006Skato The number of registers to be filled is NREGS. */ 39948006Skatoextern void move_block_to_reg PARAMS ((int, rtx, int, enum machine_mode)); 40048006Skato 40148006Skato/* Copy all or part of a BLKmode value X out of registers starting at REGNO. 40248006Skato The number of registers to be filled is NREGS. */ 40348006Skatoextern void move_block_from_reg PARAMS ((int, rtx, int, int)); 40448006Skato 40548006Skato/* Load a BLKmode value into non-consecutive registers represented by a 40648006Skato PARALLEL. */ 40748006Skatoextern void emit_group_load PARAMS ((rtx, rtx, int)); 40848006Skato 40948006Skato/* Store a BLKmode value from non-consecutive registers represented by a 41048006Skato PARALLEL. */ 41148006Skatoextern void emit_group_store PARAMS ((rtx, rtx, int)); 41248006Skato 413116431Sphk#ifdef TREE_CODE 41448006Skato/* Copy BLKmode object from a set of registers. */ 41548006Skatoextern rtx copy_blkmode_from_reg PARAMS ((rtx,rtx,tree)); 41648006Skato#endif 41748006Skato 41848006Skato/* Mark REG as holding a parameter for the next CALL_INSN. */ 41948006Skatoextern void use_reg PARAMS ((rtx *, rtx)); 42048006Skato 42148006Skato/* Mark NREGS consecutive regs, starting at REGNO, as holding parameters 42248006Skato for the next CALL_INSN. */ 42348006Skatoextern void use_regs PARAMS ((rtx *, int, int)); 42448006Skato 42548006Skato/* Mark a PARALLEL as holding a parameter for the next CALL_INSN. */ 42648006Skatoextern void use_group_regs PARAMS ((rtx *, rtx)); 42748006Skato 42848006Skato/* Write zeros through the storage of OBJECT. 42948006Skato If OBJECT has BLKmode, SIZE is its length in bytes. */ 43048006Skatoextern rtx clear_storage PARAMS ((rtx, rtx)); 43148006Skato 43248006Skato/* Return non-zero if it is desirable to store LEN bytes generated by 43348006Skato CONSTFUN with several move instructions by store_by_pieces 43448006Skato function. CONSTFUNDATA is a pointer which will be passed as argument 43548006Skato in every CONSTFUN call. 43648006Skato ALIGN is maximum alignment we can assume. */ 43748006Skatoextern int can_store_by_pieces PARAMS ((unsigned HOST_WIDE_INT, 43848006Skato rtx (*) (PTR, HOST_WIDE_INT, 43948006Skato enum machine_mode), 44048006Skato PTR, unsigned int)); 44148006Skato 44248006Skato/* Generate several move instructions to store LEN bytes generated by 44348006Skato CONSTFUN to block TO. (A MEM rtx with BLKmode). CONSTFUNDATA is a 44448006Skato pointer which will be passed as argument in every CONSTFUN call. 44548006Skato ALIGN is maximum alignment we can assume. */ 44648006Skatoextern void store_by_pieces PARAMS ((rtx, unsigned HOST_WIDE_INT, 44748006Skato rtx (*) (PTR, HOST_WIDE_INT, 44848006Skato enum machine_mode), 44948006Skato PTR, unsigned int)); 45048006Skato 45148006Skato/* Emit insns to set X from Y. */ 45280537Snyanextern rtx emit_move_insn PARAMS ((rtx, rtx)); 45348006Skato 45448006Skato/* Emit insns to set X from Y, with no frills. */ 45548006Skatoextern rtx emit_move_insn_1 PARAMS ((rtx, rtx)); 456111748Sdes 45748006Skato/* Push a block of length SIZE (perhaps variable) 45848006Skato and return an rtx to address the beginning of the block. */ 45948006Skatoextern rtx push_block PARAMS ((rtx, int, int)); 46048006Skato 46148006Skato#ifdef TREE_CODE 46248006Skato/* Generate code to push something onto the stack, given its mode and type. */ 46348006Skatoextern void emit_push_insn PARAMS ((rtx, enum machine_mode, tree, rtx, 46448006Skato unsigned int, int, rtx, int, rtx, rtx, 46548006Skato int, rtx)); 46648006Skato 467130585Sphk/* Expand an assignment that stores the value of FROM into TO. */ 46848006Skatoextern rtx expand_assignment PARAMS ((tree, tree, int, int)); 469191114Sed 47048006Skato/* Generate code for computing expression EXP, 47148006Skato and storing the value into TARGET. 47248006Skato If SUGGEST_REG is nonzero, copy the value through a register 47348006Skato and return that register, if that is possible. */ 47448006Skatoextern rtx store_expr PARAMS ((tree, rtx, int)); 475116431Sphk#endif 47648006Skato 47748006Skato/* Given an rtx that may include add and multiply operations, 47848006Skato generate them as insns and return a pseudo-reg containing the value. 47948006Skato Useful after calling expand_expr with 1 as sum_ok. */ 48048006Skatoextern rtx force_operand PARAMS ((rtx, rtx)); 48148006Skato 48248006Skato/* Return an object on the placeholder list that matches EXP, a 48348006Skato PLACEHOLDER_EXPR. An object "matches" if it is of the type of the 48448006Skato PLACEHOLDER_EXPR or a pointer type to it. For further information, see 48548006Skato tree.def. If no such object is found, abort. If PLIST is nonzero, it is 48648006Skato a location which initially points to a starting location in the 48748006Skato placeholder list (zero means start of the list) and where a pointer into 48848006Skato the placeholder list at which the object is found is placed. */ 48948006Skatoextern tree find_placeholder PARAMS ((tree, tree *)); 49048006Skato 49148006Skato/* Generate code for computing expression EXP. 49248006Skato An rtx for the computed value is returned. The value is never null. 49348006Skato In the case of a void EXP, const0_rtx is returned. */ 49448006Skatoextern rtx expand_expr PARAMS ((tree, rtx, enum machine_mode, 49548006Skato enum expand_modifier)); 49648006Skato 49748006Skato/* At the start of a function, record that we have no previously-pushed 49848006Skato arguments waiting to be popped. */ 49948006Skatoextern void init_pending_stack_adjust PARAMS ((void)); 50048006Skato 50148006Skato/* When exiting from function, if safe, clear out any pending stack adjust 50248006Skato so the adjustment won't get done. */ 50348006Skatoextern void clear_pending_stack_adjust PARAMS ((void)); 50448006Skato 50548006Skato/* Pop any previously-pushed arguments that have not been popped yet. */ 50648006Skatoextern void do_pending_stack_adjust PARAMS ((void)); 50748006Skato 50848006Skato#ifdef TREE_CODE 50948006Skato/* Return the tree node and offset if a given argument corresponds to 51048006Skato a string constant. */ 51148006Skatoextern tree string_constant PARAMS ((tree, tree *)); 51248006Skato 51348006Skato/* Generate code to evaluate EXP and jump to LABEL if the value is zero. */ 51448006Skatoextern void jumpifnot PARAMS ((tree, rtx)); 51548006Skato 51648006Skato/* Generate code to evaluate EXP and jump to LABEL if the value is nonzero. */ 51748006Skatoextern void jumpif PARAMS ((tree, rtx)); 51848006Skato 51948006Skato/* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if 52048006Skato the result is zero, or IF_TRUE_LABEL if the result is one. */ 52148006Skatoextern void do_jump PARAMS ((tree, rtx, rtx)); 52248006Skato#endif 52348006Skato 52448006Skato/* Generate rtl to compare two rtx's, will call emit_cmp_insn. */ 52548006Skatoextern rtx compare_from_rtx PARAMS ((rtx, rtx, enum rtx_code, int, 52648006Skato enum machine_mode, rtx)); 527111748Sdesextern void do_compare_rtx_and_jump PARAMS ((rtx, rtx, enum rtx_code, int, 52848006Skato enum machine_mode, rtx, 52948006Skato rtx, rtx)); 53048006Skato 53148006Skato/* Two different ways of generating switch statements. */ 53248006Skatoextern int try_casesi PARAMS ((tree, tree, tree, tree, rtx, rtx)); 53348006Skatoextern int try_tablejump PARAMS ((tree, tree, tree, tree, rtx, rtx)); 53448006Skato 53548006Skato/* Smallest number of adjacent cases before we use a jump table. 53648006Skato XXX Should be a target hook. */ 53748006Skatoextern unsigned int case_values_threshold PARAMS ((void)); 53848006Skato 53948006Skato 54048006Skato#ifdef TREE_CODE 54148006Skato/* rtl.h and tree.h were included. */ 54248006Skato/* Return an rtx for the size in bytes of the value of an expr. */ 54348006Skatoextern rtx expr_size PARAMS ((tree)); 54448006Skato 54548006Skatoextern rtx lookup_static_chain PARAMS ((tree)); 54648006Skato 54748006Skato/* Convert a stack slot address ADDR valid in function FNDECL 54848006Skato into an address valid in this function (using a static chain). */ 54948006Skatoextern rtx fix_lexical_addr PARAMS ((rtx, tree)); 55048006Skato 55148006Skato/* Return the address of the trampoline for entering nested fn FUNCTION. */ 55248006Skatoextern rtx trampoline_address PARAMS ((tree)); 553130585Sphk 55448006Skato/* Return an rtx that refers to the value returned by a function 55548006Skato in its original home. This becomes invalid if any more code is emitted. */ 55648006Skatoextern rtx hard_function_value PARAMS ((tree, tree, int)); 557191114Sed 55848006Skatoextern rtx prepare_call_address PARAMS ((rtx, tree, rtx *, int, int)); 55948006Skato 56048006Skatoextern rtx expand_call PARAMS ((tree, rtx, int)); 56148006Skato 56248006Skatoextern rtx expand_shift PARAMS ((enum tree_code, enum machine_mode, rtx, tree, 56348006Skato rtx, int)); 56448006Skatoextern rtx expand_divmod PARAMS ((int, enum tree_code, enum machine_mode, rtx, 56548006Skato rtx, rtx, int)); 566116431Sphkextern void locate_and_pad_parm PARAMS ((enum machine_mode, tree, int, tree, 56748006Skato struct args_size *, 56848006Skato struct args_size *, 56948006Skato struct args_size *, 57048006Skato struct args_size *)); 57148006Skatoextern rtx expand_inline_function PARAMS ((tree, tree, rtx, int, tree, rtx)); 57248006Skato 57348006Skato/* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary. */ 57448006Skatoextern rtx label_rtx PARAMS ((tree)); 57548006Skato#endif 57680537Snyan 57748006Skato/* Indicate how an input argument register was promoted. */ 57848006Skatoextern rtx promoted_input_arg PARAMS ((unsigned int, enum machine_mode *, 57948006Skato int *)); 58048006Skato 581111748Sdes/* Return an rtx like arg but sans any constant terms. 58248006Skato Returns the original rtx if it has no constant terms. 58348006Skato The constant terms are added and stored via a second arg. */ 58448006Skatoextern rtx eliminate_constant_term PARAMS ((rtx, rtx *)); 58548006Skato 58648006Skato/* Convert arg to a valid memory address for specified machine mode, 58748006Skato by emitting insns to perform arithmetic if nec. */ 58848006Skatoextern rtx memory_address PARAMS ((enum machine_mode, rtx)); 58948006Skato 59048006Skato/* Like `memory_address' but pretent `flag_force_addr' is 0. */ 59148006Skatoextern rtx memory_address_noforce PARAMS ((enum machine_mode, rtx)); 59248006Skato 59348006Skato/* Set the alias set of MEM to SET. */ 59448006Skatoextern void set_mem_alias_set PARAMS ((rtx, HOST_WIDE_INT)); 59548006Skato 59648006Skato/* Set the alignment of MEM to ALIGN bits. */ 59748006Skatoextern void set_mem_align PARAMS ((rtx, unsigned int)); 59848006Skato 59948006Skato/* Set the expr for MEM to EXPR. */ 60048006Skatoextern void set_mem_expr PARAMS ((rtx, tree)); 60148006Skato 60248006Skato/* Set the offset for MEM to OFFSET. */ 60348006Skatoextern void set_mem_offset PARAMS ((rtx, rtx)); 60448006Skato 60580537Snyan/* Return a memory reference like MEMREF, but with its mode changed 60648006Skato to MODE and its address changed to ADDR. 60748006Skato (VOIDmode means don't change the mode. 60848006Skato NULL for ADDR means don't change the address.) */ 60948006Skatoextern rtx change_address PARAMS ((rtx, enum machine_mode, rtx)); 610130585Sphk 61148006Skato/* Return a memory reference like MEMREF, but with its mode changed 61248006Skato to MODE and its address offset by OFFSET bytes. */ 613191114Sed#define adjust_address(MEMREF, MODE, OFFSET) \ 61448006Skato adjust_address_1 (MEMREF, MODE, OFFSET, 1, 1) 61548006Skato 61648006Skato/* Likewise, but the reference is not required to be valid. */ 61748006Skato#define adjust_address_nv(MEMREF, MODE, OFFSET) \ 61848006Skato adjust_address_1 (MEMREF, MODE, OFFSET, 0, 1) 61948006Skato 62048006Skato/* Return a memory reference like MEMREF, but with its mode changed 62148006Skato to MODE and its address changed to ADDR, which is assumed to be 62248006Skato increased by OFFSET bytes from MEMREF. */ 62348006Skato#define adjust_automodify_address(MEMREF, MODE, ADDR, OFFSET) \ 62448006Skato adjust_automodify_address_1 (MEMREF, MODE, ADDR, OFFSET, 1) 62548006Skato 62648006Skato/* Likewise, but the reference is not required to be valid. */ 62748006Skato#define adjust_automodify_address_nv(MEMREF, MODE, ADDR, OFFSET) \ 62848006Skato adjust_automodify_address_1 (MEMREF, MODE, ADDR, OFFSET, 0) 62948006Skato 63048006Skatoextern rtx adjust_address_1 PARAMS ((rtx, enum machine_mode, HOST_WIDE_INT, 63148006Skato int, int)); 63248006Skatoextern rtx adjust_automodify_address_1 PARAMS ((rtx, enum machine_mode, 63348006Skato rtx, HOST_WIDE_INT, int)); 634191114Sed 635191114Sed/* Return a memory reference like MEMREF, but whose address is changed by 63648006Skato adding OFFSET, an RTX, to it. POW2 is the highest power of two factor 63748006Skato known to be in OFFSET (possibly 1). */ 63848006Skatoextern rtx offset_address PARAMS ((rtx, rtx, HOST_WIDE_INT)); 63948006Skato 64048006Skato/* Return a memory reference like MEMREF, but with its address changed to 64148006Skato ADDR. The caller is asserting that the actual piece of memory pointed 64248006Skato to is the same, just the form of the address is being changed, such as 64348006Skato by putting something into a register. */ 64448006Skatoextern rtx replace_equiv_address PARAMS ((rtx, rtx)); 64548006Skato 64648006Skato/* Likewise, but the reference is not required to be valid. */ 647extern rtx replace_equiv_address_nv PARAMS ((rtx, rtx)); 648 649/* Return a memory reference like MEMREF, but with its mode widened to 650 MODE and adjusted by OFFSET. */ 651extern rtx widen_memory_access PARAMS ((rtx, enum machine_mode, HOST_WIDE_INT)); 652 653/* Return a memory reference like MEMREF, but which is known to have a 654 valid address. */ 655extern rtx validize_mem PARAMS ((rtx)); 656 657#ifdef TREE_CODE 658/* Given REF, either a MEM or a REG, and T, either the type of X or 659 the expression corresponding to REF, set RTX_UNCHANGING_P if 660 appropriate. */ 661extern void maybe_set_unchanging PARAMS ((rtx, tree)); 662 663/* Given REF, a MEM, and T, either the type of X or the expression 664 corresponding to REF, set the memory attributes. OBJECTP is nonzero 665 if we are making a new object of this type. */ 666extern void set_mem_attributes PARAMS ((rtx, tree, int)); 667#endif 668 669/* Assemble the static constant template for function entry trampolines. */ 670extern rtx assemble_trampoline_template PARAMS ((void)); 671 672/* Given rtx, return new rtx whose address won't be affected by 673 any side effects. It has been copied to a new temporary reg. */ 674extern rtx stabilize PARAMS ((rtx)); 675 676/* Given an rtx, copy all regs it refers to into new temps 677 and return a modified copy that refers to the new temps. */ 678extern rtx copy_all_regs PARAMS ((rtx)); 679 680/* Copy given rtx to a new temp reg and return that. */ 681extern rtx copy_to_reg PARAMS ((rtx)); 682 683/* Like copy_to_reg but always make the reg Pmode. */ 684extern rtx copy_addr_to_reg PARAMS ((rtx)); 685 686/* Like copy_to_reg but always make the reg the specified mode MODE. */ 687extern rtx copy_to_mode_reg PARAMS ((enum machine_mode, rtx)); 688 689/* Copy given rtx to given temp reg and return that. */ 690extern rtx copy_to_suggested_reg PARAMS ((rtx, rtx, enum machine_mode)); 691 692/* Copy a value to a register if it isn't already a register. 693 Args are mode (in case value is a constant) and the value. */ 694extern rtx force_reg PARAMS ((enum machine_mode, rtx)); 695 696/* Return given rtx, copied into a new temp reg if it was in memory. */ 697extern rtx force_not_mem PARAMS ((rtx)); 698 699#ifdef TREE_CODE 700/* Return mode and signedness to use when object is promoted. */ 701extern enum machine_mode promote_mode PARAMS ((tree, enum machine_mode, 702 int *, int)); 703#endif 704 705/* Remove some bytes from the stack. An rtx says how many. */ 706extern void adjust_stack PARAMS ((rtx)); 707 708/* Add some bytes to the stack. An rtx says how many. */ 709extern void anti_adjust_stack PARAMS ((rtx)); 710 711/* This enum is used for the following two functions. */ 712enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL}; 713 714/* Save the stack pointer at the specified level. */ 715extern void emit_stack_save PARAMS ((enum save_level, rtx *, rtx)); 716 717/* Restore the stack pointer from a save area of the specified level. */ 718extern void emit_stack_restore PARAMS ((enum save_level, rtx, rtx)); 719 720/* Allocate some space on the stack dynamically and return its address. An rtx 721 says how many bytes. */ 722extern rtx allocate_dynamic_stack_space PARAMS ((rtx, rtx, int)); 723 724/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. 725 FIRST is a constant and size is a Pmode RTX. These are offsets from the 726 current stack pointer. STACK_GROWS_DOWNWARD says whether to add or 727 subtract from the stack. If SIZE is constant, this is done 728 with a fixed number of probes. Otherwise, we must make a loop. */ 729extern void probe_stack_range PARAMS ((HOST_WIDE_INT, rtx)); 730 731/* Return an rtx that refers to the value returned by a library call 732 in its original home. This becomes invalid if any more code is emitted. */ 733extern rtx hard_libcall_value PARAMS ((enum machine_mode)); 734 735/* Given an rtx, return an rtx for a value rounded up to a multiple 736 of STACK_BOUNDARY / BITS_PER_UNIT. */ 737extern rtx round_push PARAMS ((rtx)); 738 739/* Return the mode desired by operand N of a particular bitfield 740 insert/extract insn, or MAX_MACHINE_MODE if no such insn is 741 available. */ 742 743enum extraction_pattern { EP_insv, EP_extv, EP_extzv }; 744extern enum machine_mode 745mode_for_extraction PARAMS ((enum extraction_pattern, int)); 746 747extern rtx store_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, 748 unsigned HOST_WIDE_INT, 749 enum machine_mode, rtx, HOST_WIDE_INT)); 750extern rtx extract_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, 751 unsigned HOST_WIDE_INT, int, rtx, 752 enum machine_mode, enum machine_mode, 753 HOST_WIDE_INT)); 754extern rtx expand_mult PARAMS ((enum machine_mode, rtx, rtx, rtx, int)); 755extern rtx expand_mult_add PARAMS ((rtx, rtx, rtx, rtx,enum machine_mode, int)); 756extern rtx expand_mult_highpart_adjust PARAMS ((enum machine_mode, rtx, rtx, rtx, rtx, int)); 757 758extern rtx assemble_static_space PARAMS ((int)); 759 760/* Hook called by expand_expr for language-specific tree codes. 761 It is up to the language front end to install a hook 762 if it has any such codes that expand_expr needs to know about. */ 763extern rtx (*lang_expand_expr) PARAMS ((union tree_node *, rtx, 764 enum machine_mode, 765 enum expand_modifier modifier)); 766 767extern int safe_from_p PARAMS ((rtx, tree, int)); 768 769/* Call this once to initialize the contents of the optabs 770 appropriately for the current target machine. */ 771extern void init_optabs PARAMS ((void)); 772extern void init_all_optabs PARAMS ((void)); 773 774/* Call this to initialize an optab function entry. */ 775extern rtx init_one_libfunc PARAMS ((const char *)); 776 777extern void do_jump_by_parts_equality_rtx PARAMS ((rtx, rtx, rtx)); 778extern void do_jump_by_parts_greater_rtx PARAMS ((enum machine_mode, 779 int, rtx, rtx, rtx, 780 rtx)); 781 782#ifdef TREE_CODE /* Don't lose if tree.h not included. */ 783extern void mark_seen_cases PARAMS ((tree, unsigned char *, 784 HOST_WIDE_INT, int)); 785#endif 786