Repository navigation
Conversation
|
+20 bytes according to the Travis results. Appveyor failed due to CPython 3.4 on the Windows build. Will make the test conditional. |
For such tests a .py.exp file is usually provided (see eg |
|
Thanks :) Done |
|
This is the code size change I measure locally: So it might be worth thinking of ways to minimise this impact. It could be made compile-time configurable but that's going to be rather messy. |
Bytecode version already changed since the last release, so there is scope to make a change again before the next release. |
There was a problem hiding this comment.
It might be possible to compress this switch statement into a small array with a single byte lookup (if so it should be a separate PR to fully evaluate it).
There was a problem hiding this comment.
This switch might also be compressed.
+1, this is a pet operator of numpy, which I never saw to be used anywhere else. (Then maybe numpy support for MicroPython would be important, but I didn't see someone arguing that. And then support for @ would be again among the last things to care about, after 95% of other functionality.) |
Well, it would be pretty awesome. We actually have more than one usecase here where we have uPy code dump data to a binary format, then launch a CPython process to deal with it in numpy and get results from that back into uPy. However that's just us, and numpy is like the opposite of 'micro', so I can see why it's not there yet. |
Maps to __matmul__, not supported for any built-in type (but intended for unumpy.ndarray). Same precedence as *. Also adds corresponding imatmul and rmatmul. Note: also moves some big switches to lookup tables to reduce code size.
|
@dpgeorge Good thinking on the switch statements. Especially the non-inplace one benefitted because it could take advantage of the table already used in parse.c. @pfalcon Yes it's highly specialised for numpy, it's literally called "matmul" for a reason. Actually it's pretty high on the list of things to care about because it's a good feature that people use, it means that existing code will work without modification, and it avoids an error-prone conversion of |
|
See #4947 for a reworked version of this. |
|
Superseded by #4947 |
modmath: Remove stray "pragma GCC diagnostic pop"
Maps to
__matmul__, not supported for any built-in type (but intended forunumpy.ndarray).Same precedence as
*and left associative.Also adds corresponding
__imatmul__and__rmatmul__.This is +80 bytes on ports/minimal. Also a breaking change to the bytecode as the op table changes (but my understanding is that this is OK between micropython versions?)