ネームスペース Onikiri::EmulatorUtility::Operation


構成

struct  AsFP
struct  AShiftR
struct  AsInt
struct  BitAnd
struct  BitAndNot
struct  BitExtract
struct  BitNand
struct  BitNor
struct  BitNot
struct  BitOr
struct  BitOrNot
struct  BitXor
struct  BitXorNot
struct  BorrowOfSub
struct  BorrowOfSubWithBorrow
struct  CarryOfAdd
struct  CarryOfAddWithCarry
struct  Cast
struct  CastFP
struct  Compare
struct  CondAnd
struct  CondOr
class  DstOperand
struct  FPAbs
struct  FPAdd
struct  FPCondEqual
struct  FPCondGreater
struct  FPCondGreaterEqual
struct  FPCondLess
struct  FPCondLessEqual
struct  FPCondNotEqual
struct  FPDiv
struct  FPDoubleCopySign
struct  FPDoubleCopySignExp
struct  FPDoubleCopySignNeg
struct  FPMul
struct  FPNeg
struct  FPSqrt
struct  FPSub
struct  FPSubTest
struct  IntAdd
struct  IntCondEqual
struct  IntCondEqualNthBit
struct  IntCondGreaterEqualSigned
struct  IntCondGreaterEqualUnsigned
struct  IntCondGreaterSigned
struct  IntCondGreaterUnsigned
struct  IntCondLessEqualSigned
struct  IntCondLessEqualUnsigned
struct  IntCondLessSigned
struct  IntCondLessUnsigned
struct  IntCondNotEqual
struct  IntCondNotEqualNthBit
struct  IntConst
struct  IntDiv
struct  IntMul
struct  IntNeg
struct  IntScaledAdd
struct  IntScaledSub
struct  IntSMulh64
struct  IntSub
struct  IntUMulh64
struct  Load
struct  LShiftL
struct  LShiftR
struct  NumberOfLeadingZeros
struct  NumberOfPopulations
struct  NumberOfTrailingZeros
struct  RotateL
struct  RotateR
struct  Select
struct  SrcOperand

型定義

typedef u64 RegisterType

関数

template<typename FPType, typename IntType>
FPType AsFPFunc (IntType value)
template<typename IntType, typename FPType>
IntType AsIntFunc (FPType value)
template<typename TSrcTarget, typename TCond>
void BranchAbsCond (OpEmulationState *opState)
template<typename TSrcTarget>
void BranchAbsUncond (OpEmulationState *opState)
template<typename TSrcDisp, typename TCond>
void BranchRelCond (OpEmulationState *opState)
template<typename TSrcDisp>
void BranchRelUncond (OpEmulationState *opState)
template<typename TDest, typename TSrcTarget>
void CallAbsUncond (OpEmulationState *opState)
template<typename TDest, typename TSrcDisp>
void CallRelUncond (OpEmulationState *opState)
u64 current_pc (OpEmulationState *opState)
void do_branch (OpEmulationState *opState, u64 target)
u64 next_pc (OpEmulationState *opState)
void NoOperation (OpEmulationState *opState)
template<typename T>
ReadMemory (OpEmulationState *opState, u64 addr)
template<void(*)(OpEmulationState *) Func1, void(*)(OpEmulationState *) Func2>
void Sequence2 (OpEmulationState *opState)
template<void(*)(OpEmulationState *) Func1, void(*)(OpEmulationState *) Func2, void(*)(OpEmulationState *) Func3>
void Sequence3 (OpEmulationState *opState)
template<typename TDest, typename TFunc>
void Set (OpEmulationState *opState)
template<typename TDest, typename TFunc>
void SetFP (OpEmulationState *opState)
template<typename TDest, typename TFunc>
void SetSext (OpEmulationState *opState)
s64 SignedMulHigh64 (s64 lhs, s64 rhs)
template<typename Type, typename TValue, typename TAddr>
void Store (OpEmulationState *opState)
void testroundmode (OpEmulationState *opState)
void UndefinedOperation (OpEmulationState *opState)
u64 UnsignedMulHigh64 (u64 lhs, u64 rhs)
template<typename T>
void WriteMemory (OpEmulationState *opState, u64 addr, const T &value)


型定義

typedef u64 Onikiri::EmulatorUtility::Operation::RegisterType

GenericOperation.h50 行で定義されています。


関数

template<typename FPType, typename IntType>
FPType Onikiri::EmulatorUtility::Operation::AsFPFunc ( IntType  value  )  [inline]

GenericOperation.h101 行で定義されています。

00102 {
00103     BOOST_STATIC_ASSERT(sizeof(IntType) == sizeof(FPType));
00104 
00105     union {
00106         IntType i;
00107         FPType  f;
00108     } intfp;
00109 
00110     intfp.i = value;
00111     return intfp.f;
00112 }

template<typename IntType, typename FPType>
IntType Onikiri::EmulatorUtility::Operation::AsIntFunc ( FPType  value  )  [inline]

GenericOperation.h116 行で定義されています。

00117 {
00118     BOOST_STATIC_ASSERT(sizeof(IntType) == sizeof(FPType));
00119     union {
00120         IntType i;
00121         FPType  f;
00122     } intfp;
00123 
00124     intfp.f = value;
00125     return intfp.i;
00126 }

template<typename TSrcTarget, typename TCond>
void Onikiri::EmulatorUtility::Operation::BranchAbsCond ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1183 行で定義されています。

参照先 Onikiri::EmulatorUtility::OpEmulationState::SetTakenPC().

01184 {
01185     if ( TCond()(opState) ) {
01186         BranchAbsUncond<TSrcTarget>(opState);
01187     }
01188     else {
01189         RegisterType addr = TSrcTarget()(opState) & ~(RegisterType)0x03;
01190         opState->SetTakenPC( addr );
01191     }
01192 }

関数の呼び出しグラフ:

template<typename TSrcTarget>
void Onikiri::EmulatorUtility::Operation::BranchAbsUncond ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1162 行で定義されています。

参照先 do_branch()Onikiri::EmulatorUtility::OpEmulationState::SetTakenPC().

01163 {
01164     // <TODO> 0x03
01165     RegisterType addr = TSrcTarget()(opState) & ~(RegisterType)0x03;
01166     do_branch(opState, addr );
01167 
01168     opState->SetTakenPC(addr);
01169 }

関数の呼び出しグラフ:

template<typename TSrcDisp, typename TCond>
void Onikiri::EmulatorUtility::Operation::BranchRelCond ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1172 行で定義されています。

参照先 Onikiri::EmulatorUtility::cast_to_signed()next_pc()Onikiri::EmulatorUtility::OpEmulationState::SetTakenPC().

01173 {
01174     if ( TCond()(opState) ) {
01175         BranchRelUncond<TSrcDisp>(opState);
01176     }
01177     else {
01178         opState->SetTakenPC( next_pc(opState) + 4*cast_to_signed( TSrcDisp()(opState) ));
01179     }
01180 }

関数の呼び出しグラフ:

template<typename TSrcDisp>
void Onikiri::EmulatorUtility::Operation::BranchRelUncond ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1153 行で定義されています。

参照先 Onikiri::EmulatorUtility::cast_to_signed()do_branch()next_pc()Onikiri::EmulatorUtility::OpEmulationState::SetTakenPC().

01154 {
01155     u64 target = next_pc(opState) + 4*cast_to_signed( TSrcDisp()(opState) );
01156     do_branch(opState, target);
01157 
01158     opState->SetTakenPC(target);
01159 }

関数の呼び出しグラフ:

template<typename TDest, typename TSrcTarget>
void Onikiri::EmulatorUtility::Operation::CallAbsUncond ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1204 行で定義されています。

参照先 next_pc().

01205 {
01206     // <TODO> 0x03
01207     RegisterType ret_addr = static_cast<RegisterType>( next_pc(opState) );
01208     BranchAbsUncond<TSrcTarget>(opState);
01209     TDest::SetOperand(opState, ret_addr );
01210 }

関数の呼び出しグラフ:

template<typename TDest, typename TSrcDisp>
void Onikiri::EmulatorUtility::Operation::CallRelUncond ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1196 行で定義されています。

参照先 next_pc().

01197 {
01198     RegisterType ret_addr = static_cast<RegisterType>( next_pc(opState) );
01199     BranchRelUncond<TSrcDisp>(opState);
01200     TDest::SetOperand(opState, ret_addr );
01201 }

関数の呼び出しグラフ:

u64 Onikiri::EmulatorUtility::Operation::current_pc ( OpEmulationState *  opState  )  [inline]

GenericOperation.h66 行で定義されています。

参照先 Onikiri::EmulatorUtility::OpEmulationState::GetPC().

参照元 Onikiri::PPC64Linux::Operation::PPC64BranchRelCond()Onikiri::PPC64Linux::Operation::PPC64BranchRelUncond().

00067 {
00068     return opState->GetPC();
00069 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Onikiri::EmulatorUtility::Operation::do_branch ( OpEmulationState *  opState,
u64  target 
) [inline]

GenericOperation.h56 行で定義されています。

参照先 Onikiri::EmulatorUtility::OpEmulationState::SetTaken().

参照元 BranchAbsUncond()BranchRelUncond()Onikiri::PPC64Linux::Operation::PPC64BranchAbsUncond()Onikiri::PPC64Linux::Operation::PPC64BranchRelUncond().

00057 {
00058     opState->SetTaken(true);
00059 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

u64 Onikiri::EmulatorUtility::Operation::next_pc ( OpEmulationState *  opState  )  [inline]

GenericOperation.h61 行で定義されています。

参照先 Onikiri::EmulatorUtility::OpEmulationState::GetPC().

参照元 BranchRelCond()BranchRelUncond()CallAbsUncond()CallRelUncond()Onikiri::PPC64Linux::Operation::PPC64CallAbsUncond()Onikiri::PPC64Linux::Operation::PPC64CallRelUncond().

00062 {
00063     return opState->GetPC()+4;
00064 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Onikiri::EmulatorUtility::Operation::NoOperation ( OpEmulationState *  opState  )  [inline]

GenericOperation.h390 行で定義されています。

00391 {
00392     // no operation
00393 }

template<typename T>
T Onikiri::EmulatorUtility::Operation::ReadMemory ( OpEmulationState *  opState,
u64  addr 
) [inline]

GenericOperation.h84 行で定義されています。

参照先 Onikiri::Addr::addressOnikiri::MemAccess::addressOnikiri::EmulatorUtility::OpEmulationState::GetOpState()Onikiri::EmulatorUtility::OpEmulationState::GetPID()Onikiri::LogicalData::pidOnikiri::MemIF::Read()Onikiri::MemAccess::signOnikiri::MemAccess::sizeOnikiri::MemAccess::value.

00085 {
00086     Onikiri::MemAccess access;
00087     access.address.pid = opState->GetPID();
00088     access.address.address = addr;
00089     access.size = sizeof(T);
00090     access.sign = false;
00091     access.value = 0;
00092     opState->GetOpState()->Read( &access );
00093     return static_cast<T>( access.value );
00094 }

関数の呼び出しグラフ:

template<void(*)(OpEmulationState *) Func1, void(*)(OpEmulationState *) Func2>
void Onikiri::EmulatorUtility::Operation::Sequence2 ( OpEmulationState *  opState  )  [inline]

GenericOperation.h400 行で定義されています。

00401 {
00402     Func1(opState);
00403     Func2(opState);
00404 }

template<void(*)(OpEmulationState *) Func1, void(*)(OpEmulationState *) Func2, void(*)(OpEmulationState *) Func3>
void Onikiri::EmulatorUtility::Operation::Sequence3 ( OpEmulationState *  opState  )  [inline]

GenericOperation.h411 行で定義されています。

00412 {
00413     Func1(opState);
00414     Func2(opState);
00415     Func3(opState);
00416 }

template<typename TDest, typename TFunc>
void Onikiri::EmulatorUtility::Operation::Set ( OpEmulationState *  opState  )  [inline]

GenericOperation.h428 行で定義されています。

00429 {
00430     TDest::SetOperand(opState, TFunc()(opState) );
00431 }

template<typename TDest, typename TFunc>
void Onikiri::EmulatorUtility::Operation::SetFP ( OpEmulationState *  opState  )  [inline]

GenericOperation.h434 行で定義されています。

00435 {
00436     TDest::SetOperand(opState, AsIntFunc<RegisterType>( TFunc()(opState) ) );
00437 }

template<typename TDest, typename TFunc>
void Onikiri::EmulatorUtility::Operation::SetSext ( OpEmulationState *  opState  )  [inline]

GenericOperation.h422 行で定義されています。

参照先 Onikiri::EmulatorUtility::cast_to_signed().

00423 {
00424     TDest::SetOperand(opState, cast_to_signed( TFunc()(opState) ) );
00425 }

関数の呼び出しグラフ:

s64 Onikiri::EmulatorUtility::Operation::SignedMulHigh64 ( s64  lhs,
s64  rhs 
)

GenericOperation.cpp72 行で定義されています。

参照先 UnsignedMulHigh64().

参照元 Onikiri::EmulatorUtility::Operation::IntSMulh64< TSrc1, TSrc2 >::operator()().

00073 {
00074     // @CEZsC
00075     s64 resultSign = 1;
00076     if (lhs < 0) {
00077         lhs = -lhs;
00078         resultSign *= -1;
00079     }
00080     if (rhs < 0) {
00081         rhs = -rhs;
00082         resultSign *= -1;
00083     }
00084     s64 result = (s64)UnsignedMulHigh64((u64)lhs, (u64)rhs);
00085     return result*resultSign;
00086 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

template<typename Type, typename TValue, typename TAddr>
void Onikiri::EmulatorUtility::Operation::Store ( OpEmulationState *  opState  )  [inline]

GenericOperation.h488 行で定義されています。

00489 {
00490     WriteMemory<Type>(opState, TAddr()(opState), static_cast<Type>( TValue()(opState) ));
00491 }

void Onikiri::EmulatorUtility::Operation::testroundmode ( OpEmulationState *  opState  )  [inline]

GenericOperation.h1108 行で定義されています。

参照先 Onikiri::g_envOnikiri::Environment::Print().

参照元 Onikiri::EmulatorUtility::CommonEmulator< Traits >::CommonEmulator().

01109 {
01110     bool testResult;
01111 
01112     // IEEE double has a significand with 53 bits of precision.
01113     // So, we test rounding modes with 1 (or -1) subtracted by 1.xx * 2^(-53).
01114     // The results are rounded to [-]1 - (1 * 2^(-53)) or [-]1 - (2 * 2^(-53))
01115     // depending on the rounding modes.
01116 
01117     // Double precision floating-point numbers are displayed in hexadecimal as follows:
01118     // 1.75 * 2^(-53) == 0x3cac000000000000
01119     // 1.25 * 2^(-53) == 0x3ca4000000000000
01120     // 1 - (1 * 2^(-53)) == 0x3fefffffffffffff
01121     // 1 - (2 * 2^(-53)) == 0x3feffffffffffffe
01122     // -1 - (1 * 2^(-53)) == 0xbff0000000000000
01123     // -1 - (2 * 2^(-53)) == 0xbff0000000000001
01124 
01125     testResult = FpSubTestFunc< 1,0x3cac000000000000,FE_DOWNWARD,0x3feffffffffffffe >(opState)
01126         && FpSubTestFunc< 1,0x3cac000000000000,FE_UPWARD,0x3fefffffffffffff >(opState)
01127         && FpSubTestFunc< 1,0x3cac000000000000,FE_TONEAREST,0x3feffffffffffffe >(opState)
01128         && FpSubTestFunc< 1,0x3cac000000000000,FE_TOWARDZERO,0x3feffffffffffffe >(opState)
01129         && FpSubTestFunc< 1,0x3ca4000000000000,FE_DOWNWARD,0x3feffffffffffffe >(opState)
01130         && FpSubTestFunc< 1,0x3ca4000000000000,FE_UPWARD,0x3fefffffffffffff >(opState)
01131         && FpSubTestFunc< 1,0x3ca4000000000000,FE_TONEAREST,0x3fefffffffffffff >(opState)
01132         && FpSubTestFunc< 1,0x3ca4000000000000,FE_TOWARDZERO,0x3feffffffffffffe >(opState)
01133         && FpSubTestFunc< -1,0x3cac000000000000,FE_DOWNWARD,0xbff0000000000001 >(opState)
01134         && FpSubTestFunc< -1,0x3cac000000000000,FE_UPWARD,0xbff0000000000000 >(opState)
01135         && FpSubTestFunc< -1,0x3cac000000000000,FE_TONEAREST,0xbff0000000000001 >(opState)
01136         && FpSubTestFunc< -1,0x3cac000000000000,FE_TOWARDZERO,0xbff0000000000000 >(opState);
01137 
01138     if (!testResult)
01139     {
01140         g_env.Print("\nFP rounding mode test failed. Programs may not be executed precisely.\n");
01141     }
01142 }

関数の呼び出しグラフ:

Here is the caller graph for this function:

void Onikiri::EmulatorUtility::Operation::UndefinedOperation ( OpEmulationState *  opState  )  [inline]

GenericOperation.h383 行で定義されています。

00384 {
00385     // do nothing
00386     // opState->undef = true ?
00387 }

u64 Onikiri::EmulatorUtility::Operation::UnsignedMulHigh64 ( u64  lhs,
u64  rhs 
)

GenericOperation.cpp43 行で定義されています。

参照元 Onikiri::EmulatorUtility::Operation::IntUMulh64< TSrc1, TSrc2 >::operator()()SignedMulHigh64().

00044 {
00045     // split to high and low part
00046     u64 lhs_h = lhs >> 32;
00047     u64 lhs_l = lhs & 0xffffffff;
00048     u64 rhs_h = rhs >> 32;
00049     u64 rhs_l = rhs & 0xffffffff;
00050 
00051     u64 result = lhs_h * rhs_h;
00052 
00053     u64 lhs_l_rhs_h = lhs_l * rhs_h;
00054     u64 lhs_h_rhs_l = lhs_h * rhs_l;
00055 
00056     u64 lhs_l_rhs_l = lhs_l * rhs_l;
00057 
00058     // Add to 'result' high-order 64 bits of '(lhs_l_rhs_h<<32) + (lhs_r_rhs_l<<32) + lhs_l_rhs_l'
00059     //
00060     // Now, low-order 32 bits of lhs_l_rhs_l does not affect the result (since it generates no carry),
00061     // so we can simply take high-order 32 bits of
00062     // 'lhs_l_rhs_h&0x00000000ffffffff + lhs_h_rhs_l&0x00000000ffffffff + lhs_l_rhs_l>>32'.
00063     // and high-order 64 bits of
00064     // '(lhs_l_rhs_h&0xffffffff00000000 + lhs_h_rhs_l&0xffffffff00000000) << 32'
00065 
00066     result += (lhs_l_rhs_h>>32) + (lhs_h_rhs_l>>32);
00067     result += ((lhs_l_rhs_h&0xffffffff) + (lhs_h_rhs_l&0xffffffff) + (lhs_l_rhs_l>>32))>>32;
00068 
00069     return result;
00070 }

Here is the caller graph for this function:

template<typename T>
void Onikiri::EmulatorUtility::Operation::WriteMemory ( OpEmulationState *  opState,
u64  addr,
const T &  value 
) [inline]

GenericOperation.h72 行で定義されています。

参照先 Onikiri::Addr::addressOnikiri::MemAccess::addressOnikiri::EmulatorUtility::OpEmulationState::GetOpState()Onikiri::EmulatorUtility::OpEmulationState::GetPID()Onikiri::LogicalData::pidOnikiri::MemAccess::signOnikiri::MemAccess::sizeOnikiri::MemAccess::valueOnikiri::MemIF::Write().

00073 {
00074     Onikiri::MemAccess access;
00075     access.address.pid = opState->GetPID();
00076     access.address.address = addr;
00077     access.size = sizeof(T);
00078     access.sign = false;
00079     access.value = value;
00080     opState->GetOpState()->Write( &access );
00081 }

関数の呼び出しグラフ:


Onikiri2に対してTue Jun 18 15:31:58 2013に生成されました。  doxygen 1.4.7