Add Read_F32 and Read_F64 helper functions to MemmapFunctions.
This commit is contained in:
parent
5147e5167b
commit
dc66b3d474
|
@ -136,6 +136,11 @@ u16 Read_U16(const u32 _Address);
|
|||
u32 Read_U32(const u32 _Address);
|
||||
u64 Read_U64(const u32 _Address);
|
||||
|
||||
// Useful helper functions, used by ARM JIT
|
||||
float Read_F32(const u32 _Address);
|
||||
double Read_F64(const u32 _Address);
|
||||
|
||||
|
||||
// used by JIT. Return zero-extended 32bit values
|
||||
u32 Read_U8_ZX(const u32 _Address);
|
||||
u32 Read_U16_ZX(const u32 _Address);
|
||||
|
|
|
@ -403,6 +403,30 @@ u64 Read_U64(const u32 _Address)
|
|||
return _var;
|
||||
}
|
||||
|
||||
double Read_F64(const u32 _Address)
|
||||
{
|
||||
union
|
||||
{
|
||||
u64 i;
|
||||
double d;
|
||||
} cvt;
|
||||
|
||||
cvt.i = Read_U64(_Address);
|
||||
return cvt.d;
|
||||
}
|
||||
|
||||
float Read_F32(const u32 _Address)
|
||||
{
|
||||
union
|
||||
{
|
||||
u32 i;
|
||||
float d;
|
||||
} cvt;
|
||||
|
||||
cvt.i = Read_U32(_Address);
|
||||
return cvt.d;
|
||||
}
|
||||
|
||||
u32 Read_U8_ZX(const u32 _Address)
|
||||
{
|
||||
return (u32)Read_U8(_Address);
|
||||
|
|
Loading…
Reference in New Issue