Skip to content

Commit d8cc8c6

Browse files
committed
Explicit cast to double for i64 intmax.
1 parent ec18d2b commit d8cc8c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,9 @@ static Value createLinalgBodyCalculationForElementwiseOp(
561561
auto intMaxPlusOneFP = rewriter.create<arith::ConstantOp>(
562562
loc, rewriter.getFloatAttr(
563563
getElementTypeOrSelf(srcTy),
564-
APInt::getSignedMaxValue(dstTy.getIntOrFloatBitWidth())
565-
.getSExtValue() +
566-
1.0));
564+
static_cast<double>(APInt::getSignedMaxValue(dstTy.getIntOrFloatBitWidth())
565+
.getSExtValue()) +
566+
1.0f));
567567

568568
auto intMax = rewriter.create<arith::ConstantOp>(
569569
loc, rewriter.getIntegerAttr(

0 commit comments

Comments
 (0)