From b8cfb0d7b2c91ea1e17f6caeabfc9cb23166cdc1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 27 Nov 2015 17:09:11 +0000 Subject: py: Add support for 64-bit NaN-boxing object model, on 32-bit machine. To use, put the following in mpconfigport.h: #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_D) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) typedef int64_t mp_int_t; typedef uint64_t mp_uint_t; #define UINT_FMT "%llu" #define INT_FMT "%lld" Currently does not work with native emitter enabled. --- py/objfloat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'py/objfloat.c') diff --git a/py/objfloat.c b/py/objfloat.c index c9e3ddd37..051c0f61c 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -39,7 +39,7 @@ #include #include "py/formatfloat.h" -#if MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_C +#if MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_C && MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_D typedef struct _mp_obj_float_t { mp_obj_base_t base; @@ -125,7 +125,7 @@ const mp_obj_type_t mp_type_float = { .binary_op = float_binary_op, }; -#if MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_C +#if MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_C && MICROPY_OBJ_REPR != MICROPY_OBJ_REPR_D mp_obj_t mp_obj_new_float(mp_float_t value) { mp_obj_float_t *o = m_new(mp_obj_float_t, 1); -- cgit v1.2.3