Allow freezing 31-bit ints

This commit is contained in:
Jeff Epler 2023-08-20 10:07:32 -05:00
parent d277294a14
commit d9022343dc
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
1 changed files with 2 additions and 4 deletions

View File

@ -327,11 +327,9 @@ class Opcode:
self.extra_arg = extra_arg
# This definition of a small int covers all possible targets, in the sense that every
# target can encode as a small int, an integer that passes this test. The minimum is set
# by MICROPY_OBJ_REPR_B on a 16-bit machine, where there are 14 bits for the small int.
# CIRCUITPY: we assume MICROPY_OBJ_REPR_C
def mp_small_int_fits(i):
return -0x2000 <= i <= 0x1FFF
return -0x4_000_000 <= i <= 0x3_FFF_FFF
def mp_encode_uint(val, signed=False):