ReXGlue SDK
Loading...
Searching...
No Matches
rex::ppc Namespace Reference

Namespaces

namespace  simd

Classes

struct  ArgCountT
struct  ArgPlace
struct  ArgPlaceT
struct  ArgTranslator
struct  BoundThread
struct  ByValue
struct  CRRegister
struct  DetourOriginal
struct  DetourOriginal< R(Args...)>
struct  DetourOriginal< R(PPCContext &, Args...)>
struct  EmbeddedMetadataAsset
struct  FPSCRRegister
struct  ImportFunction
struct  ImportFunction< R(Args...)>
struct  IsByValue
struct  IsByValue< ByValue< T > >
struct  KernelHooks
struct  MMIORecipient
struct  PPCCallUsage
struct  PPCCodegenFlags
struct  PPCImage
union  Register
struct  RuntimeFunction
class  StackFrame
struct  Vec128S
union  VRegister
struct  VSCRRegister
struct  XERRegister

Concepts

concept  BigEndianType
concept  MappedPtrType
concept  FloatType
concept  VectorType
concept  ByValueType
concept  HiddenReturnType
concept  PlainType

Typedefs

using RegisterModulesFunc = void (*)(kernel::IModuleRegistry& modules)
using RecompiledCodeFunc = std::span<const u8> (*)()
using Vec128 = Vec128S

Enumerations

enum class  RuntimeFunctionType : u8 { kSaveMillicode , kNoHandler , kRestoreMillicode , kHandler }
enum class  MMIOBlock : u8 { kGPU , kAPU }

Functions

template<typename R, typename... T>
constexpr std::tuple< T... > FunctionArgs (R(*)(T...)) noexcept
constexpr u32 ByValueSlots (size_t size)
constexpr bool IsRightJustified (size_t size)
template<typename T>
constexpr bool IsFloatType ()
template<typename... Args>
constexpr std::array< ArgPlace, sizeof...(Args)> PlaceArgs ()
template<typename R, typename... Args>
constexpr auto PlaceSignatureArgs (R(*)(Args...))
template<auto Func>
constexpr auto PlaceFunctionArgs ()
template<auto Func, int I = 0, typename... TArgs>
requires (I >= sizeof...(TArgs))
void TranslateArgsToHost (PPCContext &ctx, u8 *base, std::tuple< TArgs... > &) noexcept
template<auto Func, int I = 0, typename... TArgs>
requires (I < sizeof...(TArgs))
void TranslateArgsToHost (PPCContext &ctx, u8 *base, std::tuple< TArgs... > &tpl) noexcept
template<int I = 0, typename... TArgs>
requires (I >= sizeof...(TArgs))
void TranslateArgsToGuest (PPCContext &ctx, u8 *base, std::tuple< TArgs... > &) noexcept
template<int I = 0, typename... TArgs>
requires (I < sizeof...(TArgs))
void TranslateArgsToGuest (PPCContext &ctx, u8 *base, std::tuple< TArgs... > &tpl) noexcept
template<ByValueType T>
void StoreByValue (u8 *base, u32 address, const T &value)
template<ByValueType T>
u64 ByValueToWord (const T &value)
template<ByValueType T>
T ByValueFromWord (u64 word)
template<ByValueType T>
T LoadByValue (u8 *base, u32 address)
template<typename RetT>
void StoreHostResult (PPCContext &ctx, u8 *base, u32 hidden_pointer, const RetT &value)
template<auto Func, bool StopAtEntry = true>
void GuestToHostThunk (PPCContext &ctx, u8 *base)
u32 GetStackLimit (PPCContext &ctx, u8 *base)
void stack_bounds_check (PPCContext &ctx, u8 *base, u32 new_r1)
u32 FrameBelow (PPCContext &ctx, u8 *base, u32 size)
u32 OpenCallFrame (PPCContext &ctx, u8 *base, u32 stack_bytes)
template<typename... Args>
constexpr u32 GetStackArgumentBytes ()
template<typename R>
constexpr u32 HiddenReturnBytes ()
template<typename R>
R LoadGuestResult (u8 *base, const PPCRegister &r3, const PPCRegister &f1, const PPCVRegister &v1, u32 result_storage)
template<typename R, typename... Args>
R Call (PPCContext &ctx, u8 *base, PPCFunc &fn, Args... args)
template<typename T, typename... TArgs>
T HostToGuestCall (PPCFunc *func, TArgs &&... argv)
REX_PPC_API BoundThread GetBoundThread ()
f64 ReciprocalEstimate (f64 x) noexcept
f64 ReciprocalSqrtEstimate (f64 x) noexcept
template<auto Body>
void RunDetour (PPCContext &ctx, u8 *base, const char *name, PPCFunc *host)
REX_PPC_API bool RegisterEmbeddedMetadataAsset (std::string_view relative_path, const u8 *data, std::size_t size)
REX_PPC_API std::optional< EmbeddedMetadataAsset > FindEmbeddedMetadataAsset (const std::filesystem::path &relative_path)
constexpr RuntimeFunction DecodeRuntimeFunction (u32 begin, u32 word)
REX_PPC_API void SetKernelHooks (const KernelHooks *hooks)
constexpr u32 MMIOBlockBase (MMIOBlock block)
constexpr std::optional< MMIOBlock > MMIOBlockOf (u32 address)
constexpr bool IsMMIOBlockAddress (u32 address)
REX_PPC_API void AttachMMIO (MMIOBlock block, const MMIORecipient &recipient)
REX_PPC_API void DetachMMIO (MMIOBlock block, const void *context)
REX_PPC_API u32 MMIOLoad32 (u32 address)
REX_PPC_API void MMIOStore32 (u32 address, u32 value)
REX_PPC_API u8 MMIOLoad8 (u32 address)
REX_PPC_API u16 MMIOLoad16 (u32 address)
REX_PPC_API void MMIONarrowStore (u32 address, u32 size)
REX_PPC_API PPCFunc * ResolveFunction (u32 guest_address)
REX_PPC_API void Trap (PPCContext &ctx, u8 *base, u16 trap_type)
REX_PPC_API std::jmp_buf & GetJumpBuffer (u32 address)
REX_PPC_API void LongJump (u32 address, int value)
REX_PPC_API void UnimplementedInstruction (const char *opcode)
REX_PPC_API bool AddRecompiledCode (std::span< const u8 > code)
REX_PPC_API void RemoveRecompiledCode (std::span< const u8 > code)
REX_PPC_API bool IsRecompiledCode (u64 address)
std::string to_string (const Vec128 &value)
std::ostream & operator<< (std::ostream &os, const Vec128 &value)
std::string to_hex_string (const Vec128 &value)
template<int N>
f32 m128_f32 (const simde__m128 &v)
template<int N>
i32 m128_i32 (const simde__m128 &v)
template<int N>
f64 m128_f64 (const simde__m128d &v)
template<int N>
f64 m128_f64 (const simde__m128 &v)
template<int N>
i64 m128_i64 (const simde__m128d &v)
template<int N>
i64 m128_i64 (const simde__m128 &v)

Variables

template<ByValueType T>
constexpr size_t kByValueSize = sizeof(std::declval<std::remove_cvref_t<T>>().value)
constexpr u32 kRedZone = 1344
constexpr u32 kLinkageSize = 0x50
constexpr u32 kHostReturnAddress = 0xBCBCBCBC
constexpr u32 kRoundNearest = 0x00
constexpr u32 kRoundTowardZero = 0x01
constexpr u32 kRoundUp = 0x02
constexpr u32 kRoundDown = 0x03
constexpr u32 kRoundMask = 0x03
constexpr u64 kScalarReciprocalTable [128]
constexpr u64 kScalarReciprocalSqrtTable [16]
constexpr u32 kSign32 = 0x80000000u
constexpr u32 kQuiet32 = 0x00400000u
constexpr u32 kInfinity32 = 0x7F800000u
constexpr u32 kQNaN32 = 0x7FC00000u
constexpr u64 kSign64 = 0x8000000000000000ull
constexpr u64 kQuiet64 = 0x0008000000000000ull
constexpr u64 kMantissa64 = 0x000FFFFFFFFFFFFFull
constexpr u64 kInfinity64 = 0x7FF0000000000000ull
constexpr u64 kQNaN64 = 0x7FF8000000000000ull
constexpr u32 kMMIOBlockSize = 0x10000

Detailed Description

The PowerPC context, intrinsics and hook support that generated code uses.

Typedef Documentation

◆ RecompiledCodeFunc

using rex::ppc::RecompiledCodeFunc = std::span<const u8> (*)()

Returns the recompiled code that codegen generated for an image.

◆ RegisterModulesFunc

Registers the recompiled libraries of a project with several binaries.

Parameters
modulesThe module registry of the runtime being launched.

Enumeration Type Documentation

◆ MMIOBlock

enum class rex::ppc::MMIOBlock : u8
strong
Enumerator
kGPU 

0x7FC80000 to 0x7FC8FFFF.

kAPU 

0x7FEA0000 to 0x7FEAFFFF.

◆ RuntimeFunctionType

enum class rex::ppc::RuntimeFunctionType : u8
strong

Function type held in the 2 high bits of a pdata word.

Enumerator
kSaveMillicode 

Stores registers and returns.

kNoHandler 

A normal function.

kRestoreMillicode 

Loads registers and returns.

kHandler 

A function with handler data before it.

Function Documentation

◆ AddRecompiledCode()

REX_PPC_API bool rex::ppc::AddRecompiledCode ( std::span< const u8 > code)

Registers a range of recompiled code. Each registration needs its own RemoveRecompiledCode.

Returns
True when the range is registered, false when all 64 slots are taken.

◆ AttachMMIO()

REX_PPC_API void rex::ppc::AttachMMIO ( MMIOBlock block,
const MMIORecipient & recipient )

Routes the loads and stores of a block to a recipient. A recipient with no read or write handler is refused. Call it only while no guest thread runs.

Parameters
blockBlock whose accesses are routed.
recipientThe handler and its context.

◆ ByValueFromWord()

template<ByValueType T>
T rex::ppc::ByValueFromWord ( u64 word)

Unpacks a structure of at most 8 bytes from the register image a function returns in r3.

◆ ByValueSlots()

u32 rex::ppc::ByValueSlots ( size_t size)
constexpr

Returns the number of 8 byte image slots a structure takes.

◆ ByValueToWord()

template<ByValueType T>
u64 rex::ppc::ByValueToWord ( const T & value)

Packs a structure of at most 8 bytes into the register image a function returns in r3.

Returns
The register value, right justified when the size is a power of 2 under 8, else left justified.

◆ Call()

template<typename R, typename... Args>
R rex::ppc::Call ( PPCContext & ctx,
u8 * base,
PPCFunc & fn,
Args... args )

Calls recompiled code on the thread's register file by the guest calling convention.

Template Parameters
RThe return type, read from r3 or f1.
Parameters
ctxThe register file of the calling thread.

◆ DecodeRuntimeFunction()

RuntimeFunction rex::ppc::DecodeRuntimeFunction ( u32 begin,
u32 word )
constexpr

Decodes a pdata entry.

Parameters
beginThe begin address word.
wordThe type, length and prologue word.

◆ DetachMMIO()

REX_PPC_API void rex::ppc::DetachMMIO ( MMIOBlock block,
const void * context )

Restores the null recipient when the block routes to the context.

Parameters
blockBlock to restore.
contextThe context the owner attached.

◆ FindEmbeddedMetadataAsset()

REX_PPC_API std::optional< EmbeddedMetadataAsset > rex::ppc::FindEmbeddedMetadataAsset ( const std::filesystem::path & relative_path)

Looks up an embedded metadata asset by normalized path.

Returns
The asset, or an empty optional when none is registered at the path.

◆ FrameBelow()

u32 rex::ppc::FrameBelow ( PPCContext & ctx,
u8 * base,
u32 size )
inline

Returns a 16 byte aligned r1 under the current one, aborting on a wrap or a stack limit crossing.

Parameters
baseThe guest memory base, null when no thread state is bound.
sizeThe bytes the frame needs.

◆ FunctionArgs()

template<typename R, typename... T>
std::tuple< T... > rex::ppc::FunctionArgs ( R(*  )(T...))
constexprnoexcept

Returns a tuple of the argument types of a function pointer.

◆ GetBoundThread()

REX_PPC_API BoundThread rex::ppc::GetBoundThread ( )

Returns the register file and memory base of the calling thread, null when no thread state is bound to the calling thread.

◆ GetJumpBuffer()

REX_PPC_API std::jmp_buf & rex::ppc::GetJumpBuffer ( u32 address)

Returns the host jump buffer of the calling thread for a guest jump buffer address, created on first use.

Parameters
addressThe guest address of the jump buffer.

◆ GetStackArgumentBytes()

template<typename... Args>
u32 rex::ppc::GetStackArgumentBytes ( )
constexpr

Returns the stack argument bytes a call with these argument types needs. The count is 8 bytes per argument slot past slot 8.

◆ GetStackLimit()

u32 rex::ppc::GetStackLimit ( PPCContext & ctx,
u8 * base )
inline

Returns the stack limit of the running thread, 0 when r13 is unset.

◆ GuestToHostThunk()

template<auto Func, bool StopAtEntry = true>
void rex::ppc::GuestToHostThunk ( PPCContext & ctx,
u8 * base )

Calls a native function with arguments read from the register file.

Template Parameters
StopAtEntryFalse to skip the stop check before the call, for a release that must finish.

◆ HiddenReturnBytes()

template<typename R>
u32 rex::ppc::HiddenReturnBytes ( )
constexpr

Returns the call frame bytes the result of a hidden return call needs, 0 when R is not returned through a pointer.

◆ HostToGuestCall()

template<typename T, typename... TArgs>
T rex::ppc::HostToGuestCall ( PPCFunc * func,
TArgs &&... argv )

Calls recompiled code on the calling thread's register file.

Template Parameters
TArgsThe argument types, deduced from argv.

◆ IsFloatType()

template<typename T>
bool rex::ppc::IsFloatType ( )
constexpr

Reports whether a type is float or double.

◆ IsMMIOBlockAddress()

bool rex::ppc::IsMMIOBlockAddress ( u32 address)
constexpr

Reports whether an address is in a register block.

Returns
True when the address is in the GPU or APU block.

◆ IsRecompiledCode()

REX_PPC_API bool rex::ppc::IsRecompiledCode ( u64 address)

Reports whether an address is in registered recompiled code. Safe in a signal handler.

Returns
True when a registered range holds the address.

◆ IsRightJustified()

bool rex::ppc::IsRightJustified ( size_t size)
constexpr

Reports whether a structure sits at the low end of its slot instead of the start.

Returns
True when the size is a power of 2 under 8.

◆ LoadByValue()

template<ByValueType T>
T rex::ppc::LoadByValue ( u8 * base,
u32 address )

Reads a structure from guest memory in guest layout, a vector byte reversed.

◆ LoadGuestResult()

template<typename R>
R rex::ppc::LoadGuestResult ( u8 * base,
const PPCRegister & r3,
const PPCRegister & f1,
const PPCVRegister & v1,
u32 result_storage )

Reads the result a guest function left in its result registers.

Parameters
result_storageThe guest address of the hidden return storage, used by a hidden return.

◆ LongJump()

REX_PPC_API void rex::ppc::LongJump ( u32 address,
int value )

Jumps to the host jump buffer of the calling thread for a guest jump buffer address.

Parameters
addressThe guest address of the jump buffer.
valueThe value setjmp returns.

◆ m128_f32()

template<int N>
f32 rex::ppc::m128_f32 ( const simde__m128 & v)

Returns a lane of an SSE register as f32.

Template Parameters
NLane index, 0 to 3.

◆ m128_f64() [1/2]

template<int N>
f64 rex::ppc::m128_f64 ( const simde__m128 & v)

Returns a lane of an SSE register as f64.

Template Parameters
NLane index, 0 or 1.
Parameters
vThe SSE register, read as two f64 lanes.

◆ m128_f64() [2/2]

template<int N>
f64 rex::ppc::m128_f64 ( const simde__m128d & v)

Returns a lane of an SSE register as f64.

Template Parameters
NLane index, 0 or 1.

◆ m128_i32()

template<int N>
i32 rex::ppc::m128_i32 ( const simde__m128 & v)

Returns the bits of a lane of an SSE register as i32.

Template Parameters
NLane index, 0 to 3.

◆ m128_i64() [1/2]

template<int N>
i64 rex::ppc::m128_i64 ( const simde__m128 & v)

Returns the bits of a lane of an SSE register as i64.

Template Parameters
NLane index, 0 or 1.
Parameters
vThe SSE register, read as two 64 bit lanes.

◆ m128_i64() [2/2]

template<int N>
i64 rex::ppc::m128_i64 ( const simde__m128d & v)

Returns the bits of a lane of an SSE register as i64.

Template Parameters
NLane index, 0 or 1.

◆ MMIOBlockOf()

std::optional< MMIOBlock > rex::ppc::MMIOBlockOf ( u32 address)
constexpr

Finds the register block that holds an address.

Returns
The block, or std::nullopt when the address is outside both blocks.

◆ MMIOLoad16()

REX_PPC_API u16 rex::ppc::MMIOLoad16 ( u32 address)

Loads two bytes of a register, addressed as in big endian order.

Returns
The halfword, or 0 when the address is outside both blocks.

◆ MMIOLoad32()

REX_PPC_API u32 rex::ppc::MMIOLoad32 ( u32 address)

Loads a register value.

Returns
The register value, or 0 when the address is outside both blocks.

◆ MMIOLoad8()

REX_PPC_API u8 rex::ppc::MMIOLoad8 ( u32 address)

Loads one byte of a register, addressed as in big endian order.

Parameters
addressThe guest address of the byte.
Returns
The byte, or 0 when the address is outside both blocks.

◆ MMIONarrowStore()

REX_PPC_API void rex::ppc::MMIONarrowStore ( u32 address,
u32 size )

Ends the process with an error naming a store narrower than a register.

◆ MMIOStore32()

REX_PPC_API void rex::ppc::MMIOStore32 ( u32 address,
u32 value )

Stores a register value. A store outside both blocks is ignored.

◆ OpenCallFrame()

u32 rex::ppc::OpenCallFrame ( PPCContext & ctx,
u8 * base,
u32 stack_bytes )
inline

Opens a call frame under r1 for a call from host code into recompiled code.

Parameters
stack_bytesThe stack argument bytes the call needs.
Returns
The caller's r1.

◆ operator<<()

std::ostream & rex::ppc::operator<< ( std::ostream & os,
const Vec128 & value )

Writes the four u32 lanes as 8 digit uppercase hex, "[X X X X]".

◆ PlaceArgs()

template<typename... Args>
std::array< ArgPlace, sizeof...(Args)> rex::ppc::PlaceArgs ( )
constexpr

Places an argument list by the guest calling convention, where a float takes the slot of an integer register and a vector in a register takes no slot.

Template Parameters
ArgsThe argument types in order.
Returns
A placement per argument.

◆ PlaceFunctionArgs()

template<auto Func>
auto rex::ppc::PlaceFunctionArgs ( )
constexpr

Places each argument of a function by the guest calling convention.

◆ PlaceSignatureArgs()

template<typename R, typename... Args>
auto rex::ppc::PlaceSignatureArgs ( R(*  )(Args...))
constexpr

Places each argument of a function signature by the guest calling convention.

◆ ReciprocalEstimate()

f64 rex::ppc::ReciprocalEstimate ( f64 x)
inlinenodiscardnoexcept

Computes the scalar reciprocal estimate of fres.

Operands with a biased exponent below 895 give a signed infinity, above 1172 a signed zero. A NaN comes back quiet.

◆ ReciprocalSqrtEstimate()

f64 rex::ppc::ReciprocalSqrtEstimate ( f64 x)
inlinenodiscardnoexcept

Computes the scalar reciprocal square root estimate of frsqrte.

Zero gives a signed infinity. A negative operand or negative infinity gives the default quiet NaN.

◆ RegisterEmbeddedMetadataAsset()

REX_PPC_API bool rex::ppc::RegisterEmbeddedMetadataAsset ( std::string_view relative_path,
const u8 * data,
std::size_t size )

Registers a metadata asset embedded into the host executable.

An empty path, null data, 0 size or a path that normalizes to nothing is rejected.

Parameters
relative_pathPath relative to the metadata root, such as "icons/custom/67.png".
dataAsset bytes, which must stay valid for the whole process.
sizeByte count of data.
Returns
True when the asset is registered.

◆ RemoveRecompiledCode()

REX_PPC_API void rex::ppc::RemoveRecompiledCode ( std::span< const u8 > code)

Removes a registration of a range of recompiled code.

Parameters
codeThe range passed to AddRecompiledCode.

◆ ResolveFunction()

REX_PPC_API PPCFunc * rex::ppc::ResolveFunction ( u32 guest_address)

Resolves a guest address to the recompiled function that implements it.

Returns
The function, or a trap function when the address has none.

◆ RunDetour()

template<auto Body>
void rex::ppc::RunDetour ( PPCContext & ctx,
u8 * base,
const char * name,
PPCFunc * host )

Runs a detour body for a recompiled function.

Template Parameters
BodyThe detour body, optionally taking the context first.
Parameters
hostThe hook, as the image maps it.

◆ SetKernelHooks()

REX_PPC_API void rex::ppc::SetKernelHooks ( const KernelHooks * hooks)

Sets the kernel calls of the PPC runtime. With none set, no thread is bound, no address resolves and the detour checks do nothing.

Parameters
hooksThe calls, which must stay valid until they are replaced. Null clears them.

◆ stack_bounds_check()

void rex::ppc::stack_bounds_check ( PPCContext & ctx,
u8 * base,
u32 new_r1 )
inline

Aborts when a new r1 would fall below the stack limit of the thread.

Parameters
ctxThe register file, r1 still at its current value.
new_r1The r1 the caller is about to set.

◆ StoreByValue()

template<ByValueType T>
void rex::ppc::StoreByValue ( u8 * base,
u32 address,
const T & value )

Writes a structure to guest memory in guest layout, a vector byte reversed.

◆ StoreHostResult()

template<typename RetT>
void rex::ppc::StoreHostResult ( PPCContext & ctx,
u8 * base,
u32 hidden_pointer,
const RetT & value )

Writes the result of a native C++ function to the registers a guest caller reads.

Parameters
hidden_pointerThe result pointer the caller passed in r3, used by a hidden return.

◆ to_hex_string()

std::string rex::ppc::to_hex_string ( const Vec128 & value)
inline

Formats the four u32 lanes of a vector as hex.

Returns
The lanes as "[XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX]".

◆ to_string()

std::string rex::ppc::to_string ( const Vec128 & value)

Returns the four f32 lanes as "(x, y, z, w)".

◆ TranslateArgsToGuest() [1/2]

template<int I = 0, typename... TArgs>
requires (I >= sizeof...(TArgs))
void rex::ppc::TranslateArgsToGuest ( PPCContext & ctx,
u8 * base,
std::tuple< TArgs... > &  )
noexcept

Ends the recursion over the arguments written as guest values.

◆ TranslateArgsToGuest() [2/2]

template<int I = 0, typename... TArgs>
requires (I < sizeof...(TArgs))
void rex::ppc::TranslateArgsToGuest ( PPCContext & ctx,
u8 * base,
std::tuple< TArgs... > & tpl )
noexcept

Writes argument I and every later one from a tuple into the register file and stack image.

◆ TranslateArgsToHost() [1/2]

template<auto Func, int I = 0, typename... TArgs>
requires (I >= sizeof...(TArgs))
void rex::ppc::TranslateArgsToHost ( PPCContext & ctx,
u8 * base,
std::tuple< TArgs... > &  )
noexcept

Ends the recursion over the arguments read into host values.

◆ TranslateArgsToHost() [2/2]

template<auto Func, int I = 0, typename... TArgs>
requires (I < sizeof...(TArgs))
void rex::ppc::TranslateArgsToHost ( PPCContext & ctx,
u8 * base,
std::tuple< TArgs... > & tpl )
noexcept

Reads argument I and every later one from the register file into a tuple.

◆ Trap()

REX_PPC_API void rex::ppc::Trap ( PPCContext & ctx,
u8 * base,
u16 trap_type )

Logs a trap instruction of generated code. Execution continues.

◆ UnimplementedInstruction()

REX_PPC_API void rex::ppc::UnimplementedInstruction ( const char * opcode)

Throws for an instruction that codegen does not translate.

Variable Documentation

◆ kByValueSize

template<ByValueType T>
size_t rex::ppc::kByValueSize = sizeof(std::declval<std::remove_cvref_t<T>>().value)
inlineconstexpr

Size in bytes of the structure a ByValue holds.

◆ kHostReturnAddress

u32 rex::ppc::kHostReturnAddress = 0xBCBCBCBC
inlineconstexpr

Return address a call from host code leaves in lr.

◆ kLinkageSize

u32 rex::ppc::kLinkageSize = 0x50
inlineconstexpr

Minimum frame of a guest function that calls others, 10 double words.

◆ kRedZone

u32 rex::ppc::kRedZone = 1344
inlineconstexpr

Bytes under r1 a leaf guest function may use without moving r1.

◆ kRoundDown

u32 rex::ppc::kRoundDown = 0x03
constexpr

Rounding mode, toward negative infinity.

◆ kRoundUp

u32 rex::ppc::kRoundUp = 0x02
constexpr

Rounding mode, toward positive infinity.

◆ kScalarReciprocalSqrtTable

u64 rex::ppc::kScalarReciprocalSqrtTable[16]
inlineconstexpr
Initial value:
= {
0x3FEF100000000000, 0x3FED800000000000, 0x3FEC000000000000, 0x3FEA800000000000,
0x3FE9800000000000, 0x3FE8800000000000, 0x3FE8000000000000, 0x3FE7000000000000,
0x3FE6000000000000, 0x3FE4C00000000000, 0x3FE3C00000000000, 0x3FE3000000000000,
0x3FE2000000000000, 0x3FE1800000000000, 0x3FE1000000000000, 0x3FE0800000000000,
}

Scalar reciprocal square root estimate indexed by parity and the top 3 mantissa bits.

◆ kScalarReciprocalTable

u64 rex::ppc::kScalarReciprocalTable[128]
inlineconstexpr

Result of the scalar reciprocal estimate indexed by the top 7 mantissa bits of the operand.