expr.h revision 117395
1/* Definitions for code generation pass of GNU compiler. 2 Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 3 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 4 5This file is part of GCC. 6 7GCC is free software; you can redistribute it and/or modify it under 8the terms of the GNU General Public License as published by the Free 9Software Foundation; either version 2, or (at your option) any later 10version. 11 12GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13WARRANTY; without even the implied warranty of MERCHANTABILITY or 14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15for more details. 16 17You should have received a copy of the GNU General Public License 18along with GCC; see the file COPYING. If not, write to the Free 19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 2002111-1307, USA. */ 21 22/* The default branch cost is 1. */ 23#ifndef BRANCH_COST 24#define BRANCH_COST 1 25#endif 26 27/* Macros to access the slots of a QUEUED rtx. 28 Here rather than in rtl.h because only the expansion pass 29 should ever encounter a QUEUED. */ 30 31/* The variable for which an increment is queued. */ 32#define QUEUED_VAR(P) XEXP (P, 0) 33/* If the increment has been emitted, this is the insn 34 that does the increment. It is zero before the increment is emitted. 35 If more than one insn is emitted, this is the first insn. */ 36#define QUEUED_INSN(P) XEXP (P, 1) 37/* If a pre-increment copy has been generated, this is the copy 38 (it is a temporary reg). Zero if no copy made yet. */ 39#define QUEUED_COPY(P) XEXP (P, 2) 40/* This is the body to use for the insn to do the increment. 41 It is used to emit the increment. */ 42#define QUEUED_BODY(P) XEXP (P, 3) 43/* Next QUEUED in the queue. */ 44#define QUEUED_NEXT(P) XEXP (P, 4) 45 46/* This is the 4th arg to `expand_expr'. 47 EXPAND_STACK_PARM means we are possibly expanding a call param onto 48 the stack. Choosing a value of 2 isn't special; It just allows 49 some code optimization in store_expr. 50 EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx. 51 EXPAND_INITIALIZER is similar but also record any labels on forced_labels. 52 EXPAND_CONST_ADDRESS means it is ok to return a MEM whose address 53 is a constant that is not a legitimate address. 54 EXPAND_WRITE means we are only going to write to the resulting rtx. 55 EXPAND_MEMORY means we are interested in a memory result, even if 56 the memory is constant and we could have propagated a constant value. */ 57enum expand_modifier {EXPAND_NORMAL = 0, EXPAND_STACK_PARM = 2, EXPAND_SUM, 58 EXPAND_CONST_ADDRESS, EXPAND_INITIALIZER, EXPAND_WRITE, 59 EXPAND_MEMORY}; 60 61/* Prevent the compiler from deferring stack pops. See 62 inhibit_defer_pop for more information. */ 63#define NO_DEFER_POP (inhibit_defer_pop += 1) 64 65/* Allow the compiler to defer stack pops. See inhibit_defer_pop for 66 more information. */ 67#define OK_DEFER_POP (inhibit_defer_pop -= 1) 68 69#ifdef TREE_CODE /* Don't lose if tree.h not included. */ 70/* Structure to record the size of a sequence of arguments 71 as the sum of a tree-expression and a constant. This structure is 72 also used to store offsets from the stack, which might be negative, 73 so the variable part must be ssizetype, not sizetype. */ 74 75struct args_size 76{ 77 HOST_WIDE_INT constant; 78 tree var; 79}; 80#endif 81 82/* Add the value of the tree INC to the `struct args_size' TO. */ 83 84#define ADD_PARM_SIZE(TO, INC) \ 85do { \ 86 tree inc = (INC); \ 87 if (host_integerp (inc, 0)) \ 88 (TO).constant += tree_low_cst (inc, 0); \ 89 else if ((TO).var == 0) \ 90 (TO).var = convert (ssizetype, inc); \ 91 else \ 92 (TO).var = size_binop (PLUS_EXPR, (TO).var, \ 93 convert (ssizetype, inc)); \ 94} while (0) 95 96#define SUB_PARM_SIZE(TO, DEC) \ 97do { \ 98 tree dec = (DEC); \ 99 if (host_integerp (dec, 0)) \ 100 (TO).constant -= tree_low_cst (dec, 0); \ 101 else if ((TO).var == 0) \ 102 (TO).var = size_binop (MINUS_EXPR, ssize_int (0), \ 103 convert (ssizetype, dec)); \ 104 else \ 105 (TO).var = size_binop (MINUS_EXPR, (TO).var, \ 106 convert (ssizetype, dec)); \ 107} while (0) 108 109/* Convert the implicit sum in a `struct args_size' into a tree 110 of type ssizetype. */ 111#define ARGS_SIZE_TREE(SIZE) \ 112((SIZE).var == 0 ? ssize_int ((SIZE).constant) \ 113 : size_binop (PLUS_EXPR, convert (ssizetype, (SIZE).var), \ 114 ssize_int ((SIZE).constant))) 115 116/* Convert the implicit sum in a `struct args_size' into an rtx. */ 117#define ARGS_SIZE_RTX(SIZE) \ 118((SIZE).var == 0 ? GEN_INT ((SIZE).constant) \ 119 : expand_expr (ARGS_SIZE_TREE (SIZE), NULL_RTX, VOIDmode, 0)) 120 121/* Supply a default definition for FUNCTION_ARG_PADDING: 122 usually pad upward, but pad short args downward on 123 big-endian machines. */ 124 125enum direction {none, upward, downward}; /* Value has this type. */ 126 127#ifndef FUNCTION_ARG_PADDING 128#define FUNCTION_ARG_PADDING(MODE, TYPE) \ 129 (! BYTES_BIG_ENDIAN \ 130 ? upward \ 131 : (((MODE) == BLKmode \ 132 ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ 133 && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ 134 : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ 135 ? downward : upward)) 136#endif 137 138/* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let 139 FUNCTION_ARG_PADDING, which also pads the length, handle any needed 140 alignment. */ 141 142#ifndef FUNCTION_ARG_BOUNDARY 143#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY 144#endif 145 146/* Provide a default value for STRICT_ARGUMENT_NAMING. */ 147#ifndef STRICT_ARGUMENT_NAMING 148#define STRICT_ARGUMENT_NAMING 0 149#endif 150 151/* Provide a default value for PRETEND_OUTGOING_VARARGS_NAMED. */ 152#ifdef SETUP_INCOMING_VARARGS 153#ifndef PRETEND_OUTGOING_VARARGS_NAMED 154#define PRETEND_OUTGOING_VARARGS_NAMED 1 155#endif 156#else 157/* It is an error to define PRETEND_OUTGOING_VARARGS_NAMED without 158 defining SETUP_INCOMING_VARARGS. */ 159#define PRETEND_OUTGOING_VARARGS_NAMED 0 160#endif 161 162/* Nonzero if we do not know how to pass TYPE solely in registers. 163 We cannot do so in the following cases: 164 165 - if the type has variable size 166 - if the type is marked as addressable (it is required to be constructed 167 into the stack) 168 - if the padding and mode of the type is such that a copy into a register 169 would put it into the wrong part of the register. 170 171 Which padding can't be supported depends on the byte endianness. 172 173 A value in a register is implicitly padded at the most significant end. 174 On a big-endian machine, that is the lower end in memory. 175 So a value padded in memory at the upper end can't go in a register. 176 For a little-endian machine, the reverse is true. */ 177 178#ifndef MUST_PASS_IN_STACK 179#define MUST_PASS_IN_STACK(MODE,TYPE) \ 180 ((TYPE) != 0 \ 181 && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ 182 || TREE_ADDRESSABLE (TYPE) \ 183 || ((MODE) == BLKmode \ 184 && ! ((TYPE) != 0 && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ 185 && 0 == (int_size_in_bytes (TYPE) \ 186 % (PARM_BOUNDARY / BITS_PER_UNIT))) \ 187 && (FUNCTION_ARG_PADDING (MODE, TYPE) \ 188 == (BYTES_BIG_ENDIAN ? upward : downward))))) 189#endif 190 191/* Nonzero if type TYPE should be returned in memory. 192 Most machines can use the following default definition. */ 193 194#ifndef RETURN_IN_MEMORY 195#define RETURN_IN_MEMORY(TYPE) (TYPE_MODE (TYPE) == BLKmode) 196#endif 197 198/* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save. 199 Normally move_insn, so Pmode stack pointer. */ 200 201#ifndef STACK_SAVEAREA_MODE 202#define STACK_SAVEAREA_MODE(LEVEL) Pmode 203#endif 204 205/* Supply a default definition of STACK_SIZE_MODE for 206 allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */ 207 208#ifndef STACK_SIZE_MODE 209#define STACK_SIZE_MODE word_mode 210#endif 211 212/* Provide default values for the macros controlling stack checking. */ 213 214#ifndef STACK_CHECK_BUILTIN 215#define STACK_CHECK_BUILTIN 0 216#endif 217 218/* The default interval is one page. */ 219#ifndef STACK_CHECK_PROBE_INTERVAL 220#define STACK_CHECK_PROBE_INTERVAL 4096 221#endif 222 223/* The default is to do a store into the stack. */ 224#ifndef STACK_CHECK_PROBE_LOAD 225#define STACK_CHECK_PROBE_LOAD 0 226#endif 227 228/* This value is arbitrary, but should be sufficient for most machines. */ 229#ifndef STACK_CHECK_PROTECT 230#define STACK_CHECK_PROTECT (75 * UNITS_PER_WORD) 231#endif 232 233/* Make the maximum frame size be the largest we can and still only need 234 one probe per function. */ 235#ifndef STACK_CHECK_MAX_FRAME_SIZE 236#define STACK_CHECK_MAX_FRAME_SIZE \ 237 (STACK_CHECK_PROBE_INTERVAL - UNITS_PER_WORD) 238#endif 239 240/* This is arbitrary, but should be large enough everywhere. */ 241#ifndef STACK_CHECK_FIXED_FRAME_SIZE 242#define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD) 243#endif 244 245/* Provide a reasonable default for the maximum size of an object to 246 allocate in the fixed frame. We may need to be able to make this 247 controllable by the user at some point. */ 248#ifndef STACK_CHECK_MAX_VAR_SIZE 249#define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) 250#endif 251 252/* Functions from optabs.c, commonly used, and without need for the optabs 253 tables: */ 254 255/* Passed to expand_simple_binop and expand_binop to say which options 256 to try to use if the requested operation can't be open-coded on the 257 requisite mode. Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using 258 a library call. Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try 259 using a wider mode. OPTAB_MUST_WIDEN says try widening and don't 260 try anything else. */ 261 262enum optab_methods 263{ 264 OPTAB_DIRECT, 265 OPTAB_LIB, 266 OPTAB_WIDEN, 267 OPTAB_LIB_WIDEN, 268 OPTAB_MUST_WIDEN 269}; 270 271/* Generate code for a simple binary or unary operation. "Simple" in 272 this case means "can be unambiguously described by a (mode, code) 273 pair and mapped to a single optab." */ 274extern rtx expand_simple_binop PARAMS ((enum machine_mode, enum rtx_code, rtx, 275 rtx, rtx, int, enum optab_methods)); 276extern rtx expand_simple_unop PARAMS ((enum machine_mode, enum rtx_code, 277 rtx, rtx, int)); 278 279/* Report whether the machine description contains an insn which can 280 perform the operation described by CODE and MODE. */ 281extern int have_insn_for PARAMS ((enum rtx_code, enum machine_mode)); 282 283/* Emit code to make a call to a constant function or a library call. */ 284extern void emit_libcall_block PARAMS ((rtx, rtx, rtx, rtx)); 285 286/* Create but don't emit one rtl instruction to perform certain operations. 287 Modes must match; operands must meet the operation's predicates. 288 Likewise for subtraction and for just copying. 289 These do not call protect_from_queue; caller must do so. */ 290extern rtx gen_add2_insn PARAMS ((rtx, rtx)); 291extern rtx gen_add3_insn PARAMS ((rtx, rtx, rtx)); 292extern rtx gen_sub2_insn PARAMS ((rtx, rtx)); 293extern rtx gen_sub3_insn PARAMS ((rtx, rtx, rtx)); 294extern rtx gen_move_insn PARAMS ((rtx, rtx)); 295extern int have_add2_insn PARAMS ((rtx, rtx)); 296extern int have_sub2_insn PARAMS ((rtx, rtx)); 297 298/* Emit a pair of rtl insns to compare two rtx's and to jump 299 to a label if the comparison is true. */ 300extern void emit_cmp_and_jump_insns PARAMS ((rtx, rtx, enum rtx_code, rtx, 301 enum machine_mode, int, rtx)); 302 303/* Generate code to indirectly jump to a location given in the rtx LOC. */ 304extern void emit_indirect_jump PARAMS ((rtx)); 305 306#ifdef HAVE_conditional_move 307/* Emit a conditional move operation. */ 308rtx emit_conditional_move PARAMS ((rtx, enum rtx_code, rtx, rtx, 309 enum machine_mode, rtx, rtx, 310 enum machine_mode, int)); 311 312/* Return nonzero if the conditional move is supported. */ 313int can_conditionally_move_p PARAMS ((enum machine_mode mode)); 314 315#endif 316 317 318/* Functions from expmed.c: */ 319 320/* Arguments MODE, RTX: return an rtx for the negation of that value. 321 May emit insns. */ 322extern rtx negate_rtx PARAMS ((enum machine_mode, rtx)); 323 324/* Expand a logical AND operation. */ 325extern rtx expand_and PARAMS ((enum machine_mode, rtx, rtx, rtx)); 326 327/* Emit a store-flag operation. */ 328extern rtx emit_store_flag PARAMS ((rtx, enum rtx_code, rtx, rtx, 329 enum machine_mode, int, int)); 330 331/* Like emit_store_flag, but always succeeds. */ 332extern rtx emit_store_flag_force PARAMS ((rtx, enum rtx_code, rtx, rtx, 333 enum machine_mode, int, int)); 334 335/* Functions from loop.c: */ 336 337/* Given an insn and condition, return a canonical description of 338 the test being made. */ 339extern rtx canonicalize_condition PARAMS ((rtx, rtx, int, rtx *, rtx)); 340 341/* Given a JUMP_INSN, return a canonical description of the test 342 being made. */ 343extern rtx get_condition PARAMS ((rtx, rtx *)); 344 345/* Generate a conditional trap instruction. */ 346extern rtx gen_cond_trap PARAMS ((enum rtx_code, rtx, rtx, rtx)); 347 348/* Functions from builtins.c: */ 349extern rtx expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int)); 350extern void std_expand_builtin_va_start PARAMS ((tree, rtx)); 351extern rtx std_expand_builtin_va_arg PARAMS ((tree, tree)); 352extern rtx expand_builtin_va_arg PARAMS ((tree, tree)); 353extern void default_init_builtins PARAMS ((void)); 354extern rtx default_expand_builtin PARAMS ((tree, rtx, rtx, 355 enum machine_mode, int)); 356extern void expand_builtin_setjmp_setup PARAMS ((rtx, rtx)); 357extern void expand_builtin_setjmp_receiver PARAMS ((rtx)); 358extern void expand_builtin_longjmp PARAMS ((rtx, rtx)); 359extern rtx expand_builtin_saveregs PARAMS ((void)); 360extern void expand_builtin_trap PARAMS ((void)); 361extern HOST_WIDE_INT get_varargs_alias_set PARAMS ((void)); 362extern HOST_WIDE_INT get_frame_alias_set PARAMS ((void)); 363extern void record_base_value PARAMS ((unsigned int, rtx, int)); 364extern void record_alias_subset PARAMS ((HOST_WIDE_INT, 365 HOST_WIDE_INT)); 366extern HOST_WIDE_INT new_alias_set PARAMS ((void)); 367extern int can_address_p PARAMS ((tree)); 368 369/* Functions from expr.c: */ 370 371/* This is run once per compilation to set up which modes can be used 372 directly in memory and to initialize the block move optab. */ 373extern void init_expr_once PARAMS ((void)); 374 375/* This is run at the start of compiling a function. */ 376extern void init_expr PARAMS ((void)); 377 378/* This is run at the end of compiling a function. */ 379extern void finish_expr_for_function PARAMS ((void)); 380 381/* Use protect_from_queue to convert a QUEUED expression 382 into something that you can put immediately into an instruction. */ 383extern rtx protect_from_queue PARAMS ((rtx, int)); 384 385/* Perform all the pending incrementations. */ 386extern void emit_queue PARAMS ((void)); 387 388/* Tell if something has a queued subexpression. */ 389extern int queued_subexp_p PARAMS ((rtx)); 390 391/* Emit some rtl insns to move data between rtx's, converting machine modes. 392 Both modes must be floating or both fixed. */ 393extern void convert_move PARAMS ((rtx, rtx, int)); 394 395/* Convert an rtx to specified machine mode and return the result. */ 396extern rtx convert_to_mode PARAMS ((enum machine_mode, rtx, int)); 397 398/* Convert an rtx to MODE from OLDMODE and return the result. */ 399extern rtx convert_modes PARAMS ((enum machine_mode, enum machine_mode, 400 rtx, int)); 401 402/* Emit code to move a block Y to a block X. */ 403 404enum block_op_methods 405{ 406 BLOCK_OP_NORMAL, 407 BLOCK_OP_NO_LIBCALL, 408 BLOCK_OP_CALL_PARM 409}; 410 411extern rtx emit_block_move PARAMS ((rtx, rtx, rtx, enum block_op_methods)); 412 413/* Copy all or part of a value X into registers starting at REGNO. 414 The number of registers to be filled is NREGS. */ 415extern void move_block_to_reg PARAMS ((int, rtx, int, enum machine_mode)); 416 417/* Copy all or part of a BLKmode value X out of registers starting at REGNO. 418 The number of registers to be filled is NREGS. */ 419extern void move_block_from_reg PARAMS ((int, rtx, int, int)); 420 421/* Generate a non-consecutive group of registers represented by a PARALLEL. */ 422extern rtx gen_group_rtx PARAMS ((rtx)); 423 424/* Load a BLKmode value into non-consecutive registers represented by a 425 PARALLEL. */ 426extern void emit_group_load PARAMS ((rtx, rtx, int)); 427 428/* Move a non-consecutive group of registers represented by a PARALLEL into 429 a non-consecutive group of registers represented by a PARALLEL. */ 430extern void emit_group_move PARAMS ((rtx, rtx)); 431 432/* Store a BLKmode value from non-consecutive registers represented by a 433 PARALLEL. */ 434extern void emit_group_store PARAMS ((rtx, rtx, int)); 435 436#ifdef TREE_CODE 437/* Copy BLKmode object from a set of registers. */ 438extern rtx copy_blkmode_from_reg PARAMS ((rtx,rtx,tree)); 439#endif 440 441/* Mark REG as holding a parameter for the next CALL_INSN. */ 442extern void use_reg PARAMS ((rtx *, rtx)); 443 444/* Mark NREGS consecutive regs, starting at REGNO, as holding parameters 445 for the next CALL_INSN. */ 446extern void use_regs PARAMS ((rtx *, int, int)); 447 448/* Mark a PARALLEL as holding a parameter for the next CALL_INSN. */ 449extern void use_group_regs PARAMS ((rtx *, rtx)); 450 451/* Write zeros through the storage of OBJECT. 452 If OBJECT has BLKmode, SIZE is its length in bytes. */ 453extern rtx clear_storage PARAMS ((rtx, rtx)); 454 455/* Return nonzero if it is desirable to store LEN bytes generated by 456 CONSTFUN with several move instructions by store_by_pieces 457 function. CONSTFUNDATA is a pointer which will be passed as argument 458 in every CONSTFUN call. 459 ALIGN is maximum alignment we can assume. */ 460extern int can_store_by_pieces PARAMS ((unsigned HOST_WIDE_INT, 461 rtx (*) (PTR, HOST_WIDE_INT, 462 enum machine_mode), 463 PTR, unsigned int)); 464 465/* Generate several move instructions to store LEN bytes generated by 466 CONSTFUN to block TO. (A MEM rtx with BLKmode). CONSTFUNDATA is a 467 pointer which will be passed as argument in every CONSTFUN call. 468 ALIGN is maximum alignment we can assume. */ 469extern void store_by_pieces PARAMS ((rtx, unsigned HOST_WIDE_INT, 470 rtx (*) (PTR, HOST_WIDE_INT, 471 enum machine_mode), 472 PTR, unsigned int)); 473 474/* Emit insns to set X from Y. */ 475extern rtx emit_move_insn PARAMS ((rtx, rtx)); 476 477/* Emit insns to set X from Y, with no frills. */ 478extern rtx emit_move_insn_1 PARAMS ((rtx, rtx)); 479 480/* Push a block of length SIZE (perhaps variable) 481 and return an rtx to address the beginning of the block. */ 482extern rtx push_block PARAMS ((rtx, int, int)); 483 484#ifdef TREE_CODE 485/* Generate code to push something onto the stack, given its mode and type. */ 486extern void emit_push_insn PARAMS ((rtx, enum machine_mode, tree, rtx, 487 unsigned int, int, rtx, int, rtx, rtx, 488 int, rtx)); 489 490/* Expand an assignment that stores the value of FROM into TO. */ 491extern rtx expand_assignment PARAMS ((tree, tree, int, int)); 492 493/* Generate code for computing expression EXP, 494 and storing the value into TARGET. 495 If SUGGEST_REG is nonzero, copy the value through a register 496 and return that register, if that is possible. */ 497extern rtx store_expr PARAMS ((tree, rtx, int)); 498#endif 499 500/* Given an rtx that may include add and multiply operations, 501 generate them as insns and return a pseudo-reg containing the value. 502 Useful after calling expand_expr with 1 as sum_ok. */ 503extern rtx force_operand PARAMS ((rtx, rtx)); 504 505/* Return an object on the placeholder list that matches EXP, a 506 PLACEHOLDER_EXPR. An object "matches" if it is of the type of the 507 PLACEHOLDER_EXPR or a pointer type to it. For further information, see 508 tree.def. If no such object is found, abort. If PLIST is nonzero, it is 509 a location which initially points to a starting location in the 510 placeholder list (zero means start of the list) and where a pointer into 511 the placeholder list at which the object is found is placed. */ 512extern tree find_placeholder PARAMS ((tree, tree *)); 513 514/* Generate code for computing expression EXP. 515 An rtx for the computed value is returned. The value is never null. 516 In the case of a void EXP, const0_rtx is returned. */ 517extern rtx expand_expr PARAMS ((tree, rtx, enum machine_mode, 518 enum expand_modifier)); 519 520/* At the start of a function, record that we have no previously-pushed 521 arguments waiting to be popped. */ 522extern void init_pending_stack_adjust PARAMS ((void)); 523 524/* When exiting from function, if safe, clear out any pending stack adjust 525 so the adjustment won't get done. */ 526extern void clear_pending_stack_adjust PARAMS ((void)); 527 528/* Pop any previously-pushed arguments that have not been popped yet. */ 529extern void do_pending_stack_adjust PARAMS ((void)); 530 531#ifdef TREE_CODE 532/* Return the tree node and offset if a given argument corresponds to 533 a string constant. */ 534extern tree string_constant PARAMS ((tree, tree *)); 535 536/* Generate code to evaluate EXP and jump to LABEL if the value is zero. */ 537extern void jumpifnot PARAMS ((tree, rtx)); 538 539/* Generate code to evaluate EXP and jump to LABEL if the value is nonzero. */ 540extern void jumpif PARAMS ((tree, rtx)); 541 542/* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if 543 the result is zero, or IF_TRUE_LABEL if the result is one. */ 544extern void do_jump PARAMS ((tree, rtx, rtx)); 545#endif 546 547/* Generate rtl to compare two rtx's, will call emit_cmp_insn. */ 548extern rtx compare_from_rtx PARAMS ((rtx, rtx, enum rtx_code, int, 549 enum machine_mode, rtx)); 550extern void do_compare_rtx_and_jump PARAMS ((rtx, rtx, enum rtx_code, int, 551 enum machine_mode, rtx, 552 rtx, rtx)); 553 554/* Two different ways of generating switch statements. */ 555extern int try_casesi PARAMS ((tree, tree, tree, tree, rtx, rtx)); 556extern int try_tablejump PARAMS ((tree, tree, tree, tree, rtx, rtx)); 557 558/* Smallest number of adjacent cases before we use a jump table. 559 XXX Should be a target hook. */ 560extern unsigned int case_values_threshold PARAMS ((void)); 561 562 563#ifdef TREE_CODE 564/* rtl.h and tree.h were included. */ 565/* Return an rtx for the size in bytes of the value of an expr. */ 566extern rtx expr_size PARAMS ((tree)); 567 568/* Return a wide integer for the size in bytes of the value of EXP, or -1 569 if the size can vary or is larger than an integer. */ 570extern HOST_WIDE_INT int_expr_size PARAMS ((tree)); 571 572extern rtx lookup_static_chain PARAMS ((tree)); 573 574/* Convert a stack slot address ADDR valid in function FNDECL 575 into an address valid in this function (using a static chain). */ 576extern rtx fix_lexical_addr PARAMS ((rtx, tree)); 577 578/* Return the address of the trampoline for entering nested fn FUNCTION. */ 579extern rtx trampoline_address PARAMS ((tree)); 580 581/* Return an rtx that refers to the value returned by a function 582 in its original home. This becomes invalid if any more code is emitted. */ 583extern rtx hard_function_value PARAMS ((tree, tree, int)); 584 585extern rtx prepare_call_address PARAMS ((rtx, tree, rtx *, int, int)); 586 587extern rtx expand_call PARAMS ((tree, rtx, int)); 588 589extern rtx expand_shift PARAMS ((enum tree_code, enum machine_mode, rtx, tree, 590 rtx, int)); 591extern rtx expand_divmod PARAMS ((int, enum tree_code, enum machine_mode, rtx, 592 rtx, rtx, int)); 593extern void locate_and_pad_parm PARAMS ((enum machine_mode, tree, int, tree, 594 struct args_size *, 595 struct args_size *, 596 struct args_size *, 597 struct args_size *)); 598extern rtx expand_inline_function PARAMS ((tree, tree, rtx, int, tree, rtx)); 599 600/* Return the CODE_LABEL rtx for a LABEL_DECL, creating it if necessary. */ 601extern rtx label_rtx PARAMS ((tree)); 602#endif 603 604/* Indicate how an input argument register was promoted. */ 605extern rtx promoted_input_arg PARAMS ((unsigned int, enum machine_mode *, 606 int *)); 607 608/* Return an rtx like arg but sans any constant terms. 609 Returns the original rtx if it has no constant terms. 610 The constant terms are added and stored via a second arg. */ 611extern rtx eliminate_constant_term PARAMS ((rtx, rtx *)); 612 613/* Convert arg to a valid memory address for specified machine mode, 614 by emitting insns to perform arithmetic if nec. */ 615extern rtx memory_address PARAMS ((enum machine_mode, rtx)); 616 617/* Like `memory_address' but pretent `flag_force_addr' is 0. */ 618extern rtx memory_address_noforce PARAMS ((enum machine_mode, rtx)); 619 620/* Set the alias set of MEM to SET. */ 621extern void set_mem_alias_set PARAMS ((rtx, HOST_WIDE_INT)); 622 623/* Set the alignment of MEM to ALIGN bits. */ 624extern void set_mem_align PARAMS ((rtx, unsigned int)); 625 626/* Set the expr for MEM to EXPR. */ 627extern void set_mem_expr PARAMS ((rtx, tree)); 628 629/* Set the offset for MEM to OFFSET. */ 630extern void set_mem_offset PARAMS ((rtx, rtx)); 631 632/* Set the size for MEM to SIZE. */ 633extern void set_mem_size PARAMS ((rtx, rtx)); 634 635/* Return a memory reference like MEMREF, but with its mode changed 636 to MODE and its address changed to ADDR. 637 (VOIDmode means don't change the mode. 638 NULL for ADDR means don't change the address.) */ 639extern rtx change_address PARAMS ((rtx, enum machine_mode, rtx)); 640 641/* Return a memory reference like MEMREF, but with its mode changed 642 to MODE and its address offset by OFFSET bytes. */ 643#define adjust_address(MEMREF, MODE, OFFSET) \ 644 adjust_address_1 (MEMREF, MODE, OFFSET, 1, 1) 645 646/* Likewise, but the reference is not required to be valid. */ 647#define adjust_address_nv(MEMREF, MODE, OFFSET) \ 648 adjust_address_1 (MEMREF, MODE, OFFSET, 0, 1) 649 650/* Return a memory reference like MEMREF, but with its mode changed 651 to MODE and its address changed to ADDR, which is assumed to be 652 increased by OFFSET bytes from MEMREF. */ 653#define adjust_automodify_address(MEMREF, MODE, ADDR, OFFSET) \ 654 adjust_automodify_address_1 (MEMREF, MODE, ADDR, OFFSET, 1) 655 656/* Likewise, but the reference is not required to be valid. */ 657#define adjust_automodify_address_nv(MEMREF, MODE, ADDR, OFFSET) \ 658 adjust_automodify_address_1 (MEMREF, MODE, ADDR, OFFSET, 0) 659 660extern rtx adjust_address_1 PARAMS ((rtx, enum machine_mode, HOST_WIDE_INT, 661 int, int)); 662extern rtx adjust_automodify_address_1 PARAMS ((rtx, enum machine_mode, 663 rtx, HOST_WIDE_INT, int)); 664 665/* Return a memory reference like MEMREF, but whose address is changed by 666 adding OFFSET, an RTX, to it. POW2 is the highest power of two factor 667 known to be in OFFSET (possibly 1). */ 668extern rtx offset_address PARAMS ((rtx, rtx, HOST_WIDE_INT)); 669 670/* Return a memory reference like MEMREF, but with its address changed to 671 ADDR. The caller is asserting that the actual piece of memory pointed 672 to is the same, just the form of the address is being changed, such as 673 by putting something into a register. */ 674extern rtx replace_equiv_address PARAMS ((rtx, rtx)); 675 676/* Likewise, but the reference is not required to be valid. */ 677extern rtx replace_equiv_address_nv PARAMS ((rtx, rtx)); 678 679/* Return a memory reference like MEMREF, but with its mode widened to 680 MODE and adjusted by OFFSET. */ 681extern rtx widen_memory_access PARAMS ((rtx, enum machine_mode, HOST_WIDE_INT)); 682 683/* Return a memory reference like MEMREF, but which is known to have a 684 valid address. */ 685extern rtx validize_mem PARAMS ((rtx)); 686 687#ifdef TREE_CODE 688/* Given REF, either a MEM or a REG, and T, either the type of X or 689 the expression corresponding to REF, set RTX_UNCHANGING_P if 690 appropriate. */ 691extern void maybe_set_unchanging PARAMS ((rtx, tree)); 692 693/* Given REF, a MEM, and T, either the type of X or the expression 694 corresponding to REF, set the memory attributes. OBJECTP is nonzero 695 if we are making a new object of this type. */ 696extern void set_mem_attributes PARAMS ((rtx, tree, int)); 697 698/* Similar, except that BITPOS has not yet been applied to REF, so if 699 we alter MEM_OFFSET according to T then we should subtract BITPOS 700 expecting that it'll be added back in later. */ 701extern void set_mem_attributes_minus_bitpos PARAMS ((rtx, tree, int, 702 HOST_WIDE_INT)); 703#endif 704 705/* Assemble the static constant template for function entry trampolines. */ 706extern rtx assemble_trampoline_template PARAMS ((void)); 707 708/* Given rtx, return new rtx whose address won't be affected by 709 any side effects. It has been copied to a new temporary reg. */ 710extern rtx stabilize PARAMS ((rtx)); 711 712/* Given an rtx, copy all regs it refers to into new temps 713 and return a modified copy that refers to the new temps. */ 714extern rtx copy_all_regs PARAMS ((rtx)); 715 716/* Copy given rtx to a new temp reg and return that. */ 717extern rtx copy_to_reg PARAMS ((rtx)); 718 719/* Like copy_to_reg but always make the reg Pmode. */ 720extern rtx copy_addr_to_reg PARAMS ((rtx)); 721 722/* Like copy_to_reg but always make the reg the specified mode MODE. */ 723extern rtx copy_to_mode_reg PARAMS ((enum machine_mode, rtx)); 724 725/* Copy given rtx to given temp reg and return that. */ 726extern rtx copy_to_suggested_reg PARAMS ((rtx, rtx, enum machine_mode)); 727 728/* Copy a value to a register if it isn't already a register. 729 Args are mode (in case value is a constant) and the value. */ 730extern rtx force_reg PARAMS ((enum machine_mode, rtx)); 731 732/* Return given rtx, copied into a new temp reg if it was in memory. */ 733extern rtx force_not_mem PARAMS ((rtx)); 734 735#ifdef TREE_CODE 736/* Return mode and signedness to use when object is promoted. */ 737extern enum machine_mode promote_mode PARAMS ((tree, enum machine_mode, 738 int *, int)); 739#endif 740 741/* Remove some bytes from the stack. An rtx says how many. */ 742extern void adjust_stack PARAMS ((rtx)); 743 744/* Add some bytes to the stack. An rtx says how many. */ 745extern void anti_adjust_stack PARAMS ((rtx)); 746 747/* This enum is used for the following two functions. */ 748enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL}; 749 750/* Save the stack pointer at the specified level. */ 751extern void emit_stack_save PARAMS ((enum save_level, rtx *, rtx)); 752 753/* Restore the stack pointer from a save area of the specified level. */ 754extern void emit_stack_restore PARAMS ((enum save_level, rtx, rtx)); 755 756/* Allocate some space on the stack dynamically and return its address. An rtx 757 says how many bytes. */ 758extern rtx allocate_dynamic_stack_space PARAMS ((rtx, rtx, int)); 759 760/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. 761 FIRST is a constant and size is a Pmode RTX. These are offsets from the 762 current stack pointer. STACK_GROWS_DOWNWARD says whether to add or 763 subtract from the stack. If SIZE is constant, this is done 764 with a fixed number of probes. Otherwise, we must make a loop. */ 765extern void probe_stack_range PARAMS ((HOST_WIDE_INT, rtx)); 766 767/* Return an rtx that refers to the value returned by a library call 768 in its original home. This becomes invalid if any more code is emitted. */ 769extern rtx hard_libcall_value PARAMS ((enum machine_mode)); 770 771/* Given an rtx, return an rtx for a value rounded up to a multiple 772 of STACK_BOUNDARY / BITS_PER_UNIT. */ 773extern rtx round_push PARAMS ((rtx)); 774 775/* Return the mode desired by operand N of a particular bitfield 776 insert/extract insn, or MAX_MACHINE_MODE if no such insn is 777 available. */ 778 779enum extraction_pattern { EP_insv, EP_extv, EP_extzv }; 780extern enum machine_mode 781mode_for_extraction PARAMS ((enum extraction_pattern, int)); 782 783extern rtx store_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, 784 unsigned HOST_WIDE_INT, 785 enum machine_mode, rtx, HOST_WIDE_INT)); 786extern rtx extract_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT, 787 unsigned HOST_WIDE_INT, int, rtx, 788 enum machine_mode, enum machine_mode, 789 HOST_WIDE_INT)); 790extern rtx expand_mult PARAMS ((enum machine_mode, rtx, rtx, rtx, int)); 791extern bool const_mult_add_overflow_p PARAMS ((rtx, rtx, rtx, enum machine_mode, int)); 792extern rtx expand_mult_add PARAMS ((rtx, rtx, rtx, rtx,enum machine_mode, int)); 793extern rtx expand_mult_highpart_adjust PARAMS ((enum machine_mode, rtx, rtx, rtx, rtx, int)); 794 795extern rtx assemble_static_space PARAMS ((int)); 796 797/* Hook called by expand_expr for language-specific tree codes. 798 It is up to the language front end to install a hook 799 if it has any such codes that expand_expr needs to know about. */ 800extern rtx (*lang_expand_expr) PARAMS ((union tree_node *, rtx, 801 enum machine_mode, 802 enum expand_modifier modifier)); 803 804extern int safe_from_p PARAMS ((rtx, tree, int)); 805 806/* Call this once to initialize the contents of the optabs 807 appropriately for the current target machine. */ 808extern void init_optabs PARAMS ((void)); 809extern void init_all_optabs PARAMS ((void)); 810 811/* Call this to initialize an optab function entry. */ 812extern rtx init_one_libfunc PARAMS ((const char *)); 813 814extern void do_jump_by_parts_equality_rtx PARAMS ((rtx, rtx, rtx)); 815extern void do_jump_by_parts_greater_rtx PARAMS ((enum machine_mode, 816 int, rtx, rtx, rtx, 817 rtx)); 818 819#ifdef TREE_CODE /* Don't lose if tree.h not included. */ 820extern void mark_seen_cases PARAMS ((tree, unsigned char *, 821 HOST_WIDE_INT, int)); 822#endif 823 824extern int vector_mode_valid_p PARAMS ((enum machine_mode)); 825