explow.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* Export function prototypes from explow.c.
  2. Copyright (C) 2015-2016 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_EXPLOW_H
  16. #define GCC_EXPLOW_H
  17. /* Return a memory reference like MEMREF, but which is known to have a
  18. valid address. */
  19. extern rtx validize_mem (rtx);
  20. extern rtx use_anchored_address (rtx);
  21. /* Copy given rtx to a new temp reg and return that. */
  22. extern rtx copy_to_reg (rtx);
  23. /* Like copy_to_reg but always make the reg Pmode. */
  24. extern rtx copy_addr_to_reg (rtx);
  25. /* Like copy_to_reg but always make the reg the specified mode MODE. */
  26. extern rtx copy_to_mode_reg (machine_mode, rtx);
  27. /* Copy given rtx to given temp reg and return that. */
  28. extern rtx copy_to_suggested_reg (rtx, rtx, machine_mode);
  29. /* Copy a value to a register if it isn't already a register.
  30. Args are mode (in case value is a constant) and the value. */
  31. extern rtx force_reg (machine_mode, rtx);
  32. /* Return given rtx, copied into a new temp reg if it was in memory. */
  33. extern rtx force_not_mem (rtx);
  34. /* Return mode and signedness to use when an argument or result in the
  35. given mode is promoted. */
  36. extern machine_mode promote_function_mode (const_tree, machine_mode, int *,
  37. const_tree, int);
  38. /* Return mode and signedness to use when an object in the given mode
  39. is promoted. */
  40. extern machine_mode promote_mode (const_tree, machine_mode, int *);
  41. /* Return mode and signedness to use when object is promoted. */
  42. machine_mode promote_decl_mode (const_tree, int *);
  43. /* Remove some bytes from the stack. An rtx says how many. */
  44. extern void adjust_stack (rtx);
  45. /* Add some bytes to the stack. An rtx says how many. */
  46. extern void anti_adjust_stack (rtx);
  47. /* Add some bytes to the stack while probing it. An rtx says how many. */
  48. extern void anti_adjust_stack_and_probe (rtx, bool);
  49. /* This enum is used for the following two functions. */
  50. enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL};
  51. /* Save the stack pointer at the specified level. */
  52. extern void emit_stack_save (enum save_level, rtx *);
  53. /* Restore the stack pointer from a save area of the specified level. */
  54. extern void emit_stack_restore (enum save_level, rtx);
  55. /* Invoke emit_stack_save for the nonlocal_goto_save_area. */
  56. extern void update_nonlocal_goto_save_area (void);
  57. /* Allocate some space on the stack dynamically and return its address. */
  58. extern rtx allocate_dynamic_stack_space (rtx, unsigned, unsigned, bool);
  59. /* Emit one stack probe at ADDRESS, an address within the stack. */
  60. extern void emit_stack_probe (rtx);
  61. /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
  62. FIRST is a constant and size is a Pmode RTX. These are offsets from
  63. the current stack pointer. STACK_GROWS_DOWNWARD says whether to add
  64. or subtract them from the stack pointer. */
  65. extern void probe_stack_range (HOST_WIDE_INT, rtx);
  66. /* Return an rtx that refers to the value returned by a library call
  67. in its original home. This becomes invalid if any more code is emitted. */
  68. extern rtx hard_libcall_value (machine_mode, rtx);
  69. /* Return an rtx that refers to the value returned by a function
  70. in its original home. This becomes invalid if any more code is emitted. */
  71. extern rtx hard_function_value (const_tree, const_tree, const_tree, int);
  72. /* Convert arg to a valid memory address for specified machine mode that points
  73. to a specific named address space, by emitting insns to perform arithmetic
  74. if necessary. */
  75. extern rtx memory_address_addr_space (machine_mode, rtx, addr_space_t);
  76. extern rtx eliminate_constant_term (rtx, rtx *);
  77. /* Like memory_address_addr_space, except assume the memory address points to
  78. the generic named address space. */
  79. #define memory_address(MODE,RTX) \
  80. memory_address_addr_space ((MODE), (RTX), ADDR_SPACE_GENERIC)
  81. #endif /* GCC_EXPLOW_H */