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 #ifndef w2op_INCLUDED 00037 #define w2op_INCLUDED 00038 00039 #include "topcode.h" 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 /* Given a WHIRL opcode, return the corresponding TOP. 00046 * This will only return machine ops, 00047 * else TOP_UNDEFINED if not an exact correspondence. 00048 */ 00049 extern TOP OPCODE_To_TOP (OPCODE opcode); 00050 00051 /* Given a WHIRL node, return the corresponding TOP. 00052 * This will only return machine ops, 00053 * else TOP_UNDEFINED if not an exact correspondence. 00054 * (this handles more cases than OPCODE_To_TOP, cause it can look at kids). 00055 */ 00056 extern TOP WHIRL_To_TOP (WN *wn); 00057 00058 /* return whether MPY, DIV, or REM will be translated into shifts and adds */ 00059 extern BOOL Can_Do_Fast_Multiply (TYPE_ID mtype, INT64 val); 00060 extern BOOL Can_Do_Fast_Divide (TYPE_ID mtype, INT64 val); 00061 extern BOOL Can_Do_Fast_Remainder (TYPE_ID mtype, INT64 val); 00062 00063 /* When trying to convert a multiply or divide operation into a series 00064 * of shifts/adds/subtracts, there is some limit (cycles? ops?) at 00065 * which the conversion is not profitable. Return that limit. 00066 */ 00067 extern INT Multiply_Limit ( BOOL is_64bit, INT64 val); 00068 extern INT Divide_Limit ( BOOL is_64bit); 00069 00070 /* Return whether or not the immediate specified by <val> would be a valid 00071 * operand of the machine instruction generated by the whirl operator 00072 * <opr> with the immediate as the <whichkid> whirl operand. 00073 * The datatype of the operator is specified by <dtype> and if the 00074 * operation is an STID, <stid_st> specifies the symbol being stored to. 00075 */ 00076 extern BOOL Can_Be_Immediate(OPERATOR opr, 00077 INT64 val, 00078 TYPE_ID dtype, 00079 INT whichkid, 00080 ST *stid_st); 00081 00082 /* determine speculative execution taking into account eagerness level 00083 * 00084 */ 00085 extern BOOL TOP_Can_Be_Speculative (TOP opcode); 00086 extern BOOL WN_Can_Be_Speculative (WN *wn, struct ALIAS_MANAGER *alias); 00087 extern BOOL WN_Expr_Can_Be_Speculative (WN *wn, struct ALIAS_MANAGER *alias); 00088 extern BOOL OPCODE_Can_Be_Speculative(OPCODE opcode); 00089 00090 #ifdef __cplusplus 00091 } 00092 #endif 00093 #endif /* w2op_INCLUDED */