comparison gcc/hard-reg-set.h @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents 77e2b8dfacca
children 04ced10e8804
comparison
equal deleted inserted replaced
65:65488c3d617d 67:f6334be47118
1 /* Sets (bit vectors) of hard registers, and operations on them. 1 /* Sets (bit vectors) of hard registers, and operations on them.
2 Copyright (C) 1987, 1992, 1994, 2000, 2003, 2004, 2005, 2007, 2008, 2009 2 Copyright (C) 1987, 1992, 1994, 2000, 2003, 2004, 2005, 2007, 2008, 2009,
3 Free Software Foundation, Inc. 3 2010 Free Software Foundation, Inc.
4 4
5 This file is part of GCC 5 This file is part of GCC
6 6
7 GCC is free software; you can redistribute it and/or modify it under 7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free 8 the terms of the GNU General Public License as published by the Free
574 574
575 575
576 /* Define some standard sets of registers. */ 576 /* Define some standard sets of registers. */
577 577
578 /* Indexed by hard register number, contains 1 for registers 578 /* Indexed by hard register number, contains 1 for registers
579 that are fixed use (stack pointer, pc, frame pointer, etc.).
580 These are the registers that cannot be used to allocate
581 a pseudo reg whose life does not cross calls. */
582
583 extern char fixed_regs[FIRST_PSEUDO_REGISTER];
584
585 /* The same info as a HARD_REG_SET. */
586
587 extern HARD_REG_SET fixed_reg_set;
588
589 /* Indexed by hard register number, contains 1 for registers
590 that are fixed use or are clobbered by function calls.
591 These are the registers that cannot be used to allocate
592 a pseudo reg whose life crosses calls. */
593
594 extern char call_used_regs[FIRST_PSEUDO_REGISTER];
595
596 #ifdef CALL_REALLY_USED_REGISTERS
597 extern char call_really_used_regs[];
598 #endif
599
600 /* The same info as a HARD_REG_SET. */
601
602 extern HARD_REG_SET call_used_reg_set;
603
604 /* Contains registers that are fixed use -- i.e. in fixed_reg_set -- or
605 a function value return register or TARGET_STRUCT_VALUE_RTX or
606 STATIC_CHAIN_REGNUM. These are the registers that cannot hold quantities
607 across calls even if we are willing to save and restore them. */
608
609 extern HARD_REG_SET call_fixed_reg_set;
610
611 /* Indexed by hard register number, contains 1 for registers
612 that are being used for global register decls. 579 that are being used for global register decls.
613 These must be exempt from ordinary flow analysis 580 These must be exempt from ordinary flow analysis
614 and are also considered fixed. */ 581 and are also considered fixed. */
615 582
616 extern char global_regs[FIRST_PSEUDO_REGISTER]; 583 extern char global_regs[FIRST_PSEUDO_REGISTER];
617 584
618 /* Contains 1 for registers that are set or clobbered by calls. */ 585 struct target_hard_regs {
619 /* ??? Ideally, this would be just call_used_regs plus global_regs, but 586 /* Indexed by hard register number, contains 1 for registers
620 for someone's bright idea to have call_used_regs strictly include 587 that are fixed use (stack pointer, pc, frame pointer, etc.;.
621 fixed_regs. Which leaves us guessing as to the set of fixed_regs 588 These are the registers that cannot be used to allocate
622 that are actually preserved. We know for sure that those associated 589 a pseudo reg whose life does not cross calls. */
623 with the local stack frame are safe, but scant others. */ 590 char x_fixed_regs[FIRST_PSEUDO_REGISTER];
624 591
625 extern HARD_REG_SET regs_invalidated_by_call; 592 /* The same info as a HARD_REG_SET. */
626 593 HARD_REG_SET x_fixed_reg_set;
627 /* Call used hard registers which can not be saved because there is no 594
628 insn for this. */ 595 /* Indexed by hard register number, contains 1 for registers
629 596 that are fixed use or are clobbered by function calls.
630 extern HARD_REG_SET no_caller_save_reg_set; 597 These are the registers that cannot be used to allocate
631 598 a pseudo reg whose life crosses calls. */
632 #ifdef REG_ALLOC_ORDER 599 char x_call_used_regs[FIRST_PSEUDO_REGISTER];
633 /* Table of register numbers in the order in which to try to use them. */ 600
634 601 char x_call_really_used_regs[FIRST_PSEUDO_REGISTER];
635 extern int reg_alloc_order[FIRST_PSEUDO_REGISTER]; 602
636 603 /* The same info as a HARD_REG_SET. */
637 /* The inverse of reg_alloc_order. */ 604 HARD_REG_SET x_call_used_reg_set;
638 605
639 extern int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER]; 606 /* Contains registers that are fixed use -- i.e. in fixed_reg_set -- or
607 a function value return register or TARGET_STRUCT_VALUE_RTX or
608 STATIC_CHAIN_REGNUM. These are the registers that cannot hold quantities
609 across calls even if we are willing to save and restore them. */
610 HARD_REG_SET x_call_fixed_reg_set;
611
612 /* Contains 1 for registers that are set or clobbered by calls. */
613 /* ??? Ideally, this would be just call_used_regs plus global_regs, but
614 for someone's bright idea to have call_used_regs strictly include
615 fixed_regs. Which leaves us guessing as to the set of fixed_regs
616 that are actually preserved. We know for sure that those associated
617 with the local stack frame are safe, but scant others. */
618 HARD_REG_SET x_regs_invalidated_by_call;
619
620 /* Call used hard registers which can not be saved because there is no
621 insn for this. */
622 HARD_REG_SET x_no_caller_save_reg_set;
623
624 /* Table of register numbers in the order in which to try to use them. */
625 int x_reg_alloc_order[FIRST_PSEUDO_REGISTER];
626
627 /* The inverse of reg_alloc_order. */
628 int x_inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
629
630 /* For each reg class, a HARD_REG_SET saying which registers are in it. */
631 HARD_REG_SET x_reg_class_contents[N_REG_CLASSES];
632
633 /* For each reg class, a boolean saying whether the class contains only
634 fixed registers. */
635 bool x_class_only_fixed_regs[N_REG_CLASSES];
636
637 /* For each reg class, number of regs it contains. */
638 unsigned int x_reg_class_size[N_REG_CLASSES];
639
640 /* For each reg class, table listing all the classes contained in it. */
641 enum reg_class x_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
642
643 /* For each pair of reg classes,
644 a largest reg class contained in their union. */
645 enum reg_class x_reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
646
647 /* For each pair of reg classes,
648 the smallest reg class that contains their union. */
649 enum reg_class x_reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
650
651 /* Vector indexed by hardware reg giving its name. */
652 const char *x_reg_names[FIRST_PSEUDO_REGISTER];
653 };
654
655 extern struct target_hard_regs default_target_hard_regs;
656 #if SWITCHABLE_TARGET
657 extern struct target_hard_regs *this_target_hard_regs;
658 #else
659 #define this_target_hard_regs (&default_target_hard_regs)
640 #endif 660 #endif
641 661
642 /* For each reg class, a HARD_REG_SET saying which registers are in it. */ 662 #define fixed_regs \
643 663 (this_target_hard_regs->x_fixed_regs)
644 extern HARD_REG_SET reg_class_contents[N_REG_CLASSES]; 664 #define fixed_reg_set \
645 665 (this_target_hard_regs->x_fixed_reg_set)
646 /* For each reg class, number of regs it contains. */ 666 #define call_used_regs \
647 667 (this_target_hard_regs->x_call_used_regs)
648 extern unsigned int reg_class_size[N_REG_CLASSES]; 668 #define call_really_used_regs \
649 669 (this_target_hard_regs->x_call_really_used_regs)
650 /* For each reg class, table listing all the classes contained in it. */ 670 #define call_used_reg_set \
651 671 (this_target_hard_regs->x_call_used_reg_set)
652 extern enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES]; 672 #define call_fixed_reg_set \
653 673 (this_target_hard_regs->x_call_fixed_reg_set)
654 /* For each pair of reg classes, 674 #define regs_invalidated_by_call \
655 a largest reg class contained in their union. */ 675 (this_target_hard_regs->x_regs_invalidated_by_call)
656 676 #define no_caller_save_reg_set \
657 extern enum reg_class reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES]; 677 (this_target_hard_regs->x_no_caller_save_reg_set)
658 678 #define reg_alloc_order \
659 /* For each pair of reg classes, 679 (this_target_hard_regs->x_reg_alloc_order)
660 the smallest reg class that contains their union. */ 680 #define inv_reg_alloc_order \
661 681 (this_target_hard_regs->x_inv_reg_alloc_order)
662 extern enum reg_class reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES]; 682 #define reg_class_contents \
663 683 (this_target_hard_regs->x_reg_class_contents)
664 /* Vector indexed by hardware reg giving its name. */ 684 #define class_only_fixed_regs \
665 685 (this_target_hard_regs->x_class_only_fixed_regs)
666 extern const char * reg_names[FIRST_PSEUDO_REGISTER]; 686 #define reg_class_size \
687 (this_target_hard_regs->x_reg_class_size)
688 #define reg_class_subclasses \
689 (this_target_hard_regs->x_reg_class_subclasses)
690 #define reg_class_subunion \
691 (this_target_hard_regs->x_reg_class_subunion)
692 #define reg_class_superunion \
693 (this_target_hard_regs->x_reg_class_superunion)
694 #define reg_names \
695 (this_target_hard_regs->x_reg_names)
667 696
668 /* Vector indexed by reg class giving its name. */ 697 /* Vector indexed by reg class giving its name. */
669 698
670 extern const char * reg_class_names[]; 699 extern const char * reg_class_names[];
671 700