示例#1
0
文件: main.cpp 项目: sztomi/tememu
TEST(RInstruction, ExtractRt2)
{
	int32 inst(0x0399e021);
    EXPECT_EQ(RT(inst), 25);
}
示例#2
0
void StoichSubstance::getStandardChemPotentials(doublereal* mu0) const
{
    getGibbs_RT(mu0);
    mu0[0] *= RT();
}
示例#3
0
文件: error2.C 项目: VargMon/dd-wrt
 Test(const RT& c = RT()) {} // ERROR - reference to void
void SemiconductorPhase::getChemPotentials(doublereal* mu) const
{
    getActivityConcentrations(m_work.data());
    mu[0] = ec() + RT()*(JoyceDixon(m_work[0]/nc()));
    mu[1] = ev() + RT()*(log(m_work[1]/nv()));
}
示例#5
0
 static RT
 eval(Env const& env, A0& _0, A1& _1)
 {
     return RT(_0.eval(env), _1.eval(env));
 }
示例#6
0
void MineralEQ3::getEnthalpy_RT(doublereal* hrt) const
{
    getEnthalpy_RT_ref(hrt);
    doublereal presCorrect = (m_press - m_p0) / molarDensity();
    hrt[0] += presCorrect / RT();
}
示例#7
0
 RT SymBandSVDiv<T>::condition() const 
 { 
     return pimpl->S.size() > 0 ? 
         pimpl->S(0)/pimpl->S(pimpl->S.size()-1) : RT(1);
 }
示例#8
0
 static RT
 eval(Env const& env)
 {
     return RT();
 }
示例#9
0
 RT HermBandSVDiv<T>::condition() const 
 { 
     return pimpl->S.size() > 0 ? 
         TMV_ABS(pimpl->S(0)/pimpl->S(pimpl->S.size()-1)) : RT(1);
 }
示例#10
0
 RT SymBandSVDiv<T>::norm2() const 
 { return pimpl->S.size() > 0 ? pimpl->S(0) : RT(0); }
示例#11
0
 RT HermBandSVDiv<T>::norm2() const 
 { return pimpl->S.size() > 0 ? TMV_ABS(pimpl->S(0)) : RT(0); }
示例#12
0
 Test(const RT& c = RT()) {} // { dg-error "" } reference to void
示例#13
0
const struct logoInstructionDef instructions[] = {
	
	SET_ALT(100)
	
	// Go Home and point North
	HOME
	
	REPEAT_FOREVER
		DO_ARG(SQUARE, 100)
	END
	
	
	TO (SQUARE)
		REPEAT(4)
			FD_PARAM
			RT(90)
		END
	END
} ;


////////////////////////////////////////////////////////////////////////////////
// RTL Flight Plan
// 
// On entering RTL mode, turn off the engine, fly home, and circle indefinitely until touching down

const struct logoInstructionDef rtlInstructions[] = {
	
	// Use cross-tracking for navigation
	FLAG_ON(F_CROSS_TRACK)
	
示例#14
0
void StoichSubstance::getEnthalpy_RT(doublereal* hrt) const
{
    getEnthalpy_RT_ref(hrt);
    doublereal presCorrect = (m_press - m_p0) / molarDensity();
    hrt[0] += presCorrect / RT();
}
示例#15
0
void FixedChemPotSSTP::getEnthalpy_RT_ref(doublereal* hrt) const
{
    hrt[0] = chemPot_ / RT();
}
示例#16
0
void StoichSubstance::getIntEnergy_RT_ref(doublereal* urt) const
{
    _updateThermo();
    urt[0] = m_h0_RT - m_p0 / molarDensity() / RT();
}
示例#17
0
void FixedChemPotSSTP::getGibbs_RT_ref(doublereal* grt) const
{
    grt[0] = chemPot_ / RT();
}
示例#18
0
 static RT
 eval(Env const& env, A0& _0)
 {
     return RT(_0.eval(env));
 }
示例#19
0
文件: main.cpp 项目: sztomi/tememu
TEST(IInstruction, ExtractRd1)
{
	int32 inst(0xffffffff);
    EXPECT_EQ(RT(inst), 31);
}
示例#20
0
void MineralEQ3::getStandardChemPotentials(doublereal* mu0) const
{
    getGibbs_RT(mu0);
    mu0[0] *= RT();
}
示例#21
0
文件: main.cpp 项目: sztomi/tememu
TEST(IInstruction, ExtractRd2)
{
	int32 inst(0x24625bfa);
    EXPECT_EQ(RT(inst), 2);
}
示例#22
0
static inline int do_32(unsigned long inst, struct pt_regs *regs)
{
	int imm, regular, load, len, sign_ext;
	unsigned long unaligned_addr, target_val, shift;

	unaligned_addr = *idx_to_addr(regs, RA(inst));

	switch ((inst >> 25) << 1) {

	case 0x02:		/* LHI       */
		imm = 1;
		regular = 1;
		load = 1;
		len = 2;
		sign_ext = 0;
		break;
	case 0x0A:		/* LHI.bi    */
		imm = 1;
		regular = 0;
		load = 1;
		len = 2;
		sign_ext = 0;
		break;
	case 0x22:		/* LHSI      */
		imm = 1;
		regular = 1;
		load = 1;
		len = 2;
		sign_ext = 1;
		break;
	case 0x2A:		/* LHSI.bi   */
		imm = 1;
		regular = 0;
		load = 1;
		len = 2;
		sign_ext = 1;
		break;
	case 0x04:		/* LWI       */
		imm = 1;
		regular = 1;
		load = 1;
		len = 4;
		sign_ext = 0;
		break;
	case 0x0C:		/* LWI.bi    */
		imm = 1;
		regular = 0;
		load = 1;
		len = 4;
		sign_ext = 0;
		break;
	case 0x12:		/* SHI       */
		imm = 1;
		regular = 1;
		load = 0;
		len = 2;
		sign_ext = 0;
		break;
	case 0x1A:		/* SHI.bi    */
		imm = 1;
		regular = 0;
		load = 0;
		len = 2;
		sign_ext = 0;
		break;
	case 0x14:		/* SWI       */
		imm = 1;
		regular = 1;
		load = 0;
		len = 4;
		sign_ext = 0;
		break;
	case 0x1C:		/* SWI.bi    */
		imm = 1;
		regular = 0;
		load = 0;
		len = 4;
		sign_ext = 0;
		break;

	default:
		switch (inst & 0xff) {

		case 0x01:	/* LH        */
			imm = 0;
			regular = 1;
			load = 1;
			len = 2;
			sign_ext = 0;
			break;
		case 0x05:	/* LH.bi     */
			imm = 0;
			regular = 0;
			load = 1;
			len = 2;
			sign_ext = 0;
			break;
		case 0x11:	/* LHS       */
			imm = 0;
			regular = 1;
			load = 1;
			len = 2;
			sign_ext = 1;
			break;
		case 0x15:	/* LHS.bi    */
			imm = 0;
			regular = 0;
			load = 1;
			len = 2;
			sign_ext = 1;
			break;
		case 0x02:	/* LW        */
			imm = 0;
			regular = 1;
			load = 1;
			len = 4;
			sign_ext = 0;
			break;
		case 0x06:	/* LW.bi     */
			imm = 0;
			regular = 0;
			load = 1;
			len = 4;
			sign_ext = 0;
			break;
		case 0x09:	/* SH        */
			imm = 0;
			regular = 1;
			load = 0;
			len = 2;
			sign_ext = 0;
			break;
		case 0x0D:	/* SH.bi     */
			imm = 0;
			regular = 0;
			load = 0;
			len = 2;
			sign_ext = 0;
			break;
		case 0x0A:	/* SW        */
			imm = 0;
			regular = 1;
			load = 0;
			len = 4;
			sign_ext = 0;
			break;
		case 0x0E:	/* SW.bi     */
			imm = 0;
			regular = 0;
			load = 0;
			len = 4;
			sign_ext = 0;
			break;

		default:
			return -EFAULT;
		}
	}

	if (imm)
		shift = GET_IMMSVAL(IMM(inst)) * len;
	else
		shift = *idx_to_addr(regs, RB(inst)) << SV(inst);

	if (regular)
		unaligned_addr += shift;

	if (load) {

		if (!access_ok(VERIFY_READ, (void *)unaligned_addr, len))
			return -EACCES;

		get_data(unaligned_addr, &target_val, len);

		if (sign_ext)
			*idx_to_addr(regs, RT(inst)) =
			    sign_extend(target_val, len);
		else
			*idx_to_addr(regs, RT(inst)) = target_val;
	} else {

		if (!access_ok(VERIFY_WRITE, (void *)unaligned_addr, len))
			return -EACCES;

		target_val = *idx_to_addr(regs, RT(inst));
		set_data((void *)unaligned_addr, target_val, len);
	}

	if (!regular)
		*idx_to_addr(regs, RA(inst)) = unaligned_addr + shift;

	regs->ipc += 4;

	return 0;
fault:
	return -EACCES;
}
示例#23
0
文件: main.cpp 项目: sztomi/tememu
TEST(RInstruction, ExtractRt1)
{
	int32 inst(0xFFFFFFFF);
    EXPECT_EQ(RT(inst), 31);
}
示例#24
0
void MineralEQ3::getIntEnergy_RT(doublereal* urt) const
{
    _updateThermo();
    urt[0] = m_h0_RT - m_p0 / molarDensity() / RT();
}
示例#25
0
 static RT
 eval(Env const& /*env*/)
 {
     return RT();
 }