diff options
| author | azidar | 2016-02-08 14:55:21 -0800 |
|---|---|---|
| committer | azidar | 2016-02-09 18:57:07 -0800 |
| commit | bae6ba5d2405ba1caf7400f15d8875d4a79b8bae (patch) | |
| tree | 55345b1d4997c394efb4e6cdd83cd732807d7368 /src/main/scala/firrtl/PrimOps.scala | |
| parent | 666a193706308a6fbd6c8b4bd06cbc69ae4200a6 (diff) | |
More bug fixes
Diffstat (limited to 'src/main/scala/firrtl/PrimOps.scala')
| -rw-r--r-- | src/main/scala/firrtl/PrimOps.scala | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/main/scala/firrtl/PrimOps.scala b/src/main/scala/firrtl/PrimOps.scala index f947be35..c4884ff6 100644 --- a/src/main/scala/firrtl/PrimOps.scala +++ b/src/main/scala/firrtl/PrimOps.scala @@ -277,75 +277,70 @@ object PrimOps extends LazyLogging { } case AND_OP => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:SIntType) => UIntType(MAX(w1(),w2())) + case (_:SIntType|_:UIntType, _:SIntType|_:UIntType) => UIntType(MAX(w1(),w2())) case (t1,t2) => UnknownType() } DoPrim(o,a,c,t) } case OR_OP => { val t = (t1(),t2()) match { - case (t1:SIntType, t2:SIntType) => UIntType(MAX(w1(),w2())) + case (_:SIntType|_:UIntType, _:SIntType|_:UIntType) => UIntType(MAX(w1(),w2())) case (t1,t2) => UnknownType() } DoPrim(o,a,c,t) } case XOR_OP => { val t = (t1(),t2()) match { - case (t1:UIntType, t2:UIntType) => UIntType(MAX(w1(),w2())) - case (t1:SIntType, t2:UIntType) => UIntType(MAX(w1(),w2())) - case (t1:UIntType, t2:SIntType) => UIntType(MAX(w1(),w2())) - case (t1:SIntType, t2:SIntType) => UIntType(MAX(w1(),w2())) + case (_:SIntType|_:UIntType, _:SIntType|_:UIntType) => UIntType(MAX(w1(),w2())) case (t1,t2) => UnknownType() } DoPrim(o,a,c,t) } case AND_REDUCE_OP => { val t = (t1()) match { - case (t1:UIntType) => BoolType() - case (t1:SIntType) => BoolType() + case (_:UIntType|_:SIntType) => BoolType() case (t1) => UnknownType() } DoPrim(o,a,c,t) } case OR_REDUCE_OP => { val t = (t1()) match { - case (t1:UIntType) => BoolType() + case (_:UIntType|_:SIntType) => BoolType() case (t1) => UnknownType() } DoPrim(o,a,c,t) } case XOR_REDUCE_OP => { val t = (t1()) match { - case (t1:SIntType) => BoolType() + case (_:UIntType|_:SIntType) => BoolType() case (t1) => UnknownType() } DoPrim(o,a,c,t) } case CONCAT_OP => { val t = (t1(),t2()) match { - case (t1:SIntType, t2:SIntType) => UIntType(PLUS(w1(),w2())) + case (_:UIntType|_:SIntType,_:UIntType|_:SIntType) => UIntType(PLUS(w1(),w2())) case (t1, t2) => UnknownType() } DoPrim(o,a,c,t) } case BITS_SELECT_OP => { val t = (t1()) match { - case (t1:UIntType) => UIntType(PLUS(MINUS(c1(),c2()),ONE)) - case (t1:SIntType) => UIntType(PLUS(MINUS(c1(),c2()),ONE)) + case (_:UIntType|_:SIntType) => UIntType(PLUS(MINUS(c1(),c2()),ONE)) case (t1) => UnknownType() } DoPrim(o,a,c,t) } case HEAD_OP => { val t = (t1()) match { - case (t1:UIntType) => UIntType(c1()) + case (_:UIntType|_:SIntType) => UIntType(c1()) case (t1) => UnknownType() } DoPrim(o,a,c,t) } case TAIL_OP => { val t = (t1()) match { - case (t1:SIntType) => UIntType(MINUS(w1(),c1())) + case (_:UIntType|_:SIntType) => UIntType(MINUS(w1(),c1())) case (t1) => UnknownType() } DoPrim(o,a,c,t) |
