00001 /* 00002 Copyright (C) 2000-2003, Intel Corporation 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, 00006 are permitted provided that the following conditions are met: 00007 00008 Redistributions of source code must retain the above copyright notice, this list 00009 of conditions and the following disclaimer. 00010 00011 Redistributions in binary form must reproduce the above copyright notice, this list 00012 of conditions and the following disclaimer in the documentation and/or other materials 00013 provided with the distribution. 00014 00015 Neither the name of the owner nor the names of its contributors may be used to endorse or 00016 promote products derived from this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 00019 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00020 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR 00021 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 00023 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00024 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00025 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00026 */ 00027 00028 //-*-C++-*- 00029 00030 //============================================================================= 00031 //============================================================================= 00032 // 00033 // Module : recovery.h 00034 // $Date : 2001/02/20 21:12:34 $ 00035 // $Author: marcel $ 00036 // $Source: /proj/osprey/CVS/open64/osprey1.0/be/cg/orc_intel/recovery.h,v $ 00037 // 00038 // Description: 00039 // ============ 00040 // 00041 // Interface to Ipfec Recovery Code Generation. 00042 // 00043 //============================================================================= 00044 //============================================================================= 00045 00046 00047 #ifndef recovery_INCLUDED 00048 #define recovery_INCLUDED 00049 00050 00051 #include "speculation.h" 00052 #include "tn.h" 00053 #include "region.h" 00054 #include "op.h" 00055 00056 00057 extern int Generate_Recovery_Code(); 00058 extern void Adjust_Recovery_Block(); 00059 extern BB* Handle_Chk_Split_Bunch(BB*); 00060 extern void Force_Chk_Fail(); 00061 00062 00063 #define rec_prob 0.01F 00064 #define btm_prob 0.99F 00065 00066 00067 #define chks_reg_pos 1 00068 #define chks_tgt_pos 2 00069 00070 #define chka_reg_pos 2 00071 #define chka_tgt_pos 3 00072 00073 00074 //============================================================================= 00075 // Set_chk_tgt 00076 // - Set chk_op's branch target opnd. 00077 // 00078 // Get_chk_tgt 00079 // - Get chk_op's branch target opnd. 00080 // 00081 // Set_chk_reg 00082 // - Set the under checking opnd of the chk_op. 00083 // 00084 // Get_chk_reg 00085 // - Get the under checking opnd of the chk_op. 00086 // 00087 // BB_chk_op 00088 // - If the BB's last op is a chk op, return it, or return NULL. 00089 //============================================================================= 00090 inline OP* 00091 Set_chk_tgt(OP *chk_op, TN *target_tn) 00092 { 00093 Is_True(OP_chk(chk_op),("not a chk op!")); 00094 00095 INT target_pos; 00096 target_pos = OP_chk_s(chk_op) ? chks_tgt_pos : chka_tgt_pos ; 00097 Set_OP_opnd(chk_op, target_pos, target_tn); 00098 00099 return chk_op; 00100 } 00101 00102 inline TN* 00103 Get_chk_tgt(OP* chk_op) 00104 { 00105 Is_True(OP_chk(chk_op),("not a chk op!")); 00106 00107 return ( OP_chk_s(chk_op) ? OP_opnd(chk_op,chks_tgt_pos) : 00108 OP_opnd(chk_op,chka_tgt_pos) ); 00109 } 00110 00111 inline OP* 00112 Set_chk_reg(OP *chk_op, TN *register_tn) 00113 { 00114 Is_True(OP_chk(chk_op),("not a chk op!")); 00115 00116 INT register_pos; 00117 register_pos = OP_chk_s(chk_op) ? chks_reg_pos : chka_reg_pos ; 00118 Set_OP_opnd(chk_op, register_pos, register_tn); 00119 00120 return chk_op; 00121 } 00122 00123 00124 inline TN* 00125 Get_chk_reg(OP *chk_op) 00126 { 00127 Is_True(OP_chk(chk_op),("not a chk op!")); 00128 00129 return ( OP_chk_s(chk_op) ? OP_opnd(chk_op,chks_reg_pos) : 00130 OP_opnd(chk_op,chka_reg_pos) ); 00131 } 00132 00133 inline OP* BB_chk_op( BB *bb ) 00134 { 00135 OP *last_op = BB_last_op(bb); 00136 00137 if (!last_op || !OP_chk(last_op)){ 00138 return NULL; 00139 } else { 00140 return last_op; 00141 } 00142 } 00143 00144 #endif 00145 00146 00147 00148 00149 00150
1.5.6