Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
pf_cg.h
Go to the documentation of this file.
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 pf_cg_INCLUDED
00037 #define pf_cg_INCLUDED
00038 
00039 #include "wn.h"
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif /* __cplusplus */
00044 
00045 typedef struct pf_pointer {
00046   WN* wn_pref_1L;
00047   WN* wn_pref_2L;
00048   WN_OFFSET distance_1L;
00049   WN_OFFSET distance_2L;
00050   mINT16 lrnum_1L;
00051   mINT16 lrnum_2L;
00052   mUINT32 flag;
00053 } PF_POINTER;
00054 
00055 /* flag structure 
00056      bits 8-11:  L1 confidence
00057      bits 12-15: L2 confidence
00058 */
00059 #define GET_CONF_1L(flag)   (((flag) >> 8) & 0xf)
00060 #define SET_CONF_1L(flag,x) flag=(((flag) & 0xfffff0ff) | (((x) & 0xf) << 8))
00061 
00062 #define GET_CONF_2L(flag)   (((flag) >> 12) & 0xf)
00063 #define SET_CONF_2L(flag,x) flag=(((flag) & 0xffff0fff) | (((x) & 0xf) << 12))
00064 
00065 #define PF_PTR_wn_pref_1L(pp)   ((pp)->wn_pref_1L)
00066 #define PF_PTR_wn_pref_2L(pp)   ((pp)->wn_pref_2L)
00067 #define PF_PTR_distance_1L(pp)  ((pp)->distance_1L)
00068 #define PF_PTR_distance_2L(pp)  ((pp)->distance_2L)
00069 #define PF_PTR_lrnum_1L(pp)     ((pp)->lrnum_1L)
00070 #define PF_PTR_lrnum_2L(pp)     ((pp)->lrnum_2L)
00071 #define PF_PTR_flag(pp)         ((pp)->flag)
00072 
00073 #define PF_PTR_conf_1L(pp)       (GET_CONF_1L(PF_PTR_flag(pp)))
00074 #define PF_PTR_set_conf_1L(pp,x) (SET_CONF_1L(PF_PTR_flag(pp),x))
00075 
00076 #define PF_PTR_conf_2L(pp)       (GET_CONF_2L(PF_PTR_flag(pp)))
00077 #define PF_PTR_set_conf_2L(pp,x) (SET_CONF_2L(PF_PTR_flag(pp),x))
00078 
00079 /* Macros to access visited bit in pf_pointer. */
00080 #define VISITED_BIT          0x1
00081 #define VISIT_CM_BIT         0x2
00082 #define VISIT_EM_BIT         0x4
00083 #define AUTO_BIT             0x8
00084 #define PF_PRUNED_BIT        0x10   // the prefetch is pruned by CG
00085 
00086 #define VISITED(pp)          (((pp)->flag) & VISITED_BIT)
00087 #define SET_VISITED(pp)      ((pp)->flag |=  VISITED_BIT)
00088 #define RESET_VISITED(pp)    ((pp)->flag &= ~VISITED_BIT)
00089 
00090 #define VISITED_CM(pp)       (((pp)->flag) & VISIT_CM_BIT)
00091 #define SET_VISITED_CM(pp)   ((pp)->flag |=  VISIT_CM_BIT)
00092 #define RESET_VISITED_CM(pp) ((pp)->flag &= ~VISIT_CM_BIT)
00093 
00094 #define VISITED_EM(pp)       (((pp)->flag) & VISIT_EM_BIT)
00095 #define SET_VISITED_EM(pp)   ((pp)->flag |=  VISIT_EM_BIT)
00096 #define RESET_VISITED_EM(pp) ((pp)->flag &= ~VISIT_EM_BIT)
00097 
00098 #define AUTO(pp)             (((pp)->flag) & AUTO_BIT)
00099 #define SET_AUTO(pp)         ((pp)->flag |=  AUTO_BIT)
00100 #define RESET_AUTO(pp)       ((pp)->flag &= ~AUTO_BIT)
00101 
00102 #define PF_PRUNED(pp)        (((pp)->flag) & PF_PRUNED_BIT)
00103 #define SET_PF_PRUNED(pp)    ((pp)->flag |=  PF_PRUNED_BIT)
00104 #define RESET_PF_PRUNED(pp)  ((pp)->flag &= ~PF_PRUNED_BIT)
00105 
00106 #ifdef __cplusplus
00107 }
00108 #endif /* __cplusplus */
00109 
00110 #endif /* pf_cg_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines