[Mlir-commits] [mlir] 7d79a25 - [mlir] Use float literals to make Windows build happy.
Alexander Belyaev
llvmlistbot at llvm.org
Tue Oct 26 12:37:01 PDT 2021
Author: Alexander Belyaev
Date: 2021-10-26T21:36:04+02:00
New Revision: 7d79a2576942a185f38183aa73e329eba32a6fab
URL: https://github.com/llvm/llvm-project/commit/7d79a2576942a185f38183aa73e329eba32a6fab
DIFF: https://github.com/llvm/llvm-project/commit/7d79a2576942a185f38183aa73e329eba32a6fab.diff
LOG: [mlir] Use float literals to make Windows build happy.
Added:
Modified:
mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
index 9b49d13546e5..df66c1582645 100644
--- a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
+++ b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
@@ -524,48 +524,48 @@ ErfPolynomialApproximation::matchAndRewrite(math::ErfOp op,
Value zero = bcast(f32Cst(builder, 0));
Value one = bcast(f32Cst(builder, 1));
Value pp[intervalsCount][polyDegree + 1];
- pp[0][0] = bcast(f32Cst(builder, +0.00000000000000000e+00));
- pp[0][1] = bcast(f32Cst(builder, +1.12837916222975858e+00));
- pp[0][2] = bcast(f32Cst(builder, -5.23018562988006470e-01));
- pp[0][3] = bcast(f32Cst(builder, +2.09741709609267072e-01));
- pp[0][4] = bcast(f32Cst(builder, +2.58146801602987875e-02));
- pp[1][0] = bcast(f32Cst(builder, +0.00000000000000000e+00));
- pp[1][1] = bcast(f32Cst(builder, +1.12750687816789140e+00));
- pp[1][2] = bcast(f32Cst(builder, -3.64721408487825775e-01));
- pp[1][3] = bcast(f32Cst(builder, +1.18407396425136952e-01));
- pp[1][4] = bcast(f32Cst(builder, +3.70645533056476558e-02));
- pp[2][0] = bcast(f32Cst(builder, -3.30093071049483172e-03));
- pp[2][1] = bcast(f32Cst(builder, +3.51961938357697011e-03));
- pp[2][2] = bcast(f32Cst(builder, -1.41373622814988039e-03));
- pp[2][3] = bcast(f32Cst(builder, +2.53447094961941348e-04));
- pp[2][4] = bcast(f32Cst(builder, -1.71048029455037401e-05));
+ pp[0][0] = bcast(f32Cst(builder, +0.00000000000000000e+00f));
+ pp[0][1] = bcast(f32Cst(builder, +1.12837916222975858e+00f));
+ pp[0][2] = bcast(f32Cst(builder, -5.23018562988006470e-01f));
+ pp[0][3] = bcast(f32Cst(builder, +2.09741709609267072e-01f));
+ pp[0][4] = bcast(f32Cst(builder, +2.58146801602987875e-02f));
+ pp[1][0] = bcast(f32Cst(builder, +0.00000000000000000e+00f));
+ pp[1][1] = bcast(f32Cst(builder, +1.12750687816789140e+00f));
+ pp[1][2] = bcast(f32Cst(builder, -3.64721408487825775e-01f));
+ pp[1][3] = bcast(f32Cst(builder, +1.18407396425136952e-01f));
+ pp[1][4] = bcast(f32Cst(builder, +3.70645533056476558e-02f));
+ pp[2][0] = bcast(f32Cst(builder, -3.30093071049483172e-03f));
+ pp[2][1] = bcast(f32Cst(builder, +3.51961938357697011e-03f));
+ pp[2][2] = bcast(f32Cst(builder, -1.41373622814988039e-03f));
+ pp[2][3] = bcast(f32Cst(builder, +2.53447094961941348e-04f));
+ pp[2][4] = bcast(f32Cst(builder, -1.71048029455037401e-05f));
Value qq[intervalsCount][polyDegree + 1];
- qq[0][0] = bcast(f32Cst(builder, +1.000000000000000000e+00));
- qq[0][1] = bcast(f32Cst(builder, -4.635138185962547255e-01));
- qq[0][2] = bcast(f32Cst(builder, +5.192301327279782447e-01));
- qq[0][3] = bcast(f32Cst(builder, -1.318089722204810087e-01));
- qq[0][4] = bcast(f32Cst(builder, +7.397964654672315005e-02));
- qq[1][0] = bcast(f32Cst(builder, +1.00000000000000000e+00));
- qq[1][1] = bcast(f32Cst(builder, -3.27607011824493086e-01));
- qq[1][2] = bcast(f32Cst(builder, +4.48369090658821977e-01));
- qq[1][3] = bcast(f32Cst(builder, -8.83462621207857930e-02));
- qq[1][4] = bcast(f32Cst(builder, +5.72442770283176093e-02));
- qq[2][0] = bcast(f32Cst(builder, +1.00000000000000000e+00));
- qq[2][1] = bcast(f32Cst(builder, -2.06069165953913769e+00));
- qq[2][2] = bcast(f32Cst(builder, +1.62705939945477759e+00));
- qq[2][3] = bcast(f32Cst(builder, -5.83389859211130017e-01));
- qq[2][4] = bcast(f32Cst(builder, +8.21908939856640930e-02));
+ qq[0][0] = bcast(f32Cst(builder, +1.000000000000000000e+00f));
+ qq[0][1] = bcast(f32Cst(builder, -4.635138185962547255e-01f));
+ qq[0][2] = bcast(f32Cst(builder, +5.192301327279782447e-01f));
+ qq[0][3] = bcast(f32Cst(builder, -1.318089722204810087e-01f));
+ qq[0][4] = bcast(f32Cst(builder, +7.397964654672315005e-02f));
+ qq[1][0] = bcast(f32Cst(builder, +1.00000000000000000e+00f));
+ qq[1][1] = bcast(f32Cst(builder, -3.27607011824493086e-01f));
+ qq[1][2] = bcast(f32Cst(builder, +4.48369090658821977e-01f));
+ qq[1][3] = bcast(f32Cst(builder, -8.83462621207857930e-02f));
+ qq[1][4] = bcast(f32Cst(builder, +5.72442770283176093e-02f));
+ qq[2][0] = bcast(f32Cst(builder, +1.00000000000000000e+00f));
+ qq[2][1] = bcast(f32Cst(builder, -2.06069165953913769e+00f));
+ qq[2][2] = bcast(f32Cst(builder, +1.62705939945477759e+00f));
+ qq[2][3] = bcast(f32Cst(builder, -5.83389859211130017e-01f));
+ qq[2][4] = bcast(f32Cst(builder, +8.21908939856640930e-02f));
Value offsets[intervalsCount];
- offsets[0] = bcast(f32Cst(builder, 0));
- offsets[1] = bcast(f32Cst(builder, 0));
- offsets[2] = bcast(f32Cst(builder, 1));
+ offsets[0] = bcast(f32Cst(builder, 0.0f));
+ offsets[1] = bcast(f32Cst(builder, 0.0f));
+ offsets[2] = bcast(f32Cst(builder, 1.0f));
Value bounds[intervalsCount];
- bounds[0] = bcast(f32Cst(builder, 0.8));
- bounds[1] = bcast(f32Cst(builder, 2));
- bounds[2] = bcast(f32Cst(builder, 3.75));
+ bounds[0] = bcast(f32Cst(builder, 0.8f));
+ bounds[1] = bcast(f32Cst(builder, 2.0f));
+ bounds[2] = bcast(f32Cst(builder, 3.75f));
Value isNegativeArg = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OLT,
op.operand(), zero);
More information about the Mlir-commits
mailing list