diff options
| author | azidar | 2015-07-30 11:50:54 -0700 |
|---|---|---|
| committer | azidar | 2015-07-30 11:50:54 -0700 |
| commit | 9b2f96b8d0b6c7f4e6fefde918d7a335ccd7b7f3 (patch) | |
| tree | 089578809d3ebe63ac5983ddda7fff7a6c00430a /src/main/stanza/flo.stanza | |
| parent | d075e52e86648d345e89ae4a4c75fd3a98cc2788 (diff) | |
Updated lots of tests so they pass. Found one bug in expand whens
Diffstat (limited to 'src/main/stanza/flo.stanza')
| -rw-r--r-- | src/main/stanza/flo.stanza | 5 |
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)) |
