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