152284Sobrien/* Definitions for computing resource usage of specific insns. 2169689Skan Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc. 352284Sobrien 490075SobrienThis file is part of GCC. 552284Sobrien 690075SobrienGCC is free software; you can redistribute it and/or modify it under 790075Sobrienthe terms of the GNU General Public License as published by the Free 890075SobrienSoftware Foundation; either version 2, or (at your option) any later 990075Sobrienversion. 1052284Sobrien 1190075SobrienGCC is distributed in the hope that it will be useful, but WITHOUT ANY 1290075SobrienWARRANTY; without even the implied warranty of MERCHANTABILITY or 1390075SobrienFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1490075Sobrienfor more details. 1552284Sobrien 1652284SobrienYou should have received a copy of the GNU General Public License 1790075Sobrienalong with GCC; see the file COPYING. If not, write to the Free 18169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 19169689Skan02110-1301, USA. */ 2052284Sobrien 21169689Skan#ifndef GCC_RESOURCE_H 22169689Skan#define GCC_RESOURCE_H 23169689Skan 24169689Skan#include "hard-reg-set.h" 25169689Skan 2652284Sobrien/* Macro to clear all resources. */ 2752284Sobrien#define CLEAR_RESOURCE(RES) \ 2852284Sobrien do { (RES)->memory = (RES)->unch_memory = (RES)->volatil = (RES)->cc = 0; \ 2952284Sobrien CLEAR_HARD_REG_SET ((RES)->regs); } while (0) 3052284Sobrien 3190075Sobrien/* The resources used by a given insn. */ 3252284Sobrienstruct resources 3352284Sobrien{ 3452284Sobrien char memory; /* Insn sets or needs a memory location. */ 3552284Sobrien char unch_memory; /* Insn sets of needs a "unchanging" MEM. */ 3652284Sobrien char volatil; /* Insn sets or needs a volatile memory loc. */ 3752284Sobrien char cc; /* Insn sets or needs the condition codes. */ 3852284Sobrien HARD_REG_SET regs; /* Which registers are set or needed. */ 3952284Sobrien}; 4052284Sobrien 4190075Sobrien/* The kinds of rtl mark_*_resources will consider */ 4290075Sobrienenum mark_resource_type 4390075Sobrien{ 4490075Sobrien MARK_SRC_DEST = 0, 45132718Skan MARK_SRC_DEST_CALL = 1 4690075Sobrien}; 4790075Sobrien 48132718Skanextern void mark_target_live_regs (rtx, rtx, struct resources *); 49132718Skanextern void mark_set_resources (rtx, struct resources *, int, 50132718Skan enum mark_resource_type); 51132718Skanextern void mark_referenced_resources (rtx, struct resources *, int); 52132718Skanextern void clear_hashed_info_for_insn (rtx); 53132718Skanextern void incr_ticks_for_insn (rtx); 54132718Skanextern void mark_end_of_function_resources (rtx, int); 55132718Skanextern void init_resource_info (rtx); 56132718Skanextern void free_resource_info (void); 57169689Skan 58169689Skan#endif /* GCC_RESOURCE_H */ 59