document that low bitsize integers don't have complete arithmetic support (#320)
* document that low bitsize integers don't have complete arithmetic support
This commit is contained in:
@@ -200,10 +200,15 @@ class IntType(LaneType):
|
|||||||
def __init__(self, bits):
|
def __init__(self, bits):
|
||||||
# type: (int) -> None
|
# type: (int) -> None
|
||||||
assert bits > 0, 'IntType must have positive number of bits'
|
assert bits > 0, 'IntType must have positive number of bits'
|
||||||
|
warning = ""
|
||||||
|
if bits < 32:
|
||||||
|
warning += "\nWARNING: "
|
||||||
|
warning += "arithmetic on {}bit integers is incomplete".format(
|
||||||
|
bits)
|
||||||
super(IntType, self).__init__(
|
super(IntType, self).__init__(
|
||||||
name='i{:d}'.format(bits),
|
name='i{:d}'.format(bits),
|
||||||
membytes=bits // 8,
|
membytes=bits // 8,
|
||||||
doc="An integer type with {} bits.".format(bits))
|
doc="An integer type with {} bits.{}".format(bits, warning))
|
||||||
self.bits = bits
|
self.bits = bits
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user