aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorazidar2016-01-15 15:44:31 -0800
committerazidar2016-01-16 11:45:00 -0800
commitb0cb00aa8c8bf1d546e354928d8dea076bb5022f (patch)
tree1e0a3f4fcce16594ce3ab25138d7e6c2c485b510 /src
parent88a369d0feed566182b1e2623b087fa1e23d8c97 (diff)
Width of multiply is sum of input widths
Diffstat (limited to 'src')
-rw-r--r--src/main/stanza/primop.stanza2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/stanza/primop.stanza b/src/main/stanza/primop.stanza
index c1a1bfd4..b285e0ee 100644
--- a/src/main/stanza/primop.stanza
+++ b/src/main/stanza/primop.stanza
@@ -73,7 +73,7 @@ public defn primop-gen-constraints (e:DoPrim,v:Vector<WGeq>) -> Type :
val w* = switch {op(e) == _} :
ADD-OP : PlusWidth(get-max(0,1),LongWidth(1))
SUB-OP : PlusWidth(get-max(0,1),LongWidth(1))
- MUL-OP : PlusWidth(get-max(0,1),get-max(0,1))
+ MUL-OP : PlusWidth(width!(args(e)[0]),width!(args(e)[1]))
DIV-OP :
match(type(args(e)[0]),type(args(e)[1])) :
(t0:UIntType,t1:SIntType) : PlusWidth(width!(args(e)[0]),LongWidth(1))