Skip to content

Commit d902234

Browse files
committed
Allow freezing 31-bit ints
1 parent d277294 commit d902234

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/mpy-tool.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,9 @@ def __init__(self, offset, fmt, opcode_byte, arg, extra_arg):
327327
self.extra_arg = extra_arg
328328

329329

330-
# This definition of a small int covers all possible targets, in the sense that every
331-
# target can encode as a small int, an integer that passes this test. The minimum is set
332-
# by MICROPY_OBJ_REPR_B on a 16-bit machine, where there are 14 bits for the small int.
330+
# CIRCUITPY: we assume MICROPY_OBJ_REPR_C
333331
def mp_small_int_fits(i):
334-
return -0x2000 <= i <= 0x1FFF
332+
return -0x4_000_000 <= i <= 0x3_FFF_FFF
335333

336334

337335
def mp_encode_uint(val, signed=False):

0 commit comments

Comments
 (0)