Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 00036 static const char source_file[] = __FILE__; 00037 00038 #include <alloca.h> 00039 00040 #include "defs.h" 00041 #include "targ_proc.h" 00042 #include "targ_proc_properties.h" 00043 #include "ti_si.h" 00044 00045 #include "ti_res.h" 00046 00047 #if defined(_GCC_NO_PRAGMAWEAK) || defined(__CYGWIN__) 00048 00049 SI_ISSUE_SLOT* const SI_issue_slots[]; 00050 const INT SI_issue_slot_count; 00051 const INT SI_resource_count; 00052 const SI_RRW SI_RRW_initializer; 00053 const SI_RRW SI_RRW_overuse_mask; 00054 const INT SI_ID_count; 00055 SI_RESOURCE* const SI_resources[]; 00056 SI* const SI_top_si[]; 00057 SI* const SI_ID_si[]; 00058 00059 #endif 00060 00061 /* ==================================================================== 00062 * 00063 * TI_RES_Can_Dual_Issue 00064 * 00065 * See interface description 00066 * 00067 * ==================================================================== 00068 */ 00069 BOOL TI_RES_Can_Dual_Issue( 00070 TOP opcode1, 00071 TOP opcode2 00072 ) 00073 { 00074 INT min_length, i; 00075 SI_RR rr1, rr2; 00076 00077 /* Quick check to see if we could ever dual issue something. 00078 */ 00079 if (!PROC_has_same_cycle_branch_shadow()) return FALSE; 00080 00081 /* Resource requirements for each. 00082 */ 00083 rr1 = TSI_Resource_Requirement(opcode1); 00084 rr2 = TSI_Resource_Requirement(opcode2); 00085 00086 /* We only have to check up to the end of the shorter of the two resource 00087 * requests. 00088 */ 00089 if ( SI_RR_Length(rr1) < SI_RR_Length(rr2) ) 00090 min_length = SI_RR_Length(rr1); 00091 else 00092 min_length = SI_RR_Length(rr2); 00093 00094 /* Check each cycle. 00095 */ 00096 for ( i = 0; i < min_length; ++i ) { 00097 SI_RRW rrw = SI_RRW_Initial(); 00098 00099 rrw = SI_RRW_Reserve(rrw,SI_RR_Cycle_RRW(rr1,i)); 00100 rrw = SI_RRW_Reserve(rrw,SI_RR_Cycle_RRW(rr2,i)); 00101 00102 if ( SI_RRW_Has_Overuse(rrw) ) return FALSE; 00103 } 00104 00105 return TRUE; 00106 }