GCC Middle and Back End API Reference
rtl.h
Go to the documentation of this file.
1/* Register Transfer Language (RTL) definitions for GCC
2 Copyright (C) 1987-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_RTL_H
21#define GCC_RTL_H
22
23/* This file is occasionally included by generator files which expect
24 machmode.h and other files to exist and would not normally have been
25 included by coretypes.h. */
26#ifdef GENERATOR_FILE
27#include "real.h"
28#include "fixed-value.h"
29#include "statistics.h"
30#include "vec.h"
31#include "hash-table.h"
32#include "hash-set.h"
33#include "input.h"
34#include "is-a.h"
35#endif /* GENERATOR_FILE */
36
37#include "hard-reg-set.h"
38
40
41/* Value used by some passes to "recognize" noop moves as valid
42 instructions. */
43#define NOOP_MOVE_INSN_CODE INT_MAX
44
45/* Register Transfer Language EXPRESSIONS CODES */
46
47#define RTX_CODE enum rtx_code
48enum rtx_code : unsigned {
49
50#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
51#include "rtl.def" /* rtl expressions are documented here */
52#undef DEF_RTL_EXPR
53
54 LAST_AND_UNUSED_RTX_CODE}; /* A convenient way to get a value for
55 NUM_RTX_CODE.
56 Assumes default enum value assignment. */
57
58/* The cast here, saves many elsewhere. */
59#define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE)
60
61/* Similar, but since generator files get more entries... */
62#ifdef GENERATOR_FILE
63# define NON_GENERATOR_NUM_RTX_CODE ((int) MATCH_OPERAND)
64#endif
65
66#define RTX_CODE_BITSIZE 8
67
68/* Register Transfer Language EXPRESSIONS CODE CLASSES */
69
71 /* We check bit 0-1 of some rtx class codes in the predicates below. */
72
73 /* Bit 0 = comparison if 0, arithmetic is 1
74 Bit 1 = 1 if commutative. */
75 RTX_COMPARE, /* 0 */
79
80 /* Must follow the four preceding values. */
81 RTX_UNARY, /* 4 */
82
86
87 /* Bit 0 = 1 if constant. */
88 RTX_OBJ, /* 8 */
90
94};
95
96#define RTX_OBJ_MASK (~1)
97#define RTX_OBJ_RESULT (RTX_OBJ & RTX_OBJ_MASK)
98#define RTX_COMPARE_MASK (~1)
99#define RTX_COMPARE_RESULT (RTX_COMPARE & RTX_COMPARE_MASK)
100#define RTX_ARITHMETIC_MASK (~1)
101#define RTX_ARITHMETIC_RESULT (RTX_COMM_ARITH & RTX_ARITHMETIC_MASK)
102#define RTX_BINARY_MASK (~3)
103#define RTX_BINARY_RESULT (RTX_COMPARE & RTX_BINARY_MASK)
104#define RTX_COMMUTATIVE_MASK (~2)
105#define RTX_COMMUTATIVE_RESULT (RTX_COMM_COMPARE & RTX_COMMUTATIVE_MASK)
106#define RTX_NON_COMMUTATIVE_RESULT (RTX_COMPARE & RTX_COMMUTATIVE_MASK)
107
108extern const unsigned char rtx_length[NUM_RTX_CODE];
109#define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
110
111extern const char * const rtx_name[NUM_RTX_CODE];
112#define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
113
114extern const char * const rtx_format[NUM_RTX_CODE];
115#define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
116
117extern const enum rtx_class rtx_class[NUM_RTX_CODE];
118#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
119
120/* True if CODE is part of the insn chain (i.e. has INSN_UID, PREV_INSN
121 and NEXT_INSN fields). */
122#define INSN_CHAIN_CODE_P(CODE) IN_RANGE (CODE, DEBUG_INSN, NOTE)
123
124extern const unsigned char rtx_code_size[NUM_RTX_CODE];
125extern const unsigned char rtx_next[NUM_RTX_CODE];
126␌
127/* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label
128 relative to which the offsets are calculated, as explained in rtl.def. */
130{
131 /* Set at the start of shorten_branches - ONLY WHEN OPTIMIZING - : */
132 unsigned min_align: 8;
133 /* Flags: */
134 unsigned base_after_vec: 1; /* BASE is after the ADDR_DIFF_VEC. */
135 unsigned min_after_vec: 1; /* minimum address target label is
136 after the ADDR_DIFF_VEC. */
137 unsigned max_after_vec: 1; /* maximum address target label is
138 after the ADDR_DIFF_VEC. */
139 unsigned min_after_base: 1; /* minimum address target label is
140 after BASE. */
141 unsigned max_after_base: 1; /* maximum address target label is
142 after BASE. */
143 /* Set by the actual branch shortening process - ONLY WHEN OPTIMIZING - : */
144 unsigned offset_unsigned: 1; /* offsets have to be treated as unsigned. */
145 unsigned : 2;
146 unsigned scale : 8;
147};
148
149/* Structure used to describe the attributes of a MEM. These are hashed
150 so MEMs that the same attributes share a data structure. This means
151 they cannot be modified in place. */
152class GTY(()) mem_attrs
153{
154public:
155 mem_attrs ();
156
157 /* The expression that the MEM accesses, or null if not known.
158 This expression might be larger than the memory reference itself.
159 (In other words, the MEM might access only part of the object.) */
161
162 /* The offset of the memory reference from the start of EXPR.
163 Only valid if OFFSET_KNOWN_P. */
165
166 /* The size of the memory reference in bytes. Only valid if
167 SIZE_KNOWN_P. */
169
170 /* The alias set of the memory reference. */
172
173 /* The alignment of the reference in bits. Always a multiple of
174 BITS_PER_UNIT. Note that EXPR may have a stricter alignment
175 than the memory reference itself. */
176 unsigned int align;
177
178 /* The address space that the memory reference uses. */
179 unsigned char addrspace;
180
181 /* True if OFFSET is known. */
183
184 /* True if SIZE is known. */
186};
187
188/* Structure used to describe the attributes of a REG in similar way as
189 mem_attrs does for MEM above. Note that the OFFSET field is calculated
190 in the same way as for mem_attrs, rather than in the same way as a
191 SUBREG_BYTE. For example, if a big-endian target stores a byte
192 object in the low part of a 4-byte register, the OFFSET field
193 will be -3 rather than 0. */
194
195class GTY((for_user)) reg_attrs {
196public:
197 tree decl; /* decl corresponding to REG. */
198 poly_int64 offset; /* Offset from start of DECL. */
199};
200
201/* Common union for an element of an rtx. */
202
221
222/* Describes the properties of a REG. */
223struct GTY(()) reg_info {
224 /* The value of REGNO. */
225 unsigned int regno;
226
227 /* The value of REG_NREGS. */
228 unsigned int nregs : 8;
229 unsigned int unused : 24;
230
231 /* The value of REG_ATTRS. */
233};
234
235/* This structure remembers the position of a SYMBOL_REF within an
236 object_block structure. A SYMBOL_REF only provides this information
237 if SYMBOL_REF_HAS_BLOCK_INFO_P is true. */
238struct GTY(()) block_symbol {
239 /* The usual SYMBOL_REF fields. */
240 rtunion GTY ((skip)) fld[2];
241
242 /* The block that contains this object. */
244
245 /* The offset of this object from the start of its block. It is negative
246 if the symbol has not yet been assigned an offset. */
247 HOST_WIDE_INT offset;
248};
249
250/* Describes a group of objects that are to be placed together in such
251 a way that their relative positions are known. */
252struct GTY((for_user)) object_block {
253 /* The section in which these objects should be placed. */
255
256 /* The alignment of the first object, measured in bits. */
257 unsigned int alignment;
258
259 /* The total size of the objects, measured in bytes. */
260 HOST_WIDE_INT size;
261
262 /* The SYMBOL_REFs for each object. The vector is sorted in
263 order of increasing offset and the following conditions will
264 hold for each element X:
265
266 SYMBOL_REF_HAS_BLOCK_INFO_P (X)
267 !SYMBOL_REF_ANCHOR_P (X)
268 SYMBOL_REF_BLOCK (X) == [address of this structure]
269 SYMBOL_REF_BLOCK_OFFSET (X) >= 0. */
271
272 /* All the anchor SYMBOL_REFs used to address these objects, sorted
273 in order of increasing offset, and then increasing TLS model.
274 The following conditions will hold for each element X in this vector:
275
276 SYMBOL_REF_HAS_BLOCK_INFO_P (X)
277 SYMBOL_REF_ANCHOR_P (X)
278 SYMBOL_REF_BLOCK (X) == [address of this structure]
279 SYMBOL_REF_BLOCK_OFFSET (X) >= 0. */
281};
282
284 HOST_WIDE_INT elem[1];
285};
286
287/* Number of elements of the HWIVEC if RTX is a CONST_WIDE_INT. */
288#define CWI_GET_NUM_ELEM(RTX) \
289 ((int)RTL_FLAG_CHECK1("CWI_GET_NUM_ELEM", (RTX), CONST_WIDE_INT)->u2.num_elem)
290#define CWI_PUT_NUM_ELEM(RTX, NUM) \
291 (RTL_FLAG_CHECK1("CWI_PUT_NUM_ELEM", (RTX), CONST_WIDE_INT)->u2.num_elem = (NUM))
292
296
297/* RTL expression ("rtx"). */
298
299/* The GTY "desc" and "tag" options below are a kludge: we need a desc
300 field for gengtype to recognize that inheritance is occurring,
301 so that all subclasses are redirected to the traversal hook for the
302 base class.
303 However, all of the fields are in the base class, and special-casing
304 is at work. Hence we use desc and tag of 0, generating a switch
305 statement of the form:
306 switch (0)
307 {
308 case 0: // all the work happens here
309 }
310 in order to work with the existing special-casing in gengtype. */
311
312struct GTY((desc("0"), tag("0"),
313 chain_next ("RTX_NEXT (&%h)"),
314 chain_prev ("RTX_PREV (&%h)"))) rtx_def {
315 /* The kind of value the expression has. */
316 machine_mode mode : MACHINE_MODE_BITSIZE;
318 /* The kind of expression this is. */
320
321 /* 1 in a MEM if we should keep the alias set for this mem unchanged
322 when we access a component.
323 1 in a JUMP_INSN if it is a crossing jump.
324 1 in a CALL_INSN if it is a sibling call.
325 1 in a SET that is for a return.
326 In a CODE_LABEL, part of the two-bit alternate entry field.
327 1 in a CONCAT is VAL_EXPR_IS_COPIED in var-tracking.cc.
328 1 in a VALUE is SP_BASED_VALUE_P in cselib.cc.
329 1 in a SUBREG generated by LRA for reload insns.
330 1 in a REG if this is a static chain register.
331 Dumped as "/j" in RTL dumps. */
332 unsigned int jump : 1;
333 /* In a CODE_LABEL, part of the two-bit alternate entry field.
334 1 in a MEM if it cannot trap.
335 1 in a CALL_INSN logically equivalent to
336 ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P.
337 1 in a VALUE is SP_DERIVED_VALUE_P in cselib.cc.
338 Dumped as "/c" in RTL dumps. */
339 unsigned int call : 1;
340 /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
341 1 in a SUBREG used for SUBREG_PROMOTED_UNSIGNED_P.
342 1 in a SYMBOL_REF if it addresses something in the per-function
343 constants pool.
344 1 in a CALL_INSN logically equivalent to ECF_CONST and TREE_READONLY.
345 1 in a NOTE, or EXPR_LIST for a const call.
346 1 in a JUMP_INSN of an annulling branch.
347 1 in a CONCAT is VAL_EXPR_IS_CLOBBERED in var-tracking.cc.
348 1 in a preserved VALUE is PRESERVED_VALUE_P in cselib.cc.
349 1 in a clobber temporarily created for LRA.
350 Dumped as "/u" in RTL dumps. */
351 unsigned int unchanging : 1;
352 /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
353 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
354 if it has been deleted.
355 1 in a REG expression if corresponds to a variable declared by the user,
356 0 for an internally generated temporary.
357 1 in a SUBREG used for SUBREG_PROMOTED_UNSIGNED_P.
358 1 in a LABEL_REF, REG_LABEL_TARGET or REG_LABEL_OPERAND note for a
359 non-local label.
360 In a SYMBOL_REF, this flag is used for machine-specific purposes.
361 In a PREFETCH, this flag indicates that it should be considered a
362 scheduling barrier.
363 1 in a CONCAT is VAL_NEEDS_RESOLUTION in var-tracking.cc.
364 Dumped as "/v" in RTL dumps. */
365 unsigned int volatil : 1;
366 /* 1 in a REG if the register is used only in exit code a loop.
367 1 in a SUBREG expression if was generated from a variable with a
368 promoted mode.
369 1 in a CODE_LABEL if the label is used for nonlocal gotos
370 and must not be deleted even if its count is zero.
371 1 in an INSN, JUMP_INSN or CALL_INSN if this insn must be scheduled
372 together with the preceding insn. Valid only within sched.
373 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
374 from the target of a branch. Valid from reorg until end of compilation;
375 cleared before used.
376
377 The name of the field is historical. It used to be used in MEMs
378 to record whether the MEM accessed part of a structure.
379 Dumped as "/s" in RTL dumps. */
380 unsigned int in_struct : 1;
381 /* At the end of RTL generation, 1 if this rtx is used. This is used for
382 copying shared structure. See `unshare_all_rtl'.
383 In a REG, this is not needed for that purpose, and used instead
384 in `leaf_renumber_regs_insn'.
385 1 in a SYMBOL_REF, means that emit_library_call
386 has used it as the function.
387 1 in a CONCAT is VAL_HOLDS_TRACK_EXPR in var-tracking.cc.
388 1 in a VALUE or DEBUG_EXPR is VALUE_RECURSED_INTO in var-tracking.cc. */
389 unsigned int used : 1;
390 /* 1 in an INSN or a SET if this rtx is related to the call frame,
391 either changing how we compute the frame address or saving and
392 restoring registers in the prologue and epilogue.
393 1 in a REG or MEM if it is a pointer.
394 1 in a SYMBOL_REF if it addresses something in the per-function
395 constant string pool.
396 1 in a VALUE is VALUE_CHANGED in var-tracking.cc.
397 Dumped as "/f" in RTL dumps. */
398 unsigned frame_related : 1;
399 /* 1 in a REG or PARALLEL that is the current function's return value.
400 1 in a SYMBOL_REF for a weak symbol.
401 1 in a CALL_INSN logically equivalent to ECF_PURE and DECL_PURE_P.
402 1 in a CONCAT is VAL_EXPR_HAS_REVERSE in var-tracking.cc.
403 1 in a VALUE or DEBUG_EXPR is NO_LOC_P in var-tracking.cc.
404 Dumped as "/i" in RTL dumps. */
405 unsigned return_val : 1;
406
407 union {
408 /* The final union field is aligned to 64 bits on LP64 hosts,
409 giving a 32-bit gap after the fields above. We optimize the
410 layout for that case and use the gap for extra code-specific
411 information. */
412
413 /* The ORIGINAL_REGNO of a REG. */
414 unsigned int original_regno;
415
416 /* The INSN_UID of an RTX_INSN-class code. */
417 int insn_uid;
418
419 /* The SYMBOL_REF_FLAGS of a SYMBOL_REF. */
420 unsigned int symbol_ref_flags;
421
422 /* The PAT_VAR_LOCATION_STATUS of a VAR_LOCATION. */
424
425 /* In a CONST_WIDE_INT (aka hwivec_def), this is the number of
426 HOST_WIDE_INTs in the hwivec_def. */
427 unsigned int num_elem;
428
429 /* The unique identifier of a VALUE rtx. */
430 int value_uid;
432 /* Information about a CONST_VECTOR. */
433 struct
434 {
435 /* The value of CONST_VECTOR_NPATTERNS. */
436 unsigned int npatterns : 16;
437
438 /* The value of CONST_VECTOR_NELTS_PER_PATTERN. */
439 unsigned int nelts_per_pattern : 8;
440
441 /* For future expansion. */
442 unsigned int unused : 8;
443 } const_vector;
444 } GTY ((skip)) u2;
445
446 /* The first element of the operands of this rtx.
447 The number of operands and their types are controlled
448 by the `code' field, according to rtl.def. */
449 union u {
451 HOST_WIDE_INT hwint[1];
452 struct reg_info reg;
456 struct hwivec_def hwiv;
457 struct const_poly_int_def cpi;
458 } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u;
459};
460
461/* A node for constructing singly-linked lists of rtx. */
462
463struct GTY(()) rtx_expr_list : public rtx_def
464{
465private:
466 /* No extra fields, but adds invariant: (GET_CODE (X) == EXPR_LIST). */
467
468public:
469 /* Get next in list. */
470 rtx_expr_list *next () const;
471
472 /* Get at the underlying rtx. */
473 rtx element () const;
474};
475
476template <>
477template <>
478inline bool
480{
481 return rt->code == EXPR_LIST;
483
484struct GTY(()) rtx_insn_list : public rtx_def
485{
486private:
487 /* No extra fields, but adds invariant: (GET_CODE (X) == INSN_LIST).
488
489 This is an instance of:
490
491 DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
492
493 i.e. a node for constructing singly-linked lists of rtx_insn *, where
494 the list is "external" to the insn (as opposed to the doubly-linked
495 list embedded within rtx_insn itself). */
496
497public:
498 /* Get next in list. */
499 rtx_insn_list *next () const;
500
501 /* Get at the underlying instruction. */
502 rtx_insn *insn () const;
503
504};
505
506template <>
507template <>
508inline bool
510{
511 return rt->code == INSN_LIST;
512}
513
514/* A node with invariant GET_CODE (X) == SEQUENCE i.e. a vector of rtx,
515 typically (but not always) of rtx_insn *, used in the late passes. */
516
517struct GTY(()) rtx_sequence : public rtx_def
518{
519private:
520 /* No extra fields, but adds invariant: (GET_CODE (X) == SEQUENCE). */
521
522public:
523 /* Get number of elements in sequence. */
524 int len () const;
525
526 /* Get i-th element of the sequence. */
527 rtx element (int index) const;
528
529 /* Get i-th element of the sequence, with a checked cast to
530 rtx_insn *. */
531 rtx_insn *insn (int index) const;
532};
533
534template <>
535template <>
536inline bool
538{
539 return rt->code == SEQUENCE;
540}
541
542template <>
543template <>
544inline bool
546{
547 return rt->code == SEQUENCE;
549
550struct GTY(()) rtx_insn : public rtx_def
551{
552public:
553 /* No extra fields, but adds the invariant:
554
555 (INSN_P (X)
556 || NOTE_P (X)
557 || JUMP_TABLE_DATA_P (X)
558 || BARRIER_P (X)
559 || LABEL_P (X))
560
561 i.e. that we must be able to use the following:
562 INSN_UID ()
563 NEXT_INSN ()
564 PREV_INSN ()
565 i.e. we have an rtx that has an INSN_UID field and can be part of
566 a linked list of insns.
567 */
568
569 /* Returns true if this insn has been deleted. */
570
571 bool deleted () const { return volatil; }
572
573 /* Mark this insn as deleted. */
574
575 void set_deleted () { volatil = true; }
576
577 /* Mark this insn as not deleted. */
578
579 void set_undeleted () { volatil = false; }
580};
581
582/* Subclasses of rtx_insn. */
583
584struct GTY(()) rtx_debug_insn : public rtx_insn
585{
586 /* No extra fields, but adds the invariant:
587 DEBUG_INSN_P (X) aka (GET_CODE (X) == DEBUG_INSN)
588 i.e. an annotation for tracking variable assignments.
589
590 This is an instance of:
591 DEF_RTL_EXPR(DEBUG_INSN, "debug_insn", "uuBeLie", RTX_INSN)
592 from rtl.def. */
594
595struct GTY(()) rtx_nonjump_insn : public rtx_insn
596{
597 /* No extra fields, but adds the invariant:
598 NONJUMP_INSN_P (X) aka (GET_CODE (X) == INSN)
599 i.e an instruction that cannot jump.
600
601 This is an instance of:
602 DEF_RTL_EXPR(INSN, "insn", "uuBeLie", RTX_INSN)
603 from rtl.def. */
605
606struct GTY(()) rtx_jump_insn : public rtx_insn
607{
608public:
609 /* No extra fields, but adds the invariant:
610 JUMP_P (X) aka (GET_CODE (X) == JUMP_INSN)
611 i.e. an instruction that can possibly jump.
612
613 This is an instance of:
614 DEF_RTL_EXPR(JUMP_INSN, "jump_insn", "uuBeLie0", RTX_INSN)
615 from rtl.def. */
616
617 /* Returns jump target of this instruction. The returned value is not
618 necessarily a code label: it may also be a RETURN or SIMPLE_RETURN
619 expression. Also, when the code label is marked "deleted", it is
620 replaced by a NOTE. In some cases the value is NULL_RTX. */
621
622 inline rtx jump_label () const;
623
624 /* Returns jump target cast to rtx_code_label *. */
625
626 inline rtx_code_label *jump_target () const;
627
628 /* Set jump target. */
629
630 inline void set_jump_target (rtx_code_label *);
632
633struct GTY(()) rtx_call_insn : public rtx_insn
634{
635 /* No extra fields, but adds the invariant:
636 CALL_P (X) aka (GET_CODE (X) == CALL_INSN)
637 i.e. an instruction that can possibly call a subroutine
638 but which will not change which instruction comes next
639 in the current function.
640
641 This is an instance of:
642 DEF_RTL_EXPR(CALL_INSN, "call_insn", "uuBeLiee", RTX_INSN)
643 from rtl.def. */
645
646struct GTY(()) rtx_jump_table_data : public rtx_insn
647{
648 /* No extra fields, but adds the invariant:
649 JUMP_TABLE_DATA_P (X) aka (GET_CODE (INSN) == JUMP_TABLE_DATA)
650 i.e. a data for a jump table, considered an instruction for
651 historical reasons.
652
653 This is an instance of:
654 DEF_RTL_EXPR(JUMP_TABLE_DATA, "jump_table_data", "uuBe0000", RTX_INSN)
655 from rtl.def. */
656
657 /* This can be either:
658
659 (a) a table of absolute jumps, in which case PATTERN (this) is an
660 ADDR_VEC with arg 0 a vector of labels, or
661
662 (b) a table of relative jumps (e.g. for -fPIC), in which case
663 PATTERN (this) is an ADDR_DIFF_VEC, with arg 0 a LABEL_REF and
664 arg 1 the vector of labels.
665
666 This method gets the underlying vec. */
667
668 inline rtvec get_labels () const;
669 inline scalar_int_mode get_data_mode () const;
671
672struct GTY(()) rtx_barrier : public rtx_insn
673{
674 /* No extra fields, but adds the invariant:
675 BARRIER_P (X) aka (GET_CODE (X) == BARRIER)
676 i.e. a marker that indicates that control will not flow through.
677
678 This is an instance of:
679 DEF_RTL_EXPR(BARRIER, "barrier", "uu00000", RTX_EXTRA)
680 from rtl.def. */
682
683struct GTY(()) rtx_code_label : public rtx_insn
684{
685 /* No extra fields, but adds the invariant:
686 LABEL_P (X) aka (GET_CODE (X) == CODE_LABEL)
687 i.e. a label in the assembler.
688
689 This is an instance of:
690 DEF_RTL_EXPR(CODE_LABEL, "code_label", "uuB00is", RTX_EXTRA)
691 from rtl.def. */
693
694struct GTY(()) rtx_note : public rtx_insn
695{
696 /* No extra fields, but adds the invariant:
697 NOTE_P(X) aka (GET_CODE (X) == NOTE)
698 i.e. a note about the corresponding source code.
699
700 This is an instance of:
701 DEF_RTL_EXPR(NOTE, "note", "uuB0ni", RTX_EXTRA)
702 from rtl.def. */
703};
705/* The size in bytes of an rtx header (code, mode and flags). */
706#define RTX_HDR_SIZE offsetof (struct rtx_def, u)
708/* The size in bytes of an rtx with code CODE. */
709#define RTX_CODE_SIZE(CODE) rtx_code_size[CODE]
710
711#define NULL_RTX (rtx) 0
712
713/* The "next" and "previous" RTX, relative to this one. */
714
715#define RTX_NEXT(X) (rtx_next[GET_CODE (X)] == 0 ? NULL \
716 : *(rtx *)(((char *)X) + rtx_next[GET_CODE (X)]))
717
718/* FIXME: the "NEXT_INSN (PREV_INSN (X)) == X" condition shouldn't be needed.
719 */
720#define RTX_PREV(X) ((INSN_P (X) \
721 || NOTE_P (X) \
722 || JUMP_TABLE_DATA_P (X) \
723 || BARRIER_P (X) \
724 || LABEL_P (X)) \
725 && PREV_INSN (as_a <rtx_insn *> (X)) != NULL \
726 && NEXT_INSN (PREV_INSN (as_a <rtx_insn *> (X))) == X \
727 ? PREV_INSN (as_a <rtx_insn *> (X)) : NULL)
728
729/* Define macros to access the `code' field of the rtx. */
731#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
732#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
734#define GET_MODE(RTX) ((machine_mode) (RTX)->mode)
735#define PUT_MODE_RAW(RTX, MODE) ((RTX)->mode = (MODE))
736
737/* RTL vector. These appear inside RTX's when there is a need
738 for a variable number of things. The principle use is inside
739 PARALLEL expressions. */
741struct GTY(()) rtvec_def {
742 int num_elem; /* number of elements */
743 rtx GTY ((length ("%h.num_elem"))) elem[1];
745
746#define NULL_RTVEC (rtvec) 0
748#define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
749#define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (NUM))
751/* Predicate yielding nonzero iff X is an rtx for a register. */
752#define REG_P(X) (GET_CODE (X) == REG)
754/* Predicate yielding nonzero iff X is an rtx for a memory location. */
755#define MEM_P(X) (GET_CODE (X) == MEM)
756
757#if TARGET_SUPPORTS_WIDE_INT
758
759/* Match CONST_*s that can represent compile-time constant integers. */
760#define CASE_CONST_SCALAR_INT \
761 case CONST_INT: \
762 case CONST_WIDE_INT
763
764/* Match CONST_*s for which pointer equality corresponds to value
765 equality. */
766#define CASE_CONST_UNIQUE \
767 case CONST_INT: \
768 case CONST_WIDE_INT: \
769 case CONST_POLY_INT: \
770 case CONST_DOUBLE: \
771 case CONST_FIXED
772
773/* Match all CONST_* rtxes. */
774#define CASE_CONST_ANY \
775 case CONST_INT: \
776 case CONST_WIDE_INT: \
777 case CONST_POLY_INT: \
778 case CONST_DOUBLE: \
779 case CONST_FIXED: \
780 case CONST_VECTOR
781
782#else
784/* Match CONST_*s that can represent compile-time constant integers. */
785#define CASE_CONST_SCALAR_INT \
786 case CONST_INT: \
787 case CONST_DOUBLE
788
789/* Match CONST_*s for which pointer equality corresponds to value
790 equality. */
791#define CASE_CONST_UNIQUE \
792 case CONST_INT: \
793 case CONST_DOUBLE: \
794 case CONST_FIXED
796/* Match all CONST_* rtxes. */
797#define CASE_CONST_ANY \
798 case CONST_INT: \
799 case CONST_DOUBLE: \
800 case CONST_FIXED: \
801 case CONST_VECTOR
802#endif
804/* Predicate yielding nonzero iff X is an rtx for a constant integer. */
805#define CONST_INT_P(X) (GET_CODE (X) == CONST_INT)
807/* Predicate yielding nonzero iff X is an rtx for a constant integer. */
808#define CONST_WIDE_INT_P(X) (GET_CODE (X) == CONST_WIDE_INT)
809
810/* Predicate yielding nonzero iff X is an rtx for a polynomial constant
811 integer. */
812#define CONST_POLY_INT_P(X) \
813 (NUM_POLY_INT_COEFFS > 1 && GET_CODE (X) == CONST_POLY_INT)
815/* Predicate yielding nonzero iff X is an rtx for a constant fixed-point. */
816#define CONST_FIXED_P(X) (GET_CODE (X) == CONST_FIXED)
817
818/* Predicate yielding true iff X is an rtx for a double-int
819 or floating point constant. */
820#define CONST_DOUBLE_P(X) (GET_CODE (X) == CONST_DOUBLE)
822/* Predicate yielding true iff X is an rtx for a double-int. */
823#define CONST_DOUBLE_AS_INT_P(X) \
824 (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == VOIDmode)
825
826/* Predicate yielding true iff X is an rtx for a integer const. */
827#if TARGET_SUPPORTS_WIDE_INT
828#define CONST_SCALAR_INT_P(X) \
829 (CONST_INT_P (X) || CONST_WIDE_INT_P (X))
830#else
831#define CONST_SCALAR_INT_P(X) \
832 (CONST_INT_P (X) || CONST_DOUBLE_AS_INT_P (X))
833#endif
835/* Predicate yielding true iff X is an rtx for a double-int. */
836#define CONST_DOUBLE_AS_FLOAT_P(X) \
837 (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) != VOIDmode)
839/* Predicate yielding nonzero iff X is an rtx for a constant vector. */
840#define CONST_VECTOR_P(X) (GET_CODE (X) == CONST_VECTOR)
842/* Predicate yielding nonzero iff X is a label insn. */
843#define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
845/* Predicate yielding nonzero iff X is a jump insn. */
846#define JUMP_P(X) (GET_CODE (X) == JUMP_INSN)
848/* Predicate yielding nonzero iff X is a call insn. */
849#define CALL_P(X) (GET_CODE (X) == CALL_INSN)
850
851/* 1 if RTX is a call_insn for a fake call.
852 CALL_INSN use "used" flag to indicate it's a fake call. */
853#define FAKE_CALL_P(RTX) \
854 (RTL_FLAG_CHECK1 ("FAKE_CALL_P", (RTX), CALL_INSN)->used)
856/* Predicate yielding nonzero iff X is an insn that cannot jump. */
857#define NONJUMP_INSN_P(X) (GET_CODE (X) == INSN)
859/* Predicate yielding nonzero iff X is a debug note/insn. */
860#define DEBUG_INSN_P(X) (GET_CODE (X) == DEBUG_INSN)
862/* Predicate yielding nonzero iff X is an insn that is not a debug insn. */
863#define NONDEBUG_INSN_P(X) (NONJUMP_INSN_P (X) || JUMP_P (X) || CALL_P (X))
865/* Nonzero if DEBUG_MARKER_INSN_P may possibly hold. */
866#define MAY_HAVE_DEBUG_MARKER_INSNS debug_nonbind_markers_p
867/* Nonzero if DEBUG_BIND_INSN_P may possibly hold. */
868#define MAY_HAVE_DEBUG_BIND_INSNS flag_var_tracking_assignments
869/* Nonzero if DEBUG_INSN_P may possibly hold. */
870#define MAY_HAVE_DEBUG_INSNS \
871 (MAY_HAVE_DEBUG_MARKER_INSNS || MAY_HAVE_DEBUG_BIND_INSNS)
873/* Predicate yielding nonzero iff X is a real insn. */
874#define INSN_P(X) (NONDEBUG_INSN_P (X) || DEBUG_INSN_P (X))
876/* Predicate yielding nonzero iff X is a note insn. */
877#define NOTE_P(X) (GET_CODE (X) == NOTE)
879/* Predicate yielding nonzero iff X is a barrier insn. */
880#define BARRIER_P(X) (GET_CODE (X) == BARRIER)
882/* Predicate yielding nonzero iff X is a data for a jump table. */
883#define JUMP_TABLE_DATA_P(INSN) (GET_CODE (INSN) == JUMP_TABLE_DATA)
885/* Predicate yielding nonzero iff RTX is a subreg. */
886#define SUBREG_P(RTX) (GET_CODE (RTX) == SUBREG)
888/* Predicate yielding true iff RTX is a symbol ref. */
889#define SYMBOL_REF_P(RTX) (GET_CODE (RTX) == SYMBOL_REF)
890
891template <>
892template <>
893inline bool
895{
896 return (INSN_P (rt)
897 || NOTE_P (rt)
898 || JUMP_TABLE_DATA_P (rt)
899 || BARRIER_P (rt)
900 || LABEL_P (rt));
901}
902
903template <>
904template <>
905inline bool
907{
908 return (INSN_P (rt)
909 || NOTE_P (rt)
910 || JUMP_TABLE_DATA_P (rt)
911 || BARRIER_P (rt)
912 || LABEL_P (rt));
913}
914
915template <>
916template <>
917inline bool
919{
920 return DEBUG_INSN_P (rt);
921}
922
923template <>
924template <>
925inline bool
927{
928 return NONJUMP_INSN_P (rt);
929}
930
931template <>
932template <>
933inline bool
935{
936 return JUMP_P (rt);
937}
938
939template <>
940template <>
941inline bool
943{
944 return JUMP_P (insn);
945}
946
947template <>
948template <>
949inline bool
951{
952 return CALL_P (rt);
953}
954
955template <>
956template <>
957inline bool
959{
960 return CALL_P (insn);
961}
962
963template <>
964template <>
965inline bool
967{
968 return CALL_P (insn);
969}
970
971template <>
972template <>
973inline bool
975{
976 return JUMP_TABLE_DATA_P (rt);
977}
978
979template <>
980template <>
981inline bool
983{
984 return JUMP_TABLE_DATA_P (insn);
985}
986
987template <>
988template <>
989inline bool
991{
992 return BARRIER_P (rt);
993}
994
995template <>
996template <>
997inline bool
999{
1000 return LABEL_P (rt);
1001}
1002
1003template <>
1004template <>
1005inline bool
1007{
1008 return LABEL_P (insn);
1009}
1010
1011template <>
1012template <>
1013inline bool
1015{
1016 return NOTE_P (rt);
1017}
1018
1019template <>
1020template <>
1021inline bool
1023{
1024 return NOTE_P (insn);
1025}
1027/* Predicate yielding nonzero iff X is a return or simple_return. */
1028#define ANY_RETURN_P(X) \
1029 (GET_CODE (X) == RETURN || GET_CODE (X) == SIMPLE_RETURN)
1030
1031/* 1 if X is a unary operator. */
1032
1033#define UNARY_P(X) \
1034 (GET_RTX_CLASS (GET_CODE (X)) == RTX_UNARY)
1035
1036/* 1 if X is a binary operator. */
1037
1038#define BINARY_P(X) \
1039 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_BINARY_MASK) == RTX_BINARY_RESULT)
1040
1041/* 1 if X is an arithmetic operator. */
1042
1043#define ARITHMETIC_P(X) \
1044 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_ARITHMETIC_MASK) \
1045 == RTX_ARITHMETIC_RESULT)
1046
1047/* 1 if X is an arithmetic operator. */
1048
1049#define COMMUTATIVE_ARITH_P(X) \
1050 (GET_RTX_CLASS (GET_CODE (X)) == RTX_COMM_ARITH)
1051
1052/* 1 if X is a commutative arithmetic operator or a comparison operator.
1053 These two are sometimes selected together because it is possible to
1054 swap the two operands. */
1055
1056#define SWAPPABLE_OPERANDS_P(X) \
1057 ((1 << GET_RTX_CLASS (GET_CODE (X))) \
1058 & ((1 << RTX_COMM_ARITH) | (1 << RTX_COMM_COMPARE) \
1059 | (1 << RTX_COMPARE)))
1060
1061/* 1 if X is a non-commutative operator. */
1062
1063#define NON_COMMUTATIVE_P(X) \
1064 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK) \
1065 == RTX_NON_COMMUTATIVE_RESULT)
1066
1067/* 1 if X is a commutative operator on integers. */
1068
1069#define COMMUTATIVE_P(X) \
1070 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK) \
1071 == RTX_COMMUTATIVE_RESULT)
1072
1073/* 1 if X is a relational operator. */
1074
1075#define COMPARISON_P(X) \
1076 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMPARE_MASK) == RTX_COMPARE_RESULT)
1077
1078/* 1 if X is a constant value that is an integer. */
1079
1080#define CONSTANT_P(X) \
1081 (GET_RTX_CLASS (GET_CODE (X)) == RTX_CONST_OBJ)
1083/* 1 if X is a LABEL_REF. */
1084#define LABEL_REF_P(X) \
1085 (GET_CODE (X) == LABEL_REF)
1087/* 1 if X can be used to represent an object. */
1088#define OBJECT_P(X) \
1089 ((GET_RTX_CLASS (GET_CODE (X)) & RTX_OBJ_MASK) == RTX_OBJ_RESULT)
1090
1091/* General accessor macros for accessing the fields of an rtx. */
1092
1093#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
1094/* The bit with a star outside the statement expr and an & inside is
1095 so that N can be evaluated only once. */
1096#define RTL_CHECK1(RTX, N, C1) __extension__ \
1097(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
1098 const enum rtx_code _code = GET_CODE (_rtx); \
1099 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
1100 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
1101 __FUNCTION__); \
1102 if (GET_RTX_FORMAT (_code)[_n] != C1) \
1103 rtl_check_failed_type1 (_rtx, _n, C1, __FILE__, __LINE__, \
1104 __FUNCTION__); \
1105 &_rtx->u.fld[_n]; }))
1106
1107#define RTL_CHECK2(RTX, N, C1, C2) __extension__ \
1108(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
1109 const enum rtx_code _code = GET_CODE (_rtx); \
1110 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
1111 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
1112 __FUNCTION__); \
1113 if (GET_RTX_FORMAT (_code)[_n] != C1 \
1114 && GET_RTX_FORMAT (_code)[_n] != C2) \
1115 rtl_check_failed_type2 (_rtx, _n, C1, C2, __FILE__, __LINE__, \
1116 __FUNCTION__); \
1117 &_rtx->u.fld[_n]; }))
1118
1119#define RTL_CHECKC1(RTX, N, C) __extension__ \
1120(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
1121 if (GET_CODE (_rtx) != (C)) \
1122 rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
1123 __FUNCTION__); \
1124 &_rtx->u.fld[_n]; }))
1125
1126#define RTL_CHECKC2(RTX, N, C1, C2) __extension__ \
1127(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
1128 const enum rtx_code _code = GET_CODE (_rtx); \
1129 if (_code != (C1) && _code != (C2)) \
1130 rtl_check_failed_code2 (_rtx, (C1), (C2), __FILE__, __LINE__, \
1131 __FUNCTION__); \
1132 &_rtx->u.fld[_n]; }))
1133
1134#define RTL_CHECKC3(RTX, N, C1, C2, C3) __extension__ \
1135(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
1136 const enum rtx_code _code = GET_CODE (_rtx); \
1137 if (_code != (C1) && _code != (C2) && _code != (C3)) \
1138 rtl_check_failed_code3 (_rtx, (C1), (C2), (C3), __FILE__, \
1139 __LINE__, __FUNCTION__); \
1140 &_rtx->u.fld[_n]; }))
1141
1142#define RTVEC_ELT(RTVEC, I) __extension__ \
1143(*({ __typeof (RTVEC) const _rtvec = (RTVEC); const int _i = (I); \
1144 if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \
1145 rtvec_check_failed_bounds (_rtvec, _i, __FILE__, __LINE__, \
1146 __FUNCTION__); \
1147 &_rtvec->elem[_i]; }))
1148
1149#define XWINT(RTX, N) __extension__ \
1150(*({ __typeof (RTX) const _rtx = (RTX); const int _n = (N); \
1151 const enum rtx_code _code = GET_CODE (_rtx); \
1152 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
1153 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
1154 __FUNCTION__); \
1155 if (GET_RTX_FORMAT (_code)[_n] != 'w') \
1156 rtl_check_failed_type1 (_rtx, _n, 'w', __FILE__, __LINE__, \
1157 __FUNCTION__); \
1158 &_rtx->u.hwint[_n]; }))
1159
1160#define CWI_ELT(RTX, I) __extension__ \
1161(*({ __typeof (RTX) const _cwi = (RTX); \
1162 int _max = CWI_GET_NUM_ELEM (_cwi); \
1163 const int _i = (I); \
1164 if (_i < 0 || _i >= _max) \
1165 cwi_check_failed_bounds (_cwi, _i, __FILE__, __LINE__, \
1166 __FUNCTION__); \
1167 &_cwi->u.hwiv.elem[_i]; }))
1168
1169#define XCWINT(RTX, N, C) __extension__ \
1170(*({ __typeof (RTX) const _rtx = (RTX); \
1171 if (GET_CODE (_rtx) != (C)) \
1172 rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
1173 __FUNCTION__); \
1174 &_rtx->u.hwint[N]; }))
1175
1176#define XCMWINT(RTX, N, C, M) __extension__ \
1177(*({ __typeof (RTX) const _rtx = (RTX); \
1178 if (GET_CODE (_rtx) != (C) || GET_MODE (_rtx) != (M)) \
1179 rtl_check_failed_code_mode (_rtx, (C), (M), false, __FILE__, \
1180 __LINE__, __FUNCTION__); \
1181 &_rtx->u.hwint[N]; }))
1182
1183#define XCNMPRV(RTX, C, M) __extension__ \
1184({ __typeof (RTX) const _rtx = (RTX); \
1185 if (GET_CODE (_rtx) != (C) || GET_MODE (_rtx) == (M)) \
1186 rtl_check_failed_code_mode (_rtx, (C), (M), true, __FILE__, \
1187 __LINE__, __FUNCTION__); \
1188 &_rtx->u.rv; })
1189
1190#define XCNMPFV(RTX, C, M) __extension__ \
1191({ __typeof (RTX) const _rtx = (RTX); \
1192 if (GET_CODE (_rtx) != (C) || GET_MODE (_rtx) == (M)) \
1193 rtl_check_failed_code_mode (_rtx, (C), (M), true, __FILE__, \
1194 __LINE__, __FUNCTION__); \
1195 &_rtx->u.fv; })
1196
1197#define REG_CHECK(RTX) __extension__ \
1198({ __typeof (RTX) const _rtx = (RTX); \
1199 if (GET_CODE (_rtx) != REG) \
1200 rtl_check_failed_code1 (_rtx, REG, __FILE__, __LINE__, \
1201 __FUNCTION__); \
1202 &_rtx->u.reg; })
1203
1204#define BLOCK_SYMBOL_CHECK(RTX) __extension__ \
1205({ __typeof (RTX) const _symbol = (RTX); \
1206 const unsigned int flags = SYMBOL_REF_FLAGS (_symbol); \
1207 if ((flags & SYMBOL_FLAG_HAS_BLOCK_INFO) == 0) \
1208 rtl_check_failed_block_symbol (__FILE__, __LINE__, \
1209 __FUNCTION__); \
1210 &_symbol->u.block_sym; })
1211
1212#define HWIVEC_CHECK(RTX,C) __extension__ \
1213({ __typeof (RTX) const _symbol = (RTX); \
1214 RTL_CHECKC1 (_symbol, 0, C); \
1215 &_symbol->u.hwiv; })
1216
1217extern void rtl_check_failed_bounds (const_rtx, int, const char *, int,
1218 const char *)
1219 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1220extern void rtl_check_failed_type1 (const_rtx, int, int, const char *, int,
1221 const char *)
1222 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1223extern void rtl_check_failed_type2 (const_rtx, int, int, int, const char *,
1224 int, const char *)
1225 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1226extern void rtl_check_failed_code1 (const_rtx, enum rtx_code, const char *,
1227 int, const char *)
1228 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1229extern void rtl_check_failed_code2 (const_rtx, enum rtx_code, enum rtx_code,
1230 const char *, int, const char *)
1231 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1232extern void rtl_check_failed_code3 (const_rtx, enum rtx_code, enum rtx_code,
1233 enum rtx_code, const char *, int,
1234 const char *)
1235 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1236extern void rtl_check_failed_code_mode (const_rtx, enum rtx_code, machine_mode,
1237 bool, const char *, int, const char *)
1238 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1239extern void rtl_check_failed_block_symbol (const char *, int, const char *)
1240 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1241extern void cwi_check_failed_bounds (const_rtx, int, const char *, int,
1242 const char *)
1243 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1244extern void rtvec_check_failed_bounds (const_rtvec, int, const char *, int,
1245 const char *)
1246 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
1247
1248#else /* not ENABLE_RTL_CHECKING */
1250#define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
1251#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
1252#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
1253#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
1254#define RTL_CHECKC3(RTX, N, C1, C2, C3) ((RTX)->u.fld[N])
1255#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
1256#define XWINT(RTX, N) ((RTX)->u.hwint[N])
1257#define CWI_ELT(RTX, I) ((RTX)->u.hwiv.elem[I])
1258#define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
1259#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
1260#define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
1261#define XCNMPRV(RTX, C, M) (&(RTX)->u.rv)
1262#define XCNMPFV(RTX, C, M) (&(RTX)->u.fv)
1263#define REG_CHECK(RTX) (&(RTX)->u.reg)
1264#define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym)
1265#define HWIVEC_CHECK(RTX,C) (&(RTX)->u.hwiv)
1266
1267#endif
1268
1269/* General accessor macros for accessing the flags of an rtx. */
1271/* Access an individual rtx flag, with no checking of any kind. */
1272#define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG)
1273
1274#if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION >= 2007)
1275#define RTL_FLAG_CHECK1(NAME, RTX, C1) __extension__ \
1276({ __typeof (RTX) const _rtx = (RTX); \
1277 if (GET_CODE (_rtx) != C1) \
1278 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
1279 __FUNCTION__); \
1280 _rtx; })
1281
1282#define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \
1283({ __typeof (RTX) const _rtx = (RTX); \
1284 if (GET_CODE (_rtx) != C1 && GET_CODE(_rtx) != C2) \
1285 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
1286 __FUNCTION__); \
1287 _rtx; })
1288
1289#define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \
1290({ __typeof (RTX) const _rtx = (RTX); \
1291 if (GET_CODE (_rtx) != C1 && GET_CODE(_rtx) != C2 \
1292 && GET_CODE (_rtx) != C3) \
1293 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
1294 __FUNCTION__); \
1295 _rtx; })
1296
1297#define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \
1298({ __typeof (RTX) const _rtx = (RTX); \
1299 if (GET_CODE (_rtx) != C1 && GET_CODE(_rtx) != C2 \
1300 && GET_CODE (_rtx) != C3 && GET_CODE(_rtx) != C4) \
1301 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
1302 __FUNCTION__); \
1303 _rtx; })
1304
1305#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \
1306({ __typeof (RTX) const _rtx = (RTX); \
1307 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
1308 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
1309 && GET_CODE (_rtx) != C5) \
1310 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
1311 __FUNCTION__); \
1312 _rtx; })
1313
1314#define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \
1315 __extension__ \
1316({ __typeof (RTX) const _rtx = (RTX); \
1317 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
1318 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
1319 && GET_CODE (_rtx) != C5 && GET_CODE (_rtx) != C6) \
1320 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
1321 __FUNCTION__); \
1322 _rtx; })
1323
1324#define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \
1325 __extension__ \
1326({ __typeof (RTX) const _rtx = (RTX); \
1327 if (GET_CODE (_rtx) != C1 && GET_CODE (_rtx) != C2 \
1328 && GET_CODE (_rtx) != C3 && GET_CODE (_rtx) != C4 \
1329 && GET_CODE (_rtx) != C5 && GET_CODE (_rtx) != C6 \
1330 && GET_CODE (_rtx) != C7) \
1331 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
1332 __FUNCTION__); \
1333 _rtx; })
1334
1335#define RTL_INSN_CHAIN_FLAG_CHECK(NAME, RTX) \
1336 __extension__ \
1337({ __typeof (RTX) const _rtx = (RTX); \
1338 if (!INSN_CHAIN_CODE_P (GET_CODE (_rtx))) \
1339 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
1340 __FUNCTION__); \
1341 _rtx; })
1342
1343extern void rtl_check_failed_flag (const char *, const_rtx, const char *,
1344 int, const char *)
1345 ATTRIBUTE_NORETURN ATTRIBUTE_COLD
1346 ;
1347
1348#else /* not ENABLE_RTL_FLAG_CHECKING */
1350#define RTL_FLAG_CHECK1(NAME, RTX, C1) (RTX)
1351#define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX)
1352#define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX)
1353#define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX)
1354#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
1355#define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX)
1356#define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
1357#define RTL_INSN_CHAIN_FLAG_CHECK(NAME, RTX) (RTX)
1358#endif
1360#define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rt_int)
1361#define XUINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rt_uint)
1362#define XLOC(RTX, N) (RTL_CHECK1 (RTX, N, 'L').rt_loc)
1363#define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rt_str)
1364#define XEXP(RTX, N) (RTL_CHECK2 (RTX, N, 'e', 'u').rt_rtx)
1365#define XVEC(RTX, N) (RTL_CHECK2 (RTX, N, 'E', 'V').rt_rtvec)
1366#define XMODE(RTX, N) (RTL_CHECK1 (RTX, N, 'M').rt_type)
1367#define XTREE(RTX, N) (RTL_CHECK1 (RTX, N, 't').rt_tree)
1368#define XBBDEF(RTX, N) (RTL_CHECK1 (RTX, N, 'B').rt_bb)
1369#define XTMPL(RTX, N) (RTL_CHECK1 (RTX, N, 'T').rt_str)
1370#define XCFI(RTX, N) (RTL_CHECK1 (RTX, N, 'C').rt_cfi)
1372#define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M)
1373#define XVECLEN(RTX, N) GET_NUM_ELEM (XVEC (RTX, N))
1374
1375/* These are like XINT, etc. except that they expect a '0' field instead
1376 of the normal type code. */
1378#define X0INT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_int)
1379#define X0UINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_uint)
1380#define X0LOC(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_loc)
1381#define X0STR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_str)
1382#define X0EXP(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_rtx)
1383#define X0VEC(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_rtvec)
1384#define X0MODE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_type)
1385#define X0TREE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_tree)
1386#define X0BBDEF(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_bb)
1387#define X0ADVFLAGS(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_addr_diff_vec_flags)
1388#define X0CSELIB(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_cselib)
1389#define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rt_mem)
1390#define X0CONSTANT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_constant)
1392/* Access a '0' field with any type. */
1393#define X0ANY(RTX, N) RTL_CHECK1 (RTX, N, '0')
1395#define XCINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_int)
1396#define XCUINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_uint)
1397#define XCLOC(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_loc)
1398#define XCSUBREG(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_subreg)
1399#define XCSTR(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_str)
1400#define XCEXP(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_rtx)
1401#define XCVEC(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_rtvec)
1402#define XCMODE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_type)
1403#define XCTREE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_tree)
1404#define XCBBDEF(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_bb)
1405#define XCCFI(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_cfi)
1406#define XCCSELIB(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_cselib)
1408#define XCVECEXP(RTX, N, M, C) RTVEC_ELT (XCVEC (RTX, N, C), M)
1409#define XCVECLEN(RTX, N, C) GET_NUM_ELEM (XCVEC (RTX, N, C))
1411#define XC2EXP(RTX, N, C1, C2) (RTL_CHECKC2 (RTX, N, C1, C2).rt_rtx)
1412#define XC3EXP(RTX, N, C1, C2, C3) (RTL_CHECKC3 (RTX, N, C1, C2, C3).rt_rtx)
1413␌
1414
1415/* Methods of rtx_expr_list. */
1416
1417inline rtx_expr_list *rtx_expr_list::next () const
1418{
1419 rtx tmp = XEXP (this, 1);
1420 return safe_as_a <rtx_expr_list *> (tmp);
1422
1423inline rtx rtx_expr_list::element () const
1424{
1425 return XEXP (this, 0);
1426}
1427
1428/* Methods of rtx_insn_list. */
1429
1430inline rtx_insn_list *rtx_insn_list::next () const
1431{
1432 rtx tmp = XEXP (this, 1);
1433 return safe_as_a <rtx_insn_list *> (tmp);
1435
1436inline rtx_insn *rtx_insn_list::insn () const
1437{
1438 rtx tmp = XEXP (this, 0);
1440}
1441
1442/* Methods of rtx_sequence. */
1443
1444inline int rtx_sequence::len () const
1445{
1446 return XVECLEN (this, 0);
1448
1449inline rtx rtx_sequence::element (int index) const
1450{
1451 return XVECEXP (this, 0, index);
1453
1454inline rtx_insn *rtx_sequence::insn (int index) const
1455{
1456 return as_a <rtx_insn *> (XVECEXP (this, 0, index));
1457}
1458
1459/* ACCESS MACROS for particular fields of insns. */
1460
1461/* Holds a unique number for each insn.
1462 These are not necessarily sequentially increasing. */
1463inline int INSN_UID (const_rtx insn)
1464{
1465 return RTL_INSN_CHAIN_FLAG_CHECK ("INSN_UID",
1466 (insn))->u2.insn_uid;
1467}
1468inline int& INSN_UID (rtx insn)
1469{
1470 return RTL_INSN_CHAIN_FLAG_CHECK ("INSN_UID",
1471 (insn))->u2.insn_uid;
1472}
1473
1474/* Chain insns together in sequence. */
1475
1476/* For now these are split in two: an rvalue form:
1477 PREV_INSN/NEXT_INSN
1478 and an lvalue form:
1479 SET_NEXT_INSN/SET_PREV_INSN. */
1480
1481inline rtx_insn *PREV_INSN (const rtx_insn *insn)
1482{
1483 rtx prev = XEXP (insn, 0);
1484 return safe_as_a <rtx_insn *> (prev);
1486
1487inline rtx& SET_PREV_INSN (rtx_insn *insn)
1488{
1489 return XEXP (insn, 0);
1491
1492inline rtx_insn *NEXT_INSN (const rtx_insn *insn)
1493{
1494 rtx next = XEXP (insn, 1);
1495 return safe_as_a <rtx_insn *> (next);
1497
1498inline rtx& SET_NEXT_INSN (rtx_insn *insn)
1499{
1500 return XEXP (insn, 1);
1502
1504{
1505 return XBBDEF (insn, 2);
1506}
1507
1508inline basic_block& BLOCK_FOR_INSN (rtx insn)
1509{
1510 return XBBDEF (insn, 2);
1512
1513inline void set_block_for_insn (rtx_insn *insn, basic_block bb)
1514{
1515 BLOCK_FOR_INSN (insn) = bb;
1516}
1518/* The body of an insn. */
1519inline rtx PATTERN (const_rtx insn)
1520{
1521 return XEXP (insn, 3);
1522}
1523
1524inline rtx& PATTERN (rtx insn)
1525{
1526 return XEXP (insn, 3);
1528
1529inline location_t INSN_LOCATION (const rtx_insn *insn)
1530{
1531 return XLOC (insn, 4);
1533
1534inline location_t& INSN_LOCATION (rtx_insn *insn)
1535{
1536 return XLOC (insn, 4);
1538
1539inline bool INSN_HAS_LOCATION (const rtx_insn *insn)
1540{
1542}
1544/* LOCATION of an RTX if relevant. */
1545#define RTL_LOCATION(X) (INSN_P (X) ? \
1546 INSN_LOCATION (as_a <rtx_insn *> (X)) \
1547 : UNKNOWN_LOCATION)
1548
1549/* Code number of instruction, from when it was recognized.
1550 -1 means this instruction has not been recognized yet. */
1551#define INSN_CODE(INSN) XINT (INSN, 5)
1552
1554{
1555 rtx pat = PATTERN (this);
1556 if (GET_CODE (pat) == ADDR_VEC)
1557 return XVEC (pat, 0);
1558 else
1559 return XVEC (pat, 1); /* presumably an ADDR_DIFF_VEC */
1560}
1561
1562/* Return the mode of the data in the table, which is always a scalar
1563 integer. */
1568 return as_a <scalar_int_mode> (GET_MODE (PATTERN (this)));
1569}
1570
1571/* If LABEL is followed by a jump table, return the table, otherwise
1572 return null. */
1574inline rtx_jump_table_data *
1576{
1579
1580#define RTX_FRAME_RELATED_P(RTX) \
1581 (RTL_FLAG_CHECK6 ("RTX_FRAME_RELATED_P", (RTX), DEBUG_INSN, INSN, \
1582 CALL_INSN, JUMP_INSN, BARRIER, SET)->frame_related)
1584/* 1 if JUMP RTX is a crossing jump. */
1585#define CROSSING_JUMP_P(RTX) \
1586 (RTL_FLAG_CHECK1 ("CROSSING_JUMP_P", (RTX), JUMP_INSN)->jump)
1587
1588/* 1 if RTX is a call to a const function. Built from ECF_CONST and
1589 TREE_READONLY. */
1590#define RTL_CONST_CALL_P(RTX) \
1591 (RTL_FLAG_CHECK1 ("RTL_CONST_CALL_P", (RTX), CALL_INSN)->unchanging)
1592
1593/* 1 if RTX is a call to a pure function. Built from ECF_PURE and
1594 DECL_PURE_P. */
1595#define RTL_PURE_CALL_P(RTX) \
1596 (RTL_FLAG_CHECK1 ("RTL_PURE_CALL_P", (RTX), CALL_INSN)->return_val)
1598/* 1 if RTX is a call to a const or pure function. */
1599#define RTL_CONST_OR_PURE_CALL_P(RTX) \
1600 (RTL_CONST_CALL_P (RTX) || RTL_PURE_CALL_P (RTX))
1601
1602/* 1 if RTX is a call to a looping const or pure function. Built from
1603 ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P. */
1604#define RTL_LOOPING_CONST_OR_PURE_CALL_P(RTX) \
1605 (RTL_FLAG_CHECK1 ("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN)->call)
1607/* 1 if RTX is a call_insn for a sibling call. */
1608#define SIBLING_CALL_P(RTX) \
1609 (RTL_FLAG_CHECK1 ("SIBLING_CALL_P", (RTX), CALL_INSN)->jump)
1611/* 1 if RTX is a jump_insn, call_insn, or insn that is an annulling branch. */
1612#define INSN_ANNULLED_BRANCH_P(RTX) \
1613 (RTL_FLAG_CHECK1 ("INSN_ANNULLED_BRANCH_P", (RTX), JUMP_INSN)->unchanging)
1614
1615/* 1 if RTX is an insn in a delay slot and is from the target of the branch.
1616 If the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
1617 executed if the branch is taken. For annulled branches with this bit
1618 clear, the insn should be executed only if the branch is not taken. */
1619#define INSN_FROM_TARGET_P(RTX) \
1620 (RTL_FLAG_CHECK3 ("INSN_FROM_TARGET_P", (RTX), INSN, JUMP_INSN, \
1621 CALL_INSN)->in_struct)
1622
1623/* In an ADDR_DIFF_VEC, the flags for RTX for use by branch shortening.
1624 See the comments for ADDR_DIFF_VEC in rtl.def. */
1625#define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS (RTX, 4)
1626
1627/* In a VALUE, the value cselib has assigned to RTX.
1628 This is a "struct cselib_val", see cselib.h. */
1629#define CSELIB_VAL_PTR(RTX) X0CSELIB (RTX, 0)
1631/* A VALUE's unique identifier. */
1632#define CSELIB_VAL_UID(RTX) \
1633 RTL_FLAG_CHECK1 ("CSELIB_VAL_UID", (RTX), VALUE)->u2.value_uid
1634
1635/* Holds a list of notes on what this insn does to various REGs.
1636 It is a chain of EXPR_LIST rtx's, where the second operand is the
1637 chain pointer and the first operand is the REG being described.
1638 The mode field of the EXPR_LIST contains not a real machine mode
1639 but a value from enum reg_note. */
1640#define REG_NOTES(INSN) XEXP(INSN, 6)
1641
1642/* In an ENTRY_VALUE this is the DECL_INCOMING_RTL of the argument in
1643 question. */
1644#define ENTRY_VALUE_EXP(RTX) (RTL_CHECKC1 (RTX, 0, ENTRY_VALUE).rt_rtx)
1645
1647{
1648#define DEF_REG_NOTE(NAME) NAME,
1649#include "reg-notes.def"
1650#undef DEF_REG_NOTE
1652};
1654/* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */
1655#define REG_NOTE_KIND(LINK) ((enum reg_note) GET_MODE (LINK))
1656#define PUT_REG_NOTE_KIND(LINK, KIND) \
1657 PUT_MODE_RAW (LINK, (machine_mode) (KIND))
1658
1659/* Names for REG_NOTE's in EXPR_LIST insn's. */
1661extern const char * const reg_note_name[];
1662#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
1663
1664/* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of
1665 USE, CLOBBER and SET expressions.
1666 USE expressions list the registers filled with arguments that
1667 are passed to the function.
1668 CLOBBER expressions document the registers explicitly clobbered
1669 by this CALL_INSN.
1670 SET expressions say that the return value of the call (the SET_DEST)
1671 is equivalent to a value available before the call (the SET_SRC).
1672 This kind of SET is used when the return value is predictable in
1673 advance. It is purely an optimisation hint; unlike USEs and CLOBBERs,
1674 it does not affect register liveness.
1676 Pseudo registers cannot be mentioned in this list. */
1677#define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 7)
1679/* Specifies the callee's ABI as an index in the range [0, NUM_ABI_IDS - 1].
1680 See function-abi.h for more details. */
1681#define CALL_INSN_ABI_ID(INSN) XCINT(INSN, 8, CALL_INSN)
1682
1683/* The label-number of a code-label. The assembler label
1684 is made from `L' and the label-number printed in decimal.
1685 Label numbers are unique in a compilation. */
1686#define CODE_LABEL_NUMBER(INSN) XINT (INSN, 5)
1687
1688/* In a NOTE that is a line number, this is a string for the file name that the
1689 line is in. We use the same field to record block numbers temporarily in
1690 NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes. (We avoid lots of casts
1691 between ints and pointers if we use a different macro for the block number.)
1692 */
1694/* Opaque data. */
1695#define NOTE_DATA(INSN) RTL_CHECKC1 (INSN, 3, NOTE)
1696#define NOTE_DELETED_LABEL_NAME(INSN) XCSTR (INSN, 3, NOTE)
1697#define SET_INSN_DELETED(INSN) set_insn_deleted (INSN);
1698#define NOTE_BLOCK(INSN) XCTREE (INSN, 3, NOTE)
1699#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 3, NOTE)
1700#define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 3, NOTE)
1701#define NOTE_VAR_LOCATION(INSN) XCEXP (INSN, 3, NOTE)
1702#define NOTE_MARKER_LOCATION(INSN) XCLOC (INSN, 3, NOTE)
1703#define NOTE_CFI(INSN) XCCFI (INSN, 3, NOTE)
1704#define NOTE_LABEL_NUMBER(INSN) XCINT (INSN, 3, NOTE)
1705
1706/* In a NOTE that is a line number, this is the line number.
1707 Other kinds of NOTEs are identified by negative numbers here. */
1708#define NOTE_KIND(INSN) XCINT (INSN, 4, NOTE)
1710/* Nonzero if INSN is a note marking the beginning of a basic block. */
1711#define NOTE_INSN_BASIC_BLOCK_P(INSN) \
1712 (NOTE_P (INSN) && NOTE_KIND (INSN) == NOTE_INSN_BASIC_BLOCK)
1713
1714/* Nonzero if INSN is a debug nonbind marker note,
1715 for which NOTE_MARKER_LOCATION can be used. */
1716#define NOTE_MARKER_P(INSN) \
1717 (NOTE_P (INSN) && \
1718 (NOTE_KIND (INSN) == NOTE_INSN_BEGIN_STMT \
1719 || NOTE_KIND (INSN) == NOTE_INSN_INLINE_ENTRY))
1721/* Variable declaration and the location of a variable. */
1722#define PAT_VAR_LOCATION_DECL(PAT) (XCTREE ((PAT), 0, VAR_LOCATION))
1723#define PAT_VAR_LOCATION_LOC(PAT) (XCEXP ((PAT), 1, VAR_LOCATION))
1724
1725/* Initialization status of the variable in the location. Status
1726 can be unknown, uninitialized or initialized. See enumeration
1727 type below. */
1728#define PAT_VAR_LOCATION_STATUS(PAT) \
1729 (RTL_FLAG_CHECK1 ("PAT_VAR_LOCATION_STATUS", PAT, VAR_LOCATION) \
1730 ->u2.var_location_status)
1732/* Accessors for a NOTE_INSN_VAR_LOCATION. */
1733#define NOTE_VAR_LOCATION_DECL(NOTE) \
1734 PAT_VAR_LOCATION_DECL (NOTE_VAR_LOCATION (NOTE))
1735#define NOTE_VAR_LOCATION_LOC(NOTE) \
1736 PAT_VAR_LOCATION_LOC (NOTE_VAR_LOCATION (NOTE))
1737#define NOTE_VAR_LOCATION_STATUS(NOTE) \
1738 PAT_VAR_LOCATION_STATUS (NOTE_VAR_LOCATION (NOTE))
1739
1740/* Evaluate to TRUE if INSN is a debug insn that denotes a variable
1741 location/value tracking annotation. */
1742#define DEBUG_BIND_INSN_P(INSN) \
1743 (DEBUG_INSN_P (INSN) \
1744 && (GET_CODE (PATTERN (INSN)) \
1745 == VAR_LOCATION))
1746/* Evaluate to TRUE if INSN is a debug insn that denotes a program
1747 source location marker. */
1748#define DEBUG_MARKER_INSN_P(INSN) \
1749 (DEBUG_INSN_P (INSN) \
1750 && (GET_CODE (PATTERN (INSN)) \
1751 != VAR_LOCATION))
1752/* Evaluate to the marker kind. */
1753#define INSN_DEBUG_MARKER_KIND(INSN) \
1754 (GET_CODE (PATTERN (INSN)) == DEBUG_MARKER \
1755 ? (GET_MODE (PATTERN (INSN)) == VOIDmode \
1756 ? NOTE_INSN_BEGIN_STMT \
1757 : GET_MODE (PATTERN (INSN)) == BLKmode \
1758 ? NOTE_INSN_INLINE_ENTRY \
1759 : (enum insn_note)-1) \
1760 : (enum insn_note)-1)
1761/* Create patterns for debug markers. These and the above abstract
1762 the representation, so that it's easier to get rid of the abuse of
1763 the mode to hold the marker kind. Other marker types are
1764 envisioned, so a single bit flag won't do; maybe separate RTL codes
1765 wouldn't be a problem. */
1766#define GEN_RTX_DEBUG_MARKER_BEGIN_STMT_PAT() \
1767 gen_rtx_DEBUG_MARKER (VOIDmode)
1768#define GEN_RTX_DEBUG_MARKER_INLINE_ENTRY_PAT() \
1769 gen_rtx_DEBUG_MARKER (BLKmode)
1771/* The VAR_LOCATION rtx in a DEBUG_INSN. */
1772#define INSN_VAR_LOCATION(INSN) \
1773 (RTL_FLAG_CHECK1 ("INSN_VAR_LOCATION", PATTERN (INSN), VAR_LOCATION))
1774/* A pointer to the VAR_LOCATION rtx in a DEBUG_INSN. */
1775#define INSN_VAR_LOCATION_PTR(INSN) \
1776 (&PATTERN (INSN))
1778/* Accessors for a tree-expanded var location debug insn. */
1779#define INSN_VAR_LOCATION_DECL(INSN) \
1780 PAT_VAR_LOCATION_DECL (INSN_VAR_LOCATION (INSN))
1781#define INSN_VAR_LOCATION_LOC(INSN) \
1782 PAT_VAR_LOCATION_LOC (INSN_VAR_LOCATION (INSN))
1783#define INSN_VAR_LOCATION_STATUS(INSN) \
1784 PAT_VAR_LOCATION_STATUS (INSN_VAR_LOCATION (INSN))
1785
1786/* Expand to the RTL that denotes an unknown variable location in a
1787 DEBUG_INSN. */
1788#define gen_rtx_UNKNOWN_VAR_LOC() (gen_rtx_CLOBBER (VOIDmode, const0_rtx))
1790/* Determine whether X is such an unknown location. */
1791#define VAR_LOC_UNKNOWN_P(X) \
1792 (GET_CODE (X) == CLOBBER && XEXP ((X), 0) == const0_rtx)
1793
1794/* 1 if RTX is emitted after a call, but it should take effect before
1795 the call returns. */
1796#define NOTE_DURING_CALL_P(RTX) \
1797 (RTL_FLAG_CHECK1 ("NOTE_VAR_LOCATION_DURING_CALL_P", (RTX), NOTE)->call)
1799/* DEBUG_EXPR_DECL corresponding to a DEBUG_EXPR RTX. */
1800#define DEBUG_EXPR_TREE_DECL(RTX) XCTREE (RTX, 0, DEBUG_EXPR)
1802/* VAR_DECL/PARM_DECL DEBUG_IMPLICIT_PTR takes address of. */
1803#define DEBUG_IMPLICIT_PTR_DECL(RTX) XCTREE (RTX, 0, DEBUG_IMPLICIT_PTR)
1805/* PARM_DECL DEBUG_PARAMETER_REF references. */
1806#define DEBUG_PARAMETER_REF_DECL(RTX) XCTREE (RTX, 0, DEBUG_PARAMETER_REF)
1807
1808/* Codes that appear in the NOTE_KIND field for kinds of notes
1809 that are not line numbers. These codes are all negative.
1810
1811 Notice that we do not try to use zero here for any of
1812 the special note codes because sometimes the source line
1813 actually can be zero! This happens (for example) when we
1814 are generating code for the per-translation-unit constructor
1815 and destructor routines for some C++ translation unit. */
1816
1818{
1819#define DEF_INSN_NOTE(NAME) NAME,
1820#include "insn-notes.def"
1821#undef DEF_INSN_NOTE
1822
1824};
1825
1826/* Names for NOTE insn's other than line numbers. */
1828extern const char * const note_insn_name[NOTE_INSN_MAX];
1829#define GET_NOTE_INSN_NAME(NOTE_CODE) \
1830 (note_insn_name[(NOTE_CODE)])
1831
1832/* The name of a label, in case it corresponds to an explicit label
1833 in the input source code. */
1834#define LABEL_NAME(RTX) XCSTR (RTX, 6, CODE_LABEL)
1835
1836/* In jump.cc, each label contains a count of the number
1837 of LABEL_REFs that point at it, so unused labels can be deleted. */
1838#define LABEL_NUSES(RTX) XCINT (RTX, 4, CODE_LABEL)
1839
1840/* Labels carry a two-bit field composed of the ->jump and ->call
1841 bits. This field indicates whether the label is an alternate
1842 entry point, and if so, what kind. */
1845 LABEL_NORMAL = 0, /* ordinary label */
1846 LABEL_STATIC_ENTRY, /* alternate entry point, not exported */
1847 LABEL_GLOBAL_ENTRY, /* alternate entry point, exported */
1848 LABEL_WEAK_ENTRY /* alternate entry point, exported as weak symbol */
1850
1851#if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION > 2007)
1852
1853/* Retrieve the kind of LABEL. */
1854#define LABEL_KIND(LABEL) __extension__ \
1855({ __typeof (LABEL) const _label = (LABEL); \
1856 if (! LABEL_P (_label)) \
1857 rtl_check_failed_flag ("LABEL_KIND", _label, __FILE__, __LINE__, \
1858 __FUNCTION__); \
1859 (enum label_kind) ((_label->jump << 1) | _label->call); })
1860
1861/* Set the kind of LABEL. */
1862#define SET_LABEL_KIND(LABEL, KIND) do { \
1863 __typeof (LABEL) const _label = (LABEL); \
1864 const unsigned int _kind = (KIND); \
1865 if (! LABEL_P (_label)) \
1866 rtl_check_failed_flag ("SET_LABEL_KIND", _label, __FILE__, __LINE__, \
1867 __FUNCTION__); \
1868 _label->jump = ((_kind >> 1) & 1); \
1869 _label->call = (_kind & 1); \
1870} while (0)
1871
1872#else
1874/* Retrieve the kind of LABEL. */
1875#define LABEL_KIND(LABEL) \
1876 ((enum label_kind) (((LABEL)->jump << 1) | (LABEL)->call))
1878/* Set the kind of LABEL. */
1879#define SET_LABEL_KIND(LABEL, KIND) do { \
1880 rtx const _label = (LABEL); \
1881 const unsigned int _kind = (KIND); \
1882 _label->jump = ((_kind >> 1) & 1); \
1883 _label->call = (_kind & 1); \
1884} while (0)
1885
1886#endif /* rtl flag checking */
1887
1888#define LABEL_ALT_ENTRY_P(LABEL) (LABEL_KIND (LABEL) != LABEL_NORMAL)
1889
1890/* In jump.cc, each JUMP_INSN can point to a label that it can jump to,
1891 so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
1892 be decremented and possibly the label can be deleted. */
1893#define JUMP_LABEL(INSN) XCEXP (INSN, 7, JUMP_INSN)
1894
1895inline rtx_insn *JUMP_LABEL_AS_INSN (const rtx_insn *insn)
1896{
1897 return safe_as_a <rtx_insn *> (JUMP_LABEL (insn));
1898}
1899
1900/* Methods of rtx_jump_insn. */
1901
1902inline rtx rtx_jump_insn::jump_label () const
1903{
1904 return JUMP_LABEL (this);
1911
1913{
1914 JUMP_LABEL (this) = target;
1915}
1916
1917/* Once basic blocks are found, each CODE_LABEL starts a chain that
1918 goes through all the LABEL_REFs that jump to that label. The chain
1919 eventually winds up at the CODE_LABEL: it is circular. */
1920#define LABEL_REFS(LABEL) XCEXP (LABEL, 3, CODE_LABEL)
1922/* Get the label that a LABEL_REF references. */
1923inline rtx_insn *
1925{
1926 return as_a<rtx_insn *> (XCEXP (ref, 0, LABEL_REF));
1927}
1928
1929/* Set the label that LABEL_REF ref refers to. */
1931inline void
1932set_label_ref_label (rtx ref, rtx_insn *label)
1933{
1934 XCEXP (ref, 0, LABEL_REF) = label;
1935}
1936␌
1937/* For a REG rtx, REGNO extracts the register number. REGNO can only
1938 be used on RHS. Use SET_REGNO to change the value. */
1939#define REGNO(RTX) (rhs_regno(RTX))
1940#define SET_REGNO(RTX, N) (df_ref_change_reg_with_loc (RTX, N))
1941
1942/* Return the number of consecutive registers in a REG. This is always
1943 1 for pseudo registers and is determined by TARGET_HARD_REGNO_NREGS for
1944 hard registers. */
1945#define REG_NREGS(RTX) (REG_CHECK (RTX)->nregs)
1946
1947/* ORIGINAL_REGNO holds the number the register originally had; for a
1948 pseudo register turned into a hard reg this will hold the old pseudo
1949 register number. */
1950#define ORIGINAL_REGNO(RTX) \
1951 (RTL_FLAG_CHECK1 ("ORIGINAL_REGNO", (RTX), REG)->u2.original_regno)
1952
1953/* Force the REGNO macro to only be used on the lhs. */
1954inline unsigned int
1956{
1957 return REG_CHECK (x)->regno;
1958}
1959
1960/* Return the final register in REG X plus one. */
1961inline unsigned int
1963{
1964 return REGNO (x) + REG_NREGS (x);
1965}
1966
1967/* Change the REGNO and REG_NREGS of REG X to the specified values,
1968 bypassing the df machinery. */
1969inline void
1970set_regno_raw (rtx x, unsigned int regno, unsigned int nregs)
1971{
1972 reg_info *reg = REG_CHECK (x);
1973 reg->regno = regno;
1974 reg->nregs = nregs;
1975}
1976
1977/* 1 if RTX is a reg or parallel that is the current function's return
1978 value. */
1979#define REG_FUNCTION_VALUE_P(RTX) \
1980 (RTL_FLAG_CHECK2 ("REG_FUNCTION_VALUE_P", (RTX), REG, PARALLEL)->return_val)
1982/* 1 if RTX is a reg that corresponds to a variable declared by the user. */
1983#define REG_USERVAR_P(RTX) \
1984 (RTL_FLAG_CHECK1 ("REG_USERVAR_P", (RTX), REG)->volatil)
1986/* 1 if RTX is a reg that holds a pointer value. */
1987#define REG_POINTER(RTX) \
1988 (RTL_FLAG_CHECK1 ("REG_POINTER", (RTX), REG)->frame_related)
1990/* 1 if RTX is a mem that holds a pointer value. */
1991#define MEM_POINTER(RTX) \
1992 (RTL_FLAG_CHECK1 ("MEM_POINTER", (RTX), MEM)->frame_related)
1994/* 1 if the given register REG corresponds to a hard register. */
1995#define HARD_REGISTER_P(REG) HARD_REGISTER_NUM_P (REGNO (REG))
1997/* 1 if the given register number REG_NO corresponds to a hard register. */
1998#define HARD_REGISTER_NUM_P(REG_NO) ((REG_NO) < FIRST_PSEUDO_REGISTER)
2000/* 1 if the given register REG corresponds to a virtual register. */
2001#define VIRTUAL_REGISTER_P(REG) VIRTUAL_REGISTER_NUM_P (REGNO (REG))
2003/* 1 if the given register number REG_NO corresponds to a virtual register. */
2004#define VIRTUAL_REGISTER_NUM_P(REG_NO) \
2005 IN_RANGE (REG_NO, FIRST_VIRTUAL_REGISTER, LAST_VIRTUAL_REGISTER)
2007/* For a CONST_INT rtx, INTVAL extracts the integer. */
2008#define INTVAL(RTX) XCWINT (RTX, 0, CONST_INT)
2009#define UINTVAL(RTX) ((unsigned HOST_WIDE_INT) INTVAL (RTX))
2010
2011/* For a CONST_WIDE_INT, CONST_WIDE_INT_NUNITS is the number of
2012 elements actually needed to represent the constant.
2013 CONST_WIDE_INT_ELT gets one of the elements. 0 is the least
2014 significant HOST_WIDE_INT. */
2015#define CONST_WIDE_INT_VEC(RTX) HWIVEC_CHECK (RTX, CONST_WIDE_INT)
2016#define CONST_WIDE_INT_NUNITS(RTX) CWI_GET_NUM_ELEM (RTX)
2017#define CONST_WIDE_INT_ELT(RTX, N) CWI_ELT (RTX, N)
2018
2019/* For a CONST_POLY_INT, CONST_POLY_INT_COEFFS gives access to the
2020 individual coefficients, in the form of a trailing_wide_ints structure. */
2021#define CONST_POLY_INT_COEFFS(RTX) \
2022 (RTL_FLAG_CHECK1("CONST_POLY_INT_COEFFS", (RTX), \
2023 CONST_POLY_INT)->u.cpi.coeffs)
2024
2025/* For a CONST_DOUBLE:
2026#if TARGET_SUPPORTS_WIDE_INT == 0
2027 For a VOIDmode, there are two integers CONST_DOUBLE_LOW is the
2028 low-order word and ..._HIGH the high-order.
2029#endif
2030 For a float, there is a REAL_VALUE_TYPE structure, and
2031 CONST_DOUBLE_REAL_VALUE(r) is a pointer to it. */
2032#define CONST_DOUBLE_LOW(r) XCMWINT (r, 0, CONST_DOUBLE, VOIDmode)
2033#define CONST_DOUBLE_HIGH(r) XCMWINT (r, 1, CONST_DOUBLE, VOIDmode)
2034#define CONST_DOUBLE_REAL_VALUE(r) \
2035 ((const struct real_value *) XCNMPRV (r, CONST_DOUBLE, VOIDmode))
2036
2037#define CONST_FIXED_VALUE(r) \
2038 ((const struct fixed_value *) XCNMPFV (r, CONST_FIXED, VOIDmode))
2039#define CONST_FIXED_VALUE_HIGH(r) \
2040 ((HOST_WIDE_INT) (CONST_FIXED_VALUE (r)->data.high))
2041#define CONST_FIXED_VALUE_LOW(r) \
2042 ((HOST_WIDE_INT) (CONST_FIXED_VALUE (r)->data.low))
2044/* For a CONST_VECTOR, return element #n. */
2045#define CONST_VECTOR_ELT(RTX, N) const_vector_elt (RTX, N)
2047/* See rtl.texi for a description of these macros. */
2048#define CONST_VECTOR_NPATTERNS(RTX) \
2049 (RTL_FLAG_CHECK1 ("CONST_VECTOR_NPATTERNS", (RTX), CONST_VECTOR) \
2050 ->u2.const_vector.npatterns)
2051
2052#define CONST_VECTOR_NELTS_PER_PATTERN(RTX) \
2053 (RTL_FLAG_CHECK1 ("CONST_VECTOR_NELTS_PER_PATTERN", (RTX), CONST_VECTOR) \
2054 ->u2.const_vector.nelts_per_pattern)
2055
2056#define CONST_VECTOR_DUPLICATE_P(RTX) \
2057 (CONST_VECTOR_NELTS_PER_PATTERN (RTX) == 1)
2058
2059#define CONST_VECTOR_STEPPED_P(RTX) \
2060 (CONST_VECTOR_NELTS_PER_PATTERN (RTX) == 3)
2061
2062#define CONST_VECTOR_ENCODED_ELT(RTX, N) XCVECEXP (RTX, 0, N, CONST_VECTOR)
2063
2064/* Return the number of elements encoded directly in a CONST_VECTOR. */
2066inline unsigned int
2068{
2070}
2072/* For a CONST_VECTOR, return the number of elements in a vector. */
2073#define CONST_VECTOR_NUNITS(RTX) GET_MODE_NUNITS (GET_MODE (RTX))
2074
2075/* For a SUBREG rtx, SUBREG_REG extracts the value we want a subreg of.
2076 SUBREG_BYTE extracts the byte-number. */
2078#define SUBREG_REG(RTX) XCEXP (RTX, 0, SUBREG)
2079#define SUBREG_BYTE(RTX) XCSUBREG (RTX, 1, SUBREG)
2080
2081/* in rtlanal.cc */
2082/* Return the right cost to give to an operation
2083 to make the cost of the corresponding register-to-register instruction
2084 N times that of a fast register-to-register instruction. */
2085#define COSTS_N_INSNS(N) ((N) * 4)
2086
2087/* Maximum cost of an rtl expression. This value has the special meaning
2088 not to use an rtx with this cost under any circumstances. */
2089#define MAX_COST INT_MAX
2090
2091/* Return true if CODE always has VOIDmode. */
2093inline bool
2094always_void_p (enum rtx_code code)
2095{
2096 switch (code)
2097 {
2098 case SET:
2099 case PC:
2100 case RETURN:
2101 case SIMPLE_RETURN:
2102 return true;
2103
2104 default:
2105 return false;
2106 }
2107}
2108
2109/* A structure to hold all available cost information about an rtl
2110 expression. */
2113 int speed;
2114 int size;
2115};
2116
2117/* Initialize a full_rtx_costs structure C to the maximum cost. */
2118inline void
2120{
2121 c->speed = MAX_COST;
2122 c->size = MAX_COST;
2123}
2124
2125/* Initialize a full_rtx_costs structure C to zero cost. */
2126inline void
2128{
2129 c->speed = 0;
2130 c->size = 0;
2131}
2132
2133/* Compare two full_rtx_costs structures A and B, returning true
2134 if A < B when optimizing for speed. */
2135inline bool
2136costs_lt_p (struct full_rtx_costs *a, struct full_rtx_costs *b,
2137 bool speed)
2138{
2139 if (speed)
2140 return (a->speed < b->speed
2141 || (a->speed == b->speed && a->size < b->size));
2142 else
2143 return (a->size < b->size
2144 || (a->size == b->size && a->speed < b->speed));
2145}
2146
2147/* Increase both members of the full_rtx_costs structure C by the
2148 cost of N insns. */
2149inline void
2150costs_add_n_insns (struct full_rtx_costs *c, int n)
2151{
2152 c->speed += COSTS_N_INSNS (n);
2153 c->size += COSTS_N_INSNS (n);
2154}
2155
2156/* Describes the shape of a subreg:
2157
2158 inner_mode == the mode of the SUBREG_REG
2159 offset == the SUBREG_BYTE
2160 outer_mode == the mode of the SUBREG itself. */
2161class subreg_shape {
2162public:
2163 subreg_shape (machine_mode, poly_uint16, machine_mode);
2164 bool operator == (const subreg_shape &) const;
2165 bool operator != (const subreg_shape &) const;
2166 unsigned HOST_WIDE_INT unique_id () const;
2168 machine_mode inner_mode;
2170 machine_mode outer_mode;
2171};
2173inline
2174subreg_shape::subreg_shape (machine_mode inner_mode_in,
2175 poly_uint16 offset_in,
2176 machine_mode outer_mode_in)
2177 : inner_mode (inner_mode_in), offset (offset_in), outer_mode (outer_mode_in)
2178{}
2180inline bool
2181subreg_shape::operator == (const subreg_shape &other) const
2182{
2183 return (inner_mode == other.inner_mode
2184 && known_eq (offset, other.offset)
2185 && outer_mode == other.outer_mode);
2186}
2188inline bool
2189subreg_shape::operator != (const subreg_shape &other) const
2190{
2191 return !operator == (other);
2192}
2193
2194/* Return an integer that uniquely identifies this shape. Structures
2195 like rtx_def assume that a mode can fit in an 8-bit bitfield and no
2196 current mode is anywhere near being 65536 bytes in size, so the
2197 id comfortably fits in an int. */
2199inline unsigned HOST_WIDE_INT
2201{
2202 { STATIC_ASSERT (MAX_MACHINE_MODE <= (1 << MACHINE_MODE_BITSIZE)); }
2204 { STATIC_ASSERT (sizeof (offset.coeffs[0]) <= 2); }
2205 int res = (int) inner_mode + ((int) outer_mode << 8);
2206 for (int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
2207 res += (HOST_WIDE_INT) offset.coeffs[i] << ((1 + i) * 16);
2208 return res;
2209}
2210
2211/* Return the shape of a SUBREG rtx. */
2213inline subreg_shape
2215{
2216 return subreg_shape (GET_MODE (SUBREG_REG (x)),
2217 SUBREG_BYTE (x), GET_MODE (x));
2218}
2219
2220/* Information about an address. This structure is supposed to be able
2221 to represent all supported target addresses. Please extend it if it
2222 is not yet general enough. */
2223struct address_info {
2224 /* The mode of the value being addressed, or VOIDmode if this is
2225 a load-address operation with no known address mode. */
2226 machine_mode mode;
2228 /* The address space. */
2231 /* True if this is an RTX_AUTOINC address. */
2232 bool autoinc_p;
2233
2234 /* The MEM whose address this is, or null if this describes an address
2235 operand with no enclosing MEM (an ADDRESS rather than a MEM address). */
2236 rtx mem;
2238 /* A pointer to the top-level address. */
2239 rtx *outer;
2240
2241 /* A pointer to the inner address, after all address mutations
2242 have been stripped from the top-level address. It can be one
2243 of the following:
2244
2245 - A {PRE,POST}_{INC,DEC} of *BASE. SEGMENT, INDEX and DISP are null.
2246
2247 - A {PRE,POST}_MODIFY of *BASE. In this case either INDEX or DISP
2248 points to the step value, depending on whether the step is variable
2249 or constant respectively. SEGMENT is null.
2250
2251 - A plain sum of the form SEGMENT + BASE + INDEX + DISP,
2252 with null fields evaluating to 0. */
2253 rtx *inner;
2254
2255 /* Components that make up *INNER. Each one may be null or nonnull.
2256 When nonnull, their meanings are as follows:
2257
2258 - *SEGMENT is the "segment" of memory to which the address refers.
2259 This value is entirely target-specific and is only called a "segment"
2260 because that's its most typical use. It contains exactly one UNSPEC,
2261 pointed to by SEGMENT_TERM. The contents of *SEGMENT do not need
2262 reloading.
2263
2264 - *BASE is a variable expression representing a base address.
2265 It contains exactly one "term", pointed to by BASE_TERM.
2266 This term can be one of the following:
2267
2268 (1) a REG, or a SUBREG of a REG
2269 (2) an eliminated REG (a PLUS of (1) and a constant)
2270 (3) a MEM, or a SUBREG of a MEM
2271 (4) a SCRATCH
2272
2273 This term is the one that base_reg_class constrains.
2274
2275 - *INDEX is a variable expression representing an index value.
2276 It may be a scaled expression, such as a MULT. It has exactly
2277 one "term", pointed to by INDEX_TERM. The possible terms are
2278 the same as for BASE. This term is the one that index_reg_class
2279 constrains.
2280
2281 - *DISP is a constant, possibly mutated. DISP_TERM points to the
2282 unmutated RTX_CONST_OBJ. */
2285 rtx *index;
2290 rtx *index_term;
2291 rtx *disp_term;
2292
2293 /* In a {PRE,POST}_MODIFY address, this points to a second copy
2294 of BASE_TERM, otherwise it is null. */
2295 rtx *base_term2;
2296
2297 /* ADDRESS if this structure describes an address operand, MEM if
2298 it describes a MEM address. */
2301 /* If BASE is nonnull, this is the code of the rtx that contains it. */
2303};
2304
2305/* This is used to bundle an rtx and a mode together so that the pair
2306 can be used with the wi:: routines. If we ever put modes into rtx
2307 integer constants, this should go away and then just pass an rtx in. */
2308typedef std::pair <rtx, machine_mode> rtx_mode_t;
2309
2310namespace wi
2312 template <>
2315 static const enum precision_type precision_type = VAR_PRECISION;
2316 static const bool host_dependent_precision = false;
2317 /* This ought to be true, except for the special case that BImode
2318 is canonicalized to STORE_FLAG_VALUE, which might be 1. */
2319 static const bool is_sign_extended = false;
2320 static const bool needs_write_val_arg = false;
2321 static unsigned int get_precision (const rtx_mode_t &);
2322 static wi::storage_ref decompose (HOST_WIDE_INT *, unsigned int,
2323 const rtx_mode_t &);
2324 };
2325}
2327inline unsigned int
2329{
2330 return GET_MODE_PRECISION (as_a <scalar_mode> (x.second));
2331}
2333inline wi::storage_ref
2335 unsigned int precision,
2336 const rtx_mode_t &x)
2337{
2339 switch (GET_CODE (x.first))
2340 {
2341 case CONST_INT:
2343 /* Nonzero BImodes are stored as STORE_FLAG_VALUE, which on many
2344 targets is 1 rather than -1. */
2345 gcc_checking_assert (INTVAL (x.first)
2346 == sext_hwi (INTVAL (x.first), precision)
2347 || (x.second == BImode && INTVAL (x.first) == 1));
2348
2349 return wi::storage_ref (&INTVAL (x.first), 1, precision);
2350
2351 case CONST_WIDE_INT:
2352 return wi::storage_ref (&CONST_WIDE_INT_ELT (x.first, 0),
2353 CONST_WIDE_INT_NUNITS (x.first), precision);
2354
2355#if TARGET_SUPPORTS_WIDE_INT == 0
2356 case CONST_DOUBLE:
2357 return wi::storage_ref (&CONST_DOUBLE_LOW (x.first), 2, precision);
2358#endif
2359
2360 default:
2361 gcc_unreachable ();
2362 }
2363}
2364
2365namespace wi
2366{
2367 hwi_with_prec shwi (HOST_WIDE_INT, machine_mode mode);
2368 wide_int min_value (machine_mode, signop);
2369 wide_int max_value (machine_mode, signop);
2370}
2372inline wi::hwi_with_prec
2373wi::shwi (HOST_WIDE_INT val, machine_mode mode)
2374{
2375 return shwi (val, GET_MODE_PRECISION (as_a <scalar_mode> (mode)));
2376}
2377
2378/* Produce the smallest number that is represented in MODE. The precision
2379 is taken from MODE and the sign from SGN. */
2380inline wide_int
2381wi::min_value (machine_mode mode, signop sgn)
2382{
2383 return min_value (GET_MODE_PRECISION (as_a <scalar_mode> (mode)), sgn);
2384}
2385
2386/* Produce the largest number that is represented in MODE. The precision
2387 is taken from MODE and the sign from SGN. */
2388inline wide_int
2389wi::max_value (machine_mode mode, signop sgn)
2390{
2391 return max_value (GET_MODE_PRECISION (as_a <scalar_mode> (mode)), sgn);
2392}
2393
2394namespace wi
2395{
2397 generic_wide_int <wide_int_ref_storage <false, false> > >
2400}
2401
2402/* Return the value of a CONST_POLY_INT in its native precision. */
2406{
2408 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
2409 res.coeffs[i] = CONST_POLY_INT_COEFFS (x)[i];
2410 return res;
2411}
2412
2413/* Return true if X is a scalar integer or a CONST_POLY_INT. The value
2414 can then be extracted using wi::to_poly_wide. */
2416inline bool
2418{
2419 return CONST_SCALAR_INT_P (x) || CONST_POLY_INT_P (x);
2420}
2421
2422/* Access X (which satisfies poly_int_rtx_p) as a poly_wide_int.
2423 MODE is the mode of X. */
2426wi::to_poly_wide (const_rtx x, machine_mode mode)
2427{
2428 if (CONST_POLY_INT_P (x))
2429 return const_poly_int_value (x);
2430 return rtx_mode_t (const_cast<rtx> (x), mode);
2431}
2432
2433/* Return the value of X as a poly_int64. */
2435inline poly_int64
2437{
2438 if (CONST_POLY_INT_P (x))
2439 {
2440 poly_int64 res;
2441 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
2442 res.coeffs[i] = CONST_POLY_INT_COEFFS (x)[i].to_shwi ();
2443 return res;
2444 }
2445 return INTVAL (x);
2446}
2447
2448/* Return true if arbitrary value X is an integer constant that can
2449 be represented as a poly_int64. Store the value in *RES if so,
2450 otherwise leave it unmodified. */
2452inline bool
2454{
2455 if (CONST_INT_P (x))
2456 {
2457 *res = INTVAL (x);
2458 return true;
2459 }
2460 if (CONST_POLY_INT_P (x))
2461 {
2462 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
2464 return false;
2465 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
2466 res->coeffs[i] = CONST_POLY_INT_COEFFS (x)[i].to_shwi ();
2467 return true;
2468 }
2469 return false;
2470}
2471
2472extern void init_rtlanal (void);
2473extern int rtx_cost (rtx, machine_mode, enum rtx_code, int, bool);
2474extern int address_cost (rtx, machine_mode, addr_space_t, bool);
2475extern void get_full_rtx_cost (rtx, machine_mode, enum rtx_code, int,
2476 struct full_rtx_costs *);
2477extern bool native_encode_rtx (machine_mode, rtx, vec<target_unit> &,
2478 unsigned int, unsigned int);
2479extern wide_int native_decode_int (const vec<target_unit> &, unsigned int,
2480 unsigned int, unsigned int);
2481extern rtx native_decode_rtx (machine_mode, const vec<target_unit> &,
2482 unsigned int);
2483extern rtx native_decode_vector_rtx (machine_mode, const vec<target_unit> &,
2484 unsigned int, unsigned int, unsigned int);
2488 poly_uint64);
2489extern bool read_modify_subreg_p (const_rtx);
2490
2491/* Given a subreg's OUTER_MODE, INNER_MODE, and SUBREG_BYTE, return the
2492 bit offset at which the subreg begins (counting from the least significant
2493 bit of the operand). */
2495inline poly_uint64
2496subreg_lsb_1 (machine_mode outer_mode, machine_mode inner_mode,
2497 poly_uint64 subreg_byte)
2498{
2499 return subreg_size_lsb (GET_MODE_SIZE (outer_mode),
2500 GET_MODE_SIZE (inner_mode), subreg_byte);
2501}
2502
2503/* Return the subreg byte offset for a subreg whose outer mode is
2504 OUTER_MODE, whose inner mode is INNER_MODE, and where there are
2505 LSB_SHIFT *bits* between the lsb of the outer value and the lsb of
2506 the inner value. This is the inverse of subreg_lsb_1 (which converts
2507 byte offsets to bit shifts). */
2509inline poly_uint64
2510subreg_offset_from_lsb (machine_mode outer_mode,
2511 machine_mode inner_mode,
2512 poly_uint64 lsb_shift)
2513{
2514 return subreg_size_offset_from_lsb (GET_MODE_SIZE (outer_mode),
2515 GET_MODE_SIZE (inner_mode), lsb_shift);
2516}
2517
2518extern unsigned int subreg_regno_offset (unsigned int, machine_mode,
2519 poly_uint64, machine_mode);
2520extern bool subreg_offset_representable_p (unsigned int, machine_mode,
2521 poly_uint64, machine_mode);
2522extern unsigned int subreg_regno (const_rtx);
2523extern int simplify_subreg_regno (unsigned int, machine_mode,
2524 poly_uint64, machine_mode,
2525 bool allow_stack_regs = false);
2526extern int lowpart_subreg_regno (unsigned int, machine_mode,
2527 machine_mode);
2528extern unsigned int subreg_nregs (const_rtx);
2529extern unsigned int subreg_nregs_with_regno (unsigned int, const_rtx);
2530extern unsigned HOST_WIDE_INT nonzero_bits (const_rtx, machine_mode);
2531extern unsigned int num_sign_bit_copies (const_rtx, machine_mode);
2532extern bool constant_pool_constant_p (rtx);
2533extern bool truncated_to_mode (machine_mode, const_rtx);
2534extern int low_bitmask_len (machine_mode, unsigned HOST_WIDE_INT);
2535extern void split_double (rtx, rtx *, rtx *);
2536extern rtx *strip_address_mutations (rtx *, enum rtx_code * = 0);
2537extern void decompose_address (struct address_info *, rtx *,
2538 machine_mode, addr_space_t, enum rtx_code);
2539extern void decompose_lea_address (struct address_info *, rtx *);
2540extern void decompose_mem_address (struct address_info *, rtx);
2541extern void update_address (struct address_info *);
2542extern HOST_WIDE_INT get_index_scale (const struct address_info *);
2543extern enum rtx_code get_index_code (const struct address_info *);
2544
2545/* 1 if RTX is a subreg containing a reg that is already known to be
2546 sign- or zero-extended from the mode of the subreg to the mode of
2547 the reg. SUBREG_PROMOTED_UNSIGNED_P gives the signedness of the
2548 extension.
2549
2550 When used as a LHS, is means that this extension must be done
2551 when assigning to SUBREG_REG. */
2552
2553#define SUBREG_PROMOTED_VAR_P(RTX) \
2554 (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED", (RTX), SUBREG)->in_struct)
2555
2556/* Valid for subregs which are SUBREG_PROMOTED_VAR_P(). In that case
2557 this gives the necessary extensions:
2558 0 - signed (SPR_SIGNED)
2559 1 - normal unsigned (SPR_UNSIGNED)
2560 2 - value is both sign and unsign extended for mode
2561 (SPR_SIGNED_AND_UNSIGNED).
2562 -1 - pointer unsigned, which most often can be handled like unsigned
2563 extension, except for generating instructions where we need to
2564 emit special code (ptr_extend insns) on some architectures
2565 (SPR_POINTER). */
2567const int SRP_POINTER = -1;
2568const int SRP_SIGNED = 0;
2569const int SRP_UNSIGNED = 1;
2570const int SRP_SIGNED_AND_UNSIGNED = 2;
2572/* Sets promoted mode for SUBREG_PROMOTED_VAR_P(). */
2573#define SUBREG_PROMOTED_SET(RTX, VAL) \
2574do { \
2575 rtx const _rtx = RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_SET", \
2576 (RTX), SUBREG); \
2577 switch (VAL) \
2578 { \
2579 case SRP_POINTER: \
2580 _rtx->volatil = 0; \
2581 _rtx->unchanging = 0; \
2582 break; \
2583 case SRP_SIGNED: \
2584 _rtx->volatil = 0; \
2585 _rtx->unchanging = 1; \
2586 break; \
2587 case SRP_UNSIGNED: \
2588 _rtx->volatil = 1; \
2589 _rtx->unchanging = 0; \
2590 break; \
2591 case SRP_SIGNED_AND_UNSIGNED: \
2592 _rtx->volatil = 1; \
2593 _rtx->unchanging = 1; \
2594 break; \
2595 } \
2596} while (0)
2597
2598/* Gets the value stored in promoted mode for SUBREG_PROMOTED_VAR_P(),
2599 including SRP_SIGNED_AND_UNSIGNED if promoted for
2600 both signed and unsigned. */
2601#define SUBREG_PROMOTED_GET(RTX) \
2602 (2 * (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_GET", (RTX), SUBREG)->volatil)\
2603 + (RTX)->unchanging - 1)
2605/* Returns sign of promoted mode for SUBREG_PROMOTED_VAR_P(). */
2606#define SUBREG_PROMOTED_SIGN(RTX) \
2607 ((RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_SIGN", (RTX), SUBREG)->volatil) ? 1\
2608 : (RTX)->unchanging - 1)
2609
2610/* Predicate to check if RTX of SUBREG_PROMOTED_VAR_P() is promoted
2611 for SIGNED type. */
2612#define SUBREG_PROMOTED_SIGNED_P(RTX) \
2613 (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_SIGNED_P", (RTX), SUBREG)->unchanging)
2614
2615/* Predicate to check if RTX of SUBREG_PROMOTED_VAR_P() is promoted
2616 for UNSIGNED type. */
2617#define SUBREG_PROMOTED_UNSIGNED_P(RTX) \
2618 (RTL_FLAG_CHECK1 ("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil)
2620/* Checks if RTX of SUBREG_PROMOTED_VAR_P() is promoted for given SIGN. */
2621#define SUBREG_CHECK_PROMOTED_SIGN(RTX, SIGN) \
2622((SIGN) == SRP_POINTER ? SUBREG_PROMOTED_GET (RTX) == SRP_POINTER \
2623 : (SIGN) == SRP_SIGNED ? SUBREG_PROMOTED_SIGNED_P (RTX) \
2624 : SUBREG_PROMOTED_UNSIGNED_P (RTX))
2626/* True if the REG is the static chain register for some CALL_INSN. */
2627#define STATIC_CHAIN_REG_P(RTX) \
2628 (RTL_FLAG_CHECK1 ("STATIC_CHAIN_REG_P", (RTX), REG)->jump)
2629
2630/* True if the subreg was generated by LRA for reload insns. Such
2631 subregs are valid only during LRA. */
2632#define LRA_SUBREG_P(RTX) \
2633 (RTL_FLAG_CHECK1 ("LRA_SUBREG_P", (RTX), SUBREG)->jump)
2634
2635/* Access various components of an ASM_OPERANDS rtx. */
2637#define ASM_OPERANDS_TEMPLATE(RTX) XCSTR (RTX, 0, ASM_OPERANDS)
2638#define ASM_OPERANDS_OUTPUT_CONSTRAINT(RTX) XCSTR (RTX, 1, ASM_OPERANDS)
2639#define ASM_OPERANDS_OUTPUT_IDX(RTX) XCINT (RTX, 2, ASM_OPERANDS)
2640#define ASM_OPERANDS_INPUT_VEC(RTX) XCVEC (RTX, 3, ASM_OPERANDS)
2641#define ASM_OPERANDS_INPUT_CONSTRAINT_VEC(RTX) XCVEC (RTX, 4, ASM_OPERANDS)
2642#define ASM_OPERANDS_INPUT(RTX, N) XCVECEXP (RTX, 3, N, ASM_OPERANDS)
2643#define ASM_OPERANDS_INPUT_LENGTH(RTX) XCVECLEN (RTX, 3, ASM_OPERANDS)
2644#define ASM_OPERANDS_INPUT_CONSTRAINT_EXP(RTX, N) \
2645 XCVECEXP (RTX, 4, N, ASM_OPERANDS)
2646#define ASM_OPERANDS_INPUT_CONSTRAINT(RTX, N) \
2647 XSTR (XCVECEXP (RTX, 4, N, ASM_OPERANDS), 0)
2648#define ASM_OPERANDS_INPUT_MODE(RTX, N) \
2649 GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS))
2650#define ASM_OPERANDS_LABEL_VEC(RTX) XCVEC (RTX, 5, ASM_OPERANDS)
2651#define ASM_OPERANDS_LABEL_LENGTH(RTX) XCVECLEN (RTX, 5, ASM_OPERANDS)
2652#define ASM_OPERANDS_LABEL(RTX, N) XCVECEXP (RTX, 5, N, ASM_OPERANDS)
2653#define ASM_OPERANDS_SOURCE_LOCATION(RTX) XCLOC (RTX, 6, ASM_OPERANDS)
2654#define ASM_INPUT_SOURCE_LOCATION(RTX) XCLOC (RTX, 1, ASM_INPUT)
2656/* 1 if RTX is a mem that is statically allocated in read-only memory. */
2657#define MEM_READONLY_P(RTX) \
2658 (RTL_FLAG_CHECK1 ("MEM_READONLY_P", (RTX), MEM)->unchanging)
2659
2660/* 1 if RTX is a mem and we should keep the alias set for this mem
2661 unchanged when we access a component. Set to 1, or example, when we
2662 are already in a non-addressable component of an aggregate. */
2663#define MEM_KEEP_ALIAS_SET_P(RTX) \
2664 (RTL_FLAG_CHECK1 ("MEM_KEEP_ALIAS_SET_P", (RTX), MEM)->jump)
2666/* 1 if RTX is a mem or asm_operand for a volatile reference. */
2667#define MEM_VOLATILE_P(RTX) \
2668 (RTL_FLAG_CHECK3 ("MEM_VOLATILE_P", (RTX), MEM, ASM_OPERANDS, \
2669 ASM_INPUT)->volatil)
2671/* 1 if RTX is a mem that cannot trap. */
2672#define MEM_NOTRAP_P(RTX) \
2673 (RTL_FLAG_CHECK1 ("MEM_NOTRAP_P", (RTX), MEM)->call)
2674
2675/* The memory attribute block. We provide access macros for each value
2676 in the block and provide defaults if none specified. */
2677#define MEM_ATTRS(RTX) X0MEMATTR (RTX, 1)
2678
2679/* The register attribute block. We provide access macros for each value
2680 in the block and provide defaults if none specified. */
2681#define REG_ATTRS(RTX) (REG_CHECK (RTX)->attrs)
2682
2683#ifndef GENERATOR_FILE
2684/* For a MEM rtx, the alias set. If 0, this MEM is not in any alias
2685 set, and may alias anything. Otherwise, the MEM can only alias
2686 MEMs in a conflicting alias set. This value is set in a
2687 language-dependent manner in the front-end, and should not be
2688 altered in the back-end. These set numbers are tested with
2689 alias_sets_conflict_p. */
2690#define MEM_ALIAS_SET(RTX) (get_mem_attrs (RTX)->alias)
2691
2692/* For a MEM rtx, the decl it is known to refer to, if it is known to
2693 refer to part of a DECL. It may also be a COMPONENT_REF. */
2694#define MEM_EXPR(RTX) (get_mem_attrs (RTX)->expr)
2696/* For a MEM rtx, true if its MEM_OFFSET is known. */
2697#define MEM_OFFSET_KNOWN_P(RTX) (get_mem_attrs (RTX)->offset_known_p)
2699/* For a MEM rtx, the offset from the start of MEM_EXPR. */
2700#define MEM_OFFSET(RTX) (get_mem_attrs (RTX)->offset)
2702/* For a MEM rtx, the address space. */
2703#define MEM_ADDR_SPACE(RTX) (get_mem_attrs (RTX)->addrspace)
2705/* For a MEM rtx, true if its MEM_SIZE is known. */
2706#define MEM_SIZE_KNOWN_P(RTX) (get_mem_attrs (RTX)->size_known_p)
2708/* For a MEM rtx, the size in bytes of the MEM. */
2709#define MEM_SIZE(RTX) (get_mem_attrs (RTX)->size)
2710
2711/* For a MEM rtx, the alignment in bits. We can use the alignment of the
2712 mode as a default when STRICT_ALIGNMENT, but not if not. */
2713#define MEM_ALIGN(RTX) (get_mem_attrs (RTX)->align)
2714#else
2715#define MEM_ADDR_SPACE(RTX) ADDR_SPACE_GENERIC
2716#endif
2717
2718/* For a REG rtx, the decl it is known to refer to, if it is known to
2719 refer to part of a DECL. */
2720#define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl)
2721
2722/* For a REG rtx, the offset from the start of REG_EXPR, if known, as an
2723 HOST_WIDE_INT. */
2724#define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset)
2726/* Copy the attributes that apply to memory locations from RHS to LHS. */
2727#define MEM_COPY_ATTRIBUTES(LHS, RHS) \
2728 (MEM_VOLATILE_P (LHS) = MEM_VOLATILE_P (RHS), \
2729 MEM_NOTRAP_P (LHS) = MEM_NOTRAP_P (RHS), \
2730 MEM_READONLY_P (LHS) = MEM_READONLY_P (RHS), \
2731 MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
2732 MEM_POINTER (LHS) = MEM_POINTER (RHS), \
2733 MEM_ATTRS (LHS) = MEM_ATTRS (RHS))
2734
2735/* 1 if RTX is a label_ref for a nonlocal label. */
2736/* Likewise in an expr_list for a REG_LABEL_OPERAND or
2737 REG_LABEL_TARGET note. */
2738#define LABEL_REF_NONLOCAL_P(RTX) \
2739 (RTL_FLAG_CHECK1 ("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF)->volatil)
2741/* 1 if RTX is a code_label that should always be considered to be needed. */
2742#define LABEL_PRESERVE_P(RTX) \
2743 (RTL_FLAG_CHECK2 ("LABEL_PRESERVE_P", (RTX), CODE_LABEL, NOTE)->in_struct)
2744
2745/* During sched, 1 if RTX is an insn that must be scheduled together
2746 with the preceding insn. */
2747#define SCHED_GROUP_P(RTX) \
2748 (RTL_FLAG_CHECK4 ("SCHED_GROUP_P", (RTX), DEBUG_INSN, INSN, \
2749 JUMP_INSN, CALL_INSN)->in_struct)
2750
2751/* For a SET rtx, SET_DEST is the place that is set
2752 and SET_SRC is the value it is set to. */
2753#define SET_DEST(RTX) XC2EXP (RTX, 0, SET, CLOBBER)
2754#define SET_SRC(RTX) XCEXP (RTX, 1, SET)
2755#define SET_IS_RETURN_P(RTX) \
2756 (RTL_FLAG_CHECK1 ("SET_IS_RETURN_P", (RTX), SET)->jump)
2758/* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
2759#define TRAP_CONDITION(RTX) XCEXP (RTX, 0, TRAP_IF)
2760#define TRAP_CODE(RTX) XCEXP (RTX, 1, TRAP_IF)
2761
2762/* For a COND_EXEC rtx, COND_EXEC_TEST is the condition to base
2763 conditionally executing the code on, COND_EXEC_CODE is the code
2764 to execute if the condition is true. */
2765#define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC)
2766#define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC)
2767
2768/* 1 if RTX is a symbol_ref that addresses this function's rtl
2769 constants pool. */
2770#define CONSTANT_POOL_ADDRESS_P(RTX) \
2771 (RTL_FLAG_CHECK1 ("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
2772
2773/* 1 if RTX is a symbol_ref that addresses a value in the file's
2774 tree constant pool. This information is private to varasm.cc. */
2775#define TREE_CONSTANT_POOL_ADDRESS_P(RTX) \
2776 (RTL_FLAG_CHECK1 ("TREE_CONSTANT_POOL_ADDRESS_P", \
2777 (RTX), SYMBOL_REF)->frame_related)
2779/* Used if RTX is a symbol_ref, for machine-specific purposes. */
2780#define SYMBOL_REF_FLAG(RTX) \
2781 (RTL_FLAG_CHECK1 ("SYMBOL_REF_FLAG", (RTX), SYMBOL_REF)->volatil)
2782
2783/* 1 if RTX is a symbol_ref that has been the library function in
2784 emit_library_call. */
2785#define SYMBOL_REF_USED(RTX) \
2786 (RTL_FLAG_CHECK1 ("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used)
2788/* 1 if RTX is a symbol_ref for a weak symbol. */
2789#define SYMBOL_REF_WEAK(RTX) \
2790 (RTL_FLAG_CHECK1 ("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->return_val)
2791
2792/* A pointer attached to the SYMBOL_REF; either SYMBOL_REF_DECL or
2793 SYMBOL_REF_CONSTANT. */
2794#define SYMBOL_REF_DATA(RTX) X0ANY ((RTX), 1)
2795
2796/* Set RTX's SYMBOL_REF_DECL to DECL. RTX must not be a constant
2797 pool symbol. */
2798#define SET_SYMBOL_REF_DECL(RTX, DECL) \
2799 (gcc_assert (!CONSTANT_POOL_ADDRESS_P (RTX)), X0TREE ((RTX), 1) = (DECL))
2801/* The tree (decl or constant) associated with the symbol, or null. */
2802#define SYMBOL_REF_DECL(RTX) \
2803 (CONSTANT_POOL_ADDRESS_P (RTX) ? NULL : X0TREE ((RTX), 1))
2805/* Set RTX's SYMBOL_REF_CONSTANT to C. RTX must be a constant pool symbol. */
2806#define SET_SYMBOL_REF_CONSTANT(RTX, C) \
2807 (gcc_assert (CONSTANT_POOL_ADDRESS_P (RTX)), X0CONSTANT ((RTX), 1) = (C))
2809/* The rtx constant pool entry for a symbol, or null. */
2810#define SYMBOL_REF_CONSTANT(RTX) \
2811 (CONSTANT_POOL_ADDRESS_P (RTX) ? X0CONSTANT ((RTX), 1) : NULL)
2812
2813/* A set of flags on a symbol_ref that are, in some respects, redundant with
2814 information derivable from the tree decl associated with this symbol.
2815 Except that we build a *lot* of SYMBOL_REFs that aren't associated with a
2816 decl. In some cases this is a bug. But beyond that, it's nice to cache
2817 this information to avoid recomputing it. Finally, this allows space for
2818 the target to store more than one bit of information, as with
2819 SYMBOL_REF_FLAG. */
2820#define SYMBOL_REF_FLAGS(RTX) \
2821 (RTL_FLAG_CHECK1 ("SYMBOL_REF_FLAGS", (RTX), SYMBOL_REF) \
2822 ->u2.symbol_ref_flags)
2823
2824/* These flags are common enough to be defined for all targets. They
2825 are computed by the default version of targetm.encode_section_info. */
2827/* Set if this symbol is a function. */
2828#define SYMBOL_FLAG_FUNCTION (1 << 0)
2829#define SYMBOL_REF_FUNCTION_P(RTX) \
2830 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_FUNCTION) != 0)
2831/* Set if targetm.binds_local_p is true. */
2832#define SYMBOL_FLAG_LOCAL (1 << 1)
2833#define SYMBOL_REF_LOCAL_P(RTX) \
2834 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_LOCAL) != 0)
2835/* Set if targetm.in_small_data_p is true. */
2836#define SYMBOL_FLAG_SMALL (1 << 2)
2837#define SYMBOL_REF_SMALL_P(RTX) \
2838 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_SMALL) != 0)
2839/* The three-bit field at [5:3] is true for TLS variables; use
2840 SYMBOL_REF_TLS_MODEL to extract the field as an enum tls_model. */
2841#define SYMBOL_FLAG_TLS_SHIFT 3
2842#define SYMBOL_REF_TLS_MODEL(RTX) \
2843 ((enum tls_model) ((SYMBOL_REF_FLAGS (RTX) >> SYMBOL_FLAG_TLS_SHIFT) & 7))
2844/* Set if this symbol is not defined in this translation unit. */
2845#define SYMBOL_FLAG_EXTERNAL (1 << 6)
2846#define SYMBOL_REF_EXTERNAL_P(RTX) \
2847 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_EXTERNAL) != 0)
2848/* Set if this symbol has a block_symbol structure associated with it. */
2849#define SYMBOL_FLAG_HAS_BLOCK_INFO (1 << 7)
2850#define SYMBOL_REF_HAS_BLOCK_INFO_P(RTX) \
2851 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_HAS_BLOCK_INFO) != 0)
2852/* Set if this symbol is a section anchor. SYMBOL_REF_ANCHOR_P implies
2853 SYMBOL_REF_HAS_BLOCK_INFO_P. */
2854#define SYMBOL_FLAG_ANCHOR (1 << 8)
2855#define SYMBOL_REF_ANCHOR_P(RTX) \
2856 ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_ANCHOR) != 0)
2858/* Subsequent bits are available for the target to use. */
2859#define SYMBOL_FLAG_MACH_DEP_SHIFT 9
2860#define SYMBOL_FLAG_MACH_DEP (1 << SYMBOL_FLAG_MACH_DEP_SHIFT)
2861
2862/* If SYMBOL_REF_HAS_BLOCK_INFO_P (RTX), this is the object_block
2863 structure to which the symbol belongs, or NULL if it has not been
2864 assigned a block. */
2865#define SYMBOL_REF_BLOCK(RTX) (BLOCK_SYMBOL_CHECK (RTX)->block)
2866
2867/* If SYMBOL_REF_HAS_BLOCK_INFO_P (RTX), this is the offset of RTX from
2868 the first object in SYMBOL_REF_BLOCK (RTX). The value is negative if
2869 RTX has not yet been assigned to a block, or it has not been given an
2870 offset within that block. */
2871#define SYMBOL_REF_BLOCK_OFFSET(RTX) (BLOCK_SYMBOL_CHECK (RTX)->offset)
2873/* True if RTX is flagged to be a scheduling barrier. */
2874#define PREFETCH_SCHEDULE_BARRIER_P(RTX) \
2875 (RTL_FLAG_CHECK1 ("PREFETCH_SCHEDULE_BARRIER_P", (RTX), PREFETCH)->volatil)
2876
2877/* Indicate whether the machine has any sort of auto increment addressing.
2878 If not, we can avoid checking for REG_INC notes. */
2879
2880#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) \
2881 || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT) \
2882 || defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_POST_MODIFY_DISP) \
2883 || defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_REG))
2884#define AUTO_INC_DEC 1
2885#else
2886#define AUTO_INC_DEC 0
2887#endif
2888
2889/* Define a macro to look for REG_INC notes,
2890 but save time on machines where they never exist. */
2891
2892#if AUTO_INC_DEC
2893#define FIND_REG_INC_NOTE(INSN, REG) \
2894 ((REG) != NULL_RTX && REG_P ((REG)) \
2895 ? find_regno_note ((INSN), REG_INC, REGNO (REG)) \
2896 : find_reg_note ((INSN), REG_INC, (REG)))
2897#else
2898#define FIND_REG_INC_NOTE(INSN, REG) 0
2899#endif
2901#ifndef HAVE_PRE_INCREMENT
2902#define HAVE_PRE_INCREMENT 0
2903#endif
2905#ifndef HAVE_PRE_DECREMENT
2906#define HAVE_PRE_DECREMENT 0
2907#endif
2909#ifndef HAVE_POST_INCREMENT
2910#define HAVE_POST_INCREMENT 0
2911#endif
2913#ifndef HAVE_POST_DECREMENT
2914#define HAVE_POST_DECREMENT 0
2915#endif
2917#ifndef HAVE_POST_MODIFY_DISP
2918#define HAVE_POST_MODIFY_DISP 0
2919#endif
2921#ifndef HAVE_POST_MODIFY_REG
2922#define HAVE_POST_MODIFY_REG 0
2923#endif
2925#ifndef HAVE_PRE_MODIFY_DISP
2926#define HAVE_PRE_MODIFY_DISP 0
2927#endif
2929#ifndef HAVE_PRE_MODIFY_REG
2930#define HAVE_PRE_MODIFY_REG 0
2931#endif
2932
2933
2934/* Some architectures do not have complete pre/post increment/decrement
2935 instruction sets, or only move some modes efficiently. These macros
2936 allow us to tune autoincrement generation. */
2938#ifndef USE_LOAD_POST_INCREMENT
2939#define USE_LOAD_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
2940#endif
2942#ifndef USE_LOAD_POST_DECREMENT
2943#define USE_LOAD_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
2944#endif
2946#ifndef USE_LOAD_PRE_INCREMENT
2947#define USE_LOAD_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
2948#endif
2950#ifndef USE_LOAD_PRE_DECREMENT
2951#define USE_LOAD_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
2952#endif
2954#ifndef USE_STORE_POST_INCREMENT
2955#define USE_STORE_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
2956#endif
2958#ifndef USE_STORE_POST_DECREMENT
2959#define USE_STORE_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
2960#endif
2962#ifndef USE_STORE_PRE_INCREMENT
2963#define USE_STORE_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
2964#endif
2966#ifndef USE_STORE_PRE_DECREMENT
2967#define USE_STORE_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
2968#endif
2969␌
2970/* Nonzero when we are generating CONCATs. */
2971extern int generating_concat_p;
2972
2973/* Nonzero when we are expanding trees to RTL. */
2975
2976/* Generally useful functions. */
2977
2978#ifndef GENERATOR_FILE
2979/* Return the cost of SET X. SPEED_P is true if optimizing for speed
2980 rather than size. */
2982inline int
2983set_rtx_cost (rtx x, bool speed_p)
2984{
2985 return rtx_cost (x, VOIDmode, INSN, 4, speed_p);
2986}
2987
2988/* Like set_rtx_cost, but return both the speed and size costs in C. */
2990inline void
2992{
2993 get_full_rtx_cost (x, VOIDmode, INSN, 4, c);
2994}
2995
2996/* Return the cost of moving X into a register, relative to the cost
2997 of a register move. SPEED_P is true if optimizing for speed rather
2998 than size. */
3000inline int
3001set_src_cost (rtx x, machine_mode mode, bool speed_p)
3002{
3003 return rtx_cost (x, mode, SET, 1, speed_p);
3004}
3005
3006/* Like set_src_cost, but return both the speed and size costs in C. */
3008inline void
3009get_full_set_src_cost (rtx x, machine_mode mode, struct full_rtx_costs *c)
3010{
3011 get_full_rtx_cost (x, mode, SET, 1, c);
3012}
3013#endif
3014
3015/* A convenience macro to validate the arguments of a zero_extract
3016 expression. It determines whether SIZE lies inclusively within
3017 [1, RANGE], POS lies inclusively within between [0, RANGE - 1]
3018 and the sum lies inclusively within [1, RANGE]. RANGE must be
3019 >= 1, but SIZE and POS may be negative. */
3020#define EXTRACT_ARGS_IN_RANGE(SIZE, POS, RANGE) \
3021 (IN_RANGE ((POS), 0, (unsigned HOST_WIDE_INT) (RANGE) - 1) \
3022 && IN_RANGE ((SIZE), 1, (unsigned HOST_WIDE_INT) (RANGE) \
3023 - (unsigned HOST_WIDE_INT)(POS)))
3024
3025/* In explow.cc */
3026extern HOST_WIDE_INT trunc_int_for_mode (HOST_WIDE_INT, machine_mode);
3027extern poly_int64 trunc_int_for_mode (poly_int64, machine_mode);
3028extern rtx plus_constant (machine_mode, rtx, poly_int64, bool = false);
3029extern HOST_WIDE_INT get_stack_check_protect (void);
3031/* In rtl.cc */
3033inline rtx
3034rtx_init (rtx rt, RTX_CODE code)
3035{
3036 memset (rt, 0, RTX_HDR_SIZE);
3037 PUT_CODE (rt, code);
3038 return rt;
3039}
3040#define rtx_alloca(code) \
3041 rtx_init ((rtx) alloca (RTX_CODE_SIZE ((code))), (code))
3043#define rtx_alloc_v(c, SZ) rtx_alloc_stat_v (c MEM_STAT_INFO, SZ)
3044#define const_wide_int_alloc(NWORDS) \
3045 rtx_alloc_v (CONST_WIDE_INT, \
3046 (sizeof (struct hwivec_def) \
3047 + ((NWORDS)-1) * sizeof (HOST_WIDE_INT))) \
3048
3049extern rtvec rtvec_alloc (size_t);
3051extern bool shared_const_p (const_rtx);
3052extern rtx copy_rtx (rtx);
3053extern enum rtx_code classify_insn (rtx);
3054extern void dump_rtx_statistics (void);
3055
3056/* In emit-rtl.cc */
3058/* Opcodes used in the bytecode generated by genemit.cc. */
3059enum class expand_opcode {
3060 /* NULL_RTX. */
3061 NO_RTX,
3063 /* A (match_operand N) or (match_dup N). Followed by the operand number. */
3065
3066 /* A (match_operator N) or (match_op_dup N) that preserves the original mode.
3067 Followed by the operand number. */
3069
3070 /* A (match_operator N) or (match_op_dup N) that overrides the original mode.
3071 Followed by the new mode and by the operand number. */
3073
3074 /* A (match_parallel N) or (match_par_dup N). Followed by the operand
3075 number. */
3078 /* A (clobber (reg:M R)). Followed by M and R. */
3081 /* FIRST_CODE + X represents a normal rtx with code X. */
3083};
3084
3085extern rtx expand_rtx (const uint8_t *, rtx *);
3086extern rtx_insn *complete_seq (const uint8_t *, rtx *);
3087extern void note_split (const char *);
3088extern rtx copy_rtx_if_shared (rtx);
3089
3090/* In rtl.cc */
3091extern unsigned int rtx_size (const_rtx);
3093
3095 rtx *, rtx *);
3096extern bool rtx_equal_p (const_rtx, const_rtx,
3098
3099extern bool rtvec_all_equal_p (const_rtvec);
3100extern bool rtvec_series_p (rtvec, poly_int64);
3101
3102/* Return true if X is a vector constant with a duplicated element value. */
3104inline bool
3106{
3107 return (GET_CODE (x) == CONST_VECTOR
3108 && CONST_VECTOR_NPATTERNS (x) == 1
3110}
3111
3112/* Return true if X is a vector constant with a duplicated element value.
3113 Store the duplicated element in *ELT if so. */
3114
3115template <typename T>
3116inline bool
3117const_vec_duplicate_p (T x, T *elt)
3118{
3119 if (const_vec_duplicate_p (x))
3120 {
3121 *elt = CONST_VECTOR_ENCODED_ELT (x, 0);
3122 return true;
3123 }
3124 return false;
3125}
3126
3127/* Return true if X is a vector with a duplicated element value, either
3128 constant or nonconstant. Store the duplicated element in *ELT if so. */
3129
3130template <typename T>
3131inline bool
3132vec_duplicate_p (T x, T *elt)
3133{
3134 if (GET_CODE (x) == VEC_DUPLICATE
3135 && !VECTOR_MODE_P (GET_MODE (XEXP (x, 0))))
3136 {
3137 *elt = XEXP (x, 0);
3138 return true;
3139 }
3140 return const_vec_duplicate_p (x, elt);
3141}
3142
3143/* If X is a vector constant with a duplicated element value, return that
3144 element value, otherwise return X. */
3145
3146template <typename T>
3147inline T
3149{
3150 if (const_vec_duplicate_p (x))
3151 x = CONST_VECTOR_ELT (x, 0);
3152 return x;
3153}
3154
3155/* In emit-rtl.cc. */
3156extern wide_int const_vector_int_elt (const_rtx, unsigned int);
3157extern rtx const_vector_elt (const_rtx, unsigned int);
3158extern bool const_vec_series_p_1 (const_rtx, rtx *, rtx *);
3159
3160/* Return true if X is an integer constant vector that contains a linear
3161 series of the form:
3162
3163 { B, B + S, B + 2 * S, B + 3 * S, ... }
3164
3165 for a nonzero S. Store B and S in *BASE_OUT and *STEP_OUT on success. */
3167inline bool
3168const_vec_series_p (const_rtx x, rtx *base_out, rtx *step_out)
3169{
3170 if (GET_CODE (x) == CONST_VECTOR
3171 && CONST_VECTOR_NPATTERNS (x) == 1
3173 return const_vec_series_p_1 (x, base_out, step_out);
3174 return false;
3175}
3176
3177/* Return true if X is a vector that contains a linear series of the
3178 form:
3179
3180 { B, B + S, B + 2 * S, B + 3 * S, ... }
3181
3182 where B and S are constant or nonconstant. Store B and S in
3183 *BASE_OUT and *STEP_OUT on success. */
3185inline bool
3186vec_series_p (const_rtx x, rtx *base_out, rtx *step_out)
3187{
3188 if (GET_CODE (x) == VEC_SERIES)
3189 {
3190 *base_out = XEXP (x, 0);
3191 *step_out = XEXP (x, 1);
3192 return true;
3193 }
3194 return const_vec_series_p (x, base_out, step_out);
3195}
3196
3197/* Return true if CONST_VECTORs X and Y, which are known to have the same mode,
3198 also have the same encoding. This means that they are equal whenever their
3199 operands are equal. */
3201inline bool
3203{
3204 /* Don't be fussy about the encoding of constant-length vectors,
3205 since XVECEXP (X, 0) and XVECEXP (Y, 0) list all the elements anyway. */
3206 if (poly_uint64 (CONST_VECTOR_NUNITS (x)).is_constant ())
3207 return true;
3208
3212}
3213
3214/* Return the unpromoted (outer) mode of SUBREG_PROMOTED_VAR_P subreg X. */
3220 return as_a <scalar_int_mode> (GET_MODE (x));
3221}
3222
3223/* Return the promoted (inner) mode of SUBREG_PROMOTED_VAR_P subreg X. */
3230}
3231
3232/* In emit-rtl.cc */
3233extern rtvec gen_rtvec_v (int, rtx *);
3234extern rtvec gen_rtvec_v (int, rtx_insn **);
3235extern rtx gen_reg_rtx (machine_mode);
3236extern rtx gen_rtx_REG_offset (rtx, machine_mode, unsigned int, poly_int64);
3237extern rtx gen_reg_rtx_offset (rtx, machine_mode, int);
3239extern rtx_code_label *gen_label_rtx (void);
3240extern rtx gen_lowpart_common (machine_mode, rtx);
3241
3242/* In cse.cc */
3243extern rtx gen_lowpart_if_possible (machine_mode, rtx);
3244
3245/* In emit-rtl.cc */
3246extern rtx gen_highpart (machine_mode, rtx);
3247extern rtx gen_highpart_mode (machine_mode, machine_mode, rtx);
3248extern rtx operand_subword (rtx, poly_uint64, int, machine_mode);
3249
3250/* In emit-rtl.cc */
3251extern rtx operand_subword_force (rtx, poly_uint64, machine_mode);
3252extern bool subreg_lowpart_p (const_rtx);
3254
3255/* Return true if a subreg of mode OUTERMODE would only access part of
3256 an inner register with mode INNERMODE. The other bits of the inner
3257 register would then be "don't care" on read. The behavior for writes
3258 depends on REGMODE_NATURAL_SIZE; bits in the same REGMODE_NATURAL_SIZE-d
3259 chunk would be clobbered but other bits would be preserved. */
3261inline bool
3262partial_subreg_p (machine_mode outermode, machine_mode innermode)
3263{
3264 /* Modes involved in a subreg must be ordered. In particular, we must
3265 always know at compile time whether the subreg is paradoxical. */
3266 poly_int64 outer_prec = GET_MODE_PRECISION (outermode);
3267 poly_int64 inner_prec = GET_MODE_PRECISION (innermode);
3268 gcc_checking_assert (ordered_p (outer_prec, inner_prec));
3269 return maybe_lt (outer_prec, inner_prec);
3270}
3271
3272/* Likewise return true if X is a subreg that is smaller than the inner
3273 register. Use read_modify_subreg_p to test whether writing to such
3274 a subreg preserves any part of the inner register. */
3276inline bool
3278{
3279 if (GET_CODE (x) != SUBREG)
3280 return false;
3281 return partial_subreg_p (GET_MODE (x), GET_MODE (SUBREG_REG (x)));
3282}
3283
3284/* Return true if a subreg with the given outer and inner modes is
3285 paradoxical. */
3287inline bool
3288paradoxical_subreg_p (machine_mode outermode, machine_mode innermode)
3289{
3290 /* Modes involved in a subreg must be ordered. In particular, we must
3291 always know at compile time whether the subreg is paradoxical. */
3292 poly_int64 outer_prec = GET_MODE_PRECISION (outermode);
3293 poly_int64 inner_prec = GET_MODE_PRECISION (innermode);
3294 gcc_checking_assert (ordered_p (outer_prec, inner_prec));
3295 return maybe_gt (outer_prec, inner_prec);
3296}
3297
3298/* Return true if X is a paradoxical subreg, false otherwise. */
3300inline bool
3302{
3303 if (GET_CODE (x) != SUBREG)
3304 return false;
3306}
3307
3308/* Return the SUBREG_BYTE for an OUTERMODE lowpart of an INNERMODE value. */
3310inline poly_uint64
3311subreg_lowpart_offset (machine_mode outermode, machine_mode innermode)
3312{
3313 return subreg_size_lowpart_offset (GET_MODE_SIZE (outermode),
3314 GET_MODE_SIZE (innermode));
3315}
3316
3317/* Given that a subreg has outer mode OUTERMODE and inner mode INNERMODE,
3318 return the smaller of the two modes if they are different sizes,
3319 otherwise return the outer mode. */
3321inline machine_mode
3322narrower_subreg_mode (machine_mode outermode, machine_mode innermode)
3323{
3324 return paradoxical_subreg_p (outermode, innermode) ? innermode : outermode;
3325}
3326
3327/* Given that a subreg has outer mode OUTERMODE and inner mode INNERMODE,
3328 return the mode that is big enough to hold both the outer and inner
3329 values. Prefer the outer mode in the event of a tie. */
3331inline machine_mode
3332wider_subreg_mode (machine_mode outermode, machine_mode innermode)
3333{
3334 return partial_subreg_p (outermode, innermode) ? innermode : outermode;
3335}
3336
3337/* Likewise for subreg X. */
3339inline machine_mode
3341{
3342 return wider_subreg_mode (GET_MODE (x), GET_MODE (SUBREG_REG (x)));
3343}
3344
3346
3347/* Return the SUBREG_BYTE for an OUTERMODE highpart of an INNERMODE value. */
3349inline poly_uint64
3350subreg_highpart_offset (machine_mode outermode, machine_mode innermode)
3351{
3352 return subreg_size_highpart_offset (GET_MODE_SIZE (outermode),
3353 GET_MODE_SIZE (innermode));
3354}
3355
3356extern poly_int64 byte_lowpart_offset (machine_mode, machine_mode);
3357extern poly_int64 subreg_memory_offset (machine_mode, machine_mode,
3358 poly_uint64);
3360extern rtx make_safe_from (rtx, rtx);
3362 addr_space_t, bool, bool);
3365#define convert_memory_address(to_mode,x) \
3366 convert_memory_address_addr_space ((to_mode), (x), ADDR_SPACE_GENERIC)
3367extern const char *get_insn_name (int);
3368extern rtx_insn *get_last_insn_anywhere (void);
3369extern rtx_insn *get_first_nonnote_insn (void);
3370extern rtx_insn *get_last_nonnote_insn (void);
3371extern void start_sequence (void);
3372extern void push_to_sequence (rtx_insn *);
3373extern void push_to_sequence2 (rtx_insn *, rtx_insn *);
3374extern rtx_insn *end_sequence (void);
3375#if TARGET_SUPPORTS_WIDE_INT == 0
3377#endif
3378extern void cwi_output_hex (FILE *, const_rtx);
3379#if TARGET_SUPPORTS_WIDE_INT == 0
3380extern rtx immed_double_const (HOST_WIDE_INT, HOST_WIDE_INT,
3381 machine_mode);
3382#endif
3383extern rtx immed_wide_int_const (const poly_wide_int_ref &, machine_mode);
3384
3385/* In varasm.cc */
3386extern rtx force_const_mem (machine_mode, rtx);
3387
3388/* In varasm.cc */
3389
3390struct function;
3392extern rtx get_pool_constant_mark (rtx, bool *);
3395extern void decide_function_section (tree);
3396
3397/* In emit-rtl.cc */
3400extern rtx_insn *emit_insn_before_setloc (rtx, rtx_insn *, location_t);
3404 location_t);
3407extern rtx_insn *emit_call_insn_before_setloc (rtx, rtx_insn *, location_t);
3410extern rtx_insn *emit_debug_insn_before_setloc (rtx, rtx_insn *, location_t);
3416extern rtx_insn *emit_insn_after_setloc (rtx, rtx_insn *, location_t);
3419extern rtx_jump_insn *emit_jump_insn_after_setloc (rtx, rtx_insn *, location_t);
3422extern rtx_insn *emit_call_insn_after_setloc (rtx, rtx_insn *, location_t);
3425extern rtx_insn *emit_debug_insn_after_setloc (rtx, rtx_insn *, location_t);
3428extern rtx_note *emit_note_after (enum insn_note, rtx_insn *);
3429extern rtx_insn *emit_insn (rtx);
3430extern rtx_insn *emit_debug_insn (rtx);
3431extern rtx_insn *emit_jump_insn (rtx);
3434extern rtx_insn *emit_call_insn (rtx);
3435extern rtx_code_label *emit_label (rtx);
3437extern rtx_barrier *emit_barrier (void);
3438extern rtx_note *emit_note (enum insn_note);
3439extern rtx_note *emit_note_copy (rtx_note *);
3440extern rtx_insn *gen_clobber (rtx);
3441extern rtx_insn *emit_clobber (rtx);
3442extern rtx_insn *gen_use (rtx);
3443extern rtx_insn *emit_use (rtx);
3444extern rtx_insn *make_insn_raw (rtx);
3445extern void add_function_usage_to (rtx, rtx);
3446extern rtx_call_insn *last_call_insn (void);
3447extern rtx_insn *previous_insn (rtx_insn *);
3448extern rtx_insn *next_insn (rtx_insn *);
3457extern rtx_insn *prev_real_insn (rtx_insn *);
3458extern rtx_insn *next_real_insn (rtx_insn *);
3463extern bool active_insn_p (const rtx_insn *);
3464
3465/* In emit-rtl.cc */
3466extern int insn_line (const rtx_insn *);
3467extern const char * insn_file (const rtx_insn *);
3468extern tree insn_scope (const rtx_insn *);
3469extern expanded_location insn_location (const rtx_insn *);
3470extern int insn_discriminator (const rtx_insn *);
3471extern location_t prologue_location, epilogue_location;
3472
3473/* In jump.cc */
3474extern enum rtx_code reverse_condition (enum rtx_code);
3476extern enum rtx_code swap_condition (enum rtx_code);
3477extern enum rtx_code unsigned_condition (enum rtx_code);
3478extern enum rtx_code signed_condition (enum rtx_code);
3479extern void mark_jump_label (rtx, rtx_insn *, int);
3480
3481/* Return true if integer comparison operator CODE interprets its operands
3482 as unsigned. */
3484inline bool
3486{
3487 return unsigned_condition (code) == code;
3488}
3489
3490/* In jump.cc */
3492
3493/* In recog.cc */
3494extern rtx *find_constant_term_loc (rtx *);
3495
3496/* In emit-rtl.cc */
3497extern rtx_insn *try_split (rtx, rtx_insn *, int);
3499/* In insn-recog.cc (generated by genrecog). */
3500extern rtx_insn *split_insns (rtx, rtx_insn *);
3501
3502/* In simplify-rtx.cc */
3503
3504/* A class that records the context in which a simplification
3505 is being mode. */
3506class simplify_context
3507{
3508public:
3509 rtx simplify_unary_operation (rtx_code, machine_mode, rtx, machine_mode);
3510 rtx simplify_binary_operation (rtx_code, machine_mode, rtx, rtx);
3511 rtx simplify_ternary_operation (rtx_code, machine_mode, machine_mode,
3512 rtx, rtx, rtx);
3513 rtx simplify_relational_operation (rtx_code, machine_mode, machine_mode,
3514 rtx, rtx);
3515 rtx simplify_ior_with_common_term (machine_mode, rtx, rtx);
3516 rtx simplify_subreg (machine_mode, rtx, machine_mode, poly_uint64);
3517
3518 rtx lowpart_subreg (machine_mode, rtx, machine_mode);
3519
3521
3522 rtx simplify_gen_unary (rtx_code, machine_mode, rtx, machine_mode);
3523 rtx simplify_gen_binary (rtx_code, machine_mode, rtx, rtx);
3524 rtx simplify_gen_ternary (rtx_code, machine_mode, machine_mode,
3525 rtx, rtx, rtx);
3526 rtx simplify_gen_relational (rtx_code, machine_mode, machine_mode, rtx, rtx);
3527 rtx simplify_gen_subreg (machine_mode, rtx, machine_mode, poly_uint64);
3528 rtx simplify_gen_vec_select (rtx, unsigned int);
3529
3530 /* Tracks the level of MEM nesting for the value being simplified:
3531 0 means the value is not in a MEM, >0 means it is. This is needed
3532 because the canonical representation of multiplication is different
3533 inside a MEM than outside. */
3534 unsigned int mem_depth = 0;
3535
3536 /* Tracks number of simplify_associative_operation calls performed during
3537 outermost simplify* call. */
3538 unsigned int assoc_count = 0;
3539
3540 /* Limit for the above number, return NULL from
3541 simplify_associative_operation after we reach that assoc_count. */
3542 static const unsigned int max_assoc_count = 64;
3543
3544private:
3545 rtx simplify_truncation (machine_mode, rtx, machine_mode);
3550 bool = false);
3553 rtx simplify_shift_const_int (rtx_code, machine_mode, rtx, unsigned int);
3554 rtx simplify_plus_minus (rtx_code, machine_mode, rtx, rtx);
3556
3559 rtx simplify_ternary_operation_1 (rtx_code, machine_mode, machine_mode,
3560 rtx, rtx, rtx);
3561 rtx simplify_relational_operation_1 (rtx_code, machine_mode, machine_mode,
3562 rtx, rtx);
3563};
3565inline rtx
3566simplify_unary_operation (rtx_code code, machine_mode mode, rtx op,
3567 machine_mode op_mode)
3568{
3569 return simplify_context ().simplify_unary_operation (code, mode, op,
3570 op_mode);
3571}
3573inline rtx
3574simplify_binary_operation (rtx_code code, machine_mode mode, rtx op0, rtx op1)
3575{
3576 return simplify_context ().simplify_binary_operation (code, mode, op0, op1);
3577}
3579inline rtx
3580simplify_ternary_operation (rtx_code code, machine_mode mode,
3581 machine_mode op0_mode, rtx op0, rtx op1, rtx op2)
3582{
3583 return simplify_context ().simplify_ternary_operation (code, mode, op0_mode,
3584 op0, op1, op2);
3585}
3587inline rtx
3588simplify_relational_operation (rtx_code code, machine_mode mode,
3589 machine_mode op_mode, rtx op0, rtx op1)
3590{
3591 return simplify_context ().simplify_relational_operation (code, mode,
3592 op_mode, op0, op1);
3593}
3595inline rtx
3596simplify_subreg (machine_mode outermode, rtx op, machine_mode innermode,
3597 poly_uint64 byte)
3598{
3599 return simplify_context ().simplify_subreg (outermode, op, innermode, byte);
3600}
3602inline rtx
3603simplify_gen_unary (rtx_code code, machine_mode mode, rtx op,
3604 machine_mode op_mode)
3605{
3606 return simplify_context ().simplify_gen_unary (code, mode, op, op_mode);
3607}
3609inline rtx
3610simplify_gen_binary (rtx_code code, machine_mode mode, rtx op0, rtx op1)
3611{
3612 return simplify_context ().simplify_gen_binary (code, mode, op0, op1);
3613}
3615inline rtx
3616simplify_gen_ternary (rtx_code code, machine_mode mode, machine_mode op0_mode,
3617 rtx op0, rtx op1, rtx op2)
3618{
3619 return simplify_context ().simplify_gen_ternary (code, mode, op0_mode,
3620 op0, op1, op2);
3621}
3623inline rtx
3624simplify_gen_relational (rtx_code code, machine_mode mode,
3625 machine_mode op_mode, rtx op0, rtx op1)
3626{
3627 return simplify_context ().simplify_gen_relational (code, mode, op_mode,
3628 op0, op1);
3629}
3631inline rtx
3632simplify_gen_subreg (machine_mode outermode, rtx op, machine_mode innermode,
3633 poly_uint64 byte)
3634{
3635 return simplify_context ().simplify_gen_subreg (outermode, op,
3636 innermode, byte);
3637}
3639inline rtx
3640simplify_gen_vec_select (rtx op, unsigned int index)
3641{
3642 return simplify_context ().simplify_gen_vec_select (op, index);
3643}
3645inline rtx
3646lowpart_subreg (machine_mode outermode, rtx op, machine_mode innermode)
3647{
3648 return simplify_context ().lowpart_subreg (outermode, op, innermode);
3649}
3650
3651extern rtx simplify_const_unary_operation (enum rtx_code, machine_mode,
3652 rtx, machine_mode);
3653extern rtx simplify_const_binary_operation (enum rtx_code, machine_mode,
3654 rtx, rtx);
3656 machine_mode, rtx, rtx);
3658 rtx (*fn) (rtx, const_rtx, void *), void *);
3660extern rtx simplify_rtx (const_rtx);
3663extern bool mode_signbit_p (machine_mode, const_rtx);
3664extern bool val_signbit_p (machine_mode, unsigned HOST_WIDE_INT);
3665extern bool val_signbit_known_set_p (machine_mode,
3666 unsigned HOST_WIDE_INT);
3667extern bool val_signbit_known_clear_p (machine_mode,
3668 unsigned HOST_WIDE_INT);
3669extern bool reverse_rotate_by_imm_p (machine_mode, unsigned int, rtx);
3670
3671/* In reginfo.cc */
3672extern machine_mode choose_hard_reg_mode (unsigned int, unsigned int,
3673 const predefined_function_abi *);
3674extern const HARD_REG_SET &simplifiable_subregs (const subreg_shape &);
3675
3676/* In emit-rtl.cc */
3677extern rtx set_for_reg_notes (rtx);
3678extern rtx set_unique_reg_note (rtx, enum reg_note, rtx);
3679extern rtx set_dst_reg_note (rtx, enum reg_note, rtx, rtx);
3680extern void set_insn_deleted (rtx_insn *);
3681
3682/* Functions in rtlanal.cc */
3683
3684extern rtx single_set_2 (const rtx_insn *, const_rtx);
3685extern rtx simple_regno_set (rtx, unsigned int);
3686extern bool contains_symbol_ref_p (const_rtx);
3689extern void add_auto_inc_notes (rtx_insn *, rtx);
3690extern bool single_output_fused_pair_p (rtx_insn *);
3691
3692/* Handle the cheap and common cases inline for performance. */
3693
3694inline rtx single_set (const rtx_insn *insn)
3695{
3696 if (!INSN_P (insn))
3697 return NULL_RTX;
3698
3699 if (GET_CODE (PATTERN (insn)) == SET)
3700 return PATTERN (insn);
3701
3702 /* Defer to the more expensive case. */
3703 return single_set_2 (insn, PATTERN (insn));
3704}
3705
3707extern bool rtx_addr_can_trap_p (const_rtx);
3708extern bool nonzero_address_p (const_rtx);
3709extern bool rtx_unstable_p (const_rtx);
3710extern bool rtx_varies_p (const_rtx, bool);
3711extern bool rtx_addr_varies_p (const_rtx, bool);
3712extern tree get_call_fndecl (const rtx_insn *);
3713extern HOST_WIDE_INT get_integer_term (const_rtx);
3715extern bool offset_within_block_p (const_rtx, HOST_WIDE_INT);
3716extern void split_const (rtx, rtx *, rtx *);
3717extern rtx strip_offset (rtx, poly_int64 *);
3719extern bool unsigned_reg_p (rtx);
3720extern bool reg_mentioned_p (const_rtx, const_rtx);
3721extern int count_occurrences (const_rtx, const_rtx, int);
3722extern bool reg_referenced_p (const_rtx, const_rtx);
3723extern bool reg_used_between_p (const_rtx, const rtx_insn *, const rtx_insn *);
3724extern bool reg_set_between_p (const_rtx, const rtx_insn *, const rtx_insn *);
3726extern bool swap_commutative_operands_p (rtx, rtx);
3727extern bool modified_between_p (const_rtx, const rtx_insn *, const rtx_insn *);
3728extern bool no_labels_between_p (const rtx_insn *, const rtx_insn *);
3729extern bool modified_in_p (const_rtx, const_rtx);
3730extern bool reg_set_p (const_rtx, const_rtx);
3731extern bool multiple_sets (const_rtx);
3732extern bool set_noop_p (const_rtx);
3733extern bool noop_move_p (const rtx_insn *);
3734extern bool refers_to_regno_p (unsigned int, unsigned int, const_rtx, rtx *);
3737extern void record_hard_reg_sets (rtx, const_rtx, void *);
3738extern void record_hard_reg_uses (rtx *, void *);
3740extern void find_all_hard_reg_sets (const rtx_insn *, HARD_REG_SET *, bool);
3741extern void note_pattern_stores (const_rtx,
3742 void (*) (rtx, const_rtx, void *), void *);
3743extern void note_stores (const rtx_insn *,
3744 void (*) (rtx, const_rtx, void *), void *);
3745extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
3746extern bool dead_or_set_p (const rtx_insn *, const_rtx);
3747extern bool dead_or_set_regno_p (const rtx_insn *, unsigned int);
3749extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int);
3751extern rtx find_constant_src (const rtx_insn *);
3752extern bool find_reg_fusage (const_rtx, enum rtx_code, const_rtx);
3753extern bool find_regno_fusage (const_rtx, enum rtx_code, unsigned int);
3754extern rtx alloc_reg_note (enum reg_note, rtx, rtx);
3755extern void add_reg_note (rtx, enum reg_note, rtx);
3756extern void add_int_reg_note (rtx_insn *, enum reg_note, int);
3757extern void add_args_size_note (rtx_insn *, poly_int64);
3759extern rtx duplicate_reg_note (rtx);
3760extern void remove_note (rtx_insn *, const_rtx);
3761extern bool remove_reg_equal_equiv_notes (rtx_insn *, bool = false);
3762extern void remove_reg_equal_equiv_notes_for_regno (unsigned int);
3763extern bool side_effects_p (const_rtx);
3764extern bool volatile_refs_p (const_rtx);
3765extern bool volatile_insn_p (const_rtx);
3766extern bool may_trap_p_1 (const_rtx, unsigned);
3767extern bool may_trap_p (const_rtx);
3768extern bool may_trap_or_fault_p (const_rtx);
3769extern bool can_throw_internal (const_rtx);
3770extern bool can_throw_external (const_rtx);
3771extern bool insn_could_throw_p (const_rtx);
3772extern bool insn_nothrow_p (const_rtx);
3773extern bool can_nonlocal_goto (const rtx_insn *);
3776extern rtx replace_rtx (rtx, rtx, rtx, bool = false);
3777extern void replace_label (rtx *, rtx, rtx, bool);
3778extern void replace_label_in_insn (rtx_insn *, rtx_insn *, rtx_insn *, bool);
3779extern bool rtx_referenced_p (const_rtx, const_rtx);
3780extern bool tablejump_p (const rtx_insn *, rtx_insn **, rtx_jump_table_data **);
3781extern rtx tablejump_casesi_pattern (const rtx_insn *insn);
3782extern bool computed_jump_p (const rtx_insn *);
3783extern bool tls_referenced_p (const_rtx);
3784extern bool contains_mem_rtx_p (rtx x);
3785extern bool register_asm_p (const_rtx);
3786
3787/* Overload for refers_to_regno_p for checking a single register. */
3788inline bool
3789refers_to_regno_p (unsigned int regnum, const_rtx x, rtx* loc = NULL)
3790{
3791 return refers_to_regno_p (regnum, regnum + 1, x, loc);
3792}
3793
3794/* Callback for for_each_inc_dec, to process the autoinc operation OP
3795 within MEM that sets DEST to SRC + SRCOFF, or SRC if SRCOFF is
3796 NULL. The callback is passed the same opaque ARG passed to
3797 for_each_inc_dec. Return zero to continue looking for other
3798 autoinc operations or any other value to interrupt the traversal and
3799 return that value to the caller of for_each_inc_dec. */
3800typedef int (*for_each_inc_dec_fn) (rtx mem, rtx op, rtx dest, rtx src,
3801 rtx srcoff, void *arg);
3802extern int for_each_inc_dec (rtx, for_each_inc_dec_fn, void *arg);
3803
3804extern rtx regno_use_in (unsigned int, rtx);
3805extern bool auto_inc_p (const_rtx);
3806extern bool in_insn_list_p (const rtx_insn_list *, const rtx_insn *);
3807extern void remove_node_from_insn_list (const rtx_insn *, rtx_insn_list **);
3808extern bool loc_mentioned_in_p (rtx *, const_rtx);
3810extern bool keep_with_call_p (const rtx_insn *);
3811extern bool label_is_jump_target_p (const_rtx, const rtx_insn *);
3812extern int pattern_cost (rtx, bool);
3813extern int insn_cost (rtx_insn *, bool);
3814extern unsigned seq_cost (const rtx_insn *, bool);
3815
3816/* Given an insn and condition, return a canonical description of
3817 the test being made. */
3818extern rtx canonicalize_condition (rtx_insn *, rtx, int, rtx_insn **, rtx,
3819 int, int);
3820
3821/* Given a JUMP_INSN, return a canonical description of the test
3822 being made. */
3823extern rtx get_condition (rtx_insn *, rtx_insn **, int, int);
3825/* Information about a subreg of a hard register. */
3826struct subreg_info
3828 /* Offset of first hard register involved in the subreg. */
3829 int offset;
3830 /* Number of hard registers involved in the subreg. In the case of
3831 a paradoxical subreg, this is the number of registers that would
3832 be modified by writing to the subreg; some of them may be don't-care
3833 when reading from the subreg. */
3834 int nregs;
3835 /* Whether this subreg can be represented as a hard reg with the new
3836 mode (by adding OFFSET to the original hard register). */
3837 bool representable_p;
3838};
3839
3840extern void subreg_get_info (unsigned int, machine_mode,
3841 poly_uint64, machine_mode,
3842 struct subreg_info *);
3843
3844/* lists.cc */
3845
3846extern void free_EXPR_LIST_list (rtx_expr_list **);
3847extern void free_INSN_LIST_list (rtx_insn_list **);
3848extern void free_EXPR_LIST_node (rtx);
3849extern void free_INSN_LIST_node (rtx);
3853extern rtx_expr_list *alloc_EXPR_LIST (int, rtx, rtx);
3855extern rtx remove_list_elem (rtx, rtx *);
3858
3859
3860/* reginfo.cc */
3861
3862/* Resize reg info. */
3863extern bool resize_reg_info (void);
3864/* Free up register info memory. */
3865extern void free_reg_info (void);
3866extern void init_subregs_of_mode (void);
3867extern void finish_subregs_of_mode (void);
3868extern void reginfo_cc_finalize (void);
3869
3870/* recog.cc */
3872extern int asm_noperands (const_rtx);
3873extern const char *decode_asm_operands (rtx, rtx *, rtx **, const char **,
3874 machine_mode *, location_t *);
3875extern void get_referenced_operands (const char *, bool *, unsigned int);
3876
3877extern enum reg_class reg_preferred_class (int);
3878extern enum reg_class reg_alternate_class (int);
3879extern enum reg_class reg_allocno_class (int);
3880extern void setup_reg_classes (int, enum reg_class, enum reg_class,
3881 enum reg_class);
3882
3883extern void split_all_insns (void);
3884extern void split_all_insns_noflow (void);
3885
3886#define MAX_SAVED_CONST_INT 64
3889#define const0_rtx (const_int_rtx[MAX_SAVED_CONST_INT])
3890#define const1_rtx (const_int_rtx[MAX_SAVED_CONST_INT+1])
3891#define const2_rtx (const_int_rtx[MAX_SAVED_CONST_INT+2])
3892#define constm1_rtx (const_int_rtx[MAX_SAVED_CONST_INT-1])
3893extern GTY(()) rtx const_true_rtx;
3894
3895extern GTY(()) rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE];
3896
3897/* Returns a constant 0 rtx in mode MODE. Integer modes are treated the
3898 same as VOIDmode. */
3899
3900#define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
3901
3902/* Likewise, for the constants 1 and 2 and -1. */
3904#define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
3905#define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
3906#define CONSTM1_RTX(MODE) (const_tiny_rtx[3][(int) (MODE)])
3907
3908extern GTY(()) rtx pc_rtx;
3909extern GTY(()) rtx ret_rtx;
3910extern GTY(()) rtx simple_return_rtx;
3911extern GTY(()) rtx_insn *invalid_insn_rtx;
3912
3913/* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
3914 is used to represent the frame pointer. This is because the
3915 hard frame pointer and the automatic variables are separated by an amount
3916 that cannot be determined until after register allocation. We can assume
3917 that in this case ELIMINABLE_REGS will be defined, one action of which
3918 will be to eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM. */
3919#ifndef HARD_FRAME_POINTER_REGNUM
3920#define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM
3921#endif
3923#ifndef HARD_FRAME_POINTER_IS_FRAME_POINTER
3924#define HARD_FRAME_POINTER_IS_FRAME_POINTER \
3925 (HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM)
3926#endif
3928#ifndef HARD_FRAME_POINTER_IS_ARG_POINTER
3929#define HARD_FRAME_POINTER_IS_ARG_POINTER \
3930 (HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM)
3931#endif
3933/* Index labels for global_rtl. */
3938/* For register elimination to work properly these hard_frame_pointer_rtx,
3939 frame_pointer_rtx, and arg_pointer_rtx must be the same if they refer to
3940 the same register. */
3941#if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
3943#endif
3944#if HARD_FRAME_POINTER_IS_FRAME_POINTER
3946#else
3948#endif
3949#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
3950#if HARD_FRAME_POINTER_IS_ARG_POINTER
3952#else
3954#endif
3955#endif
3962
3963 GR_MAX
3964};
3966/* Target-dependent globals. */
3967struct GTY(()) target_rtl {
3968 /* All references to the hard registers in global_rtl_index go through
3969 these unique rtl objects. On machines where the frame-pointer and
3970 arg-pointer are the same register, they use the same unique object.
3971
3972 After register allocation, other rtl objects which used to be pseudo-regs
3973 may be clobbered to refer to the frame-pointer register.
3974 But references that were originally to the frame-pointer can be
3975 distinguished from the others because they contain frame_pointer_rtx.
3976
3977 When to use frame_pointer_rtx and hard_frame_pointer_rtx is a little
3978 tricky: until register elimination has taken place hard_frame_pointer_rtx
3979 should be used if it is being set, and frame_pointer_rtx otherwise. After
3980 register elimination hard_frame_pointer_rtx should always be used.
3981 On machines where the two registers are same (most) then these are the
3982 same. */
3985 /* A unique representation of (REG:Pmode PIC_OFFSET_TABLE_REGNUM). */
3987
3988 /* A unique representation of (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM).
3989 This is used to implement __builtin_return_address for some machines;
3990 see for instance the MIPS port. */
3992
3993 /* Commonly used RTL for hard registers. These objects are not
3994 necessarily unique, so we allocate them separately from global_rtl.
3995 They are initialized once per compilation unit, then copied into
3996 regno_reg_rtx at the beginning of each function. */
3997 rtx x_initial_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
3999 /* A sample (mem:M stack_pointer_rtx) rtx for each mode M. */
4000 rtx x_top_of_stack[MAX_MACHINE_MODE];
4001
4002 /* Static hunks of RTL used by the aliasing code; these are treated
4003 as persistent to avoid unnecessary RTL allocations. */
4004 rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER];
4006 /* The default memory attributes for each mode. */
4007 class mem_attrs *x_mode_mem_attrs[(int) MAX_MACHINE_MODE];
4009 /* Track if RTL has been initialized. */
4011};
4012
4013extern GTY(()) struct target_rtl default_target_rtl;
4014#if SWITCHABLE_TARGET
4016#else
4017#define this_target_rtl (&default_target_rtl)
4018#endif
4019
4020#define global_rtl \
4021 (this_target_rtl->x_global_rtl)
4022#define pic_offset_table_rtx \
4023 (this_target_rtl->x_pic_offset_table_rtx)
4024#define return_address_pointer_rtx \
4025 (this_target_rtl->x_return_address_pointer_rtx)
4026#define top_of_stack \
4027 (this_target_rtl->x_top_of_stack)
4028#define mode_mem_attrs \
4029 (this_target_rtl->x_mode_mem_attrs)
4030
4031/* All references to certain hard regs, except those created
4032 by allocating pseudo regs into them (when that's possible),
4033 go through these unique rtx objects. */
4034#define stack_pointer_rtx (global_rtl[GR_STACK_POINTER])
4035#define frame_pointer_rtx (global_rtl[GR_FRAME_POINTER])
4036#define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
4037#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
4038
4039#ifndef GENERATOR_FILE
4040/* Return the attributes of a MEM rtx. */
4041inline const class mem_attrs *
4043{
4044 class mem_attrs *attrs;
4045
4046 attrs = MEM_ATTRS (x);
4047 if (!attrs)
4048 attrs = mode_mem_attrs[(int) GET_MODE (x)];
4049 return attrs;
4050}
4051#endif
4052
4053/* Include the RTL generation functions. */
4054
4055#ifndef GENERATOR_FILE
4056#include "genrtl.h"
4057#undef gen_rtx_ASM_INPUT
4058#define gen_rtx_ASM_INPUT(MODE, ARG0) \
4059 gen_rtx_fmt_sL (ASM_INPUT, (MODE), (ARG0), 0)
4060#define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC) \
4061 gen_rtx_fmt_sL (ASM_INPUT, (MODE), (ARG0), (LOC))
4062#endif
4063
4064/* There are some RTL codes that require special attention; the
4065 generation functions included above do the raw handling. If you
4066 add to this list, modify special_rtx in gengenrtl.cc as well. */
4067
4068extern rtx_expr_list *gen_rtx_EXPR_LIST (machine_mode, rtx, rtx);
4069extern rtx_insn_list *gen_rtx_INSN_LIST (machine_mode, rtx, rtx);
4070extern rtx_insn *
4071gen_rtx_INSN (machine_mode mode, rtx_insn *prev_insn, rtx_insn *next_insn,
4072 basic_block bb, rtx pattern, location_t location, int code,
4073 rtx reg_notes);
4074extern rtx gen_rtx_CONST_INT (machine_mode, HOST_WIDE_INT);
4075extern rtx gen_rtx_CONST_VECTOR (machine_mode, rtvec);
4076extern void set_mode_and_regno (rtx, machine_mode, unsigned int);
4077extern rtx init_raw_REG (rtx, machine_mode, unsigned int);
4078extern rtx gen_raw_REG (machine_mode, unsigned int);
4079#define alloca_raw_REG(mode, regno) \
4080 init_raw_REG (rtx_alloca (REG), (mode), (regno))
4081extern rtx gen_rtx_REG (machine_mode, unsigned int);
4082extern rtx gen_rtx_SUBREG (machine_mode, rtx, poly_uint64);
4083extern rtx gen_rtx_MEM (machine_mode, rtx);
4084extern rtx gen_rtx_VAR_LOCATION (machine_mode, tree, rtx,
4085 enum var_init_status);
4086
4087#ifdef GENERATOR_FILE
4088#define PUT_MODE(RTX, MODE) PUT_MODE_RAW (RTX, MODE)
4089#else
4090inline void
4091PUT_MODE (rtx x, machine_mode mode)
4092{
4093 if (REG_P (x))
4094 set_mode_and_regno (x, mode, REGNO (x));
4095 else
4096 PUT_MODE_RAW (x, mode);
4097}
4098#endif
4099
4100#define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (N))
4101
4102/* Virtual registers are used during RTL generation to refer to locations into
4103 the stack frame when the actual location isn't known until RTL generation
4104 is complete. The routine instantiate_virtual_regs replaces these with
4105 the proper value, which is normally {frame,arg,stack}_pointer_rtx plus
4106 a constant. */
4107
4108#define FIRST_VIRTUAL_REGISTER (FIRST_PSEUDO_REGISTER)
4109
4110/* This points to the first word of the incoming arguments passed on the stack,
4111 either by the caller or by the callee when pretending it was passed by the
4112 caller. */
4113
4114#define virtual_incoming_args_rtx (global_rtl[GR_VIRTUAL_INCOMING_ARGS])
4115
4116#define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
4117
4118/* If FRAME_GROWS_DOWNWARD, this points to immediately above the first
4119 variable on the stack. Otherwise, it points to the first variable on
4120 the stack. */
4121
4122#define virtual_stack_vars_rtx (global_rtl[GR_VIRTUAL_STACK_ARGS])
4123
4124#define VIRTUAL_STACK_VARS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 1)
4125
4126/* This points to the location of dynamically-allocated memory on the stack
4127 immediately after the stack pointer has been adjusted by the amount
4128 desired. */
4129
4130#define virtual_stack_dynamic_rtx (global_rtl[GR_VIRTUAL_STACK_DYNAMIC])
4131
4132#define VIRTUAL_STACK_DYNAMIC_REGNUM ((FIRST_VIRTUAL_REGISTER) + 2)
4133
4134/* This points to the location in the stack at which outgoing arguments should
4135 be written when the stack is pre-pushed (arguments pushed using push
4136 insns always use sp). */
4137
4138#define virtual_outgoing_args_rtx (global_rtl[GR_VIRTUAL_OUTGOING_ARGS])
4139
4140#define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
4141
4142/* This points to the Canonical Frame Address of the function. This
4143 should correspond to the CFA produced by INCOMING_FRAME_SP_OFFSET,
4144 but is calculated relative to the arg pointer for simplicity; the
4145 frame pointer nor stack pointer are necessarily fixed relative to
4146 the CFA until after reload. */
4147
4148#define virtual_cfa_rtx (global_rtl[GR_VIRTUAL_CFA])
4149
4150#define VIRTUAL_CFA_REGNUM ((FIRST_VIRTUAL_REGISTER) + 4)
4151
4152#define LAST_VIRTUAL_POINTER_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
4153
4154/* This is replaced by crtl->preferred_stack_boundary / BITS_PER_UNIT
4155 when finalized. */
4156
4157#define virtual_preferred_stack_boundary_rtx \
4158 (global_rtl[GR_VIRTUAL_PREFERRED_STACK_BOUNDARY])
4159
4160#define VIRTUAL_PREFERRED_STACK_BOUNDARY_REGNUM \
4161 ((FIRST_VIRTUAL_REGISTER) + 5)
4162
4163#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 5)
4165/* Nonzero if REGNUM is a pointer into the stack frame. */
4166#define REGNO_PTR_FRAME_P(REGNUM) \
4167 ((REGNUM) == STACK_POINTER_REGNUM \
4168 || (REGNUM) == FRAME_POINTER_REGNUM \
4169 || (REGNUM) == HARD_FRAME_POINTER_REGNUM \
4170 || (REGNUM) == ARG_POINTER_REGNUM \
4171 || VIRTUAL_REGISTER_NUM_P (REGNUM))
4173/* REGNUM never really appearing in the INSN stream. */
4174#define INVALID_REGNUM (~(unsigned int) 0)
4176/* REGNUM for which no debug information can be generated. */
4177#define IGNORED_DWARF_REGNUM (INVALID_REGNUM - 1)
4178
4179extern rtx output_constant_def (tree, int);
4181
4182/* Nonzero after end of reload pass.
4183 Set to 1 or 0 by reload1.cc. */
4184
4185extern int reload_completed;
4186
4187/* Nonzero after thread_prologue_and_epilogue_insns has run. */
4188extern int epilogue_completed;
4189
4190/* Set to true once the first split pass after register allocation has
4191 been run. Ports can treat that split pass as a "lowering" pass,
4192 with some instructions only being valid before the lowering
4193 and others only being valid after the lowering.
4194
4195 One use of this variable is to cope with address calculations during
4196 register allocation. The register allocator needs to be able to perform
4197 address arithmetic (such as addition) at arbitrary points in the program,
4198 regardless of whether the condition-code flags are live at that point.
4199 If a target cannot add without clobbering the condition-code flags,
4200 it must either (1) hide the condition-code flags entirely from RTL
4201 or (2) ensure that the condition-code flags are never live before
4202 or during register allocation.
4203
4204 (2) requires a boundary between "the condition-code flags are never live"
4205 and "the condition-code flags might be live". reload_completed can be
4206 used for this purpose, provided that all clobbers of the CC register
4207 are explicit before and during register allocation.
4208
4209 However, if the condition-code flags are never live before or during
4210 register allocation, there is no real need for patterns to have an explicit
4211 clobber of the flags at that point. Not having a clobber would allow more
4212 recog attempts to succeed, both before and during register allocation.
4213
4214 post_ra_split_completed is an alternative boundary to reload_completed.
4215 It allows sets and uses of the condition-code flags, such as individual
4216 comparison and jump instructions, to be introduced in the first split pass
4217 after register allocation, while also allowing new implicit clobbers of
4218 the condition-code flags to be introduced at any time before that point.
4219
4220 Ports that use post_ra_split_completed for this purpose would have an
4221 "unlowered" form with the following properties:
4222
4223 (a) The condition-code flags are never live between instructions.
4224 (That is, they are never defined by one instruction and used
4225 by another instruction.)
4226
4227 (b) As a consequence, new clobbers of the condition-code flags
4228 can be introduced at any time.
4229
4230 (c) RTL instruction patterns (such as addition) can omit clobbers of the
4231 condition-code flags even if the flags are in fact clobbered.
4232
4233 In contrast, the "lowered" form would have these properties:
4234
4235 (d) The condition-code flags can be live between instructions.
4236 That is, RTL instruction patterns can set the condition-code flags
4237 or use the condition-code flags.
4238
4239 (e) All clobbers of the condition-code flags must be explicit in the RTL
4240 instruction patterns.
4241
4242 Instructions covered by (c) would require !post_ra_split_completed
4243 and would need to be split into instructions that satisfy (d) or (e).
4244 Instructions covered by (d) would require post_ra_split_completed,
4245 so that they are not accidentally matched before lowering has taken
4246 place. */
4247extern bool post_ra_split_completed;
4248
4249/* Set to 1 while reload_as_needed is operating.
4250 Required by some machines to handle any generated moves differently. */
4251
4252extern int reload_in_progress;
4253
4254/* Set to true while in IRA. */
4255extern bool ira_in_progress;
4256
4257/* Set to true while in LRA. */
4258extern bool lra_in_progress;
4259
4260/* This macro indicates whether you may create a new
4261 pseudo-register. */
4262
4263#define can_create_pseudo_p() (!reload_in_progress && !reload_completed)
4264
4265#ifdef STACK_REGS
4266/* Nonzero after end of regstack pass.
4267 Set to 1 or 0 by reg-stack.cc. */
4268extern int regstack_completed;
4269#endif
4270
4271/* If this is nonzero, we do not bother generating VOLATILE
4272 around volatile memory references, and we are willing to
4273 output indirect addresses. If cse is to follow, we reject
4274 indirect addresses so a useful potential cse is generated;
4275 if it is used only once, instruction combination will produce
4276 the same indirect address eventually. */
4277extern int cse_not_expected;
4278
4279/* Translates rtx code to tree code, for those codes needed by
4280 real_arithmetic. The function returns an int because the caller may not
4281 know what `enum tree_code' means. */
4282
4283extern int rtx_to_tree_code (enum rtx_code);
4284
4285/* In cse.cc */
4286extern int delete_trivially_dead_insns (rtx_insn *, int);
4287extern bool exp_equiv_p (const_rtx, const_rtx, int, bool);
4288
4289typedef bool (*hash_rtx_callback_function) (const_rtx, machine_mode, rtx *,
4290 machine_mode *);
4291extern unsigned hash_rtx (const_rtx, machine_mode, int *, int *,
4293
4294/* In dse.cc */
4295extern bool check_for_inc_dec (rtx_insn *insn);
4296
4297/* In jump.cc */
4298extern bool comparison_dominates_p (enum rtx_code, enum rtx_code);
4299extern bool jump_to_label_p (const rtx_insn *);
4300extern bool condjump_p (const rtx_insn *);
4301extern bool any_condjump_p (const rtx_insn *);
4302extern bool any_uncondjump_p (const rtx_insn *);
4303extern rtx pc_set (const rtx_insn *);
4304extern rtx condjump_label (const rtx_insn *);
4305extern bool simplejump_p (const rtx_insn *);
4306extern bool returnjump_p (const rtx_insn *);
4307extern bool eh_returnjump_p (rtx_insn *);
4308extern bool onlyjump_p (const rtx_insn *);
4309extern bool invert_jump_1 (rtx_jump_insn *, rtx);
4310extern bool invert_jump (rtx_jump_insn *, rtx, int);
4312extern int true_regnum (const_rtx);
4313extern unsigned int reg_or_subregno (const_rtx);
4314extern bool redirect_jump_1 (rtx_insn *, rtx);
4315extern void redirect_jump_2 (rtx_jump_insn *, rtx, rtx, int, int);
4316extern bool redirect_jump (rtx_jump_insn *, rtx, int);
4317extern void rebuild_jump_labels (rtx_insn *);
4318extern void rebuild_jump_labels_chain (rtx_insn *);
4319extern rtx reversed_comparison (const_rtx, machine_mode);
4322 const_rtx, const rtx_insn *);
4323extern void delete_for_peephole (rtx_insn *, rtx_insn *);
4324extern bool condjump_in_parallel_p (const rtx_insn *);
4325
4326/* In emit-rtl.cc. */
4327extern int max_reg_num (void);
4328extern int max_label_num (void);
4329extern int get_first_label_num (void);
4331extern void delete_insns_since (rtx_insn *);
4332extern void mark_reg_pointer (rtx, int);
4333extern void mark_user_reg (rtx);
4334extern void reset_used_flags (rtx);
4335extern void set_used_flags (rtx);
4336extern void reorder_insns (rtx_insn *, rtx_insn *, rtx_insn *);
4337extern void reorder_insns_nobb (rtx_insn *, rtx_insn *, rtx_insn *);
4338extern int get_max_insn_count (void);
4339extern bool in_sequence_p (void);
4340extern void init_emit (void);
4341extern void init_emit_regs (void);
4342extern void init_derived_machine_modes (void);
4343extern void init_emit_once (void);
4344extern void push_topmost_sequence (void);
4345extern void pop_topmost_sequence (void);
4347extern void unshare_all_rtl (void);
4348extern void unshare_all_rtl_again (rtx_insn *);
4349extern void unshare_all_rtl_in_chain (rtx_insn *);
4350extern void verify_rtl_sharing (void);
4351extern void add_insn (rtx_insn *);
4352extern void add_insn_before (rtx_insn *, rtx_insn *, basic_block);
4353extern void add_insn_after (rtx_insn *, rtx_insn *, basic_block);
4354extern void remove_insn (rtx_insn *);
4355extern rtx_insn *emit (rtx, bool = true);
4356extern void emit_insn_at_entry (rtx);
4357extern rtx gen_lowpart_SUBREG (machine_mode, rtx);
4358extern rtx gen_const_mem (machine_mode, rtx);
4359extern rtx gen_frame_mem (machine_mode, rtx);
4360extern rtx gen_tmp_stack_mem (machine_mode, rtx);
4361extern bool validate_subreg (machine_mode, machine_mode,
4363
4364/* In combine.cc */
4365extern unsigned int extended_count (const_rtx, machine_mode, bool);
4366extern rtx remove_death (unsigned int, rtx_insn *);
4368
4369/* In sched-rgn.cc. */
4370extern void schedule_insns (void);
4372/* In sched-ebb.cc. */
4373extern void schedule_ebbs (void);
4375/* In sel-sched-dump.cc. */
4376extern void sel_sched_fix_param (const char *param, const char *val);
4377
4378/* In print-rtl.cc */
4379extern const char *print_rtx_head;
4380extern void debug (const rtx_def &ref);
4381extern void debug (const rtx_def *ptr);
4382extern void debug_rtx (const_rtx);
4383extern void debug_rtx_list (const rtx_insn *, int);
4384extern void debug_rtx_range (const rtx_insn *, const rtx_insn *);
4385extern const rtx_insn *debug_rtx_find (const rtx_insn *, int);
4386extern void print_mem_expr (FILE *, const_tree);
4387extern void print_rtl (FILE *, const_rtx);
4388extern void print_simple_rtl (FILE *, const_rtx);
4389extern void print_rtl_single (FILE *, const_rtx);
4390extern void print_rtl_single_with_indent (FILE *, const_rtx, int);
4391extern void print_inline_rtx (FILE *, const_rtx, int);
4392
4393/* In stmt.cc */
4394extern void expand_null_return (void);
4395extern void expand_naked_return (void);
4396extern void emit_jump (rtx);
4397
4398/* Memory operation built-ins differ by return value. Mapping
4399 of the enum values is following:
4400 - RETURN_BEGIN - return destination, e.g. memcpy
4401 - RETURN_END - return destination + n, e.g. mempcpy
4402 - RETURN_END_MINUS_ONE - return a pointer to the terminating
4403 null byte of the string, e.g. strcpy
4411};
4412
4413/* In expr.cc */
4414extern rtx move_by_pieces (rtx, rtx, unsigned HOST_WIDE_INT,
4415 unsigned int, memop_ret);
4418
4419/* In expmed.cc */
4420extern void init_expmed (void);
4421extern void expand_inc (rtx, rtx);
4422extern void expand_dec (rtx, rtx);
4423
4424/* In lower-subreg.cc */
4425extern void init_lower_subreg (void);
4426
4427/* In gcse.cc */
4428extern bool can_copy_p (machine_mode);
4429extern bool can_assign_to_reg_without_clobbers_p (rtx, machine_mode);
4431
4432/* In cprop.cc */
4433extern rtx fis_get_condition (rtx_insn *);
4434
4435/* In ira.cc */
4437extern void mark_elimination (int, int);
4438
4439/* In reginfo.cc */
4442extern void globalize_reg (tree, int);
4443extern void init_reg_modes_target (void);
4444extern void init_regs (void);
4445extern void reinit_regs (void);
4446extern void init_fake_stack_mems (void);
4447extern void save_register_info (void);
4448extern void init_reg_sets (void);
4449extern void regclass (rtx, int);
4450extern void reg_scan (rtx_insn *, unsigned int);
4451extern void fix_register (const char *, int, int);
4452extern const HARD_REG_SET *valid_mode_changes_for_regno (unsigned int);
4453
4454/* In reload1.cc */
4455extern bool function_invariant_p (const_rtx);
4457/* In calls.cc */
4464 LCT_THROW = 4,
4466};
4467
4469 machine_mode, int, rtx_mode_t *);
4470
4471/* Output a library call and discard the returned value. FUN is the
4472 address of the function, as a SYMBOL_REF rtx, and OUTMODE is the mode
4473 of the (discarded) return value. FN_TYPE is LCT_NORMAL for `normal'
4474 calls, LCT_CONST for `const' calls, LCT_PURE for `pure' calls, or
4475 another LCT_ value for other types of library calls.
4476
4477 There are different overloads of this function for different numbers
4478 of arguments. In each case the argument value is followed by its mode. */
4480inline void
4481emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode)
4482{
4483 emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 0, NULL);
4484}
4486inline void
4487emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
4488 rtx arg1, machine_mode arg1_mode)
4489{
4490 rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) };
4491 emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 1, args);
4492}
4494inline void
4495emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
4496 rtx arg1, machine_mode arg1_mode,
4497 rtx arg2, machine_mode arg2_mode)
4498{
4499 rtx_mode_t args[] = {
4500 rtx_mode_t (arg1, arg1_mode),
4501 rtx_mode_t (arg2, arg2_mode)
4502 };
4503 emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 2, args);
4504}
4506inline void
4507emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
4508 rtx arg1, machine_mode arg1_mode,
4509 rtx arg2, machine_mode arg2_mode,
4510 rtx arg3, machine_mode arg3_mode)
4511{
4512 rtx_mode_t args[] = {
4513 rtx_mode_t (arg1, arg1_mode),
4514 rtx_mode_t (arg2, arg2_mode),
4515 rtx_mode_t (arg3, arg3_mode)
4516 };
4517 emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 3, args);
4518}
4520inline void
4521emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
4522 rtx arg1, machine_mode arg1_mode,
4523 rtx arg2, machine_mode arg2_mode,
4524 rtx arg3, machine_mode arg3_mode,
4525 rtx arg4, machine_mode arg4_mode)
4526{
4527 rtx_mode_t args[] = {
4528 rtx_mode_t (arg1, arg1_mode),
4529 rtx_mode_t (arg2, arg2_mode),
4530 rtx_mode_t (arg3, arg3_mode),
4531 rtx_mode_t (arg4, arg4_mode)
4532 };
4533 emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 4, args);
4534}
4535
4536/* Like emit_library_call, but return the value produced by the call.
4537 Use VALUE to store the result if it is nonnull, otherwise pick a
4538 convenient location. */
4540inline rtx
4541emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
4542 machine_mode outmode)
4543{
4544 return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 0, NULL);
4545}
4547inline rtx
4548emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
4549 machine_mode outmode,
4550 rtx arg1, machine_mode arg1_mode)
4551{
4552 rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) };
4553 return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 1, args);
4554}
4556inline rtx
4557emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
4558 machine_mode outmode,
4559 rtx arg1, machine_mode arg1_mode,
4560 rtx arg2, machine_mode arg2_mode)
4561{
4562 rtx_mode_t args[] = {
4563 rtx_mode_t (arg1, arg1_mode),
4564 rtx_mode_t (arg2, arg2_mode)
4565 };
4566 return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 2, args);
4567}
4569inline rtx
4570emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
4571 machine_mode outmode,
4572 rtx arg1, machine_mode arg1_mode,
4573 rtx arg2, machine_mode arg2_mode,
4574 rtx arg3, machine_mode arg3_mode)
4575{
4576 rtx_mode_t args[] = {
4577 rtx_mode_t (arg1, arg1_mode),
4578 rtx_mode_t (arg2, arg2_mode),
4579 rtx_mode_t (arg3, arg3_mode)
4580 };
4581 return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 3, args);
4582}
4584inline rtx
4585emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
4586 machine_mode outmode,
4587 rtx arg1, machine_mode arg1_mode,
4588 rtx arg2, machine_mode arg2_mode,
4589 rtx arg3, machine_mode arg3_mode,
4590 rtx arg4, machine_mode arg4_mode)
4591{
4592 rtx_mode_t args[] = {
4593 rtx_mode_t (arg1, arg1_mode),
4594 rtx_mode_t (arg2, arg2_mode),
4595 rtx_mode_t (arg3, arg3_mode),
4596 rtx_mode_t (arg4, arg4_mode)
4597 };
4598 return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 4, args);
4599}
4600
4601/* In varasm.cc */
4602extern void init_varasm_once (void);
4603
4605
4606/* In read-rtl.cc */
4607#ifdef GENERATOR_FILE
4608extern bool read_rtx (const char *, vec<rtx> *);
4609#endif
4610
4611/* In alias.cc */
4612extern rtx canon_rtx (rtx);
4613extern rtx get_addr (rtx);
4614extern bool read_dependence (const_rtx, const_rtx);
4615extern bool true_dependence (const_rtx, machine_mode, const_rtx);
4616extern bool canon_true_dependence (const_rtx, machine_mode, rtx,
4617 const_rtx, rtx);
4618extern bool anti_dependence (const_rtx, const_rtx);
4619extern bool canon_anti_dependence (const_rtx, bool,
4620 const_rtx, machine_mode, rtx);
4622extern bool canon_output_dependence (const_rtx, bool,
4623 const_rtx, machine_mode, rtx);
4624extern bool may_alias_p (const_rtx, const_rtx);
4625extern void init_alias_target (void);
4626extern void init_alias_analysis (void);
4627extern void end_alias_analysis (void);
4630extern bool may_be_sp_based_p (rtx);
4631extern rtx gen_hard_reg_clobber (machine_mode, unsigned int);
4632extern rtx get_reg_known_value (unsigned int);
4633extern bool get_reg_known_equiv_p (unsigned int);
4634extern rtx get_reg_base_value (unsigned int);
4636
4637#ifdef STACK_REGS
4638extern bool stack_regs_mentioned (const_rtx insn);
4639#endif
4640
4641/* In toplev.cc */
4642extern GTY(()) rtx stack_limit_rtx;
4643
4644/* In var-tracking.cc */
4645extern unsigned int variable_tracking_main (void);
4646extern void delete_vta_debug_insns (bool);
4647
4648/* In stor-layout.cc. */
4649extern void get_mode_bounds (scalar_int_mode, int,
4650 scalar_int_mode, rtx *, rtx *);
4651
4652/* In loop-iv.cc */
4653extern rtx canon_condition (rtx);
4654extern void simplify_using_condition (rtx, rtx *, bitmap);
4655
4656/* In final.cc */
4657extern void compute_alignments (void);
4658extern void update_alignments (vec<rtx> &);
4659extern int asm_str_count (const char *templ);
4661␌
4664 rtx (*gen_lowpart) (machine_mode, rtx);
4665 rtx (*gen_lowpart_no_emit) (machine_mode, rtx);
4667 unsigned HOST_WIDE_INT *);
4669 unsigned int *);
4670 bool (*reg_truncated_to_mode) (machine_mode, const_rtx);
4671
4672 /* Whenever you add entries here, make sure you adjust rtlhooks-def.h. */
4673};
4674
4675/* Each pass can provide its own. */
4676extern struct rtl_hooks rtl_hooks;
4677
4678/* ... but then it has to restore these. */
4679extern const struct rtl_hooks general_rtl_hooks;
4681/* Keep this for the nonce. */
4682#define gen_lowpart rtl_hooks.gen_lowpart
4683
4684extern void insn_locations_init (void);
4685extern void insn_locations_finalize (void);
4686extern void set_curr_insn_location (location_t);
4687extern location_t curr_insn_location (void);
4688extern void set_insn_locations (rtx_insn *, location_t);
4689
4690/* rtl-error.cc */
4691extern void _fatal_insn_not_found (const_rtx, const char *, int, const char *)
4692 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
4693extern void _fatal_insn (const char *, const_rtx, const char *, int, const char *)
4694 ATTRIBUTE_NORETURN ATTRIBUTE_COLD;
4695
4696#define fatal_insn(msgid, insn) \
4697 _fatal_insn (msgid, insn, __FILE__, __LINE__, __FUNCTION__)
4698#define fatal_insn_not_found(insn) \
4699 _fatal_insn_not_found (insn, __FILE__, __LINE__, __FUNCTION__)
4700
4701/* reginfo.cc */
4702extern tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER];
4703
4704/* Information about the function that is propagated by the RTL backend.
4705 Available only for functions that has been already assembled. */
4707struct GTY(()) cgraph_rtl_info {
4709
4710 /* Which registers the function clobbers, either directly or by
4711 calling another function. */
4713};
4714
4715/* If loads from memories of mode MODE always sign or zero extend,
4716 return SIGN_EXTEND or ZERO_EXTEND as appropriate. Return UNKNOWN
4717 otherwise. */
4719inline rtx_code
4720load_extend_op (machine_mode mode)
4721{
4722 scalar_int_mode int_mode;
4723 if (is_a <scalar_int_mode> (mode, &int_mode)
4724 && GET_MODE_PRECISION (int_mode) < BITS_PER_WORD)
4725 return LOAD_EXTEND_OP (int_mode);
4726 return UNKNOWN;
4727}
4728
4729/* If X is a PLUS of a base and a constant offset, add the constant to *OFFSET
4730 and return the base. Return X otherwise. */
4732inline rtx
4734{
4735 if (GET_CODE (x) == PLUS)
4736 {
4737 poly_int64 suboffset;
4738 x = strip_offset (x, &suboffset);
4739 *offset = poly_uint64 (*offset) + suboffset;
4740 }
4741 return x;
4742}
4743
4744/* Return true if X is an operation that always operates on the full
4745 registers for WORD_REGISTER_OPERATIONS architectures. */
4747inline bool
4749{
4750 switch (GET_CODE (x))
4751 {
4752 case CONST_INT:
4753 case ROTATE:
4754 case ROTATERT:
4755 case SIGN_EXTRACT:
4756 case ZERO_EXTRACT:
4757 return false;
4758
4759 default:
4760 return true;
4761 }
4762}
4763
4764/* Holds an rtx comparison to simplify passing many parameters pertaining to a
4765 single comparison. */
4769 rtx op0, op1;
4770 machine_mode mode;
4771};
4773/* gtype-desc.cc. */
4774extern void gt_ggc_mx (rtx &);
4775extern void gt_pch_nx (rtx &);
4776extern void gt_pch_nx (rtx &, gt_pointer_operator, void *);
4777
4778#endif /* ! GCC_RTL_H */
bool may_alias_p(const_rtx mem, const_rtx x)
Definition alias.cc:3228
void end_alias_analysis(void)
Definition alias.cc:3562
rtx get_reg_known_value(unsigned int regno)
Definition alias.cc:1670
bool read_dependence(const_rtx mem, const_rtx x)
Definition alias.cc:2751
bool true_dependence(const_rtx mem, machine_mode mem_mode, const_rtx x)
Definition alias.cc:3068
rtx get_addr(rtx x)
Definition alias.cc:2290
void vt_equate_reg_base_value(const_rtx reg1, const_rtx reg2)
Definition alias.cc:3556
rtx canon_rtx(rtx x)
Definition alias.cc:1731
void init_alias_target(void)
Definition alias.cc:3281
bool output_dependence(const_rtx mem, const_rtx x)
Definition alias.cc:3202
bool canon_anti_dependence(const_rtx mem, bool mem_canonicalized, const_rtx x, machine_mode x_mode, rtx x_addr)
Definition alias.cc:3191
rtx get_reg_base_value(unsigned int regno)
Definition alias.cc:1662
bool memory_modified_in_insn_p(const_rtx mem, const_rtx insn)
Definition alias.cc:3335
void init_alias_analysis(void)
Definition alias.cc:3353
bool canon_true_dependence(const_rtx mem, machine_mode mem_mode, rtx mem_addr, const_rtx x, rtx x_addr)
Definition alias.cc:3081
bool may_be_sp_based_p(rtx x)
Definition alias.cc:2082
bool canon_output_dependence(const_rtx mem, bool mem_canonicalized, const_rtx x, machine_mode x_mode, rtx x_addr)
Definition alias.cc:3215
bool get_reg_known_equiv_p(unsigned int regno)
Definition alias.cc:1697
bool anti_dependence(const_rtx mem, const_rtx x)
Definition alias.cc:3178
void gt_pch_nx(bbitmap< N > *)
Definition bbitmap.h:226
void gt_ggc_mx(bbitmap< N > *)
Definition bbitmap.h:220
rtx emit_library_call_value_1(int retval, rtx orgfun, rtx value, enum libcall_type fn_type, machine_mode outmode, int nargs, rtx_mode_t *args)
Definition calls.cc:4201
void expand_null_return(void)
Definition cfgexpand.cc:4094
void emit_insn_at_entry(rtx insn)
Definition cfgrtl.cc:525
Definition varasm.cc:4000
Definition machmode.h:833
Definition rtl.h:153
poly_int64 offset
Definition rtl.h:164
unsigned char addrspace
Definition rtl.h:179
tree expr
Definition rtl.h:160
alias_set_type alias
Definition rtl.h:171
mem_attrs()
Definition emit-rtl.cc:1844
poly_int64 size
Definition rtl.h:168
bool offset_known_p
Definition rtl.h:182
bool size_known_p
Definition rtl.h:185
unsigned int align
Definition rtl.h:176
Definition poly-int.h:378
C coeffs[N]
Definition poly-int.h:433
Definition function-abi.h:35
Definition rtl.h:195
tree decl
Definition rtl.h:197
poly_int64 offset
Definition rtl.h:198
Definition machmode.h:437
Definition rtl.h:3505
rtx simplify_binary_operation_1(rtx_code, machine_mode, rtx, rtx, rtx, rtx)
Definition simplify-rtx.cc:3230
rtx simplify_binary_operation_series(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:2904
static const unsigned int max_assoc_count
Definition rtl.h:3540
unsigned int assoc_count
Definition rtl.h:3536
rtx simplify_shift_const_int(rtx_code, machine_mode, rtx, unsigned int)
rtx simplify_relational_operation_1(rtx_code, machine_mode, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:6733
rtx simplify_associative_operation(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:2440
rtx simplify_plus_minus(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:6345
rtx simplify_ior_with_common_term(machine_mode, rtx, rtx)
Definition simplify-rtx.cc:2781
rtx simplify_merge_mask(rtx, rtx, int)
Definition simplify-rtx.cc:7583
rtx simplify_gen_relational(rtx_code, machine_mode, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:387
rtx simplify_ternary_operation_1(rtx_code, machine_mode, machine_mode, rtx, rtx, rtx)
rtx simplify_gen_binary(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:176
unsigned int mem_depth
Definition rtl.h:3532
rtx simplify_relational_operation(rtx_code, machine_mode, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:6691
rtx simplify_gen_ternary(rtx_code, machine_mode, machine_mode, rtx, rtx, rtx)
Definition simplify-rtx.cc:369
rtx simplify_subreg(machine_mode, rtx, machine_mode, poly_uint64)
Definition simplify-rtx.cc:8671
rtx simplify_logical_relational_operation(rtx_code, machine_mode, rtx, rtx, bool=false)
Definition simplify-rtx.cc:2688
rtx simplify_unary_operation(rtx_code, machine_mode, rtx, machine_mode)
Definition simplify-rtx.cc:882
rtx simplify_truncation(machine_mode, rtx, machine_mode)
Definition simplify-rtx.cc:613
rtx simplify_distribute_over_subregs(rtx_code, machine_mode, rtx, rtx)
rtx simplify_distributive_operation(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:2941
rtx lowpart_subreg(machine_mode, rtx, machine_mode)
Definition simplify-rtx.cc:9109
rtx simplify_unary_operation_1(rtx_code, machine_mode, rtx)
Definition simplify-rtx.cc:927
rtx simplify_gen_vec_select(rtx, unsigned int)
Definition simplify-rtx.cc:9119
rtx simplify_gen_unary(rtx_code, machine_mode, rtx, machine_mode)
Definition simplify-rtx.cc:354
rtx simplify_ternary_operation(rtx_code, machine_mode, machine_mode, rtx, rtx, rtx)
Definition simplify-rtx.cc:7653
rtx simplify_binary_operation(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:2857
rtx simplify_byte_swapping_operation(rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:2409
rtx simplify_cond_clz_ctz(rtx, rtx_code, rtx, rtx)
Definition simplify-rtx.cc:7539
rtx simplify_gen_subreg(machine_mode, rtx, machine_mode, poly_uint64)
Definition simplify-rtx.cc:9081
Definition rtl.h:2159
poly_uint16 offset
Definition rtl.h:2167
machine_mode outer_mode
Definition rtl.h:2168
machine_mode inner_mode
Definition rtl.h:2166
bool operator!=(const subreg_shape &) const
Definition rtl.h:2187
subreg_shape(machine_mode, poly_uint16, machine_mode)
Definition rtl.h:2172
unsigned HOST_WIDE_INT unique_id() const
Definition rtl.h:2198
bool operator==(const subreg_shape &) const
Definition rtl.h:2179
Definition wide-int.h:1967
Definition wide-int.h:707
bool debug
Definition collect-utils.cc:34
rtx remove_death(unsigned int regno, rtx_insn *insn)
Definition combine.cc:14151
rtx make_compound_operation(rtx x, enum rtx_code in_code)
Definition combine.cc:8477
unsigned int extended_count(const_rtx x, machine_mode mode, bool unsignedp)
Definition combine.cc:10369
struct basic_block_def * basic_block
Definition coretypes.h:351
struct rtx_def * rtx
Definition coretypes.h:57
unsigned char addr_space_t
Definition coretypes.h:191
var_init_status
Definition coretypes.h:320
const struct rtvec_def * const_rtvec
Definition coretypes.h:92
const struct rtx_def * const_rtx
Definition coretypes.h:58
int reg_class_t
Definition coretypes.h:372
const union tree_node * const_tree
Definition coretypes.h:98
#define GTY(x)
Definition coretypes.h:41
class bitmap_head * bitmap
Definition coretypes.h:51
union tree_node * tree
Definition coretypes.h:97
int alias_set_type
Definition coretypes.h:345
void(*) gt_pointer_operator(void *, void *, void *)
Definition coretypes.h:469
struct rtvec_def * rtvec
Definition coretypes.h:91
rtx fis_get_condition(rtx_insn *jump)
Definition cprop.cc:1326
int delete_trivially_dead_insns(rtx_insn *insns, int nreg)
Definition cse.cc:7331
bool exp_equiv_p(const_rtx x, const_rtx y, int validate, bool for_gcse)
Definition cse.cc:2624
unsigned hash_rtx(const_rtx x, machine_mode mode, int *do_not_record_p, int *hash_arg_in_memory_p, bool have_reg_qty, hash_rtx_callback_function cb)
Definition cse.cc:2263
#define LOAD_EXTEND_OP(M)
Definition defaults.h:1246
#define BITS_PER_WORD
Definition defaults.h:484
void ATTRIBUTE_NORETURN
Definition diagnostic-core.h:76
bool check_for_inc_dec(rtx_insn *insn)
Definition dse.cc:872
void add_insn(rtx_insn *insn)
Definition emit-rtl.cc:4298
rtx gen_frame_mem(machine_mode mode, rtx addr)
Definition emit-rtl.cc:883
rtx_jump_insn * emit_jump_insn_before_noloc(rtx x, rtx_insn *before)
Definition emit-rtl.cc:4706
rtx gen_rtx_VAR_LOCATION(machine_mode mode, tree decl, rtx loc, enum var_init_status status)
Definition emit-rtl.cc:1067
rtx gen_highpart(machine_mode mode, rtx x)
Definition emit-rtl.cc:1649
rtx_jump_insn * emit_jump_insn_after_noloc(rtx x, rtx_insn *after)
Definition emit-rtl.cc:4856
void unshare_all_rtl(void)
Definition emit-rtl.cc:2982
rtx_insn * next_active_insn(rtx_insn *insn)
Definition emit-rtl.cc:3863
rtx_insn * complete_seq(const uint8_t *seq, rtx *operands)
Definition emit-rtl.cc:7091
rtx gen_rtx_SUBREG(machine_mode mode, rtx reg, poly_uint64 offset)
Definition emit-rtl.cc:1045
rtx make_safe_from(rtx x, rtx other)
Definition emit-rtl.cc:3462
rtx simple_return_rtx
Definition emit-rtl.cc:129
rtx gen_reg_rtx(machine_mode mode)
Definition emit-rtl.cc:1187
void add_insn_after(rtx_insn *insn, rtx_insn *after, basic_block bb)
Definition emit-rtl.cc:4365
int get_first_label_num(void)
Definition emit-rtl.cc:1534
rtx gen_rtx_REG(machine_mode mode, unsigned int regno)
Definition emit-rtl.cc:790
void insn_locations_finalize(void)
Definition emit-rtl.cc:6706
rtx_insn * emit_debug_insn_before(rtx pattern, rtx_insn *before)
Definition emit-rtl.cc:5192
wide_int const_vector_int_elt(const_rtx x, unsigned int i)
Definition emit-rtl.cc:6050
rtx_insn * gen_rtx_INSN(machine_mode mode, rtx_insn *prev_insn, rtx_insn *next_insn, basic_block bb, rtx pattern, location_t location, int code, rtx reg_notes)
Definition emit-rtl.cc:513
rtx const_vector_elt(const_rtx x, unsigned int i)
Definition emit-rtl.cc:6080
poly_uint64 subreg_size_lowpart_offset(poly_uint64 outer_bytes, poly_uint64 inner_bytes)
Definition emit-rtl.cc:1696
rtx_insn * emit_insn_before_setloc(rtx pattern, rtx_insn *before, location_t loc)
Definition emit-rtl.cc:5133
void reorder_insns(rtx_insn *from, rtx_insn *to, rtx_insn *after)
Definition emit-rtl.cc:4593
rtx gen_hard_reg_clobber(machine_mode mode, unsigned int regno)
Definition emit-rtl.cc:6679
rtx_insn * emit_call_insn(rtx x)
Definition emit-rtl.cc:5366
tree insn_scope(const rtx_insn *insn)
Definition emit-rtl.cc:6740
void set_curr_insn_location(location_t location)
Definition emit-rtl.cc:6714
void set_mode_and_regno(rtx x, machine_mode mode, unsigned int regno)
Definition emit-rtl.cc:462
rtx set_unique_reg_note(rtx insn, enum reg_note kind, rtx datum)
Definition emit-rtl.cc:5559
rtx_insn * emit_insn(rtx x)
Definition emit-rtl.cc:5204
poly_int64 byte_lowpart_offset(machine_mode outer_mode, machine_mode inner_mode)
Definition emit-rtl.cc:1147
rtx gen_reg_rtx_and_attrs(rtx x)
Definition emit-rtl.cc:1380
rtx init_raw_REG(rtx x, machine_mode mode, unsigned int regno)
Definition emit-rtl.cc:474
location_t curr_insn_location(void)
Definition emit-rtl.cc:6721
rtx_insn * try_split(rtx pat, rtx_insn *trial, int last)
Definition emit-rtl.cc:3943
rtx copy_rtx_if_shared(rtx orig)
Definition emit-rtl.cc:3233
rtx_code_label * gen_label_rtx(void)
Definition emit-rtl.cc:2874
int max_label_num(void)
Definition emit-rtl.cc:1526
poly_int64 subreg_memory_offset(machine_mode outer_mode, machine_mode inner_mode, poly_uint64 offset)
Definition emit-rtl.cc:1161
location_t epilogue_location
Definition emit-rtl.cc:6689
rtx_insn * next_nonnote_nondebug_insn_bb(rtx_insn *insn)
Definition emit-rtl.cc:3704
void pop_topmost_sequence(void)
Definition emit-rtl.cc:5736
bool active_insn_p(const rtx_insn *insn)
Definition emit-rtl.cc:3848
rtx_jump_table_data * emit_jump_table_data(rtx table)
Definition emit-rtl.cc:5415
rtx_insn * next_nonnote_nondebug_insn(rtx_insn *insn)
Definition emit-rtl.cc:3683
rtx_insn * emit_call_insn_before_setloc(rtx pattern, rtx_insn *before, location_t loc)
Definition emit-rtl.cc:5166
rtx_jump_insn * emit_jump_insn_after_setloc(rtx pattern, rtx_insn *after, location_t loc)
Definition emit-rtl.cc:5031
void set_used_flags(rtx x)
Definition emit-rtl.cc:3452
rtx gen_reg_rtx_offset(rtx reg, machine_mode mode, int offset)
Definition emit-rtl.cc:1305
rtx operand_subword(rtx op, poly_uint64 offset, int validate_address, machine_mode mode)
Definition emit-rtl.cc:1772
rtx_insn * emit_debug_insn(rtx x)
Definition emit-rtl.cc:5251
rtx_insn * gen_use(rtx x)
Definition emit-rtl.cc:5505
void remove_insn(rtx_insn *insn)
Definition emit-rtl.cc:4446
void init_derived_machine_modes(void)
Definition emit-rtl.cc:6326
rtx ret_rtx
Definition emit-rtl.cc:128
void set_insn_locations(rtx_insn *insn, location_t loc)
Definition emit-rtl.cc:6728
int get_max_insn_count(void)
Definition emit-rtl.cc:3564
rtx_jump_insn * emit_jump_insn_before_setloc(rtx pattern, rtx_insn *before, location_t loc)
Definition emit-rtl.cc:5148
rtx_barrier * emit_barrier_after(rtx_insn *after)
Definition emit-rtl.cc:4884
rtx_note * emit_note_before(enum insn_note subtype, rtx_insn *before)
Definition emit-rtl.cc:4955
rtx_insn * next_real_insn(rtx_insn *insn)
Definition emit-rtl.cc:3766
rtx_jump_insn * emit_jump_insn_before(rtx pattern, rtx_insn *before)
Definition emit-rtl.cc:5157
rtx set_dst_reg_note(rtx insn, enum reg_note kind, rtx datum, rtx dst)
Definition emit-rtl.cc:5612
bool in_sequence_p(void)
Definition emit-rtl.cc:5779
void add_insn_before(rtx_insn *insn, rtx_insn *before, basic_block bb)
Definition emit-rtl.cc:4393
rtx_insn * emit(rtx x, bool allow_barrier_p)
Definition emit-rtl.cc:5628
rtx set_for_reg_notes(rtx insn)
Definition emit-rtl.cc:5520
const char * insn_file(const rtx_insn *insn)
Definition emit-rtl.cc:6754
rtx pc_rtx
Definition emit-rtl.cc:127
void delete_insns_since(rtx_insn *from)
Definition emit-rtl.cc:4541
double_int rtx_to_double_int(const_rtx cst)
Definition emit-rtl.cc:615
void init_emit(void)
Definition emit-rtl.cc:5984
rtx_insn * emit_call_insn_before(rtx pattern, rtx_insn *before)
Definition emit-rtl.cc:5175
rtx_insn * emit_insn_after(rtx pattern, rtx_insn *after)
Definition emit-rtl.cc:5024
rtvec gen_rtvec_v(int n, rtx *argp)
Definition emit-rtl.cc:1104
rtx_insn * gen_clobber(rtx x)
Definition emit-rtl.cc:5478
rtx_insn * emit_call_insn_after_noloc(rtx x, rtx_insn *after)
Definition emit-rtl.cc:4866
rtx_insn * get_first_nonnote_insn(void)
Definition emit-rtl.cc:3512
rtx_insn * emit_insn_after_noloc(rtx x, rtx_insn *after, basic_block bb)
Definition emit-rtl.cc:4846
rtx_insn * next_nondebug_insn(rtx_insn *insn)
Definition emit-rtl.cc:3635
void push_topmost_sequence(void)
Definition emit-rtl.cc:5721
rtx_insn * prev_nonnote_insn(rtx_insn *insn)
Definition emit-rtl.cc:3651
rtx_insn * prev_nonnote_nondebug_insn(rtx_insn *insn)
Definition emit-rtl.cc:3726
rtx_insn * emit_debug_insn_after(rtx pattern, rtx_insn *after)
Definition emit-rtl.cc:5068
poly_uint64 subreg_size_highpart_offset(poly_uint64 outer_bytes, poly_uint64 inner_bytes)
Definition emit-rtl.cc:1715
rtx operand_subword_force(rtx op, poly_uint64 offset, machine_mode mode)
Definition emit-rtl.cc:1821
rtx_note * emit_note_after(enum insn_note subtype, rtx_insn *after)
Definition emit-rtl.cc:4939
rtx_insn * get_last_insn_anywhere(void)
Definition emit-rtl.cc:3499
rtx_insn * emit_clobber(rtx x)
Definition emit-rtl.cc:5464
rtx gen_lowpart_SUBREG(machine_mode mode, rtx reg)
Definition emit-rtl.cc:1055
void set_new_first_and_last_insn(rtx_insn *first, rtx_insn *last)
Definition emit-rtl.cc:2888
rtx_jump_insn * emit_jump_insn_after(rtx pattern, rtx_insn *after)
Definition emit-rtl.cc:5039
rtx_insn * get_last_nonnote_insn(void)
Definition emit-rtl.cc:3538
void set_insn_deleted(rtx_insn *insn)
Definition emit-rtl.cc:4421
void maybe_set_first_label_num(rtx_code_label *x)
Definition emit-rtl.cc:1544
rtx_barrier * emit_barrier_before(rtx_insn *before)
Definition emit-rtl.cc:4737
rtx_insn * prev_real_nondebug_insn(rtx_insn *insn)
Definition emit-rtl.cc:3819
rtx immed_double_const(HOST_WIDE_INT i0, HOST_WIDE_INT i1, machine_mode mode)
Definition emit-rtl.cc:705
rtx_insn * make_insn_raw(rtx pattern)
Definition emit-rtl.cc:4150
rtx immed_wide_int_const(const poly_wide_int_ref &c, machine_mode mode)
Definition emit-rtl.cc:745
bool validate_subreg(machine_mode omode, machine_mode imode, const_rtx reg, poly_uint64 offset)
Definition emit-rtl.cc:908
rtx_insn * next_nonnote_insn(rtx_insn *insn)
Definition emit-rtl.cc:3619
rtx gen_highpart_mode(machine_mode outermode, machine_mode innermode, rtx exp)
Definition emit-rtl.cc:1681
rtx const_true_rtx
Definition emit-rtl.cc:104
rtx_insn * prev_active_insn(rtx_insn *insn)
Definition emit-rtl.cc:3880
rtx_insn * emit_label_after(rtx_insn *label, rtx_insn *after)
Definition emit-rtl.cc:4897
rtx_insn * prev_nondebug_insn(rtx_insn *insn)
Definition emit-rtl.cc:3667
int insn_line(const rtx_insn *insn)
Definition emit-rtl.cc:6747
void unshare_all_rtl_in_chain(rtx_insn *insn)
Definition emit-rtl.cc:3190
rtx_barrier * emit_barrier(void)
Definition emit-rtl.cc:5430
rtx expand_rtx(const uint8_t *seq, rtx *operands)
Definition emit-rtl.cc:7081
DEBUG_FUNCTION void verify_rtl_sharing(void)
Definition emit-rtl.cc:3158
rtx_insn * emit_call_insn_after_setloc(rtx pattern, rtx_insn *after, location_t loc)
Definition emit-rtl.cc:5047
rtx gen_rtx_MEM(machine_mode mode, rtx addr)
Definition emit-rtl.cc:857
rtx_insn * end_sequence(void)
Definition emit-rtl.cc:5759
rtx_note * emit_note(enum insn_note kind)
Definition emit-rtl.cc:5454
rtx_insn * emit_likely_jump_insn(rtx x)
Definition emit-rtl.cc:5343
void start_sequence(void)
Definition emit-rtl.cc:5666
rtx gen_raw_REG(machine_mode mode, unsigned int regno)
Definition emit-rtl.cc:487
rtx_insn * previous_insn(rtx_insn *insn)
Definition emit-rtl.cc:3602
bool subreg_lowpart_p(const_rtx x)
Definition emit-rtl.cc:1734
rtx_insn * emit_call_insn_after(rtx pattern, rtx_insn *after)
Definition emit-rtl.cc:5054
rtx_insn * emit_insn_after_setloc(rtx pattern, rtx_insn *after, location_t loc)
Definition emit-rtl.cc:5017
void reset_used_flags(rtx x)
Definition emit-rtl.cc:3443
rtx_insn * emit_debug_insn_after_setloc(rtx pattern, rtx_insn *after, location_t loc)
Definition emit-rtl.cc:5061
rtx_insn_list * gen_rtx_INSN_LIST(machine_mode mode, rtx insn, rtx insn_list)
Definition emit-rtl.cc:506
rtx_insn * emit_debug_insn_before_noloc(rtx x, rtx_insn *before)
Definition emit-rtl.cc:4727
void mark_user_reg(rtx reg)
Definition emit-rtl.cc:1483
location_t prologue_location
Definition emit-rtl.cc:6688
int max_reg_num(void)
Definition emit-rtl.cc:1518
void push_to_sequence2(rtx_insn *first, rtx_insn *last)
Definition emit-rtl.cc:5709
rtx_insn * prev_real_insn(rtx_insn *insn)
Definition emit-rtl.cc:3783
void mark_reg_pointer(rtx reg, int align)
Definition emit-rtl.cc:1501
void init_emit_regs(void)
Definition emit-rtl.cc:6254
rtx gen_rtx_CONST_INT(machine_mode mode, HOST_WIDE_INT arg)
Definition emit-rtl.cc:524
rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE]
Definition emit-rtl.cc:102
void init_emit_once(void)
Definition emit-rtl.cc:6351
rtx gen_rtx_REG_offset(rtx reg, machine_mode mode, unsigned int regno, poly_int64 offset)
Definition emit-rtl.cc:1286
rtx_insn * prev_nonnote_nondebug_insn_bb(rtx_insn *insn)
Definition emit-rtl.cc:3743
expanded_location insn_location(const rtx_insn *insn)
Definition emit-rtl.cc:6761
void unshare_all_rtl_again(rtx_insn *insn)
Definition emit-rtl.cc:2952
rtx gen_const_mem(machine_mode mode, rtx addr)
Definition emit-rtl.cc:871
rtx_call_insn * last_call_insn(void)
Definition emit-rtl.cc:3835
void insn_locations_init(void)
Definition emit-rtl.cc:6698
rtx_code_label * emit_label_before(rtx_code_label *label, rtx_insn *before)
Definition emit-rtl.cc:4750
rtx_insn * emit_insn_before_noloc(rtx x, rtx_insn *before, basic_block bb)
Definition emit-rtl.cc:4697
rtx_insn * emit_unlikely_jump_insn(rtx x)
Definition emit-rtl.cc:5355
rtx gen_lowpart_common(machine_mode mode, rtx x)
Definition emit-rtl.cc:1575
void push_to_sequence(rtx_insn *first)
Definition emit-rtl.cc:5692
bool const_vec_series_p_1(const_rtx x, rtx *base_out, rtx *step_out)
Definition emit-rtl.cc:6146
rtx_code_label * emit_label(rtx uncast_label)
Definition emit-rtl.cc:5401
struct target_rtl default_target_rtl
Definition emit-rtl.cc:68
rtx_insn * emit_debug_insn_after_noloc(rtx x, rtx_insn *after)
Definition emit-rtl.cc:4875
rtx_insn * invalid_insn_rtx
Definition emit-rtl.cc:134
void reorder_insns_nobb(rtx_insn *from, rtx_insn *to, rtx_insn *after)
Definition emit-rtl.cc:4561
rtx gen_rtx_CONST_VECTOR(machine_mode mode, rtvec v)
Definition emit-rtl.cc:6235
rtx const_int_rtx[MAX_SAVED_CONST_INT *2+1]
Definition emit-rtl.cc:124
void note_split(const char *what)
Definition emit-rtl.cc:7103
rtx_insn * emit_debug_insn_before_setloc(rtx pattern, rtx_insn *before, location_t loc)
Definition emit-rtl.cc:5183
rtx_insn * emit_jump_insn(rtx x)
Definition emit-rtl.cc:5298
rtx_insn * emit_call_insn_before_noloc(rtx x, rtx_insn *before)
Definition emit-rtl.cc:4717
rtx_expr_list * gen_rtx_EXPR_LIST(machine_mode mode, rtx expr, rtx expr_list)
Definition emit-rtl.cc:499
rtx gen_tmp_stack_mem(machine_mode mode, rtx addr)
Definition emit-rtl.cc:895
rtx_insn * emit_insn_before(rtx pattern, rtx_insn *before)
Definition emit-rtl.cc:5141
rtx_insn * next_real_nondebug_insn(rtx uncast_insn)
Definition emit-rtl.cc:3800
rtx_note * emit_note_copy(rtx_note *orig)
Definition emit-rtl.cc:5441
void add_function_usage_to(rtx call_insn, rtx call_fusage)
Definition emit-rtl.cc:4517
rtx_insn * emit_use(rtx x)
Definition emit-rtl.cc:5491
rtx_insn * next_insn(rtx_insn *insn)
Definition emit-rtl.cc:3585
void copy_reg_eh_region_note_backward(rtx note_or_insn, rtx_insn *last, rtx first)
Definition except.cc:1795
bool can_throw_external(const_rtx insn)
Definition except.cc:1901
bool insn_nothrow_p(const_rtx insn)
Definition except.cc:1946
bool insn_could_throw_p(const_rtx insn)
Definition except.cc:1755
bool can_throw_internal(const_rtx insn)
Definition except.cc:1893
void copy_reg_eh_region_note_forward(rtx note_or_insn, rtx_insn *first, rtx last)
Definition except.cc:1771
bool can_nonlocal_goto(const rtx_insn *insn)
Definition except.cc:1974
rtx convert_memory_address_addr_space_1(scalar_int_mode to_mode, rtx x, addr_space_t as, bool in_const, bool no_emit)
Definition explow.cc:296
HOST_WIDE_INT get_stack_check_protect(void)
Definition explow.cc:1414
int rtx_to_tree_code(enum rtx_code code)
Definition explow.cc:2379
rtx convert_memory_address_addr_space(scalar_int_mode to_mode, rtx x, addr_space_t as)
Definition explow.cc:426
HOST_WIDE_INT trunc_int_for_mode(HOST_WIDE_INT c, machine_mode mode)
Definition explow.cc:52
rtx plus_constant(machine_mode mode, rtx x, poly_int64 c, bool inplace)
Definition explow.cc:95
void expand_inc(rtx target, rtx inc)
Definition expmed.cc:2548
void expand_dec(rtx target, rtx dec)
Definition expmed.cc:2560
void init_expmed(void)
Definition expmed.cc:259
int cse_not_expected
Definition expr.cc:79
poly_int64 find_args_size_adjust(rtx_insn *insn)
Definition expr.cc:4975
rtx move_by_pieces(rtx to, rtx from, unsigned HOST_WIDE_INT len, unsigned int align, memop_ret retmode)
Definition expr.cc:1673
poly_int64 fixup_args_size_notes(rtx_insn *prev, rtx_insn *last, poly_int64 end_args_size)
Definition expr.cc:5096
void update_alignments(vec< rtx > &label_pairs)
Definition final.cc:752
void compute_alignments(void)
Definition final.cc:607
rtx get_call_rtx_from(const rtx_insn *insn)
Definition final.cc:2099
int asm_str_count(const char *templ)
Definition final.cc:1394
int insn_discriminator(const rtx_insn *insn)
Definition final.cc:2967
bool operator==(const nowarn_spec_t &lhs, const nowarn_spec_t &rhs)
Definition gcc-diagnostic-spec.h:131
bool operator!=(const nowarn_spec_t &lhs, const nowarn_spec_t &rhs)
Definition gcc-diagnostic-spec.h:139
rtx_insn * prepare_copy_insn(rtx reg, rtx exp)
Definition gcse.cc:2076
bool can_copy_p(machine_mode mode)
Definition gcse.cc:581
bool can_assign_to_reg_without_clobbers_p(rtx x, machine_mode mode)
Definition gcse.cc:905
unsigned FIRST_CODE
Definition genemit.cc:60
#define NUM_RTX_CODE
Definition gengenrtl.cc:40
#define NUM_POLY_INT_COEFFS
Definition genmodes.cc:859
@ SET
Definition genmodes.cc:264
const char * get_insn_name(int code)
Definition gensupport.cc:3633
void schedule_insns(void)
Definition haifa-sched.cc:904
HARD_REG_ELT_TYPE HARD_REG_SET
Definition hard-reg-set.h:47
HOST_WIDE_INT sext_hwi(HOST_WIDE_INT src, unsigned int prec)
Definition hwint.h:313
#define HOST_BITS_PER_WIDE_INT
Definition hwint.h:53
#define LOCATION_LOCUS(LOC)
Definition input.h:138
#define UNKNOWN_LOCATION
Definition input.h:32
bool ira_in_progress
Definition ira.cc:5643
void mark_elimination(int from, int to)
Definition ira.cc:3032
HARD_REG_SET eliminable_regset
Definition ira.cc:428
bool is_a(U *p)
Definition is-a.h:230
T safe_as_a(U *p)
Definition is-a.h:264
T safe_dyn_cast(U *p)
Definition is-a.h:292
T as_a(U *p)
Definition is-a.h:253
void delete_for_peephole(rtx_insn *from, rtx_insn *to)
Definition jump.cc:1342
void redirect_jump_2(rtx_jump_insn *jump, rtx olabel, rtx nlabel, int delete_unused, int invert)
Definition jump.cc:1513
bool any_condjump_p(const rtx_insn *insn)
Definition jump.cc:899
enum rtx_code signed_condition(enum rtx_code code)
Definition jump.cc:663
enum rtx_code reverse_condition(enum rtx_code code)
Definition jump.cc:498
unsigned int reg_or_subregno(const_rtx reg)
Definition jump.cc:1896
void mark_jump_label(rtx x, rtx_insn *insn, int in_mem)
Definition jump.cc:1032
bool onlyjump_p(const rtx_insn *insn)
Definition jump.cc:988
rtx pc_set(const rtx_insn *insn)
Definition jump.cc:848
void rebuild_jump_labels(rtx_insn *f)
Definition jump.cc:96
bool condjump_in_parallel_p(const rtx_insn *insn)
Definition jump.cc:817
rtx condjump_label(const rtx_insn *insn)
Definition jump.cc:920
bool invert_jump_1(rtx_jump_insn *jump, rtx nlabel)
Definition jump.cc:1601
bool any_uncondjump_p(const rtx_insn *insn)
Definition jump.cc:879
rtx reversed_comparison(const_rtx exp, machine_mode mode)
Definition jump.cc:478
enum rtx_code reverse_condition_maybe_unordered(enum rtx_code code)
Definition jump.cc:545
enum rtx_code swap_condition(enum rtx_code code)
Definition jump.cc:587
bool eh_returnjump_p(rtx_insn *insn)
Definition jump.cc:972
rtx_insn * delete_related_insns(rtx uncast_insn)
Definition jump.cc:1212
bool redirect_jump(rtx_jump_insn *jump, rtx nlabel, int delete_unused)
Definition jump.cc:1481
bool simplejump_p(const rtx_insn *insn)
Definition jump.cc:774
bool redirect_jump_1(rtx_insn *jump, rtx nlabel)
Definition jump.cc:1446
bool returnjump_p(const rtx_insn *insn)
Definition jump.cc:941
enum rtx_code reversed_comparison_code_parts(enum rtx_code code, const_rtx arg0, const_rtx arg1, const rtx_insn *insn)
Definition jump.cc:355
bool invert_jump(rtx_jump_insn *jump, rtx nlabel, int delete_unused)
Definition jump.cc:1625
int true_regnum(const_rtx x)
Definition jump.cc:1865
bool rtx_renumbered_equal_p(const_rtx x, const_rtx y)
Definition jump.cc:1645
void rebuild_jump_labels_chain(rtx_insn *chain)
Definition jump.cc:105
enum rtx_code reversed_comparison_code(const_rtx comparison, const rtx_insn *insn)
Definition jump.cc:466
enum rtx_code unsigned_condition(enum rtx_code code)
Definition jump.cc:634
bool jump_to_label_p(const rtx_insn *insn)
Definition jump.cc:1009
bool condjump_p(const rtx_insn *insn)
Definition jump.cc:789
bool comparison_dominates_p(enum rtx_code code1, enum rtx_code code2)
Definition jump.cc:693
rtx_expr_list * alloc_EXPR_LIST(int kind, rtx val, rtx next)
Definition lists.cc:127
rtx_insn * remove_free_INSN_LIST_node(rtx_insn_list **listp)
Definition lists.cc:221
rtx_insn_list * copy_INSN_LIST(rtx_insn_list *link)
Definition lists.cc:165
void free_EXPR_LIST_list(rtx_expr_list **listp)
Definition lists.cc:147
void free_INSN_LIST_list(rtx_insn_list **listp)
Definition lists.cc:156
rtx remove_list_elem(rtx elem, rtx *listp)
Definition lists.cc:89
void remove_free_INSN_LIST_elem(rtx_insn *elem, rtx_insn_list **listp)
Definition lists.cc:214
void free_INSN_LIST_node(rtx ptr)
Definition lists.cc:204
void free_EXPR_LIST_node(rtx ptr)
Definition lists.cc:196
rtx_insn_list * concat_INSN_LIST(rtx_insn_list *copy, rtx_insn_list *old)
Definition lists.cc:183
rtx_insn_list * alloc_INSN_LIST(rtx val, rtx next)
Definition lists.cc:103
rtx remove_free_EXPR_LIST_node(rtx_expr_list **listp)
Definition lists.cc:234
void simplify_using_condition(rtx cond, rtx *expr, regset altered)
Definition loop-iv.cc:1723
rtx canon_condition(rtx cond)
Definition loop-iv.cc:1631
void init_lower_subreg(void)
Definition lower-subreg.cc:282
rtx extract_mem_from_operand(rtx op)
Definition lra-constraints.cc:451
bool lra_in_progress
Definition lra.cc:2342
#define VECTOR_MODE_P(MODE)
Definition machmode.h:128
ALWAYS_INLINE poly_uint16 GET_MODE_SIZE(machine_mode mode)
Definition machmode.h:657
ALWAYS_INLINE poly_uint16 GET_MODE_PRECISION(machine_mode mode)
Definition machmode.h:710
#define MACHINE_MODE_BITSIZE
Definition machmode.h:258
Definition double-int.h:439
poly_int< NUM_POLY_INT_COEFFS, generic_wide_int< wide_int_ref_storage< false, false > > > rtx_to_poly_wide_ref
Definition rtl.h:2396
@ VAR_PRECISION
Definition wide-int.h:394
wide_int min_value(machine_mode, signop)
Definition rtl.h:2379
UNARY_PREDICATE fits_shwi_p(const T &)
rtx_to_poly_wide_ref to_poly_wide(const_rtx, machine_mode)
Definition rtl.h:2424
Ca unsigned int precision
Definition poly-int.h:746
wide_int max_value(machine_mode, signop)
Definition rtl.h:2387
poly_int< N, hwi_with_prec > shwi(const poly_int< N, HOST_WIDE_INT > &a, unsigned int precision)
Definition poly-int.h:721
poly_int< NUM_POLY_INT_COEFFS, unsigned short > poly_uint16
Definition poly-int-types.h:23
poly_int< NUM_POLY_INT_COEFFS, unsigned HOST_WIDE_INT > poly_uint64
Definition poly-int-types.h:25
poly_int< NUM_POLY_INT_COEFFS, wide_int_ref > poly_wide_int_ref
Definition poly-int-types.h:28
poly_int< NUM_POLY_INT_COEFFS, HOST_WIDE_INT > poly_int64
Definition poly-int-types.h:24
#define known_eq(A, B)
i
Definition poly-int.h:776
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
#define maybe_gt(A, B)
Ca & a
Definition poly-int.h:770
DEBUG_FUNCTION void debug_rtx_range(const rtx_insn *start, const rtx_insn *end)
Definition print-rtl.cc:1157
void print_inline_rtx(FILE *outf, const_rtx x, int ind)
Definition print-rtl.cc:1066
DEBUG_FUNCTION void debug_rtx(const_rtx x)
Definition print-rtl.cc:1075
void print_rtl_single(FILE *outf, const_rtx x)
Definition print-rtl.cc:1248
void print_mem_expr(FILE *outfile, const_tree expr)
Definition print-rtl.cc:190
DEBUG_FUNCTION const rtx_insn * debug_rtx_find(const rtx_insn *x, int uid)
Definition print-rtl.cc:1174
DEBUG_FUNCTION void debug_rtx_list(const rtx_insn *x, int n)
Definition print-rtl.cc:1129
void print_rtl(FILE *outf, const_rtx rtx_first)
Definition print-rtl.cc:1239
const char * print_rtx_head
Definition print-rtl.cc:72
void print_simple_rtl(FILE *outf, const_rtx x)
Definition print-rtl.cc:1278
void split_all_insns(void)
Definition recog.cc:3581
bool post_ra_split_completed
Definition recog.cc:100
const char * decode_asm_operands(rtx body, rtx *operands, rtx **operand_locs, const char **constraints, machine_mode *modes, location_t *loc)
Definition recog.cc:2131
int reload_completed
Definition recog.cc:98
void get_referenced_operands(const char *string, bool *used, unsigned int noperands)
Definition recog.cc:2249
void split_all_insns_noflow(void)
Definition recog.cc:3671
int epilogue_completed
Definition recog.cc:103
rtx extract_asm_operands(rtx body)
Definition recog.cc:1998
int asm_noperands(const_rtx body)
Definition recog.cc:2038
rtx * find_constant_term_loc(rtx *p)
Definition recog.cc:2449
void reinit_regs(void)
Definition reginfo.cc:517
tree global_regs_decl[FIRST_PSEUDO_REGISTER]
Definition reginfo.cc:98
bool reg_classes_intersect_p(reg_class_t c1, reg_class_t c2)
Definition reginfo.cc:1165
bool reg_class_subset_p(reg_class_t c1, reg_class_t c2)
Definition reginfo.cc:1155
enum reg_class reg_allocno_class(int regno)
Definition reginfo.cc:848
void init_reg_modes_target(void)
Definition reginfo.cc:473
void free_reg_info(void)
Definition reginfo.cc:917
const HARD_REG_SET & simplifiable_subregs(const subreg_shape &shape)
Definition reginfo.cc:1200
void init_subregs_of_mode(void)
Definition reginfo.cc:1316
void init_reg_sets(void)
Definition reginfo.cc:168
bool resize_reg_info(void)
Definition reginfo.cc:883
void reginfo_cc_finalize(void)
Definition reginfo.cc:136
void reg_scan(rtx_insn *f, unsigned int nregs)
Definition reginfo.cc:1008
void globalize_reg(tree decl, int i)
Definition reginfo.cc:738
void init_regs(void)
Definition reginfo.cc:508
enum reg_class reg_preferred_class(int regno)
Definition reginfo.cc:827
void finish_subregs_of_mode(void)
Definition reginfo.cc:1344
void save_register_info(void)
Definition reginfo.cc:219
machine_mode choose_hard_reg_mode(unsigned int regno, unsigned int nregs, const predefined_function_abi *abi)
Definition reginfo.cc:600
void fix_register(const char *name, int fixed, int call_used)
Definition reginfo.cc:661
void init_fake_stack_mems(void)
Definition reginfo.cc:532
void setup_reg_classes(int regno, enum reg_class prefclass, enum reg_class altclass, enum reg_class allocnoclass)
Definition reginfo.cc:988
const HARD_REG_SET * valid_mode_changes_for_regno(unsigned int regno)
Definition reginfo.cc:1338
enum reg_class reg_alternate_class(int regno)
Definition reginfo.cc:837
bool function_invariant_p(const_rtx x)
Definition reload1.cc:5970
int reload_in_progress
Definition reload1.cc:221
void _fatal_insn(const char *msgid, const_rtx insn, const char *file, int line, const char *function)
Definition rtl-error.cc:98
void _fatal_insn_not_found(const_rtx insn, const char *file, int line, const char *function)
Definition rtl-error.cc:112
const unsigned char rtx_length[NUM_RTX_CODE]
Definition rtl.cc:45
const char *const reg_note_name[REG_NOTE_MAX]
Definition rtl.cc:146
rtvec rtvec_alloc(size_t n)
Definition rtl.cc:163
bool shared_const_p(const_rtx orig)
Definition rtl.cc:267
bool rtvec_series_p(rtvec vec, poly_int64 start)
Definition rtl.cc:597
int generating_concat_p
Definition rtl.cc:411
void dump_rtx_statistics(void)
Definition rtl.cc:679
const unsigned char rtx_code_size[NUM_RTX_CODE]
Definition rtl.cc:125
bool rtx_equal_p(const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
Definition rtl.cc:425
rtx copy_rtx(rtx orig)
Definition rtl.cc:285
bool rtvec_all_equal_p(const_rtvec vec)
Definition rtl.cc:571
const char *const rtx_format[NUM_RTX_CODE]
Definition rtl.cc:65
const char *const rtx_name[NUM_RTX_CODE]
Definition rtl.cc:55
rtx shallow_copy_rtx(const_rtx orig MEM_STAT_DECL)
Definition rtl.cc:380
rtvec shallow_copy_rtvec(rtvec vec)
Definition rtl.cc:188
void cwi_output_hex(FILE *outfile, const_rtx x)
Definition rtl.cc:250
rtx rtx_alloc(RTX_CODE code MEM_STAT_DECL)
Definition rtl.cc:242
int currently_expanding_to_rtl
Definition rtl.cc:414
enum rtx_code classify_insn(rtx x)
Definition rtl.cc:615
const char *const note_insn_name[NOTE_INSN_MAX]
Definition rtl.cc:139
rtx rtx_alloc_stat_v(RTX_CODE code MEM_STAT_DECL, int extra)
Definition rtl.cc:222
unsigned int rtx_size(const_rtx x)
Definition rtl.cc:202
void decide_function_section(tree)
Definition varasm.cc:2013
void remove_reg_equal_equiv_notes_for_regno(unsigned int)
Definition rtlanal.cc:2844
#define MAX_SAVED_CONST_INT
Definition rtl.h:3884
rtx avoid_constant_pool_reference(rtx)
Definition simplify-rtx.cc:197
int low_bitmask_len(machine_mode, unsigned HOST_WIDE_INT)
Definition rtlanal.cc:6284
#define NOTE_P(X)
Definition rtl.h:875
#define RTL_INSN_CHAIN_FLAG_CHECK(NAME, RTX)
Definition rtl.h:1355
rtx delegitimize_mem_from_attrs(rtx)
Definition simplify-rtx.cc:264
bool volatile_refs_p(const_rtx)
Definition rtlanal.cc:2980
rtx & SET_NEXT_INSN(rtx_insn *insn)
Definition rtl.h:1496
rtx_insn * PREV_INSN(const rtx_insn *insn)
Definition rtl.h:1479
int set_src_cost(rtx x, machine_mode mode, bool speed_p)
Definition rtl.h:2999
#define SUBREG_BYTE(RTX)
Definition rtl.h:2077
#define INTVAL(RTX)
Definition rtl.h:2006
bool keep_with_call_p(const rtx_insn *)
Definition rtlanal.cc:4468
rtx simplify_unary_operation(rtx_code code, machine_mode mode, rtx op, machine_mode op_mode)
Definition rtl.h:3564
bool(*) rtx_equal_p_callback_function(const_rtx *, const_rtx *, rtx *, rtx *)
Definition rtl.h:3092
expand_opcode
Definition rtl.h:3057
@ NO_RTX
Definition rtl.h:3059
@ MATCH_OPERATOR_WITH_MODE
Definition rtl.h:3070
@ MATCH_OPERATOR
Definition rtl.h:3066
@ CLOBBER_REG
Definition rtl.h:3077
@ MATCH_PARALLEL
Definition rtl.h:3074
@ MATCH_OPERAND
Definition rtl.h:3062
bool INSN_HAS_LOCATION(const rtx_insn *insn)
Definition rtl.h:1537
const int SRP_POINTER
Definition rtl.h:2565
#define CONST_VECTOR_ELT(RTX, N)
Definition rtl.h:2043
#define INSN_P(X)
Definition rtl.h:872
#define RTX_HDR_SIZE
Definition rtl.h:704
bool paradoxical_subreg_p(machine_mode outermode, machine_mode innermode)
Definition rtl.h:3286
bool dead_or_set_p(const rtx_insn *, const_rtx)
Definition rtlanal.cc:2409
bool offset_within_block_p(const_rtx, HOST_WIDE_INT)
Definition rtlanal.cc:877
bool reg_referenced_p(const_rtx, const_rtx)
Definition rtlanal.cc:1147
#define BARRIER_P(X)
Definition rtl.h:878
const int SRP_UNSIGNED
Definition rtl.h:2567
#define PUT_CODE(RTX, CODE)
Definition rtl.h:730
bool val_signbit_p(machine_mode, unsigned HOST_WIDE_INT)
Definition simplify-rtx.cc:118
#define LABEL_P(X)
Definition rtl.h:841
#define SUBREG_REG(RTX)
Definition rtl.h:2076
rtx output_constant_def(tree, int)
Definition varasm.cc:3858
rtx get_condition(rtx_insn *, rtx_insn **, int, int)
Definition rtlanal.cc:6128
std::pair< rtx, machine_mode > rtx_mode_t
Definition rtl.h:2306
void delete_vta_debug_insns(bool)
Definition var-tracking.cc:10407
rtx native_decode_rtx(machine_mode, const vec< target_unit > &, unsigned int)
Definition simplify-rtx.cc:8416
int INSN_UID(const_rtx insn)
Definition rtl.h:1461
memop_ret
Definition rtl.h:4405
@ RETURN_BEGIN
Definition rtl.h:4406
@ RETURN_END_MINUS_ONE
Definition rtl.h:4408
@ RETURN_END
Definition rtl.h:4407
#define RTX_CODE
Definition rtl.h:47
rtx find_reg_note(const_rtx, enum reg_note, const_rtx)
Definition rtlanal.cc:2519
bool poly_int_rtx_p(const_rtx x)
Definition rtl.h:2415
bool unsigned_reg_p(rtx)
Definition rtlanal.cc:1029
rtx simplify_gen_binary(rtx_code code, machine_mode mode, rtx op0, rtx op1)
Definition rtl.h:3608
rtx single_set(const rtx_insn *insn)
Definition rtl.h:3692
bool contains_symbolic_reference_p(const_rtx)
Definition rtlanal.cc:6955
bool subreg_offset_representable_p(unsigned int, machine_mode, poly_uint64, machine_mode)
Definition rtlanal.cc:4249
int commutative_operand_precedence(rtx)
Definition rtlanal.cc:3775
bool single_output_fused_pair_p(rtx_insn *)
Definition rtlanal.cc:7023
bool noop_move_p(const rtx_insn *)
Definition rtlanal.cc:1695
#define REG_NREGS(RTX)
Definition rtl.h:1943
rtx_code load_extend_op(machine_mode mode)
Definition rtl.h:4718
bool multiple_sets(const_rtx)
Definition rtlanal.cc:1593
bool reverse_rotate_by_imm_p(machine_mode, unsigned int, rtx)
Definition simplify-rtx.cc:2992
void record_hard_reg_uses(rtx *, void *)
Definition rtlanal.cc:1522
rtx find_regno_note(const_rtx, enum reg_note, unsigned int)
Definition rtlanal.cc:2548
bool rtx_referenced_p(const_rtx, const_rtx)
Definition rtlanal.cc:3501
#define CONST_WIDE_INT_ELT(RTX, N)
Definition rtl.h:2015
#define NONJUMP_INSN_P(X)
Definition rtl.h:855
void decompose_address(struct address_info *, rtx *, machine_mode, addr_space_t, enum rtx_code)
Definition rtlanal.cc:6843
wi::rtx_to_poly_wide_ref const_poly_int_value(const_rtx x)
Definition rtl.h:2403
rtx simplify_gen_relational(rtx_code code, machine_mode mode, machine_mode op_mode, rtx op0, rtx op1)
Definition rtl.h:3622
#define REGNO(RTX)
Definition rtl.h:1937
bool may_trap_or_fault_p(const_rtx)
Definition rtlanal.cc:3333
void add_auto_inc_notes(rtx_insn *, rtx)
Definition rtlanal.cc:6996
bool val_signbit_known_set_p(machine_mode, unsigned HOST_WIDE_INT)
Definition simplify-rtx.cc:137
bool side_effects_p(const_rtx)
Definition rtlanal.cc:3039
void emit_library_call(rtx fun, libcall_type fn_type, machine_mode outmode)
Definition rtl.h:4479
#define REG_P(X)
Definition rtl.h:750
bool(*) hash_rtx_callback_function(const_rtx, machine_mode, rtx *, machine_mode *)
Definition rtl.h:4287
#define CONST_POLY_INT_P(X)
Definition rtl.h:810
bool reg_mentioned_p(const_rtx, const_rtx)
Definition rtlanal.cc:1049
HOST_WIDE_INT get_index_scale(const struct address_info *)
Definition rtlanal.cc:6905
global_rtl_index
Definition rtl.h:3933
@ GR_VIRTUAL_STACK_ARGS
Definition rtl.h:3955
@ GR_STACK_POINTER
Definition rtl.h:3934
@ GR_VIRTUAL_OUTGOING_ARGS
Definition rtl.h:3957
@ GR_MAX
Definition rtl.h:3961
@ GR_FRAME_POINTER
Definition rtl.h:3935
@ GR_ARG_POINTER
Definition rtl.h:3940
@ GR_VIRTUAL_CFA
Definition rtl.h:3958
@ GR_HARD_FRAME_POINTER
Definition rtl.h:3943
@ GR_VIRTUAL_STACK_DYNAMIC
Definition rtl.h:3956
@ GR_VIRTUAL_PREFERRED_STACK_BOUNDARY
Definition rtl.h:3959
@ GR_VIRTUAL_INCOMING_ARGS
Definition rtl.h:3954
void add_int_reg_note(rtx_insn *, enum reg_note, int)
Definition rtlanal.cc:2742
rtx & SET_PREV_INSN(rtx_insn *insn)
Definition rtl.h:1485
#define CONST_POLY_INT_COEFFS(RTX)
Definition rtl.h:2019
#define SUBREG_PROMOTED_VAR_P(RTX)
Definition rtl.h:2551
bool const_vec_series_p(const_rtx x, rtx *base_out, rtx *step_out)
Definition rtl.h:3166
#define JUMP_TABLE_DATA_P(INSN)
Definition rtl.h:881
#define MAX_COST
Definition rtl.h:2087
bool tls_referenced_p(const_rtx)
Definition rtlanal.cc:6982
void replace_label_in_insn(rtx_insn *, rtx_insn *, rtx_insn *, bool)
Definition rtlanal.cc:3490
bool partial_subreg_p(machine_mode outermode, machine_mode innermode)
Definition rtl.h:3260
bool reg_used_between_p(const_rtx, const rtx_insn *, const rtx_insn *)
Definition rtlanal.cc:1126
void init_costs_to_max(struct full_rtx_costs *c)
Definition rtl.h:2117
bool same_vector_encodings_p(const_rtx x, const_rtx y)
Definition rtl.h:3200
void add_reg_note(rtx, enum reg_note, rtx)
Definition rtlanal.cc:2734
const int SRP_SIGNED
Definition rtl.h:2566
bool vec_duplicate_p(T x, T *elt)
Definition rtl.h:3130
int pattern_cost(rtx, bool)
Definition rtlanal.cc:5759
bool contains_constant_pool_address_p(const_rtx)
Definition rtlanal.cc:6968
void sel_sched_fix_param(const char *param, const char *val)
void get_mode_bounds(scalar_int_mode, int, scalar_int_mode, rtx *, rtx *)
Definition stor-layout.cc:3257
bool contains_symbol_ref_p(const_rtx)
Definition rtlanal.cc:6942
rtx simplify_const_relational_operation(enum rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:7179
rtx duplicate_reg_note(rtx)
Definition rtlanal.cc:2771
poly_uint64 subreg_size_offset_from_lsb(poly_uint64, poly_uint64, poly_uint64)
Definition rtlanal.cc:3982
#define this_target_rtl
Definition rtl.h:4015
poly_int64 rtx_to_poly_int64(const_rtx x)
Definition rtl.h:2434
rtx get_related_value(const_rtx)
Definition rtlanal.cc:859
rtx_jump_table_data * jump_table_for_label(const rtx_code_label *label)
Definition rtl.h:1573
reg_note
Definition rtl.h:1645
@ REG_NOTE_MAX
Definition rtl.h:1906
int(*) for_each_inc_dec_fn(rtx mem, rtx op, rtx dest, rtx src, rtx srcoff, void *arg)
Definition rtl.h:3798
void get_full_set_src_cost(rtx x, machine_mode mode, struct full_rtx_costs *c)
Definition rtl.h:3007
const int SRP_SIGNED_AND_UNSIGNED
Definition rtl.h:2568
bool mode_signbit_p(machine_mode, const_rtx)
Definition simplify-rtx.cc:64
rtx simplify_ternary_operation(rtx_code code, machine_mode mode, machine_mode op0_mode, rtx op0, rtx op1, rtx op2)
Definition rtl.h:3578
HOST_WIDE_INT get_integer_term(const_rtx)
Definition rtlanal.cc:840
bool reg_overlap_mentioned_p(const_rtx, const_rtx)
Definition rtlanal.cc:1847
void remove_node_from_insn_list(const rtx_insn *, rtx_insn_list **)
Definition rtlanal.cc:2890
void init_rtlanal(void)
Definition rtlanal.cc:6257
bool reg_set_p(const_rtx, const_rtx)
Definition rtlanal.cc:1236
bool find_regno_fusage(const_rtx, enum rtx_code, unsigned int)
Definition rtlanal.cc:2668
#define CONST_VECTOR_NPATTERNS(RTX)
Definition rtl.h:2046
void note_uses(rtx *, void(*)(rtx *, void *), void *)
Definition rtlanal.cc:2004
void find_all_hard_reg_sets(const rtx_insn *, HARD_REG_SET *, bool)
Definition rtlanal.cc:1507
#define JUMP_LABEL(INSN)
Definition rtl.h:1891
void decompose_lea_address(struct address_info *, rtx *)
Definition rtlanal.cc:6876
T unwrap_const_vec_duplicate(T x)
Definition rtl.h:3146
basic_block BLOCK_FOR_INSN(const_rtx insn)
Definition rtl.h:1501
const_rtx set_of(const_rtx, const_rtx)
Definition rtlanal.cc:1432
#define CONST_VECTOR_DUPLICATE_P(RTX)
Definition rtl.h:2054
rtx stack_limit_rtx
Definition toplev.cc:155
unsigned int subreg_regno(const_rtx)
Definition rtlanal.cc:4336
void update_address(struct address_info *)
Definition rtlanal.cc:6895
#define DEBUG_INSN_P(X)
Definition rtl.h:858
#define mode_mem_attrs
Definition rtl.h:4026
bool dead_or_set_regno_p(const rtx_insn *, unsigned int)
Definition rtlanal.cc:2475
scalar_int_mode subreg_promoted_mode(rtx x)
Definition rtl.h:3224
libcall_type
Definition rtl.h:4457
@ LCT_NORMAL
Definition rtl.h:4458
@ LCT_RETURNS_TWICE
Definition rtl.h:4463
@ LCT_NORETURN
Definition rtl.h:4461
@ LCT_THROW
Definition rtl.h:4462
@ LCT_PURE
Definition rtl.h:4460
@ LCT_CONST
Definition rtl.h:4459
rtx rtx_init(rtx rt, RTX_CODE code)
Definition rtl.h:3032
void record_hard_reg_sets(rtx, const_rtx, void *)
Definition rtlanal.cc:1493
#define CONST_SCALAR_INT_P(X)
Definition rtl.h:829
scalar_int_mode get_address_mode(rtx mem)
Definition rtlanal.cc:6299
bool find_reg_fusage(const_rtx, enum rtx_code, const_rtx)
Definition rtlanal.cc:2623
bool val_signbit_known_clear_p(machine_mode, unsigned HOST_WIDE_INT)
Definition simplify-rtx.cc:156
#define CONST_DOUBLE_LOW(r)
Definition rtl.h:2030
#define JUMP_P(X)
Definition rtl.h:844
label_kind
Definition rtl.h:1842
@ LABEL_WEAK_ENTRY
Definition rtl.h:1846
@ LABEL_GLOBAL_ENTRY
Definition rtl.h:1845
@ LABEL_NORMAL
Definition rtl.h:1843
@ LABEL_STATIC_ENTRY
Definition rtl.h:1844
rtx get_call_rtx_from(const rtx_insn *)
Definition final.cc:2099
poly_uint64 subreg_size_lsb(poly_uint64, poly_uint64, poly_uint64)
Definition rtlanal.cc:3922
bool refers_to_regno_p(unsigned int, unsigned int, const_rtx, rtx *)
Definition rtlanal.cc:1739
rtx emit_library_call_value(rtx fun, rtx value, libcall_type fn_type, machine_mode outmode)
Definition rtl.h:4539
unsigned int END_REGNO(const_rtx x)
Definition rtl.h:1960
void init_costs_to_zero(struct full_rtx_costs *c)
Definition rtl.h:2125
rtx strip_offset(rtx, poly_int64 *)
Definition rtlanal.cc:933
unsigned int subreg_nregs(const_rtx)
Definition rtlanal.cc:4353
int set_rtx_cost(rtx x, bool speed_p)
Definition rtl.h:2981
bool reg_set_between_p(const_rtx, const rtx_insn *, const rtx_insn *)
Definition rtlanal.cc:1219
poly_uint64 subreg_offset_from_lsb(machine_mode outer_mode, machine_mode inner_mode, poly_uint64 lsb_shift)
Definition rtl.h:2508
bool always_void_p(enum rtx_code code)
Definition rtl.h:2092
machine_mode narrower_subreg_mode(machine_mode outermode, machine_mode innermode)
Definition rtl.h:3320
bool const_vec_duplicate_p(const_rtx x)
Definition rtl.h:3103
void emit_jump(rtx)
Definition stmt.cc:136
void set_block_for_insn(rtx_insn *insn, basic_block bb)
Definition rtl.h:1511
bool modified_between_p(const_rtx, const rtx_insn *, const rtx_insn *)
Definition rtlanal.cc:1288
rtx simplify_subtraction(rtx)
Definition varasm.cc:4177
rtx_insn * split_insns(rtx, rtx_insn *)
bool constant_pool_constant_p(rtx)
Definition rtlanal.cc:6273
bool auto_inc_p(const_rtx)
Definition rtlanal.cc:3865
rtx simplify_const_binary_operation(enum rtx_code, machine_mode, rtx, rtx)
Definition simplify-rtx.cc:5749
int count_occurrences(const_rtx, const_rtx, int)
Definition rtlanal.cc:963
rtx replace_rtx(rtx, rtx, rtx, bool=false)
Definition rtlanal.cc:3348
rtx canonicalize_condition(rtx_insn *, rtx, int, rtx_insn **, rtx, int, int)
Definition rtlanal.cc:5877
void replace_label(rtx *, rtx, rtx, bool)
Definition rtlanal.cc:3418
bool truncated_to_mode(machine_mode, const_rtx)
Definition rtlanal.cc:6204
bool word_register_operation_p(const_rtx x)
Definition rtl.h:4746
rtx force_const_mem(machine_mode, rtx)
Definition varasm.cc:4188
poly_uint64 subreg_highpart_offset(machine_mode outermode, machine_mode innermode)
Definition rtl.h:3348
rtx get_pool_constant(const_rtx)
Definition varasm.cc:4287
#define NULL_RTX
Definition rtl.h:709
unsigned int rhs_regno(const_rtx x)
Definition rtl.h:1953
location_t INSN_LOCATION(const rtx_insn *insn)
Definition rtl.h:1527
bool nonzero_address_p(const_rtx)
Definition rtlanal.cc:716
bool volatile_insn_p(const_rtx)
Definition rtlanal.cc:2920
wide_int native_decode_int(const vec< target_unit > &, unsigned int, unsigned int, unsigned int)
Definition simplify-rtx.cc:8390
#define RTX_CODE_BITSIZE
Definition rtl.h:66
void regclass(rtx, int)
int simplify_subreg_regno(unsigned int, machine_mode, poly_uint64, machine_mode, bool allow_stack_regs=false)
Definition rtlanal.cc:4270
rtx strip_offset_and_add(rtx x, poly_int64 *offset)
Definition rtl.h:4731
#define REG_CHECK(RTX)
Definition rtl.h:1261
bool native_encode_rtx(machine_mode, rtx, vec< target_unit > &, unsigned int, unsigned int)
Definition simplify-rtx.cc:8196
void note_pattern_stores(const_rtx, void(*)(rtx, const_rtx, void *), void *)
Definition rtlanal.cc:1943
rtx simplify_replace_rtx(rtx, const_rtx, rtx)
Definition simplify-rtx.cc:560
void schedule_ebbs(void)
void set_label_ref_label(rtx ref, rtx_insn *label)
Definition rtl.h:1930
rtx simplify_binary_operation(rtx_code code, machine_mode mode, rtx op0, rtx op1)
Definition rtl.h:3572
unsigned int variable_tracking_main(void)
Definition var-tracking.cc:10576
void costs_add_n_insns(struct full_rtx_costs *c, int n)
Definition rtl.h:2148
rtx_code
Definition rtl.h:48
@ LAST_AND_UNUSED_RTX_CODE
Definition rtl.h:1439
void subreg_get_info(unsigned int, machine_mode, poly_uint64, machine_mode, struct subreg_info *)
Definition rtlanal.cc:4034
#define CONST_INT_P(X)
Definition rtl.h:803
rtx_insn * NEXT_INSN(const rtx_insn *insn)
Definition rtl.h:1490
rtx simplify_replace_fn_rtx(rtx, const_rtx, rtx(*fn)(rtx, const_rtx, void *), void *)
Definition simplify-rtx.cc:406
rtx * strip_address_mutations(rtx *, enum rtx_code *=0)
Definition rtlanal.cc:6496
void remove_note(rtx_insn *, const_rtx)
Definition rtlanal.cc:2786
bool set_noop_p(const_rtx)
Definition rtlanal.cc:1624
rtx simple_regno_set(rtx, unsigned int)
Definition rtlanal.cc:1457
poly_uint64 subreg_lsb(const_rtx)
Definition rtlanal.cc:3969
rtx PATTERN(const_rtx insn)
Definition rtl.h:1517
bool label_is_jump_target_p(const_rtx, const rtx_insn *)
Definition rtlanal.cc:4507
#define XVEC(RTX, N)
Definition rtl.h:1363
void get_full_set_rtx_cost(rtx x, struct full_rtx_costs *c)
Definition rtl.h:2989
void split_double(rtx, rtx *, rtx *)
Definition rtlanal.cc:6319
bool swap_commutative_operands_p(rtx, rtx)
Definition rtlanal.cc:3856
subreg_shape shape_of_subreg(const_rtx x)
Definition rtl.h:2212
rtx simplify_rtx(const_rtx)
Definition simplify-rtx.cc:9179
rtx_insn * label_ref_label(const_rtx ref)
Definition rtl.h:1922
bool no_labels_between_p(const rtx_insn *, const rtx_insn *)
Definition rtlanal.cc:1111
void set_regno_raw(rtx x, unsigned int regno, unsigned int nregs)
Definition rtl.h:1968
const class mem_attrs * get_mem_attrs(const_rtx x)
Definition rtl.h:4040
bool remove_reg_equal_equiv_notes(rtx_insn *, bool=false)
Definition rtlanal.cc:2819
#define CONST_VECTOR_ENCODED_ELT(RTX, N)
Definition rtl.h:2060
#define XEXP(RTX, N)
Definition rtl.h:1362
#define PUT_MODE_RAW(RTX, MODE)
Definition rtl.h:733
rtx gen_lowpart_if_possible(machine_mode, rtx)
Definition rtlhooks.cc:109
#define XVECEXP(RTX, N, M)
Definition rtl.h:1370
unsigned seq_cost(const rtx_insn *, bool)
Definition rtlanal.cc:5825
const struct rtl_hooks general_rtl_hooks
Definition rtlhooks.cc:42
int for_each_inc_dec(rtx, for_each_inc_dec_fn, void *arg)
Definition rtlanal.cc:3717
bool loc_mentioned_in_p(rtx *, const_rtx)
Definition rtlanal.cc:3886
bool contains_mem_rtx_p(rtx x)
Definition rtlanal.cc:703
fixed_size_mode get_pool_mode(const_rtx)
Definition varasm.cc:4308
void init_varasm_once(void)
Definition varasm.cc:6966
void add_shallow_copy_of_reg_note(rtx_insn *, rtx)
Definition rtlanal.cc:2761
unsigned HOST_WIDE_INT nonzero_bits(const_rtx, machine_mode)
Definition rtlanal.cc:4683
int address_cost(rtx, machine_mode, addr_space_t, bool)
Definition rtlanal.cc:4661
rtx tablejump_casesi_pattern(const rtx_insn *insn)
Definition rtlanal.cc:3554
bool read_modify_subreg_p(const_rtx)
Definition rtlanal.cc:1400
poly_int64 get_args_size(const_rtx)
Definition rtlanal.cc:953
#define GET_CODE(RTX)
Definition rtl.h:729
rtx simplify_gen_subreg(machine_mode outermode, rtx op, machine_mode innermode, poly_uint64 byte)
Definition rtl.h:3630
bool register_asm_p(const_rtx)
Definition rtlanal.cc:7043
#define XLOC(RTX, N)
Definition rtl.h:1360
rtx single_set_2(const rtx_insn *, const_rtx)
Definition rtlanal.cc:1532
unsigned int subreg_nregs_with_regno(unsigned int, const_rtx)
Definition rtlanal.cc:4363
bool unsigned_condition_p(enum rtx_code code)
Definition rtl.h:3483
bool rtx_unstable_p(const_rtx)
Definition rtlanal.cc:206
bool modified_in_p(const_rtx, const_rtx)
Definition rtlanal.cc:1346
rtx_class
Definition rtl.h:70
@ RTX_BIN_ARITH
Definition rtl.h:77
@ RTX_UNARY
Definition rtl.h:81
@ RTX_TERNARY
Definition rtl.h:91
@ RTX_EXTRA
Definition rtl.h:83
@ RTX_CONST_OBJ
Definition rtl.h:89
@ RTX_INSN
Definition rtl.h:85
@ RTX_COMM_ARITH
Definition rtl.h:78
@ RTX_MATCH
Definition rtl.h:84
@ RTX_OBJ
Definition rtl.h:88
@ RTX_AUTOINC
Definition rtl.h:93
@ RTX_COMM_COMPARE
Definition rtl.h:76
@ RTX_COMPARE
Definition rtl.h:75
@ RTX_BITFIELD_OPS
Definition rtl.h:92
void add_args_size_note(rtx_insn *, poly_int64)
Definition rtlanal.cc:2752
rtx native_decode_vector_rtx(machine_mode, const vec< target_unit > &, unsigned int, unsigned int, unsigned int)
Definition simplify-rtx.cc:8350
int insn_cost(rtx_insn *, bool)
Definition rtlanal.cc:5814
#define MEM_ATTRS(RTX)
Definition rtl.h:2675
#define CONST_WIDE_INT_NUNITS(RTX)
Definition rtl.h:2014
rtx lookup_constant_def(tree)
Definition varasm.cc:3974
int lowpart_subreg_regno(unsigned int, machine_mode, machine_mode)
Definition rtlanal.cc:4327
unsigned int num_sign_bit_copies(const_rtx, machine_mode)
Definition rtlanal.cc:4694
#define CALL_P(X)
Definition rtl.h:847
unsigned int subreg_regno_offset(unsigned int, machine_mode, poly_uint64, machine_mode)
Definition rtlanal.cc:4233
#define XBBDEF(RTX, N)
Definition rtl.h:1366
rtx get_pool_constant_mark(rtx, bool *)
Definition varasm.cc:4296
bool rtx_addr_varies_p(const_rtx, bool)
Definition rtlanal.cc:786
rtx lowpart_subreg(machine_mode outermode, rtx op, machine_mode innermode)
Definition rtl.h:3644
unsigned int const_vector_encoded_nelts(const_rtx x)
Definition rtl.h:2065
rtx find_constant_src(const rtx_insn *)
Definition rtlanal.cc:2600
rtx simplify_subreg(machine_mode outermode, rtx op, machine_mode innermode, poly_uint64 byte)
Definition rtl.h:3594
rtx find_reg_equal_equiv_note(const_rtx)
Definition rtlanal.cc:2571
rtx simplify_gen_vec_select(rtx op, unsigned int index)
Definition rtl.h:3638
bool may_trap_p_1(const_rtx, unsigned)
Definition rtlanal.cc:3113
insn_note
Definition rtl.h:1816
@ NOTE_INSN_MAX
Definition rtl.h:1921
enum rtx_code get_index_code(const struct address_info *)
Definition rtlanal.cc:6928
tree get_call_fndecl(const rtx_insn *)
Definition rtlanal.cc:819
bool in_insn_list_p(const rtx_insn_list *, const rtx_insn *)
Definition rtlanal.cc:2873
void get_full_rtx_cost(rtx, machine_mode, enum rtx_code, int, struct full_rtx_costs *)
Definition rtlanal.cc:4646
rtx simplify_const_unary_operation(enum rtx_code, machine_mode, rtx, machine_mode)
Definition simplify-rtx.cc:1987
void decompose_mem_address(struct address_info *, rtx)
Definition rtlanal.cc:6884
#define COSTS_N_INSNS(N)
Definition rtl.h:2083
rtx_insn * JUMP_LABEL_AS_INSN(const rtx_insn *insn)
Definition rtl.h:1893
#define XVECLEN(RTX, N)
Definition rtl.h:1371
rtx regno_use_in(unsigned int, rtx)
Definition rtlanal.cc:3743
scalar_int_mode subreg_unpromoted_mode(rtx x)
Definition rtl.h:3215
const unsigned char rtx_next[NUM_RTX_CODE]
rtx simplify_gen_unary(rtx_code code, machine_mode mode, rtx op, machine_mode op_mode)
Definition rtl.h:3601
rtx make_debug_expr_from_rtl(const_rtx)
Definition varasm.cc:8679
#define CONST_VECTOR_NELTS_PER_PATTERN(RTX)
Definition rtl.h:2050
rtx simplify_gen_ternary(rtx_code code, machine_mode mode, machine_mode op0_mode, rtx op0, rtx op1, rtx op2)
Definition rtl.h:3614
rtx_insn * find_first_parameter_load(rtx_insn *, rtx_insn *)
Definition rtlanal.cc:4398
void print_rtl_single_with_indent(FILE *, const_rtx, int)
bool rtx_varies_p(const_rtx, bool)
Definition rtlanal.cc:272
#define CONST_VECTOR_NUNITS(RTX)
Definition rtl.h:2071
void find_all_hard_regs(const_rtx, HARD_REG_SET *)
Definition rtlanal.cc:1478
#define XCEXP(RTX, N, C)
Definition rtl.h:1398
void expand_naked_return(void)
Definition stmt.cc:1022
bool computed_jump_p(const rtx_insn *)
Definition rtlanal.cc:3624
bool tablejump_p(const rtx_insn *, rtx_insn **, rtx_jump_table_data **)
Definition rtlanal.cc:3528
poly_uint64 subreg_lowpart_offset(machine_mode outermode, machine_mode innermode)
Definition rtl.h:3309
bool rtx_addr_can_trap_p(const_rtx)
Definition rtlanal.cc:695
int rtx_cost(rtx, machine_mode, enum rtx_code, int, bool)
Definition rtlanal.cc:4542
#define GET_MODE(RTX)
Definition rtl.h:732
machine_mode wider_subreg_mode(machine_mode outermode, machine_mode innermode)
Definition rtl.h:3330
void split_const(rtx, rtx *, rtx *)
Definition rtlanal.cc:912
bool may_trap_p(const_rtx)
Definition rtlanal.cc:3287
bool vec_series_p(const_rtx x, rtx *base_out, rtx *step_out)
Definition rtl.h:3184
rtx simplify_relational_operation(rtx_code code, machine_mode mode, machine_mode op_mode, rtx op0, rtx op1)
Definition rtl.h:3586
void PUT_MODE(rtx x, machine_mode mode)
Definition rtl.h:4089
bool costs_lt_p(struct full_rtx_costs *a, struct full_rtx_costs *b, bool speed)
Definition rtl.h:2134
void note_stores(const rtx_insn *, void(*)(rtx, const_rtx, void *), void *)
Definition rtlanal.cc:1983
rtx alloc_reg_note(enum reg_note, rtx, rtx)
Definition rtlanal.cc:2706
poly_uint64 subreg_lsb_1(machine_mode outer_mode, machine_mode inner_mode, poly_uint64 subreg_byte)
Definition rtl.h:2494
signop
Definition signop.h:28
#define MEM_STAT_DECL
Definition statistics.h:52
#define CXX_MEM_STAT_INFO
Definition statistics.h:58
tree variable_size(tree size)
Definition stor-layout.cc:67
Definition rtl.h:130
unsigned min_after_vec
Definition rtl.h:135
unsigned max_after_vec
Definition rtl.h:137
unsigned min_align
Definition rtl.h:132
unsigned min_after_base
Definition rtl.h:139
unsigned max_after_base
Definition rtl.h:141
unsigned base_after_vec
Definition rtl.h:134
unsigned offset_unsigned
Definition rtl.h:144
unsigned scale
Definition rtl.h:146
Definition rtl.h:2221
machine_mode mode
Definition rtl.h:2224
rtx * disp
Definition rtl.h:2284
addr_space_t as
Definition rtl.h:2227
rtx * segment_term
Definition rtl.h:2286
enum rtx_code base_outer_code
Definition rtl.h:2300
bool autoinc_p
Definition rtl.h:2230
rtx * inner
Definition rtl.h:2251
enum rtx_code addr_outer_code
Definition rtl.h:2297
rtx * base
Definition rtl.h:2282
rtx * base_term
Definition rtl.h:2287
rtx * outer
Definition rtl.h:2237
rtx * base_term2
Definition rtl.h:2293
rtx * segment
Definition rtl.h:2281
rtx * index_term
Definition rtl.h:2288
rtx * index
Definition rtl.h:2283
rtx mem
Definition rtl.h:2234
rtx * disp_term
Definition rtl.h:2289
Definition var-tracking.cc:242
Definition rtl.h:238
rtunion fld[2]
Definition rtl.h:240
struct object_block * block
Definition rtl.h:243
HOST_WIDE_INT offset
Definition rtl.h:247
Definition rtl.h:4705
HARD_REG_SET function_used_regs
Definition rtl.h:4710
unsigned int preferred_incoming_stack_boundary
Definition rtl.h:4706
Definition rtl.h:293
trailing_wide_ints< NUM_POLY_INT_COEFFS > coeffs
Definition rtl.h:294
Definition cselib.h:25
Definition double-int.h:50
Definition dwarf2out.h:57
Definition fixed-value.h:24
Definition rtl.h:2110
int size
Definition rtl.h:2112
int speed
Definition rtl.h:2111
Definition function.h:249
Definition rtl.h:283
HOST_WIDE_INT elem[1]
Definition rtl.h:284
static bool test(U *p)
Definition rtl.h:252
section * sect
Definition rtl.h:254
vec< rtx, va_gc > * objects
Definition rtl.h:270
HOST_WIDE_INT size
Definition rtl.h:260
unsigned int alignment
Definition rtl.h:257
vec< rtx, va_gc > * anchors
Definition rtl.h:280
Definition real.h:39
Definition rtl.h:223
unsigned int regno
Definition rtl.h:225
unsigned int nregs
Definition rtl.h:228
reg_attrs * attrs
Definition rtl.h:232
unsigned int unused
Definition rtl.h:229
Definition rtl.h:4661
rtx(*) reg_nonzero_bits(const_rtx, scalar_int_mode, scalar_int_mode, unsigned HOST_WIDE_INT *)
Definition rtl.h:4664
rtx(*) reg_num_sign_bit_copies(const_rtx, scalar_int_mode, scalar_int_mode, unsigned int *)
Definition rtl.h:4666
rtx(*) gen_lowpart(machine_mode, rtx)
Definition rtl.h:4662
bool(*) reg_truncated_to_mode(machine_mode, const_rtx)
Definition rtl.h:4668
rtx(*) gen_lowpart_no_emit(machine_mode, rtx)
Definition rtl.h:4663
Definition rtl.h:739
rtx elem[1]
Definition rtl.h:741
int num_elem
Definition rtl.h:740
Definition rtl.h:671
Definition rtl.h:632
Definition rtl.h:682
Definition rtl.h:4765
rtx op0
Definition rtl.h:4767
rtx op1
Definition rtl.h:4767
rtx_code code
Definition rtl.h:4766
machine_mode mode
Definition rtl.h:4768
Definition rtl.h:583
Definition rtl.h:312
unsigned int call
Definition rtl.h:337
unsigned return_val
Definition rtl.h:403
unsigned int in_struct
Definition rtl.h:378
unsigned int unchanging
Definition rtl.h:349
unsigned frame_related
Definition rtl.h:396
unsigned int used
Definition rtl.h:387
enum rtx_code code
Definition rtl.h:317
machine_mode mode
Definition rtl.h:314
union rtx_def::@172124305105153346067300352223047126326240001260 u2
union rtx_def::u u
unsigned int jump
Definition rtl.h:330
unsigned int volatil
Definition rtl.h:363
Definition rtl.h:462
rtx element() const
Definition rtl.h:1421
rtx_expr_list * next() const
Definition rtl.h:1415
Definition rtl.h:483
rtx_insn * insn() const
Definition rtl.h:1434
rtx_insn_list * next() const
Definition rtl.h:1428
Definition rtl.h:549
void set_deleted()
Definition rtl.h:573
bool deleted() const
Definition rtl.h:569
void set_undeleted()
Definition rtl.h:577
Definition rtl.h:605
rtx jump_label() const
Definition rtl.h:1900
rtx_code_label * jump_target() const
Definition rtl.h:1905
void set_jump_target(rtx_code_label *)
Definition rtl.h:1910
Definition rtl.h:645
rtvec get_labels() const
Definition rtl.h:1551
scalar_int_mode get_data_mode() const
Definition rtl.h:1564
Definition rtl.h:594
Definition rtl.h:693
Definition rtl.h:516
rtx element(int index) const
Definition rtl.h:1447
rtx_insn * insn(int index) const
Definition rtl.h:1452
int len() const
Definition rtl.h:1442
Definition rtl.h:3825
bool representable_p
Definition rtl.h:3835
int nregs
Definition rtl.h:3832
int offset
Definition rtl.h:3827
Definition rtl.h:3965
rtx x_global_rtl[GR_MAX]
Definition rtl.h:3981
rtx x_top_of_stack[MAX_MACHINE_MODE]
Definition rtl.h:3998
rtx x_initial_regno_reg_rtx[FIRST_PSEUDO_REGISTER]
Definition rtl.h:3995
bool target_specific_initialized
Definition rtl.h:4008
rtx x_pic_offset_table_rtx
Definition rtl.h:3984
rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER]
Definition rtl.h:4002
class mem_attrs * x_mode_mem_attrs[(int) MAX_MACHINE_MODE]
Definition rtl.h:4005
rtx x_return_address_pointer_rtx
Definition rtl.h:3989
Definition wide-int.h:1758
Definition vec.h:450
static const bool is_sign_extended
Definition rtl.h:2317
static unsigned int get_precision(const rtx_mode_t &)
Definition rtl.h:2326
static wi::storage_ref decompose(HOST_WIDE_INT *, unsigned int, const rtx_mode_t &)
Definition rtl.h:2332
static const bool host_dependent_precision
Definition rtl.h:2314
static enum precision_type precision_type
Definition rtl.h:2313
static const bool needs_write_val_arg
Definition rtl.h:2318
Definition wide-int.h:427
#define NULL
Definition system.h:58
#define gcc_unreachable()
Definition system.h:846
#define bool
Definition system.h:891
#define STATIC_ASSERT(X)
Definition system.h:869
#define gcc_checking_assert(EXPR)
Definition system.h:826
Definition rtl.h:204
basic_block rt_bb
Definition rtl.h:216
struct dw_cfi_node * rt_cfi
Definition rtl.h:219
rtx rt_rtx
Definition rtl.h:210
location_t rt_loc
Definition rtl.h:207
struct cselib_val * rt_cselib
Definition rtl.h:214
tree rt_tree
Definition rtl.h:215
poly_uint16 rt_subreg
Definition rtl.h:208
const char * rt_str
Definition rtl.h:209
machine_mode rt_type
Definition rtl.h:212
int rt_int
Definition rtl.h:205
class constant_descriptor_rtx * rt_constant
Definition rtl.h:218
rtvec rt_rtvec
Definition rtl.h:211
unsigned int rt_uint
Definition rtl.h:206
mem_attrs * rt_mem
Definition rtl.h:217
addr_diff_vec_flags rt_addr_diff_vec_flags
Definition rtl.h:213
struct rtx_def::@172124305105153346067300352223047126326240001260::@102127077064127000005021335374023015057026123037 const_vector
unsigned int symbol_ref_flags
unsigned int num_elem
unsigned int original_regno
enum var_init_status var_location_status
Definition rtl.h:447
struct fixed_value fv
Definition rtl.h:453
struct const_poly_int_def cpi
Definition rtl.h:455
struct reg_info reg
Definition rtl.h:450
struct real_value rv
Definition rtl.h:452
struct block_symbol block_sym
Definition rtl.h:451
struct hwivec_def hwiv
Definition rtl.h:454
HOST_WIDE_INT hwint[1]
Definition rtl.h:449
rtunion fld[1]
Definition rtl.h:448
Definition output.h:517
#define WIDE_INT_REF_FOR(T)
Definition wide-int.h:362
generic_wide_int< wide_int_storage > wide_int
Definition wide-int.h:343
const T2 & y
Definition wide-int.h:3870