resource.h revision 52284
152284Sobrien/* Definitions for computing resource usage of specific insns. 252284Sobrien Copyright (C) 1999 Free Software Foundation, Inc. 352284Sobrien 452284SobrienThis file is part of GNU CC. 552284Sobrien 652284SobrienGNU CC is free software; you can redistribute it and/or modify 752284Sobrienit under the terms of the GNU General Public License as published by 852284Sobrienthe Free Software Foundation; either version 2, or (at your option) 952284Sobrienany later version. 1052284Sobrien 1152284SobrienGNU CC is distributed in the hope that it will be useful, 1252284Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 1352284SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1452284SobrienGNU General Public License for more details. 1552284Sobrien 1652284SobrienYou should have received a copy of the GNU General Public License 1752284Sobrienalong with GNU CC; see the file COPYING. If not, write to 1852284Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330, 1952284SobrienBoston, MA 02111-1307, USA. */ 2052284Sobrien 2152284Sobrien/* Macro to clear all resources. */ 2252284Sobrien#define CLEAR_RESOURCE(RES) \ 2352284Sobrien do { (RES)->memory = (RES)->unch_memory = (RES)->volatil = (RES)->cc = 0; \ 2452284Sobrien CLEAR_HARD_REG_SET ((RES)->regs); } while (0) 2552284Sobrien 2652284Sobrien/* The resources used by a given insn. */ 2752284Sobrienstruct resources 2852284Sobrien{ 2952284Sobrien char memory; /* Insn sets or needs a memory location. */ 3052284Sobrien char unch_memory; /* Insn sets of needs a "unchanging" MEM. */ 3152284Sobrien char volatil; /* Insn sets or needs a volatile memory loc. */ 3252284Sobrien char cc; /* Insn sets or needs the condition codes. */ 3352284Sobrien HARD_REG_SET regs; /* Which registers are set or needed. */ 3452284Sobrien}; 3552284Sobrien 3652284Sobrienextern void mark_target_live_regs PROTO((rtx, rtx, struct resources *)); 3752284Sobrienextern void mark_set_resources PROTO((rtx, struct resources *, int, 3852284Sobrien int)); 3952284Sobrienextern void mark_referenced_resources PROTO((rtx, struct resources *, int)); 4052284Sobrienextern void clear_hashed_info_for_insn PROTO((rtx)); 4152284Sobrienextern void incr_ticks_for_insn PROTO((rtx)); 4252284Sobrienextern void mark_end_of_function_resources PROTO ((rtx, int)); 4352284Sobrienextern void init_resource_info PROTO((rtx)); 4452284Sobrienextern void free_resource_info PROTO((void)); 4552284Sobrienextern rtx find_free_register PROTO((rtx, char *, int, 4652284Sobrien HARD_REG_SET *)); 47