diff options
| author | jackbackrack | 2015-05-18 21:53:35 -0700 |
|---|---|---|
| committer | jackbackrack | 2015-05-18 21:53:35 -0700 |
| commit | eb7d0913bd01cffdc2be944c7001721f737b44bf (patch) | |
| tree | 4b08ee09b4e0afb869b121301fabb433840da258 /src | |
| parent | 369a6d9ee974f7ca825174e053742e0d4f440575 (diff) | |
get coercion running for flo backend and disable negative lit check
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/stanza/errors.stanza | 6 | ||||
| -rw-r--r-- | src/main/stanza/passes.stanza | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/main/stanza/errors.stanza b/src/main/stanza/errors.stanza index 30414afd..93250b6f 100644 --- a/src/main/stanza/errors.stanza +++ b/src/main/stanza/errors.stanza @@ -158,9 +158,9 @@ public defn check-high-form (c:Circuit) -> Circuit : match(exp(e)) : (e:Ref|Subfield|Index) : false (e) : add(errors,InvalidIndex(info)) - (e:UIntValue) : - if value(e) < 0 : - add(errors,NegUInt(info)) + ;; (e:UIntValue) : + ;; if value(e) < 0 : + ;; add(errors,NegUInt(info)) (e) : false e diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza index 131f0a7b..ee96708c 100644 --- a/src/main/stanza/passes.stanza +++ b/src/main/stanza/passes.stanza @@ -747,7 +747,7 @@ defn expand-expr (e:Expression) -> List<EF> : val f = {_ as Field} $ for f in fields(type(exp(e)) as BundleType) find : name(f) == name(e) if inst?(exp(e)) : - println-all(["here with " exp(e)]) + ;; println-all(["here with " exp(e)]) for x in generate-entry(name(f),type(f)) map : EF(WSubfield(exp(e),name(x),type(x),gender(e)),flip(x)) else : @@ -1886,10 +1886,10 @@ defn flo-op-name (op:PrimOp) -> String : PAD-S-OP : "arsh" NEG-U-OP : "neg" NEG-S-OP : "neg" - ;AS-UINT-U-OP : - ;AS-UINT-S-OP : - ;AS-SINT-U-OP : - ;AS-SINT-S-OP : + AS-UINT-U-OP : "mov" + AS-UINT-S-OP : "mov" + AS-SINT-U-OP : "mov" + AS-SINT-S-OP : "mov" SHIFT-LEFT-U-OP : "lsh" SHIFT-LEFT-S-OP : "lsh" SHIFT-RIGHT-U-OP : "rsh" @@ -1898,8 +1898,8 @@ defn flo-op-name (op:PrimOp) -> String : DYN-SHIFT-LEFT-S-OP : "lsh" DYN-SHIFT-RIGHT-U-OP : "rsh" DYN-SHIFT-RIGHT-S-OP : "arsh" - ;CONVERT-U-OP : - ;CONVERT-S-OP : + CONVERT-U-OP : "arsh" + CONVERT-S-OP : "mov" BIT-AND-OP : "and" BIT-NOT-OP : "not" BIT-OR-OP : "or" @@ -1970,6 +1970,8 @@ defn emit! (e:Expression,top:Symbol) : emit-all([" " args(e)[1] " " args(e)[0]], top) else : emit-all([" " args(e)[0] " " args(e)[1]], top) + else if op(e) == CONVERT-U-OP : + emit-all(["arsh'" prim-width(type(e)) " " args(e)[0] " 0"], top) else if op(e) == BIT-SELECT-OP : emit-all([flo-op-name(op(e)) "'1 " args(e)[0] " " consts(e)[0]], top) else if op(e) == BITS-SELECT-OP : |
