TEST(RInstruction, ExtractRt2) { int32 inst(0x0399e021); EXPECT_EQ(RT(inst), 25); }
void StoichSubstance::getStandardChemPotentials(doublereal* mu0) const { getGibbs_RT(mu0); mu0[0] *= RT(); }
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())); }
static RT eval(Env const& env, A0& _0, A1& _1) { return RT(_0.eval(env), _1.eval(env)); }
void MineralEQ3::getEnthalpy_RT(doublereal* hrt) const { getEnthalpy_RT_ref(hrt); doublereal presCorrect = (m_press - m_p0) / molarDensity(); hrt[0] += presCorrect / RT(); }
RT SymBandSVDiv<T>::condition() const { return pimpl->S.size() > 0 ? pimpl->S(0)/pimpl->S(pimpl->S.size()-1) : RT(1); }
static RT eval(Env const& env) { return RT(); }
RT HermBandSVDiv<T>::condition() const { return pimpl->S.size() > 0 ? TMV_ABS(pimpl->S(0)/pimpl->S(pimpl->S.size()-1)) : RT(1); }
RT SymBandSVDiv<T>::norm2() const { return pimpl->S.size() > 0 ? pimpl->S(0) : RT(0); }
RT HermBandSVDiv<T>::norm2() const { return pimpl->S.size() > 0 ? TMV_ABS(pimpl->S(0)) : RT(0); }
Test(const RT& c = RT()) {} // { dg-error "" } reference to void
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)
void StoichSubstance::getEnthalpy_RT(doublereal* hrt) const { getEnthalpy_RT_ref(hrt); doublereal presCorrect = (m_press - m_p0) / molarDensity(); hrt[0] += presCorrect / RT(); }
void FixedChemPotSSTP::getEnthalpy_RT_ref(doublereal* hrt) const { hrt[0] = chemPot_ / RT(); }
void StoichSubstance::getIntEnergy_RT_ref(doublereal* urt) const { _updateThermo(); urt[0] = m_h0_RT - m_p0 / molarDensity() / RT(); }
void FixedChemPotSSTP::getGibbs_RT_ref(doublereal* grt) const { grt[0] = chemPot_ / RT(); }
static RT eval(Env const& env, A0& _0) { return RT(_0.eval(env)); }
TEST(IInstruction, ExtractRd1) { int32 inst(0xffffffff); EXPECT_EQ(RT(inst), 31); }
void MineralEQ3::getStandardChemPotentials(doublereal* mu0) const { getGibbs_RT(mu0); mu0[0] *= RT(); }
TEST(IInstruction, ExtractRd2) { int32 inst(0x24625bfa); EXPECT_EQ(RT(inst), 2); }
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; }
TEST(RInstruction, ExtractRt1) { int32 inst(0xFFFFFFFF); EXPECT_EQ(RT(inst), 31); }
void MineralEQ3::getIntEnergy_RT(doublereal* urt) const { _updateThermo(); urt[0] = m_h0_RT - m_p0 / molarDensity() / RT(); }
static RT eval(Env const& /*env*/) { return RT(); }