- Feb 12, 2019
-
-
Damien George authored
These macros could in principle be (inline) functions so it makes sense to have them lower case, to match the other C API functions. The remaining macros that are upper case are: - MP_OBJ_TO_PTR, MP_OBJ_FROM_PTR - MP_OBJ_NEW_SMALL_INT, MP_OBJ_SMALL_INT_VALUE - MP_OBJ_NEW_QSTR, MP_OBJ_QSTR_VALUE - MP_OBJ_FUN_MAKE_SIG - MP_DECLARE_CONST_xxx - MP_DEFINE_CONST_xxx These must remain macros because they are used when defining const data (at least, MP_OBJ_NEW_SMALL_INT is so it makes sense to have MP_OBJ_SMALL_INT_VALUE also a macro). For those macros that have been made lower case, compatibility macros are provided for the old names so that users do not need to change their code immediately.
-
- Sep 20, 2018
-
-
Damien George authored
-
- Apr 04, 2018
-
-
Damien George authored
The LHS passed to mp_obj_int_binary_op() will always be an integer, either a small int or a big int, so the test for this type doesn't need to include an "other, unsupported type" case.
-
- Dec 08, 2017
-
-
Paul Sokolovsky authored
-
- Oct 04, 2017
-
-
Damien George authored
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
-
- Sep 17, 2017
-
-
Paul Sokolovsky authored
This allows user classes to implement __abs__ special method, and saves code size (104 bytes for x86_64), even though during refactor, an issue was fixed and few optimizations were made: * abs() of minimum (negative) small int value is calculated properly. * objint_longlong and objint_mpz avoid allocating new object is the argument is already non-negative.
-
- Aug 29, 2017
-
-
Damien George authored
The unary-op/binary-op enums are already defined, and there are no arithmetic tricks used with these types, so it makes sense to use the correct enum type for arguments that take these values. It also reduces code size quite a bit for nan-boxing builds.
-
- Jul 31, 2017
-
-
Alexander Steffen authored
There were several different spellings of MicroPython present in comments, when there should be only one.
-
- Jul 25, 2017
-
-
Damien George authored
Before this patch raising a big-int to a negative power would just return 0. Now it returns a floating-point number with the correct value.
-
- Jun 15, 2017
-
-
Damien George authored
-
- Apr 30, 2017
-
-
stijn authored
The standard preprocessor definition to differentiate debug and non-debug builds is NDEBUG, not DEBUG, so don't rely on the latter: - just delete the use of it in objint_longlong.c as it has been stale code for years anyway (since commit [c4029e50]): SUFFIX isn't used anywhere. - replace DEBUG with MICROPY_DEBUG_NLR in nlr.h: it is rarely used anymore so can be off by default
-
- Apr 04, 2017
-
-
Damien George authored
This reduces code duplication and allows to make mp_classify_fp_as_int static, which reduces code size.
-
- Mar 09, 2017
-
-
Paul Sokolovsky authored
This makes int.from_bytes() work for MICROPY_LONGINT_IMPL_LONGLONG.
-
- Feb 16, 2017
-
-
Damien George authored
-
- Jan 21, 2017
-
-
Paul Sokolovsky authored
To be implemented later.
-
- Dec 21, 2016
-
-
Damien George authored
And also simplify it to remove the check for small int. This can be done because this function is only ever called if the argument is not a small int.
-
- Oct 11, 2016
-
-
Damien George authored
-
- Mar 10, 2016
-
-
Damien George authored
Using the original WORD_MSBIT_HIGH-logic resulted in errors when the object model is not REPR_A or REPR_C.
-
- Jan 07, 2016
-
-
Damien George authored
This function returns the sign (-1, 0 or 1) of the integer object.
-
- Nov 08, 2015
-
-
Paul Sokolovsky authored
-
- Oct 11, 2015
-
-
Paul Sokolovsky authored
-
- May 12, 2015
-
-
Damien George authored
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as the operator argument. Hashing for int, str and bytes still go via fast-path in mp_unary_op since they are the most common objects which need to be hashed. This lead to quite a bit of code cleanup, and should be more efficient if anything. It saves 176 bytes code space on Thumb2, and 360 bytes on x86. The only loss is that the error message "unhashable type" is now the more generic "unsupported type for __hash__".
-
- Apr 25, 2015
-
-
Damien George authored
-
Damien George authored
This gets int.to_bytes working for bignum, and also struct.pack with 'q' and 'Q' args on 32-bit machines. Addresses issue #1155.
-
- Mar 14, 2015
-
-
Damien George authored
-
- Jan 24, 2015
-
-
David Steinberg authored
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 29, 2014
-
-
Paul Sokolovsky authored
This fixes conversion when float type has more mantissa bits than small int, and float value has small exponent. This is for example the case of 32-bit platform using doubles, and converting value of time.time(). Conversion of floats with larg exponnet is still not handled correctly.
-
- Dec 05, 2014
-
-
Damien George authored
mp_obj_int_get_truncated is used as a "fast path" int accessor that doesn't check for overflow and returns the int truncated to the machine word size, ie mp_int_t. Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word sized values. Addresses issues #779 and #998.
-
- Sep 10, 2014
-
-
Damien George authored
Addresses issue #848.
-
- Sep 06, 2014
-
-
Paul Sokolovsky authored
Type representing signed size doesn't have to be int, so use special value which defaults to SSIZE_MAX, but as it's not defined by C standard (but rather by POSIX), allow ports to set it.
-
- Aug 29, 2014
-
-
Damien George authored
Addressing issue #50, still some way to go yet.
-
- Jul 24, 2014
-
-
Damien George authored
Addresses issue #765.
-
- Jul 03, 2014
-
-
Paul Sokolovsky authored
Implementing it as a static constant is a bit peculiar and require cooperation from long int implementation.
-
Damien George authored
See discussion in issue #50.
-
- Jun 01, 2014
-
-
Damien George authored
This renames: MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT See issue #35 for discussion.
-
- May 28, 2014
-
-
Damien George authored
Also unifies use of SMALL_INT_FITS macro across parser and runtime.
-
Damien George authored
Addresses issue #627.
-
- May 21, 2014
-
-
Damien George authored
See issue #608 for justification.
-
- May 17, 2014
-
-
Paul Sokolovsky authored
-