Fix some arm emitter warnings on win64.

We link it in for debugging purposes.
This commit is contained in:
Unknown W. Brackets 2013-10-26 17:57:40 -07:00
parent 2757fb7096
commit ffa0f2fb44
2 changed files with 8 additions and 8 deletions

View File

@ -267,7 +267,7 @@ void ARMXEmitter::QuickCallFunction(ARMReg reg, void *func) {
if (BLInRange(func)) { if (BLInRange(func)) {
BL(func); BL(func);
} else { } else {
MOVI2R(reg, (uintptr_t)(func)); MOVI2R(reg, (u32)(uintptr_t)(func));
BL(reg); BL(reg);
} }
} }
@ -392,7 +392,7 @@ FixupBranch ARMXEmitter::B_CC(CCFlags Cond)
} }
void ARMXEmitter::B_CC(CCFlags Cond, const void *fnptr) void ARMXEmitter::B_CC(CCFlags Cond, const void *fnptr)
{ {
s32 distance = (intptr_t)fnptr - ((intptr_t)(code) + 8); ptrdiff_t distance = (intptr_t)fnptr - ((intptr_t)(code) + 8);
_assert_msg_(JIT, distance > -33554432 _assert_msg_(JIT, distance > -33554432
&& distance <= 33554432, && distance <= 33554432,
"B_CC out of range (%p calls %p)", code, fnptr); "B_CC out of range (%p calls %p)", code, fnptr);
@ -411,7 +411,7 @@ FixupBranch ARMXEmitter::BL_CC(CCFlags Cond)
} }
void ARMXEmitter::SetJumpTarget(FixupBranch const &branch) void ARMXEmitter::SetJumpTarget(FixupBranch const &branch)
{ {
s32 distance = ((intptr_t)(code) - 8) - (intptr_t)branch.ptr; ptrdiff_t distance = ((intptr_t)(code) - 8) - (intptr_t)branch.ptr;
_assert_msg_(JIT, distance > -33554432 _assert_msg_(JIT, distance > -33554432
&& distance <= 33554432, && distance <= 33554432,
"SetJumpTarget out of range (%p calls %p)", code, "SetJumpTarget out of range (%p calls %p)", code,
@ -425,7 +425,7 @@ void ARMXEmitter::SetJumpTarget(FixupBranch const &branch)
} }
void ARMXEmitter::B (const void *fnptr) void ARMXEmitter::B (const void *fnptr)
{ {
s32 distance = (intptr_t)fnptr - (intptr_t(code) + 8); ptrdiff_t distance = (intptr_t)fnptr - (intptr_t(code) + 8);
_assert_msg_(JIT, distance > -33554432 _assert_msg_(JIT, distance > -33554432
&& distance <= 33554432, && distance <= 33554432,
"B out of range (%p calls %p)", code, fnptr); "B out of range (%p calls %p)", code, fnptr);
@ -439,7 +439,7 @@ void ARMXEmitter::B(ARMReg src)
} }
bool ARMXEmitter::BLInRange(const void *fnptr) { bool ARMXEmitter::BLInRange(const void *fnptr) {
s32 distance = (intptr_t)fnptr - (intptr_t(code) + 8); ptrdiff_t distance = (intptr_t)fnptr - (intptr_t(code) + 8);
if (distance <= -33554432 || distance > 33554432) if (distance <= -33554432 || distance > 33554432)
return false; return false;
else else
@ -448,7 +448,7 @@ bool ARMXEmitter::BLInRange(const void *fnptr) {
void ARMXEmitter::BL(const void *fnptr) void ARMXEmitter::BL(const void *fnptr)
{ {
s32 distance = (intptr_t)fnptr - (intptr_t(code) + 8); ptrdiff_t distance = (intptr_t)fnptr - (intptr_t(code) + 8);
_assert_msg_(JIT, distance > -33554432 _assert_msg_(JIT, distance > -33554432
&& distance <= 33554432, && distance <= 33554432,
"BL out of range (%p calls %p)", code, fnptr); "BL out of range (%p calls %p)", code, fnptr);

View File

@ -325,7 +325,7 @@ Operand2 AssumeMakeOperand2(u32 imm);
inline Operand2 R(ARMReg Reg) { return Operand2(Reg, TYPE_REG); } inline Operand2 R(ARMReg Reg) { return Operand2(Reg, TYPE_REG); }
inline Operand2 IMM(u32 Imm) { return Operand2(Imm, TYPE_IMM); } inline Operand2 IMM(u32 Imm) { return Operand2(Imm, TYPE_IMM); }
inline Operand2 Mem(void *ptr) { return Operand2((uintptr_t)ptr, TYPE_IMM); } inline Operand2 Mem(void *ptr) { return Operand2((u32)(uintptr_t)ptr, TYPE_IMM); }
//usage: struct {int e;} s; STRUCT_OFFSET(s,e) //usage: struct {int e;} s; STRUCT_OFFSET(s,e)
#define STRUCT_OFF(str,elem) ((u32)((u32)&(str).elem-(u32)&(str))) #define STRUCT_OFF(str,elem) ((u32)((u32)&(str).elem-(u32)&(str)))
@ -339,7 +339,7 @@ struct FixupBranch
struct LiteralPool struct LiteralPool
{ {
s32 loc; intptr_t loc;
u8* ldr_address; u8* ldr_address;
u32 val; u32 val;
}; };