aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/flo.stanza
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/stanza/flo.stanza')
-rw-r--r--src/main/stanza/flo.stanza5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/stanza/flo.stanza b/src/main/stanza/flo.stanza
index f4b453ba..a7b726a7 100644
--- a/src/main/stanza/flo.stanza
+++ b/src/main/stanza/flo.stanza
@@ -61,12 +61,13 @@ defn flo-op-name (op:PrimOp, args:List<Expression>) -> String :
else :
error $ string-join $ ["Unable to print Primop: " op]
-defn sane-width (wd:Width) -> Int :
+defn sane-width (wd:Width) -> Int|Long :
match(wd) :
(w:IntWidth) : max(1, width(w))
+ (w:LongWidth) : max(to-long(1), width(w))
(w) : error(string-join(["Unknown width: " w]))
-defn prim-width (type:Type) -> Int :
+defn prim-width (type:Type) -> Int|Long :
match(type) :
(t:UIntType) : sane-width(width(t))
(t:SIntType) : sane-width(width(t))