diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-09-02 18:38:42 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-09-02 18:38:42 -0500 |
| commit | 1bc246735bcabc7dfbcf8ce8219144ba8d76f3f2 (patch) | |
| tree | 240dde7cfbc4613c4020dbad4c7d95a487ca6fb4 /Source | |
| parent | e10b0d1008915c72a1743cfd3109caf084f1d16a (diff) | |
Add some static_asserts to the Arm32 JIT to make sure ppcState is sane.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/PowerPC/JitArm32/Jit.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Core/PowerPC/JitArm32/Jit.h b/Source/Core/Core/PowerPC/JitArm32/Jit.h index 214ff31971..62fb26b90d 100644 --- a/Source/Core/Core/PowerPC/JitArm32/Jit.h +++ b/Source/Core/Core/PowerPC/JitArm32/Jit.h @@ -27,6 +27,12 @@ #include "Core/PowerPC/JitCommon/JitBase.h" #define PPCSTATE_OFF(elem) ((s32)STRUCT_OFF(PowerPC::ppcState, elem) - (s32)STRUCT_OFF(PowerPC::ppcState, spr[0])) + +// Some asserts to make sure we will be able to load everything +static_assert(PPCSTATE_OFF(spr[1023]) > -4096 && PPCSTATE_OFF(spr[1023]) < 4096, "LDR can't reach all of the SPRs"); +static_assert(PPCSTATE_OFF(ps[0][0]) >= -1020 && PPCSTATE_OFF(ps[0][0]) <= 1020, "VLDR can't reach all of the FPRs"); +static_assert((PPCSTATE_OFF(ps[0][0]) % 4) == 0, "VLDR requires FPRs to be 4 byte aligned"); + class JitArm : public JitBase, public ArmGen::ARMCodeBlock { private: |
