From 09f883182dc0ddb07b6b1a51ea0f88a485bcd993 Mon Sep 17 00:00:00 2001 From: Ty Overby Date: Mon, 7 May 2018 09:10:01 -0700 Subject: [PATCH] document that low bitsize integers don't have complete arithmetic support (#320) * document that low bitsize integers don't have complete arithmetic support --- lib/codegen/meta/cdsl/types.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/codegen/meta/cdsl/types.py b/lib/codegen/meta/cdsl/types.py index 3f2593fb78..c0e989e710 100644 --- a/lib/codegen/meta/cdsl/types.py +++ b/lib/codegen/meta/cdsl/types.py @@ -200,10 +200,15 @@ class IntType(LaneType): def __init__(self, bits): # type: (int) -> None 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__( name='i{:d}'.format(bits), membytes=bits // 8, - doc="An integer type with {} bits.".format(bits)) + doc="An integer type with {} bits.{}".format(bits, warning)) self.bits = bits def __repr__(self):