diff options
| author | azidar | 2016-01-27 13:17:33 -0800 |
|---|---|---|
| committer | azidar | 2016-01-28 09:25:04 -0800 |
| commit | bfc44fdaf7a44ac17020f48576b987ae1cf16852 (patch) | |
| tree | dfc7261bfdf3c4a6e8293efbc2c625f4ff89414a | |
| parent | 630c36e3af777aba016b38ada83c7b42259f2a86 (diff) | |
Fixed matching on types for and, or, and xor
| -rw-r--r-- | src/main/stanza/primop.stanza | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/main/stanza/primop.stanza b/src/main/stanza/primop.stanza index 7aba40c7..3d0b06a4 100644 --- a/src/main/stanza/primop.stanza +++ b/src/main/stanza/primop.stanza @@ -142,20 +142,17 @@ public defn set-primop-type (e:DoPrim) -> DoPrim : (t1:UIntType|SIntType) : UIntType(w1()) (t1) : UnknownType() AND-OP : DoPrim{o,a,c,_} $ - match(t1()) : - (t1:UIntType) : UIntType(MAX(w1(),w2())) - (t1:SIntType) : UIntType(MAX(w1(),w2())) - (t1) : UnknownType() + match(t1(),t2()) : + (t1:UIntType|SIntType, t2:UIntType|SIntType) : UIntType(MAX(w1(),w2())) + (t1,t2) : UnknownType() OR-OP : DoPrim{o,a,c,_} $ - match(t1()) : - (t1:UIntType) : UIntType(MAX(w1(),w2())) - (t1:SIntType) : UIntType(MAX(w1(),w2())) - (t1) : UnknownType() + match(t1(),t2()) : + (t1:UIntType|SIntType, t2:UIntType|SIntType) : UIntType(MAX(w1(),w2())) + (t1,t2) : UnknownType() XOR-OP : DoPrim{o,a,c,_} $ - match(t1()) : - (t1:UIntType) : UIntType(MAX(w1(),w2())) - (t1:SIntType) : UIntType(MAX(w1(),w2())) - (t1) : UnknownType() + match(t1(),t2()) : + (t1:UIntType|SIntType, t2:UIntType|SIntType) : UIntType(MAX(w1(),w2())) + (t1,t2) : UnknownType() AND-REDUCE-OP : DoPrim{o,a,c,_} $ match(t1()) : (t1:UIntType|SIntType) : BoolType() |
