diff options
Diffstat (limited to 'src/TosaDeserialize.cpp')
-rw-r--r-- | src/TosaDeserialize.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/TosaDeserialize.cpp b/src/TosaDeserialize.cpp index bd9fc9d..301d0da 100644 --- a/src/TosaDeserialize.cpp +++ b/src/TosaDeserialize.cpp @@ -1229,23 +1229,16 @@ std::vector<mlir::Value> TosaMlirOperatorBuilder::build<Op_MUL>(TosaSerializationOperator *op) const { mlir::Value input0_val = tensor_map->at(op->GetInputTensorNames()[0]); mlir::Value input1_val = tensor_map->at(op->GetInputTensorNames()[1]); + mlir::Value shift_val = tensor_map->at(op->GetInputTensorNames()[2]); + mlir::RankedTensorType output_type = tensor_type_map->at(op->GetOutputTensorNames()[0]); assert(op->GetAttributeType() == Attribute_MulAttribute); // double check attribute type - mlir::ValueRange operands; - if (output_type.getElementType().isInteger(32)) { - // Integer multiply carries shift argument. - mlir::Value shift_val = tensor_map->at(op->GetInputTensorNames()[2]); - operands = {input0_val, input1_val, shift_val}; - } else { - operands = {input0_val, input1_val}; - } - - mlir::Operation *mlir_op = - op_builder->create<mlir::tosa::MulOp>(loc, output_type, operands); + mlir::Operation *mlir_op = op_builder->create<mlir::tosa::MulOp>( + loc, output_type, input0_val, input1_val, shift_val); block->push_back(mlir_op); return std::vector<mlir::Value>({mlir_op->getResult(0)}); } |