Lines Matching refs:create
66 return !shape.empty() ? builder.create<BroadcastOp>(type, value) : value; in broadcast()
124 builder.create<vector::ShapeCastOp>(expandedType, operand); in handleMultidimensionalVectors()
144 builder.create<vector::ExtractOp>(tuple.value(), offsets); in handleMultidimensionalVectors()
152 Value result = builder.create<arith::ConstantOp>( in handleMultidimensionalVectors()
156 result = builder.create<vector::InsertOp>(results[i], result, in handleMultidimensionalVectors()
160 return builder.create<vector::ShapeCastOp>( in handleMultidimensionalVectors()
169 return builder.create<arith::ConstantOp>(builder.getF32FloatAttr(value)); in f32Cst()
173 return builder.create<arith::ConstantOp>(builder.getI32IntegerAttr(value)); in i32Cst()
178 return builder.create<arith::BitcastOp>(builder.getF32Type(), i32Value); in f32FromBits()
187 return builder.create<arith::SelectOp>( in min()
188 builder.create<arith::CmpFOp>(arith::CmpFPredicate::ULT, value, bound), in min()
194 return builder.create<arith::SelectOp>( in max()
195 builder.create<arith::CmpFOp>(arith::CmpFPredicate::UGT, value, bound), in max()
225 Value i32Half = builder.create<arith::BitcastOp>(i32, cstHalf); in frexp()
226 Value i32InvMantMask = builder.create<arith::BitcastOp>(i32, cstInvMantMask); in frexp()
227 Value i32Arg = builder.create<arith::BitcastOp>(i32Vec, arg); in frexp()
230 Value tmp0 = builder.create<arith::AndIOp>(i32Arg, bcast(i32InvMantMask)); in frexp()
231 Value tmp1 = builder.create<arith::OrIOp>(tmp0, bcast(i32Half)); in frexp()
232 Value normalizedFraction = builder.create<arith::BitcastOp>(f32Vec, tmp1); in frexp()
235 Value arg0 = isPositive ? arg : builder.create<math::AbsOp>(arg); in frexp()
236 Value biasedExponentBits = builder.create<arith::ShRUIOp>( in frexp()
237 builder.create<arith::BitcastOp>(i32Vec, arg0), in frexp()
240 builder.create<arith::SIToFPOp>(f32Vec, biasedExponentBits); in frexp()
242 builder.create<arith::SubFOp>(biasedExponent, bcast(cst126f)); in frexp()
262 Value biasedArg = builder.create<arith::AddIOp>(arg, bias); in exp2I32()
264 builder.create<arith::ShLIOp>(biasedArg, exponetBitLocation); in exp2I32()
265 Value exp2ValueF32 = builder.create<arith::BitcastOp>(f32Vec, exp2ValueInt); in exp2I32()
282 Value res = builder.create<math::FmaOp>(x, coeffs[coeffs.size() - 1], in makePolynomialCalculation()
285 res = builder.create<math::FmaOp>(x, res, coeffs[i]); in makePolynomialCalculation()
325 operands.push_back(rewriter.create<arith::ExtFOp>(loc, newType, operand)); in insertCasts()
326 auto result = rewriter.create<math::Atan2Op>(loc, newType, operands); in insertCasts()
378 Value abs = builder.create<math::AbsOp>(operand); in matchAndRewrite()
379 Value reciprocal = builder.create<arith::DivFOp>(one, abs); in matchAndRewrite()
381 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OLT, abs, reciprocal); in matchAndRewrite()
382 Value x = builder.create<arith::SelectOp>(compare, abs, reciprocal); in matchAndRewrite()
391 Value p = builder.create<math::FmaOp>(x, n1, n2); in matchAndRewrite()
392 p = builder.create<math::FmaOp>(x, p, n3); in matchAndRewrite()
393 p = builder.create<math::FmaOp>(x, p, n4); in matchAndRewrite()
394 p = builder.create<arith::MulFOp>(x, p); in matchAndRewrite()
398 Value sub = builder.create<arith::SubFOp>(halfPi, p); in matchAndRewrite()
399 Value select = builder.create<arith::SelectOp>(compare, p, sub); in matchAndRewrite()
432 auto div = builder.create<arith::DivFOp>(y, x); in matchAndRewrite()
433 auto atan = builder.create<math::AtanOp>(div); in matchAndRewrite()
438 auto addPi = builder.create<arith::AddFOp>(atan, pi); in matchAndRewrite()
439 auto subPi = builder.create<arith::SubFOp>(atan, pi); in matchAndRewrite()
441 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OGT, atan, zero); in matchAndRewrite()
442 auto flippedAtan = builder.create<arith::SelectOp>(atanGt, subPi, addPi); in matchAndRewrite()
445 auto xGt = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OGT, x, zero); in matchAndRewrite()
446 Value result = builder.create<arith::SelectOp>(xGt, atan, flippedAtan); in matchAndRewrite()
450 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, x, zero); in matchAndRewrite()
451 Value yGt = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OGT, y, zero); in matchAndRewrite()
452 Value isHalfPi = builder.create<arith::AndIOp>(xZero, yGt); in matchAndRewrite()
454 result = builder.create<arith::SelectOp>(isHalfPi, halfPi, result); in matchAndRewrite()
457 Value yLt = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OLT, y, zero); in matchAndRewrite()
458 Value isNegativeHalfPiPi = builder.create<arith::AndIOp>(xZero, yLt); in matchAndRewrite()
461 result = builder.create<arith::SelectOp>(isNegativeHalfPiPi, negativeHalfPiPi, in matchAndRewrite()
466 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, y, zero); in matchAndRewrite()
467 Value isNan = builder.create<arith::AndIOp>(xZero, yZero); in matchAndRewrite()
469 result = builder.create<arith::SelectOp>(isNan, cstNan, result); in matchAndRewrite()
509 Value tinyMask = builder.create<arith::CmpFOp>( in matchAndRewrite()
510 arith::CmpFPredicate::OLT, builder.create<math::AbsOp>(op.getOperand()), in matchAndRewrite()
529 Value x2 = builder.create<arith::MulFOp>(x, x); in matchAndRewrite()
532 Value p = builder.create<math::FmaOp>(x2, alpha13, alpha11); in matchAndRewrite()
533 p = builder.create<math::FmaOp>(x2, p, alpha9); in matchAndRewrite()
534 p = builder.create<math::FmaOp>(x2, p, alpha7); in matchAndRewrite()
535 p = builder.create<math::FmaOp>(x2, p, alpha5); in matchAndRewrite()
536 p = builder.create<math::FmaOp>(x2, p, alpha3); in matchAndRewrite()
537 p = builder.create<math::FmaOp>(x2, p, alpha1); in matchAndRewrite()
538 p = builder.create<arith::MulFOp>(x, p); in matchAndRewrite()
541 Value q = builder.create<math::FmaOp>(x2, beta6, beta4); in matchAndRewrite()
542 q = builder.create<math::FmaOp>(x2, q, beta2); in matchAndRewrite()
543 q = builder.create<math::FmaOp>(x2, q, beta0); in matchAndRewrite()
546 Value res = builder.create<arith::SelectOp>( in matchAndRewrite()
547 tinyMask, x, builder.create<arith::DivFOp>(p, q)); in matchAndRewrite()
630 Value mask = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OLT, x, in logMatchAndRewrite()
632 Value tmp = builder.create<arith::SelectOp>(mask, x, cstZero); in logMatchAndRewrite()
634 x = builder.create<arith::SubFOp>(x, cstOne); in logMatchAndRewrite()
635 e = builder.create<arith::SubFOp>( in logMatchAndRewrite()
636 e, builder.create<arith::SelectOp>(mask, cstOne, cstZero)); in logMatchAndRewrite()
637 x = builder.create<arith::AddFOp>(x, tmp); in logMatchAndRewrite()
639 Value x2 = builder.create<arith::MulFOp>(x, x); in logMatchAndRewrite()
640 Value x3 = builder.create<arith::MulFOp>(x2, x); in logMatchAndRewrite()
644 y0 = builder.create<math::FmaOp>(cstCephesLogP0, x, cstCephesLogP1); in logMatchAndRewrite()
645 y1 = builder.create<math::FmaOp>(cstCephesLogP3, x, cstCephesLogP4); in logMatchAndRewrite()
646 y2 = builder.create<math::FmaOp>(cstCephesLogP6, x, cstCephesLogP7); in logMatchAndRewrite()
647 y0 = builder.create<math::FmaOp>(y0, x, cstCephesLogP2); in logMatchAndRewrite()
648 y1 = builder.create<math::FmaOp>(y1, x, cstCephesLogP5); in logMatchAndRewrite()
649 y2 = builder.create<math::FmaOp>(y2, x, cstCephesLogP8); in logMatchAndRewrite()
650 y0 = builder.create<math::FmaOp>(y0, x3, y1); in logMatchAndRewrite()
651 y0 = builder.create<math::FmaOp>(y0, x3, y2); in logMatchAndRewrite()
652 y0 = builder.create<arith::MulFOp>(y0, x3); in logMatchAndRewrite()
654 y0 = builder.create<math::FmaOp>(cstNegHalf, x2, y0); in logMatchAndRewrite()
655 x = builder.create<arith::AddFOp>(x, y0); in logMatchAndRewrite()
659 x = builder.create<math::FmaOp>(x, cstLog2e, e); in logMatchAndRewrite()
662 x = builder.create<math::FmaOp>(e, cstLn2, x); in logMatchAndRewrite()
665 Value invalidMask = builder.create<arith::CmpFOp>(arith::CmpFPredicate::ULT, in logMatchAndRewrite()
667 Value zeroMask = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, in logMatchAndRewrite()
669 Value posInfMask = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, in logMatchAndRewrite()
676 Value aproximation = builder.create<arith::SelectOp>( in logMatchAndRewrite()
678 builder.create<arith::SelectOp>( in logMatchAndRewrite()
680 builder.create<arith::SelectOp>(posInfMask, cstPosInf, x))); in logMatchAndRewrite()
745 Value u = builder.create<arith::AddFOp>(x, cstOne); in matchAndRewrite()
747 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, u, cstOne); in matchAndRewrite()
748 Value logU = builder.create<math::LogOp>(u); in matchAndRewrite()
750 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, u, logU); in matchAndRewrite()
751 Value logLarge = builder.create<arith::MulFOp>( in matchAndRewrite()
752 x, builder.create<arith::DivFOp>( in matchAndRewrite()
753 logU, builder.create<arith::SubFOp>(u, cstOne))); in matchAndRewrite()
754 Value approximation = builder.create<arith::SelectOp>( in matchAndRewrite()
755 builder.create<arith::OrIOp>(uSmall, uInf), x, logLarge); in matchAndRewrite()
833 Value isNegativeArg = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OLT, in matchAndRewrite()
835 Value negArg = builder.create<arith::NegFOp>(op.getOperand()); in matchAndRewrite()
837 builder.create<arith::SelectOp>(isNegativeArg, negArg, op.getOperand()); in matchAndRewrite()
851 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OLT, x, bounds[j]); in matchAndRewrite()
853 p[i] = builder.create<arith::SelectOp>(isLessThanBound[j], p[i], in matchAndRewrite()
855 q[i] = builder.create<arith::SelectOp>(isLessThanBound[j], q[i], in matchAndRewrite()
858 offset = builder.create<arith::SelectOp>(isLessThanBound[j], offset, in matchAndRewrite()
861 isLessThanBound[intervalsCount - 1] = builder.create<arith::CmpFOp>( in matchAndRewrite()
866 Value rationalPoly = builder.create<arith::DivFOp>(pPoly, qPoly); in matchAndRewrite()
867 Value formula = builder.create<arith::AddFOp>(offset, rationalPoly); in matchAndRewrite()
868 formula = builder.create<arith::SelectOp>(isLessThanBound[intervalsCount - 1], in matchAndRewrite()
872 Value negFormula = builder.create<arith::NegFOp>(formula); in matchAndRewrite()
874 builder.create<arith::SelectOp>(isNegativeArg, negFormula, formula); in matchAndRewrite()
915 return builder.create<math::FmaOp>(a, b, c); in matchAndRewrite()
918 return builder.create<arith::MulFOp>(a, b); in matchAndRewrite()
921 return builder.create<arith::SubFOp>(a, b); in matchAndRewrite()
923 auto floor = [&](Value a) { return builder.create<math::FloorOp>(a); }; in matchAndRewrite()
938 Value isNan = builder.create<arith::CmpFOp>(arith::CmpFPredicate::UNO, x, x); in matchAndRewrite()
960 Value k = builder.create<arith::FPToSIOp>(i32Vec, kF32); in matchAndRewrite()
982 builder.create<arith::CmpIOp>(arith::CmpIPredicate::sle, k, kMaxConst); in matchAndRewrite()
984 builder.create<arith::CmpIOp>(arith::CmpIPredicate::sge, k, kMaxNegConst); in matchAndRewrite()
986 Value isNegInfinityX = builder.create<arith::CmpFOp>( in matchAndRewrite()
988 Value isPosInfinityX = builder.create<arith::CmpFOp>( in matchAndRewrite()
991 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OGT, x, zerof32Const); in matchAndRewrite()
992 Value isComputable = builder.create<arith::AndIOp>(rightBound, leftBound); in matchAndRewrite()
994 expY = builder.create<arith::SelectOp>( in matchAndRewrite()
996 builder.create<arith::SelectOp>( in matchAndRewrite()
998 builder.create<arith::SelectOp>( in matchAndRewrite()
1000 builder.create<arith::SelectOp>( in matchAndRewrite()
1002 builder.create<arith::SelectOp>(isPostiveX, constPosInfinity, in matchAndRewrite()
1044 Value u = builder.create<math::ExpOp>(x); in matchAndRewrite()
1046 builder.create<arith::CmpFOp>(arith::CmpFPredicate::UEQ, u, cstOne); in matchAndRewrite()
1047 Value uMinusOne = builder.create<arith::SubFOp>(u, cstOne); in matchAndRewrite()
1048 Value uMinusOneEqNegOne = builder.create<arith::CmpFOp>( in matchAndRewrite()
1051 Value logU = builder.create<math::LogOp>(u); in matchAndRewrite()
1055 builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, logU, u); in matchAndRewrite()
1058 Value expm1 = builder.create<arith::MulFOp>( in matchAndRewrite()
1059 uMinusOne, builder.create<arith::DivFOp>(x, logU)); in matchAndRewrite()
1060 expm1 = builder.create<arith::SelectOp>(isInf, u, expm1); in matchAndRewrite()
1061 Value approximation = builder.create<arith::SelectOp>( in matchAndRewrite()
1063 builder.create<arith::SelectOp>(uMinusOneEqNegOne, cstNegOne, expm1)); in matchAndRewrite()
1108 return builder.create<arith::MulFOp>(a, b); in matchAndRewrite()
1111 return builder.create<arith::SubFOp>(a, b); in matchAndRewrite()
1113 auto floor = [&](Value a) { return builder.create<math::FloorOp>(a); }; in matchAndRewrite()
1117 return builder.create<arith::FPToSIOp>(i32Vec, a); in matchAndRewrite()
1121 return builder.create<arith::AndIOp>(a, bcast(i32Cst(builder, 3))); in matchAndRewrite()
1125 return builder.create<arith::CmpIOp>(arith::CmpIPredicate::eq, a, b); in matchAndRewrite()
1129 return builder.create<arith::CmpIOp>(arith::CmpIPredicate::sgt, a, b); in matchAndRewrite()
1133 return builder.create<arith::SelectOp>(cond, t, f); in matchAndRewrite()
1137 return builder.create<math::FmaOp>(a, b, c); in matchAndRewrite()
1141 return builder.create<arith::OrIOp>(a, b); in matchAndRewrite()
1240 Value negHalf = builder.create<arith::MulFOp>(op.getOperand(), cstNegHalf); in matchAndRewrite()
1244 Value ltMinMask = builder.create<arith::CmpFOp>( in matchAndRewrite()
1246 Value infMask = builder.create<arith::CmpFOp>(arith::CmpFPredicate::OEQ, in matchAndRewrite()
1248 Value notNormalFiniteMask = builder.create<arith::OrIOp>(ltMinMask, infMask); in matchAndRewrite()
1253 return builder.create<x86vector::RsqrtOp>(operands); in matchAndRewrite()
1260 Value inner = builder.create<arith::MulFOp>(negHalf, yApprox); in matchAndRewrite()
1261 Value fma = builder.create<math::FmaOp>(yApprox, inner, cstOnePointFive); in matchAndRewrite()
1262 Value yNewton = builder.create<arith::MulFOp>(yApprox, fma); in matchAndRewrite()
1270 builder.create<arith::SelectOp>(notNormalFiniteMask, yApprox, yNewton); in matchAndRewrite()