2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: arguments in registers, registers arguments
8 .. _register-arguments:
10 Passing Arguments in Registers
11 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 This section describes the macros which let you control how various
14 types of arguments are passed in registers or how they are arranged in
17 .. function:: rtx TARGET_FUNCTION_ARG (cumulative_args_t ca, const function_arg_info &arg)
19 .. hook-start:TARGET_FUNCTION_ARG
21 Return an RTX indicating whether function argument :samp:`{arg}` is passed
22 in a register and if so, which register. Argument :samp:`{ca}` summarizes all
23 the previous arguments.
25 The return value is usually either a ``reg`` RTX for the hard
26 register in which to pass the argument, or zero to pass the argument
29 The value of the expression can also be a ``parallel`` RTX. This is
30 used when an argument is passed in multiple locations. The mode of the
31 ``parallel`` should be the mode of the entire argument. The
32 ``parallel`` holds any number of ``expr_list`` pairs; each one
33 describes where part of the argument is passed. In each
34 ``expr_list`` the first operand must be a ``reg`` RTX for the hard
35 register in which to pass this part of the argument, and the mode of the
36 register RTX indicates how large this part of the argument is. The
37 second operand of the ``expr_list`` is a ``const_int`` which gives
38 the offset in bytes into the entire argument of where this part starts.
39 As a special exception the first ``expr_list`` in the ``parallel``
40 RTX may have a first operand of zero. This indicates that the entire
41 argument is also stored on the stack.
43 The last time this hook is called, it is called with ``MODE ==
44 VOIDmode``, and its result is passed to the ``call`` or ``call_value``
45 pattern as operands 2 and 3 respectively.
47 .. index:: stdarg.h and register arguments
49 The usual way to make the ISO library :samp:`stdarg.h` work on a
50 machine where some arguments are usually passed in registers, is to
51 cause nameless arguments to be passed on the stack instead. This is
52 done by making ``TARGET_FUNCTION_ARG`` return 0 whenever
53 :samp:`{named}` is ``false``.
55 .. index:: TARGET_MUST_PASS_IN_STACK, and TARGET_FUNCTION_ARG, REG_PARM_STACK_SPACE, and TARGET_FUNCTION_ARG
57 You may use the hook ``targetm.calls.must_pass_in_stack``
58 in the definition of this macro to determine if this argument is of a
59 type that must be passed in the stack. If ``REG_PARM_STACK_SPACE``
60 is not defined and ``TARGET_FUNCTION_ARG`` returns nonzero for such an
61 argument, the compiler will abort. If ``REG_PARM_STACK_SPACE`` is
62 defined, the argument will be computed in the stack and then loaded into
67 .. function:: bool TARGET_MUST_PASS_IN_STACK (const function_arg_info &arg)
69 .. hook-start:TARGET_MUST_PASS_IN_STACK
71 This target hook should return ``true`` if we should not pass :samp:`{arg}`
72 solely in registers. The file :samp:`expr.h` defines a
73 definition that is usually appropriate, refer to :samp:`expr.h` for additional
78 .. function:: rtx TARGET_FUNCTION_INCOMING_ARG (cumulative_args_t ca, const function_arg_info &arg)
80 .. hook-start:TARGET_FUNCTION_INCOMING_ARG
82 Define this hook if the caller and callee on the target have different
83 views of where arguments are passed. Also define this hook if there are
84 functions that are never directly called, but are invoked by the hardware
85 and which have nonstandard calling conventions.
87 In this case ``TARGET_FUNCTION_ARG`` computes the register in
88 which the caller passes the value, and
89 ``TARGET_FUNCTION_INCOMING_ARG`` should be defined in a similar
90 fashion to tell the function being called where the arguments will
93 ``TARGET_FUNCTION_INCOMING_ARG`` can also return arbitrary address
94 computation using hard register, which can be forced into a register,
95 so that it can be used to pass special arguments.
97 If ``TARGET_FUNCTION_INCOMING_ARG`` is not defined,
98 ``TARGET_FUNCTION_ARG`` serves both purposes.
102 .. function:: bool TARGET_USE_PSEUDO_PIC_REG (void)
104 .. hook-start:TARGET_USE_PSEUDO_PIC_REG
106 This hook should return 1 in case pseudo register should be created
107 for pic_offset_table_rtx during function expand.
111 .. function:: void TARGET_INIT_PIC_REG (void)
113 .. hook-start:TARGET_INIT_PIC_REG
115 Perform a target dependent initialization of pic_offset_table_rtx.
116 This hook is called at the start of register allocation.
120 .. function:: int TARGET_ARG_PARTIAL_BYTES (cumulative_args_t cum, const function_arg_info &arg)
122 .. hook-start:TARGET_ARG_PARTIAL_BYTES
124 This target hook returns the number of bytes at the beginning of an
125 argument that must be put in registers. The value must be zero for
126 arguments that are passed entirely in registers or that are entirely
129 On some machines, certain arguments must be passed partially in
130 registers and partially in memory. On these machines, typically the
131 first few words of arguments are passed in registers, and the rest
132 on the stack. If a multi-word argument (a ``double`` or a
133 structure) crosses that boundary, its first few words must be passed
134 in registers and the rest must be pushed. This macro tells the
135 compiler when this occurs, and how many bytes should go in registers.
137 ``TARGET_FUNCTION_ARG`` for these arguments should return the first
138 register to be used by the caller for this argument; likewise
139 ``TARGET_FUNCTION_INCOMING_ARG``, for the called function.
143 .. function:: bool TARGET_PASS_BY_REFERENCE (cumulative_args_t cum, const function_arg_info &arg)
145 .. hook-start:TARGET_PASS_BY_REFERENCE
147 This target hook should return ``true`` if argument :samp:`{arg}` at the
148 position indicated by :samp:`{cum}` should be passed by reference. This
149 predicate is queried after target independent reasons for being
150 passed by reference, such as ``TREE_ADDRESSABLE (arg.type)``.
152 If the hook returns true, a copy of that argument is made in memory and a
153 pointer to the argument is passed instead of the argument itself.
154 The pointer is passed in whatever way is appropriate for passing a pointer
159 .. function:: bool TARGET_CALLEE_COPIES (cumulative_args_t cum, const function_arg_info &arg)
161 .. hook-start:TARGET_CALLEE_COPIES
163 The function argument described by the parameters to this hook is
164 known to be passed by reference. The hook should return true if the
165 function argument should be copied by the callee instead of copied
168 For any argument for which the hook returns true, if it can be
169 determined that the argument is not modified, then a copy need
172 The default version of this hook always returns false.
176 .. c:macro:: CUMULATIVE_ARGS
178 A C type for declaring a variable that is used as the first argument
179 of ``TARGET_FUNCTION_ARG`` and other related values. For some
180 target machines, the type ``int`` suffices and can hold the number
181 of bytes of argument so far.
183 There is no need to record in ``CUMULATIVE_ARGS`` anything about the
184 arguments that have been passed on the stack. The compiler has other
185 variables to keep track of that. For target machines on which all
186 arguments are passed on the stack, there is no need to store anything in
187 ``CUMULATIVE_ARGS`` ; however, the data structure must exist and
188 should not be empty, so use ``int``.
190 .. c:macro:: OVERRIDE_ABI_FORMAT (fndecl)
192 If defined, this macro is called before generating any code for a
193 function, but after the :samp:`{cfun}` descriptor for the function has been
194 created. The back end may use this macro to update :samp:`{cfun}` to
195 reflect an ABI other than that which would normally be used by default.
196 If the compiler is generating code for a compiler-generated function,
197 :samp:`{fndecl}` may be ``NULL``.
199 .. c:macro:: INIT_CUMULATIVE_ARGS (cum, fntype, libname, fndecl, n_named_args)
201 A C statement (sans semicolon) for initializing the variable
202 :samp:`{cum}` for the state at the beginning of the argument list. The
203 variable has type ``CUMULATIVE_ARGS``. The value of :samp:`{fntype}`
204 is the tree node for the data type of the function which will receive
205 the args, or 0 if the args are to a compiler support library function.
206 For direct calls that are not libcalls, :samp:`{fndecl}` contain the
207 declaration node of the function. :samp:`{fndecl}` is also set when
208 ``INIT_CUMULATIVE_ARGS`` is used to find arguments for the function
209 being compiled. :samp:`{n_named_args}` is set to the number of named
210 arguments, including a structure return address if it is passed as a
211 parameter, when making a call. When processing incoming arguments,
212 :samp:`{n_named_args}` is set to -1.
214 When processing a call to a compiler support library function,
215 :samp:`{libname}` identifies which one. It is a ``symbol_ref`` rtx which
216 contains the name of the function, as a string. :samp:`{libname}` is 0 when
217 an ordinary C function call is being processed. Thus, each time this
218 macro is called, either :samp:`{libname}` or :samp:`{fntype}` is nonzero, but
219 never both of them at once.
221 .. c:macro:: INIT_CUMULATIVE_LIBCALL_ARGS (cum, mode, libname)
223 Like ``INIT_CUMULATIVE_ARGS`` but only used for outgoing libcalls,
224 it gets a ``MODE`` argument instead of :samp:`{fntype}`, that would be
225 ``NULL``. :samp:`{indirect}` would always be zero, too. If this macro
226 is not defined, ``INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname,
227 0)`` is used instead.
229 .. c:macro:: INIT_CUMULATIVE_INCOMING_ARGS (cum, fntype, libname)
231 Like ``INIT_CUMULATIVE_ARGS`` but overrides it for the purposes of
232 finding the arguments for the function being compiled. If this macro is
233 undefined, ``INIT_CUMULATIVE_ARGS`` is used instead.
235 The value passed for :samp:`{libname}` is always 0, since library routines
236 with special calling conventions are never compiled with GCC. The
237 argument :samp:`{libname}` exists for symmetry with
238 ``INIT_CUMULATIVE_ARGS``.
240 .. could use "this macro" in place of @code{INIT_CUMULATIVE_ARGS}, maybe.
242 .. -mew 5feb93 i switched the order of the sentences. -mew 10feb93
244 .. function:: void TARGET_FUNCTION_ARG_ADVANCE (cumulative_args_t ca, const function_arg_info &arg)
246 .. hook-start:TARGET_FUNCTION_ARG_ADVANCE
248 This hook updates the summarizer variable pointed to by :samp:`{ca}` to
249 advance past argument :samp:`{arg}` in the argument list. Once this is done,
250 the variable :samp:`{cum}` is suitable for analyzing the *following*
251 argument with ``TARGET_FUNCTION_ARG``, etc.
253 This hook need not do anything if the argument in question was passed
254 on the stack. The compiler knows how to track the amount of stack space
255 used for arguments without any special help.
259 .. function:: HOST_WIDE_INT TARGET_FUNCTION_ARG_OFFSET (machine_mode mode, const_tree type)
261 .. hook-start:TARGET_FUNCTION_ARG_OFFSET
263 This hook returns the number of bytes to add to the offset of an
264 argument of type :samp:`{type}` and mode :samp:`{mode}` when passed in memory.
265 This is needed for the SPU, which passes ``char`` and ``short``
266 arguments in the preferred slot that is in the middle of the quad word
267 instead of starting at the top. The default implementation returns 0.
271 .. function:: pad_direction TARGET_FUNCTION_ARG_PADDING (machine_mode mode, const_tree type)
273 .. hook-start:TARGET_FUNCTION_ARG_PADDING
275 This hook determines whether, and in which direction, to pad out
276 an argument of mode :samp:`{mode}` and type :samp:`{type}`. It returns
277 ``PAD_UPWARD`` to insert padding above the argument, ``PAD_DOWNWARD``
278 to insert padding below the argument, or ``PAD_NONE`` to inhibit padding.
280 The *amount* of padding is not controlled by this hook, but by
281 ``TARGET_FUNCTION_ARG_ROUND_BOUNDARY``. It is always just enough
282 to reach the next multiple of that boundary.
284 This hook has a default definition that is right for most systems.
285 For little-endian machines, the default is to pad upward. For
286 big-endian machines, the default is to pad downward for an argument of
287 constant size shorter than an ``int``, and upward otherwise.
291 .. c:macro:: PAD_VARARGS_DOWN
293 If defined, a C expression which determines whether the default
294 implementation of va_arg will attempt to pad down before reading the
295 next argument, if that argument is smaller than its aligned space as
296 controlled by ``PARM_BOUNDARY``. If this macro is not defined, all such
297 arguments are padded down if ``BYTES_BIG_ENDIAN`` is true.
299 .. c:macro:: BLOCK_REG_PADDING (mode, type, first)
301 Specify padding for the last element of a block move between registers and
302 memory. :samp:`{first}` is nonzero if this is the only element. Defining this
303 macro allows better control of register function parameters on big-endian
304 machines, without using ``PARALLEL`` rtl. In particular,
305 ``MUST_PASS_IN_STACK`` need not test padding and mode of types in
306 registers, as there is no longer a "wrong" part of a register; For example,
307 a three byte aggregate may be passed in the high part of a register if so
310 .. function:: unsigned int TARGET_FUNCTION_ARG_BOUNDARY (machine_mode mode, const_tree type)
312 .. hook-start:TARGET_FUNCTION_ARG_BOUNDARY
314 This hook returns the alignment boundary, in bits, of an argument
315 with the specified mode and type. The default hook returns
316 ``PARM_BOUNDARY`` for all arguments.
320 .. function:: unsigned int TARGET_FUNCTION_ARG_ROUND_BOUNDARY (machine_mode mode, const_tree type)
322 .. hook-start:TARGET_FUNCTION_ARG_ROUND_BOUNDARY
324 Normally, the size of an argument is rounded up to ``PARM_BOUNDARY``,
325 which is the default value for this hook. You can define this hook to
326 return a different value if an argument size must be rounded to a larger
331 .. c:macro:: FUNCTION_ARG_REGNO_P (regno)
333 A C expression that is nonzero if :samp:`{regno}` is the number of a hard
334 register in which function arguments are sometimes passed. This does
335 *not* include implicit arguments such as the static chain and
336 the structure-value address. On many machines, no registers can be
337 used for this purpose since all function arguments are pushed on the
340 .. function:: bool TARGET_SPLIT_COMPLEX_ARG (const_tree type)
342 .. hook-start:TARGET_SPLIT_COMPLEX_ARG
344 This hook should return true if parameter of type :samp:`{type}` are passed
345 as two scalar parameters. By default, GCC will attempt to pack complex
346 arguments into the target's word size. Some ABIs require complex arguments
347 to be split and treated as their individual components. For example, on
348 AIX64, complex floats should be passed in a pair of floating point
349 registers, even though a complex float would fit in one 64-bit floating
352 The default value of this hook is ``NULL``, which is treated as always
357 .. function:: tree TARGET_BUILD_BUILTIN_VA_LIST (void)
359 .. hook-start:TARGET_BUILD_BUILTIN_VA_LIST
361 This hook returns a type node for ``va_list`` for the target.
362 The default version of the hook returns ``void*``.
366 .. function:: int TARGET_ENUM_VA_LIST_P (int idx, const char **pname, tree *ptree)
368 .. hook-start:TARGET_ENUM_VA_LIST_P
370 This target hook is used in function ``c_common_nodes_and_builtins``
371 to iterate through the target specific builtin types for va_list. The
372 variable :samp:`{idx}` is used as iterator. :samp:`{pname}` has to be a pointer
373 to a ``const char *`` and :samp:`{ptree}` a pointer to a ``tree`` typed
375 The arguments :samp:`{pname}` and :samp:`{ptree}` are used to store the result of
376 this macro and are set to the name of the va_list builtin type and its
378 If the return value of this macro is zero, then there is no more element.
379 Otherwise the :samp:`{IDX}` should be increased for the next call of this
380 macro to iterate through all types.
384 .. function:: tree TARGET_FN_ABI_VA_LIST (tree fndecl)
386 .. hook-start:TARGET_FN_ABI_VA_LIST
388 This hook returns the va_list type of the calling convention specified by
390 The default version of this hook returns ``va_list_type_node``.
394 .. function:: tree TARGET_CANONICAL_VA_LIST_TYPE (tree type)
396 .. hook-start:TARGET_CANONICAL_VA_LIST_TYPE
398 This hook returns the va_list type of the calling convention specified by the
399 type of :samp:`{type}`. If :samp:`{type}` is not a valid va_list type, it returns
404 .. function:: tree TARGET_GIMPLIFY_VA_ARG_EXPR (tree valist, tree type, gimple_seq *pre_p, gimple_seq *post_p)
406 .. hook-start:TARGET_GIMPLIFY_VA_ARG_EXPR
408 This hook performs target-specific gimplification of
409 ``VA_ARG_EXPR``. The first two parameters correspond to the
410 arguments to ``va_arg`` ; the latter two are as in
411 ``gimplify.cc:gimplify_expr``.
415 .. function:: bool TARGET_VALID_POINTER_MODE (scalar_int_mode mode)
417 .. hook-start:TARGET_VALID_POINTER_MODE
419 Define this to return nonzero if the port can handle pointers
420 with machine mode :samp:`{mode}`. The default version of this
421 hook returns true for both ``ptr_mode`` and ``Pmode``.
425 .. function:: bool TARGET_REF_MAY_ALIAS_ERRNO (ao_ref *ref)
427 .. hook-start:TARGET_REF_MAY_ALIAS_ERRNO
429 Define this to return nonzero if the memory reference :samp:`{ref}`
430 may alias with the system C library errno location. The default
431 version of this hook assumes the system C library errno location
432 is either a declaration of type int or accessed by dereferencing
437 .. function:: machine_mode TARGET_TRANSLATE_MODE_ATTRIBUTE (machine_mode mode)
439 .. hook-start:TARGET_TRANSLATE_MODE_ATTRIBUTE
441 Define this hook if during mode attribute processing, the port should
442 translate machine_mode :samp:`{mode}` to another mode. For example, rs6000's
443 ``KFmode``, when it is the same as ``TFmode``.
445 The default version of the hook returns that mode that was passed in.
449 .. function:: bool TARGET_SCALAR_MODE_SUPPORTED_P (scalar_mode mode)
451 .. hook-start:TARGET_SCALAR_MODE_SUPPORTED_P
453 Define this to return nonzero if the port is prepared to handle
454 insns involving scalar mode :samp:`{mode}`. For a scalar mode to be
455 considered supported, all the basic arithmetic and comparisons
458 The default version of this hook returns true for any mode
459 required to handle the basic C types (as defined by the port).
460 Included here are the double-word arithmetic supported by the
461 code in :samp:`optabs.cc`.
465 .. function:: bool TARGET_VECTOR_MODE_SUPPORTED_P (machine_mode mode)
467 .. hook-start:TARGET_VECTOR_MODE_SUPPORTED_P
469 Define this to return nonzero if the port is prepared to handle
470 insns involving vector mode :samp:`{mode}`. At the very least, it
471 must have move patterns for this mode.
475 .. function:: bool TARGET_COMPATIBLE_VECTOR_TYPES_P (const_tree type1, const_tree type2)
477 .. hook-start:TARGET_COMPATIBLE_VECTOR_TYPES_P
479 Return true if there is no target-specific reason for treating
480 vector types :samp:`{type1}` and :samp:`{type2}` as distinct types. The caller
481 has already checked for target-independent reasons, meaning that the
482 types are known to have the same mode, to have the same number of elements,
483 and to have what the caller considers to be compatible element types.
485 The main reason for defining this hook is to reject pairs of types
486 that are handled differently by the target's calling convention.
487 For example, when a new :samp:`{N}` -bit vector architecture is added
488 to a target, the target may want to handle normal :samp:`{N}` -bit
489 ``VECTOR_TYPE`` arguments and return values in the same way as
490 before, to maintain backwards compatibility. However, it may also
491 provide new, architecture-specific ``VECTOR_TYPE`` s that are passed
492 and returned in a more efficient way. It is then important to maintain
493 a distinction between the 'normal' ``VECTOR_TYPE`` s and the new
494 architecture-specific ones.
496 The default implementation returns true, which is correct for most targets.
500 .. function:: opt_machine_mode TARGET_ARRAY_MODE (machine_mode mode, unsigned HOST_WIDE_INT nelems)
502 .. hook-start:TARGET_ARRAY_MODE
504 Return the mode that GCC should use for an array that has
505 :samp:`{nelems}` elements, with each element having mode :samp:`{mode}`.
506 Return no mode if the target has no special requirements. In the
507 latter case, GCC looks for an integer mode of the appropriate size
508 if available and uses BLKmode otherwise. Usually the search for the
509 integer mode is limited to ``MAX_FIXED_MODE_SIZE``, but the
510 ``TARGET_ARRAY_MODE_SUPPORTED_P`` hook allows a larger mode to be
511 used in specific cases.
513 The main use of this hook is to specify that an array of vectors should
514 also have a vector mode. The default implementation returns no mode.
518 .. function:: bool TARGET_ARRAY_MODE_SUPPORTED_P (machine_mode mode, unsigned HOST_WIDE_INT nelems)
520 .. hook-start:TARGET_ARRAY_MODE_SUPPORTED_P
522 Return true if GCC should try to use a scalar mode to store an array
523 of :samp:`{nelems}` elements, given that each element has mode :samp:`{mode}`.
524 Returning true here overrides the usual ``MAX_FIXED_MODE`` limit
525 and allows GCC to use any defined integer mode.
527 One use of this hook is to support vector load and store operations
528 that operate on several homogeneous vectors. For example, ARM NEON
533 int8x8x3_t vld3_s8 (const int8_t *)
535 where the return type is defined as:
539 typedef struct int8x8x3_t
544 If this hook allows ``val`` to have a scalar mode, then
545 ``int8x8x3_t`` can have the same mode. GCC can then store
546 ``int8x8x3_t`` s in registers rather than forcing them onto the stack.
550 .. function:: bool TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P (scalar_float_mode mode)
552 .. hook-start:TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P
554 Define this to return nonzero if libgcc provides support for the
555 floating-point mode :samp:`{mode}`, which is known to pass
556 ``TARGET_SCALAR_MODE_SUPPORTED_P``. The default version of this
557 hook returns true for all of ``SFmode``, ``DFmode``,
558 ``XFmode`` and ``TFmode``, if such modes exist.
562 .. function:: opt_scalar_float_mode TARGET_FLOATN_MODE (int n, bool extended)
564 .. hook-start:TARGET_FLOATN_MODE
566 Define this to return the machine mode to use for the type
567 ``_Floatn``, if :samp:`{extended}` is false, or the type
568 ``_Floatnx``, if :samp:`{extended}` is true. If such a type is not
569 supported, return ``opt_scalar_float_mode ()``. The default version of
570 this hook returns ``SFmode`` for ``_Float32``, ``DFmode`` for
571 ``_Float64`` and ``_Float32x`` and ``TFmode`` for
572 ``_Float128``, if those modes exist and satisfy the requirements for
573 those types and pass ``TARGET_SCALAR_MODE_SUPPORTED_P`` and
574 ``TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P`` ; for ``_Float64x``, it
575 returns the first of ``XFmode`` and ``TFmode`` that exists and
576 satisfies the same requirements; for other types, it returns
577 ``opt_scalar_float_mode ()``. The hook is only called for values
578 of :samp:`{n}` and :samp:`{extended}` that are valid according to
579 ISO/IEC TS 18661-3:2015; that is, :samp:`{n}` is one of 32, 64, 128, or,
580 if :samp:`{extended}` is false, 16 or greater than 128 and a multiple of 32.
584 .. function:: bool TARGET_FLOATN_BUILTIN_P (int func)
586 .. hook-start:TARGET_FLOATN_BUILTIN_P
588 Define this to return true if the ``_Floatn`` and
589 ``_Floatnx`` built-in functions should implicitly enable the
590 built-in function without the ``__builtin_`` prefix in addition to the
591 normal built-in function with the ``__builtin_`` prefix. The default is
592 to only enable built-in functions without the ``__builtin_`` prefix for
593 the GNU C langauge. In strict ANSI/ISO mode, the built-in function without
594 the ``__builtin_`` prefix is not enabled. The argument ``FUNC`` is the
595 ``enum built_in_function`` id of the function to be enabled.
599 .. function:: bool TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P (machine_mode mode)
601 .. hook-start:TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P
603 Define this to return nonzero for machine modes for which the port has
604 small register classes. If this target hook returns nonzero for a given
605 :samp:`{mode}`, the compiler will try to minimize the lifetime of registers
606 in :samp:`{mode}`. The hook may be called with ``VOIDmode`` as argument.
607 In this case, the hook is expected to return nonzero if it returns nonzero
610 On some machines, it is risky to let hard registers live across arbitrary
611 insns. Typically, these machines have instructions that require values
612 to be in specific registers (like an accumulator), and reload will fail
613 if the required hard register is used for another purpose across such an
616 Passes before reload do not know which hard registers will be used
617 in an instruction, but the machine modes of the registers set or used in
618 the instruction are already known. And for some machines, register
619 classes are small for, say, integer registers but not for floating point
620 registers. For example, the AMD x86-64 architecture requires specific
621 registers for the legacy x86 integer instructions, but there are many
622 SSE registers for floating point operations. On such targets, a good
623 strategy may be to return nonzero from this hook for ``INTEGRAL_MODE_P``
624 machine modes but zero for the SSE register classes.
626 The default version of this hook returns false for any mode. It is always
627 safe to redefine this hook to return with a nonzero value. But if you
628 unnecessarily define it, you will reduce the amount of optimizations
629 that can be performed in some cases. If you do not define this hook
630 to return a nonzero value when it is required, the compiler will run out
631 of spill registers and print a fatal error message.