diff options
| author | Damien George <damien.p.george@gmail.com> | 2013-12-30 12:52:32 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2013-12-30 12:52:32 +0000 |
| commit | 212c296c0b24dddd19099f9188176a14ade42d86 (patch) | |
| tree | 50bdcb156669c1e6c77f0ba37206314f104196c4 /py | |
| parent | cd340c44c28e2b07513fbe4d921a7eccca2dcd7a (diff) | |
Make unix-cpy cross platform; remove dependency of asmx64 on mpconfig.
Diffstat (limited to 'py')
| -rw-r--r-- | py/asmx64.c | 8 | ||||
| -rw-r--r-- | py/showbc.c | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/py/asmx64.c b/py/asmx64.c index c023900a8..2c56f35c9 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -5,7 +5,6 @@ #include <string.h> #include "misc.h" -#include "mpconfig.h" #include "asmx64.h" /* all offsets are measured in multiples of 8 bytes */ @@ -603,7 +602,12 @@ void asm_x64_call_i1(asm_x64_t* as, void* func, int i1) */ void asm_x64_call_ind(asm_x64_t* as, void *ptr, int temp_r64) { - asm_x64_mov_i64_to_r64_optimised(as, (machine_int_t)ptr, temp_r64); +#ifdef __LP64__ + asm_x64_mov_i64_to_r64_optimised(as, (int64_t)ptr, temp_r64); +#else + // If we get here, sizeof(int) == sizeof(void*). + asm_x64_mov_i64_to_r64_optimised(as, (int64_t)(unsigned int)ptr, temp_r64); +#endif asm_x64_write_byte_2(as, OPCODE_CALL_RM32, MODRM_R64(2) | MODRM_RM_REG | MODRM_RM_R64(temp_r64)); // this reduces code size by 2 bytes per call, but doesn't seem to speed it up at all // doesn't work anymore because calls are 64 bits away diff --git a/py/showbc.c b/py/showbc.c index 600d49796..b063c846a 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -283,12 +283,12 @@ void mp_show_byte_code(const byte *ip, int len) { case MP_BC_BUILD_SET: DECODE_UINT; - printf("BUILD_SET %lu", unum); + printf("BUILD_SET " UINT_FMT, unum); break; case MP_BC_SET_ADD: DECODE_UINT; - printf("SET_ADD %lu", unum); + printf("SET_ADD " UINT_FMT, unum); break; case MP_BC_UNPACK_SEQUENCE: |
