Skip to content

Commit

Permalink
axe snat
Browse files Browse the repository at this point in the history
  • Loading branch information
flyinghead committed Jan 31, 2020
1 parent 80a0f46 commit d476b79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions core/arm_emitter/H_Branches.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ namespace ARM



inline static snat Literal(unat FnAddr)
inline static ptrdiff_t Literal(unat FnAddr)
{
u8* pc_addr = (u8*)EMIT_GET_PTR();
return (snat)((snat)FnAddr - ((snat)pc_addr+8));
//return -(snat)((pc_addr+8)-(snat)FnAddr);
return (ptrdiff_t)((ptrdiff_t)FnAddr - ((ptrdiff_t)pc_addr+8));
//return -(ptrdiff_t)((pc_addr+8)-(ptrdiff_t)FnAddr);
}

EAPI CALL(unat FnAddr, ConditionCode CC=AL)
{
bool isThumb = FnAddr & 1;
FnAddr &= ~1;
snat lit = Literal(FnAddr);
ptrdiff_t lit = Literal(FnAddr);

if(0==lit) {
printf("Error, Compiler caught NULL literal, CALL(%08zX)\n", FnAddr);
Expand Down Expand Up @@ -57,7 +57,7 @@ namespace ARM
FnAddr &= ~1;

verify(!isThumb);
snat lit = Literal(FnAddr);
ptrdiff_t lit = Literal(FnAddr);

/*if(0==lit) {
printf("Error, Compiler caught NULL literal, JUMP(%08X)\n", FnAddr);
Expand Down
1 change: 0 additions & 1 deletion core/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ typedef double f64;
#define X64
#endif

typedef ptrdiff_t snat;
typedef size_t unat;

#ifdef X64
Expand Down

0 comments on commit d476b79

Please sign in to comment.