1*e4b17023SJohn Marino /* Definitions for computing resource usage of specific insns. 2*e4b17023SJohn Marino Copyright (C) 1999, 2003, 2004, 2006, 2007, 2009, 2010 3*e4b17023SJohn Marino Free Software Foundation, Inc. 4*e4b17023SJohn Marino 5*e4b17023SJohn Marino This file is part of GCC. 6*e4b17023SJohn Marino 7*e4b17023SJohn Marino GCC is free software; you can redistribute it and/or modify it under 8*e4b17023SJohn Marino the terms of the GNU General Public License as published by the Free 9*e4b17023SJohn Marino Software Foundation; either version 3, or (at your option) any later 10*e4b17023SJohn Marino version. 11*e4b17023SJohn Marino 12*e4b17023SJohn Marino GCC is distributed in the hope that it will be useful, but WITHOUT ANY 13*e4b17023SJohn Marino WARRANTY; without even the implied warranty of MERCHANTABILITY or 14*e4b17023SJohn Marino FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15*e4b17023SJohn Marino for more details. 16*e4b17023SJohn Marino 17*e4b17023SJohn Marino You should have received a copy of the GNU General Public License 18*e4b17023SJohn Marino along with GCC; see the file COPYING3. If not see 19*e4b17023SJohn Marino <http://www.gnu.org/licenses/>. */ 20*e4b17023SJohn Marino 21*e4b17023SJohn Marino #ifndef GCC_RESOURCE_H 22*e4b17023SJohn Marino #define GCC_RESOURCE_H 23*e4b17023SJohn Marino 24*e4b17023SJohn Marino #include "hard-reg-set.h" 25*e4b17023SJohn Marino #include "df.h" 26*e4b17023SJohn Marino 27*e4b17023SJohn Marino /* Macro to clear all resources. */ 28*e4b17023SJohn Marino #define CLEAR_RESOURCE(RES) \ 29*e4b17023SJohn Marino do { (RES)->memory = (RES)->unch_memory = (RES)->volatil = (RES)->cc = 0; \ 30*e4b17023SJohn Marino CLEAR_HARD_REG_SET ((RES)->regs); } while (0) 31*e4b17023SJohn Marino 32*e4b17023SJohn Marino /* The resources used by a given insn. */ 33*e4b17023SJohn Marino struct resources 34*e4b17023SJohn Marino { 35*e4b17023SJohn Marino char memory; /* Insn sets or needs a memory location. */ 36*e4b17023SJohn Marino char unch_memory; /* Insn sets or needs an "unchanging" MEM. */ 37*e4b17023SJohn Marino char volatil; /* Insn sets or needs a volatile memory loc. */ 38*e4b17023SJohn Marino char cc; /* Insn sets or needs the condition codes. */ 39*e4b17023SJohn Marino HARD_REG_SET regs; /* Which registers are set or needed. */ 40*e4b17023SJohn Marino }; 41*e4b17023SJohn Marino 42*e4b17023SJohn Marino /* The kinds of rtl mark_*_resources will consider */ 43*e4b17023SJohn Marino enum mark_resource_type 44*e4b17023SJohn Marino { 45*e4b17023SJohn Marino MARK_SRC_DEST = 0, 46*e4b17023SJohn Marino MARK_SRC_DEST_CALL = 1 47*e4b17023SJohn Marino }; 48*e4b17023SJohn Marino 49*e4b17023SJohn Marino extern void mark_target_live_regs (rtx, rtx, struct resources *); 50*e4b17023SJohn Marino extern void mark_set_resources (rtx, struct resources *, int, 51*e4b17023SJohn Marino enum mark_resource_type); 52*e4b17023SJohn Marino extern void mark_referenced_resources (rtx, struct resources *, bool); 53*e4b17023SJohn Marino extern void clear_hashed_info_for_insn (rtx); 54*e4b17023SJohn Marino extern void incr_ticks_for_insn (rtx); 55*e4b17023SJohn Marino extern void mark_end_of_function_resources (rtx, bool); 56*e4b17023SJohn Marino extern void init_resource_info (rtx); 57*e4b17023SJohn Marino extern void free_resource_info (void); 58*e4b17023SJohn Marino 59*e4b17023SJohn Marino #endif /* GCC_RESOURCE_H */ 60