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 //-*-c++-*- 00037 /* ==================================================================== 00038 * ==================================================================== 00039 * 00040 * 00041 * Description: interface for CVTL rules 00042 * 00043 * ==================================================================== 00044 * ==================================================================== 00045 */ 00046 00047 #ifndef opt_cvtl_rule_INCLUDED 00048 #define opt_cvtl_rule_INCLUDED "opt_cvtl_rule.h" 00049 00050 #include "defs.h" 00051 #include "mtypes.h" 00052 #include "opcode_core.h" 00053 00054 struct WN; // forward declaration 00055 00056 extern TYPE_ID Adjust_signed_type(TYPE_ID rtype, INT size, WN *wn); 00057 00058 // given a OPR_CVTL opcode and the number of bits it converting to, 00059 // return the actual type. 00060 extern TYPE_ID Actual_cvtl_type(OPCODE opc, INT bits); 00061 00062 extern TYPE_ID Actual_result_type(WN *wn); 00063 00064 extern TYPE_ID Actual_signed_type(TYPE_ID rtype, INT size, WN *wn); 00065 00066 // Check if TYPE_ID lhs_type is compatible with the RHS WN node 00067 extern BOOL Types_are_compatible(TYPE_ID t1, TYPE_ID t2); 00068 extern BOOL Types_are_compatible(TYPE_ID t1, WN *wn); 00069 00070 enum { NOT_AT_ALL, NEED_CVT, NEED_CVTL }; 00071 00072 // return NOT_AT_ALL, NEED_CVT, or NEED_CVTL. The reference parameter 00073 // opc returns the opcode for the conversion, if it is either NEED_CVT 00074 // or NEED_CVTL. 00075 extern INT Need_type_conversion(TYPE_ID from_ty, TYPE_ID to_ty, OPCODE *opc); 00076 extern INT Need_load_type_conversion(BOOL source_sign_extd, 00077 BOOL target_sign_extd, 00078 TYPE_ID to_ty, TYPE_ID dsc_ty, OPCODE *opc); 00079 00080 // Actual_result_type returns the data type of the tree with the 00081 // actual number of bytes that we can determine at this point. This 00082 // function helps to determine a CVTL node is required or can be 00083 // deleted by the optimizer emitter. 00084 extern TYPE_ID Actual_result_type(WN *wn); 00085 extern INT Actual_data_size(WN *wn); 00086 00087 #endif