[issue19904] Add 128-bit integer support to struct

Fil Mackay report at bugs.python.org
Fri Dec 6 21:45:06 CET 2013


Fil Mackay added the comment:

The use case is interacting with C structures that have 128/256/512 bit integers in them. These require correct memory alignment, and can't reliably be hacked with multiple int64's.

These size ints come from the fact that CPU's now have registers of these sizes, and can't be serviced with int.from/to_bytes for performance reasons. The same reason int64 being supported with this approach would be very inconvenient and terrible for performance since they are an intrinsic type in modern hardware, not a software construction.

Two key use cases I can think of are:

- any form of integer SIMD operation (vectors)
- hosting and maintaining hash values which are routinely 128-bit and greater

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19904>
_______________________________________


More information about the Python-bugs-list mailing list