Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
targ_sim.cxx File Reference
#include <limits.h>
#include "defs.h"
#include "mtypes.h"
#include "errors.h"
#include "erglob.h"
#include "stab.h"
#include "config_targ.h"
#include "targ_sim.h"
#include "targ_sim_body.h"
Include dependency graph for targ_sim.cxx:

Go to the source code of this file.

Classes

struct  PSTRUCT

Defines

#define TRACE_ENTRY(x)
#define TRACE_EXIT(x)
#define TRACE_EXIT_i(x, i)
#define I0   (Int_Preg_Min_Offset - 1)
#define F0   Float_Preg_Min_Offset
#define PSTRUCT_struct   pstruct.is_struct
#define PSTRUCT_first_call   pstruct.first_call
#define PSTRUCT_hfa   pstruct.is_hfa
#define PSTRUCT_hfa_mtype   pstruct.hfa_mtype
#define PSTRUCT_offset   pstruct.offset
#define PSTRUCT_size   pstruct.size

Functions

static BOOL Struct_Is_HFA (const TY_IDX, Mtype_Return_Level, TYPE_ID &)
BOOL Is_Return_Preg (PREG_NUM preg)
BOOL Is_Int_Output_Preg (PREG_NUM preg)
BOOL Is_Formal_Preg (PREG_NUM preg)
static BOOL Array_Is_HFA (const TY_IDX ty, Mtype_Return_Level level, TYPE_ID &hfa_mtype)
static BOOL Struct_Has_One_Float (const TY_IDX ty, TYPE_ID &ftype)
static BOOL no_overlap (const FLD_HANDLE fld1, const FLD_HANDLE fld2)
static BOOL Struct_Has_Two_Floats (const TY_IDX ty, TYPE_ID &ftype1, TYPE_ID &ftype2)
static BOOL Is_Simulated_Type (TYPE_ID mtype)
void Get_Return_Mtypes (TY_IDX rtype, Mtype_Return_Level level, TYPE_ID *mreg1, TYPE_ID *mreg2)
void Get_Return_Pregs (TYPE_ID mreg1, TYPE_ID mreg2, PREG_NUM *rreg1, PREG_NUM *rreg2)
RETURN_INFO Get_Return_Info (TY_IDX rtype, Mtype_Return_Level level)
static PLOC Setup_Parameter_Locations (TY_IDX pu_type)
static PREG_NUM Get_Current_Float_Preg_Num (Preg_Range pr)
static PLOC Get_Parameter_Location (TY_IDX ty, BOOL is_output)
static void Setup_Struct_Parameter_Locations (TY_IDX struct_ty)
static PLOC Get_Struct_Parameter_Location (PLOC prev)
static PLOC Get_Vararg_Parameter_Location (PLOC prev)
void Init_Targ_Sim (void)

Variables

static mDED_PREG_NUM Input_Base_Preg = 32
static mDED_PREG_NUM Output_Base_Preg = 127
SIM SIM_Info []
static INT Current_Float_Param_Num = -1
static BOOL First_Param_In_Return_Reg = FALSE
static PSTRUCT pstruct
BOOL Is_Caller_Save_GP
INT Formal_Save_Area_Size = 64
INT Stack_Offset_Adjustment = 16

Define Documentation

#define F0   Float_Preg_Min_Offset

Definition at line 65 of file targ_sim.cxx.

#define I0   (Int_Preg_Min_Offset - 1)

Definition at line 64 of file targ_sim.cxx.

#define PSTRUCT_first_call   pstruct.first_call
#define PSTRUCT_hfa   pstruct.is_hfa
#define PSTRUCT_hfa_mtype   pstruct.hfa_mtype
#define PSTRUCT_offset   pstruct.offset
#define PSTRUCT_struct   pstruct.is_struct
#define TRACE_ENTRY (   x)

Definition at line 45 of file targ_sim.cxx.

Referenced by Get_Current_Float_Preg_Num().

#define TRACE_EXIT (   x)

Definition at line 46 of file targ_sim.cxx.

#define TRACE_EXIT_i (   x,
 
)

Definition at line 47 of file targ_sim.cxx.

Referenced by Get_Current_Float_Preg_Num().


Function Documentation

static BOOL Array_Is_HFA ( const TY_IDX  ty,
Mtype_Return_Level  level,
TYPE_ID hfa_mtype 
) [static]

Definition at line 138 of file targ_sim.cxx.

References FALSE, KIND_ARRAY, KIND_SCALAR, KIND_STRUCT, MTYPE_C10, MTYPE_C16, MTYPE_C4, MTYPE_C8, MTYPE_CQ, MTYPE_F10, MTYPE_F16, MTYPE_F4, MTYPE_F8, MTYPE_FQ, MTYPE_V, Struct_Is_HFA(), TRUE, TY_etype(), TY_kind(), and TY_mtype().

Referenced by Struct_Is_HFA().

Here is the call graph for this function:

void Get_Return_Mtypes ( TY_IDX  rtype,
Mtype_Return_Level  level,
TYPE_ID mreg1,
TYPE_ID mreg2 
)
void Get_Return_Pregs ( TYPE_ID  mreg1,
TYPE_ID  mreg2,
PREG_NUM rreg1,
PREG_NUM rreg2 
)

Definition at line 378 of file targ_sim.cxx.

References Fail_FmtAssertion().

Referenced by cwh_stmt_return_altentry(), cwh_stmt_return_scalar(), Find_Return_Registers(), WN_Verifier::Is_return_register_of_call(), and PUinfo_Get_ReturnPreg().

Here is the call graph for this function:

static PLOC Get_Vararg_Parameter_Location ( PLOC  prev) [static]

Definition at line 936 of file targ_sim.cxx.

References Current_Param_Num, Get_Current_Preg_Num(), Last_Param_Offset, MTYPE_RegisterSize, next, PR_last_reg, PLOC::reg, SIM_INFO, PLOC::size, and PLOC::start_offset.

Here is the call graph for this function:

void Init_Targ_Sim ( void  )

Definition at line 963 of file targ_sim.cxx.

References Is_Caller_Save_GP, and SIM_caller_save_gp.

Referenced by Configure_Target().

static BOOL Is_Simulated_Type ( TYPE_ID  mtype) [static]

Definition at line 341 of file targ_sim.cxx.

References FALSE, MTYPE_C4, MTYPE_C8, MTYPE_CQ, MTYPE_FQ, and TRUE.

static BOOL no_overlap ( const FLD_HANDLE  fld1,
const FLD_HANDLE  fld2 
) [static]

Definition at line 302 of file targ_sim.cxx.

References FLD_ofst(), FLD_type(), and TY_size().

Referenced by Struct_Has_Two_Floats().

Here is the call graph for this function:

static void Setup_Struct_Parameter_Locations ( TY_IDX  struct_ty) [static]

Definition at line 844 of file targ_sim.cxx.

References No_Simulated, PSTRUCT_first_call, PSTRUCT_hfa, PSTRUCT_hfa_mtype, PSTRUCT_offset, PSTRUCT_size, PSTRUCT_struct, Struct_Is_HFA(), TRUE, TY_is_union(), and TY_size().

Here is the call graph for this function:

static BOOL Struct_Has_One_Float ( const TY_IDX  ty,
TYPE_ID ftype 
) [static]

Definition at line 279 of file targ_sim.cxx.

References FALSE, FLD_last_field(), FLD_type(), KIND_SCALAR, MTYPE_float, MTYPE_V, TRUE, TY_fld(), TY_is_union(), TY_kind(), and TY_mtype().

Here is the call graph for this function:

static BOOL Struct_Has_Two_Floats ( const TY_IDX  ty,
TYPE_ID ftype1,
TYPE_ID ftype2 
) [static]

Definition at line 311 of file targ_sim.cxx.

References FALSE, FLD_last_field(), FLD_next(), FLD_type(), KIND_SCALAR, MTYPE_float, MTYPE_V, no_overlap(), TRUE, TY_fld(), TY_is_union(), TY_kind(), and TY_mtype().

Here is the call graph for this function:


Variable Documentation

Definition at line 606 of file targ_sim.cxx.

Referenced by Get_Parameter_Location(), and Setup_Parameter_Locations().

Definition at line 61 of file targ_sim.cxx.

Referenced by Get_Parameter_Location().

Definition at line 957 of file targ_sim.cxx.

Referenced by Init_Targ_Sim().

Definition at line 62 of file targ_sim.cxx.

Referenced by Get_Parameter_Location(), and Is_Int_Output_Preg().

PSTRUCT pstruct [static]

Definition at line 834 of file targ_sim.cxx.

Definition at line 68 of file targ_sim.cxx.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines