1 /* Subroutines for manipulating rtx's in semantically interesting ways.
2 Copyright (C) 1987, 1991 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
26 #include "hard-reg-set.h"
27 #include "insn-config.h"
29 #include "insn-flags.h"
30 #include "insn-codes.h"
32 /* Return an rtx for the sum of X and the integer C. */
39 register RTX_CODE code;
40 register enum machine_mode mode;
54 return gen_rtx (CONST_INT, VOIDmode, (INTVAL (x) + c));
58 int l1 = CONST_DOUBLE_LOW (x);
59 int h1 = CONST_DOUBLE_HIGH (x);
61 int h2 = c < 0 ? ~0 : 0;
64 add_double (l1, h1, l2, h2, &lv, &hv);
66 return immed_double_const (lv, hv, VOIDmode);
70 /* If this is a reference to the constant pool, try replacing it with
71 a reference to a new constant. If the resulting address isn't
72 valid, don't return it because we have no way to validize it. */
73 if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
74 && CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
77 = force_const_mem (GET_MODE (x),
78 plus_constant (get_pool_constant (XEXP (x, 0)),
80 if (memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
86 /* If adding to something entirely constant, set a flag
87 so that we can add a CONST around the result. */
98 /* The interesting case is adding the integer to a sum.
99 Look for constant term in the sum and combine
100 with C. For an integer constant term, we make a combined
101 integer. For a constant term that is not an explicit integer,
102 we cannot really combine, but group them together anyway.
104 Use a recursive call in case the remaining operand is something
105 that we handle specially, such as a SYMBOL_REF. */
107 if (GET_CODE (XEXP (x, 1)) == CONST_INT)
108 return plus_constant (XEXP (x, 0), c + INTVAL (XEXP (x, 1)));
109 else if (CONSTANT_P (XEXP (x, 0)))
110 return gen_rtx (PLUS, mode,
111 plus_constant (XEXP (x, 0), c),
113 else if (CONSTANT_P (XEXP (x, 1)))
114 return gen_rtx (PLUS, mode,
116 plus_constant (XEXP (x, 1), c));
120 x = gen_rtx (PLUS, mode, x, gen_rtx (CONST_INT, VOIDmode, c));
122 if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
124 else if (all_constant)
125 return gen_rtx (CONST, mode, x);
130 /* This is the same as `plus_constant', except that it handles LO_SUM. */
133 plus_constant_for_output (x, c)
137 register RTX_CODE code = GET_CODE (x);
138 register enum machine_mode mode = GET_MODE (x);
139 int all_constant = 0;
141 if (GET_CODE (x) == LO_SUM)
142 return gen_rtx (LO_SUM, mode, XEXP (x, 0),
143 plus_constant_for_output (XEXP (x, 1), c));
146 return plus_constant (x, c);
149 /* If X is a sum, return a new sum like X but lacking any constant terms.
150 Add all the removed constant terms into *CONSTPTR.
151 X itself is not altered. The result != X if and only if
152 it is not isomorphic to X. */
155 eliminate_constant_term (x, constptr)
162 if (GET_CODE (x) != PLUS)
165 /* First handle constants appearing at this level explicitly. */
166 if (GET_CODE (XEXP (x, 1)) == CONST_INT
167 && 0 != (tem = simplify_binary_operation (PLUS, GET_MODE (x), *constptr,
169 && GET_CODE (tem) == CONST_INT)
172 return eliminate_constant_term (XEXP (x, 0), constptr);
176 x0 = eliminate_constant_term (XEXP (x, 0), &tem);
177 x1 = eliminate_constant_term (XEXP (x, 1), &tem);
178 if ((x1 != XEXP (x, 1) || x0 != XEXP (x, 0))
179 && 0 != (tem = simplify_binary_operation (PLUS, GET_MODE (x),
181 && GET_CODE (tem) == CONST_INT)
184 return gen_rtx (PLUS, GET_MODE (x), x0, x1);
190 /* Returns the insn that next references REG after INSN, or 0
191 if REG is clobbered before next referenced or we cannot find
192 an insn that references REG in a straight-line piece of code. */
195 find_next_ref (reg, insn)
201 for (insn = NEXT_INSN (insn); insn; insn = next)
203 next = NEXT_INSN (insn);
204 if (GET_CODE (insn) == NOTE)
206 if (GET_CODE (insn) == CODE_LABEL
207 || GET_CODE (insn) == BARRIER)
209 if (GET_CODE (insn) == INSN
210 || GET_CODE (insn) == JUMP_INSN
211 || GET_CODE (insn) == CALL_INSN)
213 if (reg_set_p (reg, insn))
215 if (reg_mentioned_p (reg, PATTERN (insn)))
217 if (GET_CODE (insn) == JUMP_INSN)
219 if (simplejump_p (insn))
220 next = JUMP_LABEL (insn);
224 if (GET_CODE (insn) == CALL_INSN
225 && REGNO (reg) < FIRST_PSEUDO_REGISTER
226 && call_used_regs[REGNO (reg)])
235 /* Return an rtx for the size in bytes of the value of EXP. */
241 return expand_expr (size_in_bytes (TREE_TYPE (exp)),
242 0, TYPE_MODE (sizetype), 0);
245 /* Return a copy of X in which all memory references
246 and all constants that involve symbol refs
247 have been replaced with new temporary registers.
248 Also emit code to load the memory locations and constants
249 into those registers.
251 If X contains no such constants or memory references,
252 X itself (not a copy) is returned.
254 If a constant is found in the address that is not a legitimate constant
255 in an insn, it is left alone in the hope that it might be valid in the
258 X may contain no arithmetic except addition, subtraction and multiplication.
259 Values returned by expand_expr with 1 for sum_ok fit this constraint. */
262 break_out_memory_refs (x)
265 if (GET_CODE (x) == MEM
266 || (CONSTANT_P (x) && LEGITIMATE_CONSTANT_P (x)
267 && GET_MODE (x) != VOIDmode))
269 register rtx temp = force_reg (GET_MODE (x), x);
270 mark_reg_pointer (temp);
273 else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS
274 || GET_CODE (x) == MULT)
276 register rtx op0 = break_out_memory_refs (XEXP (x, 0));
277 register rtx op1 = break_out_memory_refs (XEXP (x, 1));
278 if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
279 x = gen_rtx (GET_CODE (x), Pmode, op0, op1);
284 /* Given a memory address or facsimile X, construct a new address,
285 currently equivalent, that is stable: future stores won't change it.
287 X must be composed of constants, register and memory references
288 combined with addition, subtraction and multiplication:
289 in other words, just what you can get from expand_expr if sum_ok is 1.
291 Works by making copies of all regs and memory locations used
292 by X and combining them the same way X does.
293 You could also stabilize the reference to this address
294 by copying the address to a register with copy_to_reg;
295 but then you wouldn't get indexed addressing in the reference. */
301 if (GET_CODE (x) == REG)
303 if (REGNO (x) != FRAME_POINTER_REGNUM)
306 else if (GET_CODE (x) == MEM)
308 else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS
309 || GET_CODE (x) == MULT)
311 register rtx op0 = copy_all_regs (XEXP (x, 0));
312 register rtx op1 = copy_all_regs (XEXP (x, 1));
313 if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
314 x = gen_rtx (GET_CODE (x), Pmode, op0, op1);
319 /* Return something equivalent to X but valid as a memory address
320 for something of mode MODE. When X is not itself valid, this
321 works by copying X or subexpressions of it into registers. */
324 memory_address (mode, x)
325 enum machine_mode mode;
330 /* By passing constant addresses thru registers
331 we get a chance to cse them. */
332 if (! cse_not_expected && CONSTANT_P (x) && LEGITIMATE_CONSTANT_P (x))
333 return force_reg (Pmode, x);
335 /* Accept a QUEUED that refers to a REG
336 even though that isn't a valid address.
337 On attempting to put this in an insn we will call protect_from_queue
338 which will turn it into a REG, which is valid. */
339 if (GET_CODE (x) == QUEUED
340 && GET_CODE (QUEUED_VAR (x)) == REG)
343 /* We get better cse by rejecting indirect addressing at this stage.
344 Let the combiner create indirect addresses where appropriate.
345 For now, generate the code so that the subexpressions useful to share
346 are visible. But not if cse won't be done! */
348 if (! cse_not_expected && GET_CODE (x) != REG)
349 x = break_out_memory_refs (x);
351 /* At this point, any valid address is accepted. */
352 GO_IF_LEGITIMATE_ADDRESS (mode, x, win);
354 /* If it was valid before but breaking out memory refs invalidated it,
355 use it the old way. */
356 if (memory_address_p (mode, oldx))
359 /* Perform machine-dependent transformations on X
360 in certain cases. This is not necessary since the code
361 below can handle all possible cases, but machine-dependent
362 transformations can make better code. */
363 LEGITIMIZE_ADDRESS (x, oldx, mode, win);
365 /* PLUS and MULT can appear in special ways
366 as the result of attempts to make an address usable for indexing.
367 Usually they are dealt with by calling force_operand, below.
368 But a sum containing constant terms is special
369 if removing them makes the sum a valid address:
370 then we generate that address in a register
371 and index off of it. We do this because it often makes
372 shorter code, and because the addresses thus generated
373 in registers often become common subexpressions. */
374 if (GET_CODE (x) == PLUS)
376 rtx constant_term = const0_rtx;
377 rtx y = eliminate_constant_term (x, &constant_term);
378 if (constant_term == const0_rtx
379 || ! memory_address_p (mode, y))
380 return force_operand (x, 0);
382 y = gen_rtx (PLUS, GET_MODE (x), copy_to_reg (y), constant_term);
383 if (! memory_address_p (mode, y))
384 return force_operand (x, 0);
387 if (GET_CODE (x) == MULT || GET_CODE (x) == MINUS)
388 return force_operand (x, 0);
390 /* If we have a register that's an invalid address,
391 it must be a hard reg of the wrong class. Copy it to a pseudo. */
392 if (GET_CODE (x) == REG)
393 return copy_to_reg (x);
395 /* Last resort: copy the value to a register, since
396 the register is a valid address. */
397 return force_reg (Pmode, x);
402 if (flag_force_addr && ! cse_not_expected && GET_CODE (x) != REG
403 /* Don't copy an addr via a reg if it is one of our stack slots. */
404 && ! (GET_CODE (x) == PLUS
405 && (XEXP (x, 0) == virtual_stack_vars_rtx
406 || XEXP (x, 0) == virtual_incoming_args_rtx)))
408 if (general_operand (x, Pmode))
409 return force_reg (Pmode, x);
411 return force_operand (x, 0);
416 /* Like `memory_address' but pretend `flag_force_addr' is 0. */
419 memory_address_noforce (mode, x)
420 enum machine_mode mode;
423 int ambient_force_addr = flag_force_addr;
427 val = memory_address (mode, x);
428 flag_force_addr = ambient_force_addr;
432 /* Convert a mem ref into one with a valid memory address.
433 Pass through anything else unchanged. */
439 if (GET_CODE (ref) != MEM)
441 if (memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
443 /* Don't alter REF itself, since that is probably a stack slot. */
444 return change_address (ref, GET_MODE (ref), XEXP (ref, 0));
447 /* Return a modified copy of X with its memory address copied
448 into a temporary register to protect it from side effects.
449 If X is not a MEM, it is returned unchanged (and not copied).
450 Perhaps even if it is a MEM, if there is no need to change it. */
457 if (GET_CODE (x) != MEM)
460 if (rtx_unstable_p (addr))
462 rtx temp = copy_all_regs (addr);
464 if (GET_CODE (temp) != REG)
465 temp = copy_to_reg (temp);
466 mem = gen_rtx (MEM, GET_MODE (x), temp);
468 /* Mark returned memref with in_struct if it's in an array or
469 structure. Copy const and volatile from original memref. */
471 MEM_IN_STRUCT_P (mem) = MEM_IN_STRUCT_P (x) || GET_CODE (addr) == PLUS;
472 RTX_UNCHANGING_P (mem) = RTX_UNCHANGING_P (x);
473 MEM_VOLATILE_P (mem) = MEM_VOLATILE_P (x);
479 /* Copy the value or contents of X to a new temp reg and return that reg. */
485 register rtx temp = gen_reg_rtx (GET_MODE (x));
487 /* If not an operand, must be an address with PLUS and MULT so
488 do the computation. */
489 if (! general_operand (x, VOIDmode))
490 x = force_operand (x, temp);
493 emit_move_insn (temp, x);
498 /* Like copy_to_reg but always give the new register mode Pmode
499 in case X is a constant. */
505 return copy_to_mode_reg (Pmode, x);
508 /* Like copy_to_reg but always give the new register mode MODE
509 in case X is a constant. */
512 copy_to_mode_reg (mode, x)
513 enum machine_mode mode;
516 register rtx temp = gen_reg_rtx (mode);
518 /* If not an operand, must be an address with PLUS and MULT so
519 do the computation. */
520 if (! general_operand (x, VOIDmode))
521 x = force_operand (x, temp);
523 if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
526 emit_move_insn (temp, x);
530 /* Load X into a register if it is not already one.
531 Use mode MODE for the register.
532 X should be valid for mode MODE, but it may be a constant which
533 is valid for all integer modes; that's why caller must specify MODE.
535 The caller must not alter the value in the register we return,
536 since we mark it as a "constant" register. */
540 enum machine_mode mode;
543 register rtx temp, insn;
545 if (GET_CODE (x) == REG)
547 temp = gen_reg_rtx (mode);
548 insn = emit_move_insn (temp, x);
549 /* Let optimizers know that TEMP's value never changes
550 and that X can be substituted for it. */
553 rtx note = find_reg_note (insn, REG_EQUAL, 0);
558 REG_NOTES (insn) = gen_rtx (EXPR_LIST, REG_EQUAL, x, REG_NOTES (insn));
563 /* If X is a memory ref, copy its contents to a new temp reg and return
564 that reg. Otherwise, return X. */
571 if (GET_CODE (x) != MEM || GET_MODE (x) == BLKmode)
573 temp = gen_reg_rtx (GET_MODE (x));
574 emit_move_insn (temp, x);
578 /* Copy X to TARGET (if it's nonzero and a reg)
579 or to a new temp reg and return that reg.
580 MODE is the mode to use for X in case it is a constant. */
583 copy_to_suggested_reg (x, target, mode)
585 enum machine_mode mode;
589 if (target && GET_CODE (target) == REG)
592 temp = gen_reg_rtx (mode);
594 emit_move_insn (temp, x);
598 /* Adjust the stack pointer by ADJUST (an rtx for a number of bytes).
599 This pops when ADJUST is positive. ADJUST need not be constant. */
602 adjust_stack (adjust)
606 adjust = protect_from_queue (adjust, 0);
608 if (adjust == const0_rtx)
611 temp = expand_binop (Pmode,
612 #ifdef STACK_GROWS_DOWNWARD
617 stack_pointer_rtx, adjust, stack_pointer_rtx, 0,
620 if (temp != stack_pointer_rtx)
621 emit_move_insn (stack_pointer_rtx, temp);
624 /* Adjust the stack pointer by minus ADJUST (an rtx for a number of bytes).
625 This pushes when ADJUST is positive. ADJUST need not be constant. */
628 anti_adjust_stack (adjust)
632 adjust = protect_from_queue (adjust, 0);
634 if (adjust == const0_rtx)
637 temp = expand_binop (Pmode,
638 #ifdef STACK_GROWS_DOWNWARD
643 stack_pointer_rtx, adjust, stack_pointer_rtx, 0,
646 if (temp != stack_pointer_rtx)
647 emit_move_insn (stack_pointer_rtx, temp);
650 /* Round the size of a block to be pushed up to the boundary required
651 by this machine. SIZE is the desired size, which need not be constant. */
657 #ifdef STACK_BOUNDARY
658 int align = STACK_BOUNDARY / BITS_PER_UNIT;
661 if (GET_CODE (size) == CONST_INT)
663 int new = (INTVAL (size) + align - 1) / align * align;
664 if (INTVAL (size) != new)
665 size = gen_rtx (CONST_INT, VOIDmode, new);
669 size = expand_divmod (0, CEIL_DIV_EXPR, Pmode, size,
670 gen_rtx (CONST_INT, VOIDmode, align),
672 size = expand_mult (Pmode, size,
673 gen_rtx (CONST_INT, VOIDmode, align),
676 #endif /* STACK_BOUNDARY */
680 /* Save the stack pointer for the purpose in SAVE_LEVEL. PSAVE is a pointer
681 to a previously-created save area. If no save area has been allocated,
682 this function will allocate one. If a save area is specified, it
683 must be of the proper mode.
685 The insns are emitted after insn AFTER, if nonzero, otherwise the insns
686 are emitted at the current position. */
689 emit_stack_save (save_level, psave, after)
690 enum save_level save_level;
695 /* The default is that we use a move insn and save in a Pmode object. */
696 rtx (*fcn) () = gen_move_insn;
697 enum machine_mode mode = Pmode;
699 /* See if this machine has anything special to do for this kind of save. */
702 #ifdef HAVE_save_stack_block
704 if (HAVE_save_stack_block)
706 fcn = gen_save_stack_block;
707 mode = insn_operand_mode[CODE_FOR_save_stack_block][0];
711 #ifdef HAVE_save_stack_function
713 if (HAVE_save_stack_function)
715 fcn = gen_save_stack_function;
716 mode = insn_operand_mode[CODE_FOR_save_stack_function][0];
720 #ifdef HAVE_save_stack_nonlocal
722 if (HAVE_save_stack_nonlocal)
724 fcn = gen_save_stack_nonlocal;
725 mode = insn_operand_mode[CODE_FOR_save_stack_nonlocal][0];
731 /* If there is no save area and we have to allocate one, do so. Otherwise
732 verify the save area is the proper mode. */
736 if (mode != VOIDmode)
738 if (save_level == SAVE_NONLOCAL)
739 *psave = sa = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
741 *psave = sa = gen_reg_rtx (mode);
746 if (mode == VOIDmode || GET_MODE (sa) != mode)
751 sa = validize_mem (sa);
758 emit_insn (fcn (sa, stack_pointer_rtx));
759 seq = gen_sequence ();
761 emit_insn_after (seq, after);
764 emit_insn (fcn (sa, stack_pointer_rtx));
767 /* Restore the stack pointer for the purpose in SAVE_LEVEL. SA is the save
768 area made by emit_stack_save. If it is zero, we have nothing to do.
770 Put any emitted insns after insn AFTER, if nonzero, otherwise at
774 emit_stack_restore (save_level, sa, after)
775 enum save_level save_level;
779 /* The default is that we use a move insn. */
780 rtx (*fcn) () = gen_move_insn;
782 /* See if this machine has anything special to do for this kind of save. */
785 #ifdef HAVE_restore_stack_block
787 if (HAVE_restore_stack_block)
788 fcn = gen_restore_stack_block;
791 #ifdef HAVE_restore_stack_function
793 if (HAVE_restore_stack_function)
794 fcn = gen_restore_stack_function;
797 #ifdef HAVE_restore_stack_nonlocal
800 if (HAVE_restore_stack_nonlocal)
801 fcn = gen_restore_stack_nonlocal;
807 sa = validize_mem (sa);
814 emit_insn (fcn (stack_pointer_rtx, sa));
815 seq = gen_sequence ();
817 emit_insn_after (seq, after);
820 emit_insn (fcn (stack_pointer_rtx, sa));
823 /* Return an rtx representing the address of an area of memory dynamically
824 pushed on the stack. This region of memory is always aligned to
825 a multiple of BIGGEST_ALIGNMENT.
827 Any required stack pointer alignment is preserved.
829 SIZE is an rtx representing the size of the area.
830 TARGET is a place in which the address can be placed.
832 KNOWN_ALIGN is the alignment (in bits) that we know SIZE has. */
835 allocate_dynamic_stack_space (size, target, known_align)
840 /* Ensure the size is in the proper mode. */
841 if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
842 size = convert_to_mode (Pmode, size, 1);
844 /* We will need to ensure that the address we return is aligned to
845 BIGGEST_ALIGNMENT. If STACK_DYNAMIC_OFFSET is defined, we don't
846 always know its final value at this point in the compilation (it
847 might depend on the size of the outgoing parameter lists, for
848 example), so we must align the value to be returned in that case.
849 (Note that STACK_DYNAMIC_OFFSET will have a default non-zero value if
850 STACK_POINTER_OFFSET or ACCUMULATE_OUTGOING_ARGS are defined).
851 We must also do an alignment operation on the returned value if
852 the stack pointer alignment is less strict that BIGGEST_ALIGNMENT.
854 If we have to align, we must leave space in SIZE for the hole
855 that might result from the alignment operation. */
857 #if defined (STACK_DYNAMIC_OFFSET) || defined(STACK_POINTER_OFFSET) || defined (ALLOCATE_OUTGOING_ARGS)
861 #if ! defined (MUST_ALIGN) && (!defined(STACK_BOUNDARY) || STACK_BOUNDARY < BIGGEST_ALIGNMENT)
867 if (known_align % BIGGEST_ALIGNMENT != 0)
869 if (GET_CODE (size) == CONST_INT)
870 size = gen_rtx (CONST_INT, VOIDmode,
872 + (BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1)));
874 size = expand_binop (Pmode, add_optab, size,
875 gen_rtx (CONST_INT, VOIDmode,
876 BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1),
877 0, 1, OPTAB_LIB_WIDEN);
881 #ifdef SETJMP_VIA_SAVE_AREA
882 /* If setjmp restores regs from a save area in the stack frame,
883 avoid clobbering the reg save area. Note that the offset of
884 virtual_incoming_args_rtx includes the preallocated stack args space.
885 It would be no problem to clobber that, but it's on the wrong side
886 of the old save area. */
889 = expand_binop (Pmode, sub_optab, virtual_stack_dynamic_rtx,
890 stack_pointer_rtx, 0, 1, OPTAB_LIB_WIDEN);
891 size = expand_binop (Pmode, add_optab, size, dynamic_offset,
892 0, 1, OPTAB_LIB_WIDEN);
894 #endif /* SETJMP_VIA_SAVE_AREA */
896 /* Round the size to a multiple of the required stack alignment.
897 Since the stack if presumed to be rounded before this allocation,
898 this will maintain the required alignment.
900 If the stack grows downward, we could save an insn by subtracting
901 SIZE from the stack pointer and then aligning the stack pointer.
902 The problem with this is that the stack pointer may be unaligned
903 between the execution of the subtraction and alignment insns and
904 some machines do not allow this. Even on those that do, some
905 signal handlers malfunction if a signal should occur between those
906 insns. Since this is an extremely rare event, we have no reliable
907 way of knowing which systems have this problem. So we avoid even
908 momentarily mis-aligning the stack. */
910 #ifdef STACK_BOUNDARY
911 if (known_align % STACK_BOUNDARY != 0)
912 size = round_push (size);
915 do_pending_stack_adjust ();
917 /* Don't use a TARGET that isn't a pseudo. */
918 if (target == 0 || GET_CODE (target) != REG
919 || REGNO (target) < FIRST_PSEUDO_REGISTER)
920 target = gen_reg_rtx (Pmode);
922 mark_reg_pointer (target);
924 #ifndef STACK_GROWS_DOWNWARD
925 emit_move_insn (target, virtual_stack_dynamic_rtx);
928 /* Perform the required allocation from the stack. Some systems do
929 this differently than simply incrementing/decrementing from the
931 #ifdef HAVE_allocate_stack
932 if (HAVE_allocate_stack)
934 enum machine_mode mode
935 = insn_operand_mode[(int) CODE_FOR_allocate_stack][0];
937 if (insn_operand_predicate[(int) CODE_FOR_allocate_stack][0]
938 && ! ((*insn_operand_predicate[(int) CODE_FOR_allocate_stack][0])
940 size = copy_to_mode_reg (mode, size);
942 emit_insn (gen_allocate_stack (size));
946 anti_adjust_stack (size);
948 #ifdef STACK_GROWS_DOWNWARD
949 emit_move_insn (target, virtual_stack_dynamic_rtx);
953 if (known_align % BIGGEST_ALIGNMENT != 0)
955 target = expand_divmod (0, CEIL_DIV_EXPR, Pmode, target,
956 gen_rtx (CONST_INT, VOIDmode,
957 BIGGEST_ALIGNMENT / BITS_PER_UNIT),
960 target = expand_mult (Pmode, target,
961 gen_rtx (CONST_INT, VOIDmode,
962 BIGGEST_ALIGNMENT / BITS_PER_UNIT),
967 /* Some systems require a particular insn to refer to the stack
968 to make the pages exist. */
971 emit_insn (gen_probe ());
977 /* Return an rtx representing the register or memory location
978 in which a scalar value of data type VALTYPE
979 was returned by a function call to function FUNC.
980 FUNC is a FUNCTION_DECL node if the precise function is known,
984 hard_function_value (valtype, func)
988 return FUNCTION_VALUE (valtype, func);
991 /* Return an rtx representing the register or memory location
992 in which a scalar value of mode MODE was returned by a library call. */
995 hard_libcall_value (mode)
996 enum machine_mode mode;
998 return LIBCALL_VALUE (mode);