Skip to content

atmel-samd: Big integer support #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tdicola opened this issue Mar 7, 2017 · 7 comments
Closed

atmel-samd: Big integer support #110

tdicola opened this issue Mar 7, 2017 · 7 comments
Assignees
Milestone

Comments

@tdicola
Copy link

tdicola commented Mar 7, 2017

Filing an issue to remember, let's investigate big integer (> 31 bit values) support for the samd21 port. In some discussion we think it's turned off right now and would fail. Let's see what the impact would be to turn on and support. It's not a super common case but core python does support arbitrary size integers. Won't be as fast as the optimized 31-bit packed int values, but would let people port desktop python code over with less surprises when numbers get big.

@willingc
Copy link

willingc commented Mar 24, 2017

Yep. Just ran into this when going through the 8266 REPL tutorial with the samd.

>>> 12**34
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: small int overflow
>>>

@tannewt
Copy link
Member

tannewt commented Mar 24, 2017 via email

@tannewt
Copy link
Member

tannewt commented Mar 28, 2017

Does anyone know of any specific use cases where we need this? OneWire 64 bit ids is one place they could be handy.

The MPZ implementation adds ~5000 bytes to the Feather M0 express build. The longlong implementation is ~3000 bytes. We have ~80 bytes left on the Arduino Zero build. I'd hate to split functionality between express/non-express so starkly.

@tannewt tannewt modified the milestone: Long term Aug 1, 2017
@tannewt
Copy link
Member

tannewt commented Sep 1, 2017

I'll turn this on for the SAMD51 boards with #178.

@tannewt tannewt modified the milestones: 3.0, Long term Sep 1, 2017
@tannewt tannewt modified the milestones: 3.0, 3.0 Beta Sep 25, 2017
@tannewt tannewt self-assigned this Sep 25, 2017
@tannewt
Copy link
Member

tannewt commented Oct 9, 2017

Looks like enabling a LONGINT impl will break our mpys. Maybe we can change this so they are compatible?

@dhalbert
Copy link
Collaborator

Looks like enabling a LONGINT impl will break our mpys. Maybe we can change this so they are compatible?

After looking at this, I think this is not going to be an issue. mpy-cross is already set to use MICROPY_LONGINT_IMPL_MPZ for all the .mpy's it produces, so that will not change by turning on longints in our port. tools/mpy-tool.py cares about whether the implementation supports longints or not, but it's used to build internal frozen modules, not .mpy files.

@tannewt
Copy link
Member

tannewt commented Oct 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants