Post
by dhylands » Mon Nov 30, 2015 5:17 pm
Here's my interpretation of the various MICROPY_OBJ_REPR's (I was surpised that there weren't any summary comments in the obj.h file)
A - 31 bit small int and qstrs can be packed into an mp_obj_t
B - I think that this was intended for 16-bit PIC port. It still packs in a small int and a qstr, but it needs 2 bits for both, and the qstr and small int both occupy odd pointer values.
C - 31 bit small int, qstr, and a 30-bit float are packed into an mp_obj_t. This would allow reduced memory consumption for floats, and would allow floats to be used from within ISRs. I wonder if a variant that allowed 31-bit floats and 30-bit small ints might be more appropriate?
D - Increases the mp_obj_t to 64-bits, but allows almost a 64-bit float to be represented in an mp_obj_t. I saw a comment somewhere that had the bit layouts, bit can't seem to find it any more.