Add Read_F32 and Read_F64 helper functions to MemmapFunctions.

This commit is contained in:
Ryan Houdek 2013-07-17 04:22:47 -05:00
parent 5147e5167b
commit dc66b3d474
2 changed files with 29 additions and 0 deletions

View File

@ -136,6 +136,11 @@ u16 Read_U16(const u32 _Address);
u32 Read_U32(const u32 _Address); u32 Read_U32(const u32 _Address);
u64 Read_U64(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 // used by JIT. Return zero-extended 32bit values
u32 Read_U8_ZX(const u32 _Address); u32 Read_U8_ZX(const u32 _Address);
u32 Read_U16_ZX(const u32 _Address); u32 Read_U16_ZX(const u32 _Address);

View File

@ -403,6 +403,30 @@ u64 Read_U64(const u32 _Address)
return _var; 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) u32 Read_U8_ZX(const u32 _Address)
{ {
return (u32)Read_U8(_Address); return (u32)Read_U8(_Address);