Lines Matching full:create
45 return rewriter.create<arith::ConstantOp>(
58 return rewriter.create<math::AbsFOp>(loc, resultTypes, args);
61 auto zero = rewriter.create<arith::ConstantOp>(
63 auto neg = rewriter.create<arith::SubIOp>(loc, zero, args[0]);
64 return rewriter.create<arith::MaxSIOp>(loc, args[0], neg);
69 return rewriter.create<arith::AddFOp>(loc, resultTypes, args);
72 return rewriter.create<arith::AddIOp>(loc, resultTypes, args);
76 return rewriter.create<arith::SubFOp>(loc, resultTypes, args);
79 return rewriter.create<arith::SubIOp>(loc, resultTypes, args);
83 return rewriter.create<arith::DivSIOp>(loc, resultTypes, args);
88 rewriter.create<arith::ConstantOp>(loc, FloatAttr::get(elementTy, 1));
89 return rewriter.create<arith::DivFOp>(loc, resultTypes, one, args[0]);
97 return rewriter.create<arith::MulFOp>(loc, resultTypes, args[0], args[1]);
113 rewriter.create<arith::ConstantIntOp>(loc, shift, /*bitwidth=*/8);
115 a = rewriter.create<arith::ExtSIOp>(loc, rewriter.getI32Type(), a);
118 b = rewriter.create<arith::ExtSIOp>(loc, rewriter.getI32Type(), b);
120 auto result = rewriter.create<tosa::ApplyScaleOp>(
127 return rewriter.create<arith::TruncIOp>(loc, elementTy, result);
135 a = rewriter.create<arith::ExtSIOp>(loc, resultTypes[0], a);
137 b = rewriter.create<arith::ExtSIOp>(loc, resultTypes[0], b);
139 return rewriter.create<arith::MulIOp>(loc, resultTypes, a, b);
145 return rewriter.create<arith::NegFOp>(loc, resultTypes, args);
158 auto constant = rewriter.create<arith::ConstantOp>(
160 return rewriter.create<arith::SubIOp>(loc, resultTypes, constant,
181 Value zpAddValue = rewriter.create<arith::ConstantOp>(
186 auto ext = rewriter.create<arith::ExtSIOp>(loc, intermediateType, args[0]);
187 auto sub = rewriter.create<arith::SubIOp>(loc, zpAddValue, ext);
190 Value min = rewriter.create<arith::ConstantIntOp>(
193 Value max = rewriter.create<arith::ConstantIntOp>(
200 return rewriter.create<arith::TruncIOp>(loc, elementTy, clamp);
205 return rewriter.create<arith::AndIOp>(loc, resultTypes, args);
209 return rewriter.create<arith::OrIOp>(loc, resultTypes, args);
215 auto allOnes = rewriter.create<arith::ConstantOp>(loc, allOnesAttr);
216 return rewriter.create<arith::XOrIOp>(loc, resultTypes, args[0], allOnes);
221 return rewriter.create<arith::XOrIOp>(loc, resultTypes, args);
225 return rewriter.create<arith::ShLIOp>(loc, resultTypes, args);
229 return rewriter.create<arith::ShRUIOp>(loc, resultTypes, args);
233 auto result = rewriter.create<arith::ShRSIOp>(loc, resultTypes, args);
241 rewriter.create<arith::ConstantOp>(loc, IntegerAttr::get(elementTy, 1));
243 rewriter.create<arith::ConstantOp>(loc, IntegerAttr::get(elementTy, 0));
245 rewriter.create<arith::ConstantOp>(loc, IntegerAttr::get(i1Ty, 1));
248 auto shiftValueGreaterThanZero = rewriter.create<arith::CmpIOp>(
253 rewriter.create<arith::SubIOp>(loc, resultTypes, args[1], one);
255 rewriter.create<arith::ShRSIOp>(loc, resultTypes, args[0], subtract)
258 rewriter.create<arith::TruncIOp>(loc, i1Ty, shifted, std::nullopt);
260 rewriter.create<arith::AndIOp>(loc, i1Ty, truncated, i1one);
262 auto shouldRound = rewriter.create<arith::AndIOp>(
265 rewriter.create<arith::ExtUIOp>(loc, resultTypes, shouldRound);
266 return rewriter.create<arith::AddIOp>(loc, resultTypes, result, extended);
271 return rewriter.create<math::CountLeadingZerosOp>(loc, elementTy, args[0]);
276 return rewriter.create<arith::AndIOp>(loc, resultTypes, args);
280 auto one = rewriter.create<arith::ConstantOp>(
282 return rewriter.create<arith::XOrIOp>(loc, resultTypes, args[0], one);
287 return rewriter.create<arith::OrIOp>(loc, resultTypes, args);
291 return rewriter.create<arith::XOrIOp>(loc, resultTypes, args);
295 return rewriter.create<mlir::math::PowFOp>(loc, resultTypes, args);
299 return rewriter.create<mlir::math::RsqrtOp>(loc, resultTypes, args);
303 return rewriter.create<mlir::math::LogOp>(loc, resultTypes, args);
307 return rewriter.create<mlir::math::ExpOp>(loc, resultTypes, args);
311 return rewriter.create<mlir::math::SinOp>(loc, resultTypes, args);
315 return rewriter.create<mlir::math::CosOp>(loc, resultTypes, args);
319 return rewriter.create<mlir::math::TanhOp>(loc, resultTypes, args);
323 return rewriter.create<mlir::math::ErfOp>(loc, resultTypes, args);
327 return rewriter.create<arith::CmpFOp>(loc, arith::CmpFPredicate::OGT,
331 return rewriter.create<arith::CmpIOp>(loc, arith::CmpIPredicate::sgt,
336 return rewriter.create<arith::CmpFOp>(loc, arith::CmpFPredicate::OGE,
340 return rewriter.create<arith::CmpIOp>(loc, arith::CmpIPredicate::sge,
345 return rewriter.create<arith::CmpFOp>(loc, arith::CmpFPredicate::OEQ,
349 return rewriter.create<arith::CmpIOp>(loc, arith::CmpIPredicate::eq,
356 return rewriter.create<arith::SelectOp>(loc, args[0], args[1], args[2]);
361 return rewriter.create<arith::MaximumFOp>(loc, args[0], args[1]);
365 return rewriter.create<arith::MaxSIOp>(loc, args[0], args[1]);
370 return rewriter.create<arith::MinimumFOp>(loc, args[0], args[1]);
374 return rewriter.create<arith::MinSIOp>(loc, args[0], args[1]);
379 return rewriter.create<math::CeilOp>(loc, resultTypes, args);
383 return rewriter.create<math::FloorOp>(loc, resultTypes, args);
394 auto min = rewriter.create<arith::ConstantOp>(
396 auto max = rewriter.create<arith::ConstantOp>(
431 auto minVal = rewriter.create<arith::ConstantIntOp>(
433 auto maxVal = rewriter.create<arith::ConstantIntOp>(
442 rewriter.create<arith::ConstantOp>(loc, FloatAttr::get(elementTy, 1));
443 auto negate = rewriter.create<arith::NegFOp>(loc, resultTypes, args[0]);
444 auto exp = rewriter.create<mlir::math::ExpOp>(loc, resultTypes, negate);
445 auto added = rewriter.create<arith::AddFOp>(loc, resultTypes, exp, one);
446 return rewriter.create<arith::DivFOp>(loc, resultTypes, one, added);
460 return rewriter.create<arith::ExtFOp>(loc, resultTypes, args,
464 return rewriter.create<arith::TruncFOp>(loc, resultTypes, args,
469 return rewriter.create<arith::UIToFPOp>(loc, resultTypes, args,
473 return rewriter.create<arith::ExtUIOp>(loc, resultTypes, args,
481 .create<UnrealizedConversionCastOp>(
485 return rewriter.create<arith::UIToFPOp>(loc, resultTypes[0],
491 return rewriter.create<arith::SIToFPOp>(loc, resultTypes, args,
496 Value zero = rewriter.create<arith::ConstantOp>(
498 return rewriter.create<arith::CmpFOp>(loc, arith::CmpFPredicate::UNE,
503 auto rounded = rewriter.create<math::RoundEvenOp>(loc, args[0]);
512 auto conv = rewriter.create<arith::FPToSIOp>(loc, dstTy, rounded);
513 auto posInf = rewriter.create<arith::ConstantOp>(
516 auto negInf = rewriter.create<arith::ConstantOp>(
520 auto overflow = rewriter.create<arith::CmpFOp>(
522 auto underflow = rewriter.create<arith::CmpFOp>(
524 auto intMin = rewriter.create<arith::ConstantOp>(
528 auto intMax = rewriter.create<arith::ConstantOp>(
533 rewriter.create<arith::SelectOp>(loc, overflow, intMax, conv);
534 return rewriter.create<arith::SelectOp>(loc, underflow, intMin,
538 auto intMinFP = rewriter.create<arith::ConstantOp>(
551 auto intMaxFP = rewriter.create<arith::ConstantOp>(
559 return rewriter.create<arith::FPToSIOp>(loc, dstTy, clamped);
566 auto intMaxPlusOneFP = rewriter.create<arith::ConstantOp>(
574 auto intMax = rewriter.create<arith::ConstantOp>(
579 rewriter.create<arith::MaximumFOp>(loc, rounded, intMinFP);
581 rewriter.create<arith::FPToSIOp>(loc, dstTy, minClampedFP);
582 auto overflow = rewriter.create<arith::CmpFOp>(
584 return rewriter.create<arith::SelectOp>(loc, overflow, intMax,
591 Value zero = rewriter.create<arith::ConstantIntOp>(
593 return rewriter.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ne,
598 return rewriter.create<arith::ExtSIOp>(loc, resultTypes, args,
602 return rewriter.create<arith::TruncIOp>(loc, dstTy, args[0]);
643 return rewriter.create<tensor::ExpandShapeOp>(loc, resultType, tensor,
665 rewriter.create<arith::ConstantOp>(loc, rewriter.getIndexAttr(index));
672 return rewriter.create<tensor::DimOp>(loc, tensor, indexValue).getResult();
738 targetSize = rewriter.create<arith::MaxUIOp>(loc, targetSize, nextSize);
793 auto broadcastNecessary = rewriter.create<arith::CmpIOp>(
810 Value outputTensor = opBuilder.create<tensor::EmptyOp>(
816 .create<linalg::GenericOp>(
821 opBuilder.create<linalg::YieldOp>(loc, blockArgs.front());
830 opBuilder.create<scf::YieldOp>(loc, castResultTensor);
835 opBuilder.create<scf::YieldOp>(loc, operand);
839 auto ifOp = rewriter.create<scf::IfOp>(loc, broadcastNecessary,
885 Value outputTensor = rewriter.create<tensor::EmptyOp>(
888 // Create affine maps. Input affine maps broadcast static dimensions of size
912 auto linalgOp = rewriter.create<linalg::GenericOp>(
923 opBuilder.create<linalg::YieldOp>(loc, opResult);
927 operation, "unable to create linalg.generic body for elementwise op");
1029 return rewriter.create<arith::AddFOp>(loc, args);
1033 return rewriter.create<arith::AddIOp>(loc, args);
1037 return rewriter.create<arith::MulFOp>(loc, args);
1041 return rewriter.create<arith::MulIOp>(loc, args);
1045 return rewriter.create<arith::MinimumFOp>(loc, args[0], args[1]);
1049 return rewriter.create<arith::MinSIOp>(loc, args[0], args[1]);
1053 return rewriter.create<arith::MaximumFOp>(loc, args[0], args[1]);
1057 return rewriter.create<arith::MaxSIOp>(loc, args[0], args[1]);
1061 return rewriter.create<arith::AndIOp>(loc, args);
1064 return rewriter.create<arith::OrIOp>(loc, args);
1086 dynDims.push_back(rewriter.create<tensor::DimOp>(loc, input, i));
1093 .create<tensor::EmptyOp>(loc, reduceShape, resultTy.getElementType(),
1102 auto fillValue = rewriter.create<arith::ConstantOp>(loc, fillValueAttr);
1104 .create<linalg::FillOp>(loc, ValueRange{fillValue},
1109 auto linalgOp = rewriter.create<linalg::ReduceOp>(
1117 nestedBuilder.create<linalg::YieldOp>(loc, result);
1122 op, "unable to create linalg.generic body for reduce op");
1188 dynDims.push_back(rewriter.create<tensor::DimOp>(loc, input, i));
1219 multiplierConstant = rewriter.create<arith::ConstantOp>(
1227 genericInputs.push_back(rewriter.create<arith::ConstantOp>(
1242 shiftConstant = rewriter.create<arith::ConstantOp>(
1250 genericInputs.push_back(rewriter.create<arith::ConstantOp>(
1262 Value emptyTensor = rewriter.create<tensor::EmptyOp>(
1266 auto linalgOp = rewriter.create<linalg::GenericOp>(
1291 value = nestedBuilder.create<arith::ExtUIOp>(
1294 value = nestedBuilder.create<arith::ExtSIOp>(
1300 nestedBuilder.create<arith::SubIOp>(nestedLoc, value, inputZp);
1302 value = nestedBuilder.create<tosa::ApplyScaleOp>(
1308 nestedBuilder.create<arith::AddIOp>(nestedLoc, value, outputZp);
1324 auto intMinVal = nestedBuilder.create<arith::ConstantOp>(
1326 auto intMaxVal = nestedBuilder.create<arith::ConstantOp>(
1333 value = nestedBuilder.create<arith::TruncIOp>(
1338 nestedBuilder.create<linalg::YieldOp>(loc, value);
1393 Value collapse = builder.create<tensor::CollapseShapeOp>(collapseTy, input,
1399 outputDynSize.push_back(builder.create<tensor::DimOp>(input, 0));
1401 outputDynSize.push_back(builder.create<tensor::DimOp>(input, 3));
1405 Value empty = builder.create<tensor::EmptyOp>(
1411 auto generic = builder.create<linalg::GenericOp>(
1419 b.create<arith::ExtSIOp>(loc, resultTy.getElementType(), value);
1422 Value scaleY = b.create<arith::ConstantOp>(
1424 value = b.create<arith::MulIOp>(loc, value, scaleY);
1428 Value scaleX = b.create<arith::ConstantOp>(
1430 value = b.create<arith::MulIOp>(loc, value, scaleX);
1434 b.create<linalg::YieldOp>(loc, value);
1483 builder.create<tosa::ResizeOp>(resizeTy, input, op->getAttrs());
1504 Value collapse = builder.create<tensor::CollapseShapeOp>(collapseTy, resize,
1510 outputDynSize.push_back(builder.create<tensor::DimOp>(input, 0));
1512 outputDynSize.push_back(builder.create<tensor::DimOp>(input, 3));
1516 Value empty = builder.create<tensor::EmptyOp>(
1535 b.create<linalg::YieldOp>(loc, value);
1573 auto emptyTensor = b.create<tensor::EmptyOp>(resultTy.getShape(), resultETy,
1575 auto genericOp = b.create<linalg::GenericOp>(
1584 Value batch = b.create<linalg::IndexOp>(0);
1585 Value y = b.create<linalg::IndexOp>(1);
1586 Value x = b.create<linalg::IndexOp>(2);
1587 Value channel = b.create<linalg::IndexOp>(3);
1590 b.create<arith::ConstantOp>(b.getZeroAttr(b.getI32Type()));
1591 Value zeroFp = b.create<arith::ConstantOp>(b.getZeroAttr(floatTy));
1592 Value hMax = b.create<arith::ConstantOp>(b.getI32IntegerAttr(imageH - 1));
1593 Value wMax = b.create<arith::ConstantOp>(b.getI32IntegerAttr(imageW - 1));
1595 Value inY = b.create<arith::IndexCastOp>(b.getI32Type(), y);
1596 Value inX = b.create<arith::IndexCastOp>(b.getI32Type(), x);
1603 yScaleN = b.create<arith::ConstantOp>(b.getI32IntegerAttr(scale[0]));
1604 yScaleD = b.create<arith::ConstantOp>(b.getI32IntegerAttr(scale[1]));
1605 xScaleN = b.create<arith::ConstantOp>(b.getI32IntegerAttr(scale[2]));
1606 xScaleD = b.create<arith::ConstantOp>(b.getI32IntegerAttr(scale[3]));
1609 yOffset = b.create<arith::ConstantOp>(b.getI32IntegerAttr(offset[0]));
1610 xOffset = b.create<arith::ConstantOp>(b.getI32IntegerAttr(offset[1]));
1611 yBorder = b.create<arith::ConstantOp>(b.getI32IntegerAttr(border[0]));
1612 xBorder = b.create<arith::ConstantOp>(b.getI32IntegerAttr(border[1]));
1625 Value val = b.create<arith::MulIOp>(in, scaleD);
1626 val = b.create<arith::AddIOp>(val, offset);
1627 index = b.create<arith::FloorDivSIOp>(val, scaleN);
1631 Value r = b.create<arith::RemSIOp>(val, scaleN);
1632 Value rFp = b.create<arith::SIToFPOp>(floatTy, r);
1633 Value scaleNfp = b.create<arith::UIToFPOp>(floatTy, scaleN);
1634 delta = b.create<arith::DivFOp>(rFp, scaleNfp);
1649 Value val = b.create<arith::MulIOp>(in, scaleD);
1650 val = b.create<arith::AddIOp>(val, offset);
1651 index = b.create<arith::DivSIOp>(val, scaleN);
1652 delta = b.create<arith::MulIOp>(index, scaleN);
1653 delta = b.create<arith::SubIOp>(val, delta);
1666 auto one = b.create<arith::ConstantOp>(b.getI32IntegerAttr(1));
1672 return b.create<arith::ConstantIndexOp>(0);
1677 auto h = b.create<arith::ConstantOp>(b.getFloatAttr(floatTy, 0.5f));
1678 pred = b.create<arith::CmpFOp>(arith::CmpFPredicate::OGE, dval, h);
1680 Value dvalDouble = b.create<arith::ShLIOp>(dval, one);
1681 pred = b.create<arith::CmpIOp>(arith::CmpIPredicate::sge,
1685 auto offset = b.create<arith::SelectOp>(pred, one, zeroI32);
1686 val = b.create<arith::AddIOp>(val, offset);
1688 return b.create<arith::IndexCastOp>(b.getIndexType(), val);
1694 Value result = b.create<tensor::ExtractOp>(
1697 b.create<linalg::YieldOp>(result);
1702 auto oneVal = b.create<arith::ConstantOp>(b.getI32IntegerAttr(1));
1707 val1 = b.create<arith::AddIOp>(val0, oneVal);
1712 val0 = b.create<arith::IndexCastOp>(b.getIndexType(), val0);
1713 val1 = b.create<arith::IndexCastOp>(b.getIndexType(), val1);
1725 Value y0x0 = b.create<tensor::ExtractOp>(
1727 Value y0x1 = b.create<tensor::ExtractOp>(
1729 Value y1x0 = b.create<tensor::ExtractOp>(
1731 Value y1x1 = b.create<tensor::ExtractOp>(
1736 b.create<arith::ConstantOp>(b.getFloatAttr(floatTy, 1.0f));
1742 Value oneMinusDelta = b.create<arith::SubFOp>(oneVal, delta);
1743 Value mul0 = b.create<arith::MulFOp>(val0, oneMinusDelta);
1744 Value mul1 = b.create<arith::MulFOp>(val1, delta);
1745 return b.create<arith::AddFOp>(mul0, mul1);
1761 b.create<linalg::YieldOp>(result);
1764 y0x0 = b.create<arith::ExtSIOp>(resultETy, y0x0);
1765 y0x1 = b.create<arith::ExtSIOp>(resultETy, y0x1);
1766 y1x0 = b.create<arith::ExtSIOp>(resultETy, y1x0);
1767 y1x1 = b.create<arith::ExtSIOp>(resultETy, y1x1);
1771 dx = b.create<arith::ExtSIOp>(resultETy, dx);
1772 dy = b.create<arith::ExtSIOp>(resultETy, dy);
1781 yScaleNExt = b.create<arith::ExtSIOp>(resultETy, yScaleN);
1782 xScaleNExt = b.create<arith::ExtSIOp>(resultETy, xScaleN);
1789 return b.create<arith::MulIOp>(val0, scale);
1790 Value weight0 = b.create<arith::SubIOp>(scale, weight1);
1791 Value mul0 = b.create<arith::MulIOp>(val0, weight0);
1792 Value mul1 = b.create<arith::MulIOp>(val1, weight1);
1793 return b.create<arith::AddIOp>(mul0, mul1);
1800 b.create<linalg::YieldOp>(result);
1851 dynDims.push_back(rewriter.create<tensor::DimOp>(loc, input, i));
1855 Value axisDimSize = rewriter.create<tensor::DimOp>(loc, input, axis);
1859 .create<tensor::EmptyOp>(loc, inputTy.getShape(),
1873 rewriter.create<linalg::IndexOp>(nestedLoc, i).getResult();
1875 auto one = rewriter.create<arith::ConstantIndexOp>(nestedLoc, 1);
1877 rewriter.create<arith::SubIOp>(nestedLoc, axisDimSize, one);
1878 index = rewriter.create<arith::SubIOp>(nestedLoc, sizeMinusOne,
1885 auto extract = nestedBuilder.create<tensor::ExtractOp>(
1887 nestedBuilder.create<linalg::YieldOp>(op.getLoc(),
1927 dynDims.push_back(rewriter.create<tensor::DimOp>(loc, input, i));
1931 auto emptyTensor = rewriter.create<tensor::EmptyOp>(
1947 auto genericOp = rewriter.create<linalg::GenericOp>(
1952 nestedBuilder.create<linalg::YieldOp>(op.getLoc(), *args.begin());
1998 dynDims.push_back(rewriter.create<tensor::DimOp>(loc, input, i));
2004 .create<tensor::EmptyOp>(loc, resultTy.getShape(),
2007 auto fillValueIdx = rewriter.create<arith::ConstantOp>(
2011 .create<linalg::FillOp>(loc, ValueRange{fillValueIdx},
2017 .create<tensor::EmptyOp>(loc, resultTy.getShape(),
2028 rewriter.create<arith::ConstantOp>(loc, fillValueMaxAttr);
2031 .create<linalg::FillOp>(loc, ValueRange{fillValueMax},
2052 auto linalgOp = rewriter.create<linalg::GenericOp>(
2061 Value newIndex = rewriter.create<arith::IndexCastOp>(
2063 rewriter.create<linalg::IndexOp>(loc, axis));
2067 predicate = rewriter.create<arith::CmpFOp>(
2070 predicate = rewriter.create<arith::CmpIOp>(
2077 auto resultMax = rewriter.create<arith::SelectOp>(
2079 auto resultIndex = rewriter.create<arith::SelectOp>(
2081 nestedBuilder.create<linalg::YieldOp>(
2118 .create<tensor::EmptyOp>(loc, resultTy.getShape(), resultElementTy,
2129 auto genericOp = rewriter.create<linalg::GenericOp>(
2135 auto index0 = rewriter.create<linalg::IndexOp>(loc, 0);
2136 Value index1 = rewriter.create<arith::IndexCastOp>(
2138 auto index2 = rewriter.create<linalg::IndexOp>(loc, 2);
2139 Value extract = rewriter.create<tensor::ExtractOp>(
2141 rewriter.create<linalg::YieldOp>(loc, extract);
2190 rewriter.create<tensor::DimOp>(loc, op.getOperand(0), i));
2195 .create<tensor::EmptyOp>(loc, resultTy.getShape(),
2203 auto genericOp = rewriter.create<linalg::GenericOp>(
2218 Value index = rewriter.create<arith::IndexCastOp>(
2220 Value offset = rewriter.create<arith::ConstantIndexOp>(loc, 128);
2221 index = rewriter.create<arith::AddIOp>(loc, rewriter.getIndexType(),
2224 rewriter.create<tensor::ExtractOp>(loc, table, ValueRange{index});
2225 rewriter.create<linalg::YieldOp>(loc, extract);
2231 Value extend = rewriter.create<arith::ExtSIOp>(
2234 auto offset = rewriter.create<arith::ConstantOp>(
2236 auto seven = rewriter.create<arith::ConstantOp>(
2238 auto one = rewriter.create<arith::ConstantOp>(
2240 auto b1111111 = rewriter.create<arith::ConstantOp>(
2247 auto extendAdd = rewriter.create<arith::AddIOp>(loc, extend, offset);
2248 Value index = rewriter.create<arith::ShRUIOp>(loc, extendAdd, seven);
2250 rewriter.create<arith::AndIOp>(loc, extendAdd, b1111111);
2255 Value indexPlusOne = rewriter.create<arith::AddIOp>(loc, index, one);
2257 index = rewriter.create<arith::IndexCastOp>(
2259 indexPlusOne = rewriter.create<arith::IndexCastOp>(
2263 rewriter.create<tensor::ExtractOp>(loc, table, ValueRange{index});
2264 Value next = rewriter.create<tensor::ExtractOp>(
2268 rewriter.create<arith::ExtSIOp>(loc, rewriter.getI32Type(), base);
2270 rewriter.create<arith::ExtSIOp>(loc, rewriter.getI32Type(), next);
2274 Value baseScaled = rewriter.create<arith::ShLIOp>(loc, base, seven);
2275 Value diff = rewriter.create<arith::SubIOp>(loc, next, base);
2276 Value diffScaled = rewriter.create<arith::MulIOp>(loc, diff, fraction);
2278 rewriter.create<arith::AddIOp>(loc, baseScaled, diffScaled);
2280 rewriter.create<linalg::YieldOp>(loc, result);
2287 op, "unable to create body for tosa.table op");
2298 auto one = builder.create<arith::ConstantIndexOp>(loc, 1);
2299 auto two = builder.create<arith::ConstantIndexOp>(loc, 2);
2328 rewriter.create<tensor::EmptyOp>(loc, type, dynamicSizes);
2330 auto fillValue = rewriter.create<arith::ConstantOp>(loc, fillValueAttr);
2332 .create<linalg::FillOp>(loc, ValueRange{fillValue},
2340 auto integerVal = builder.create<arith::IndexCastUIOp>(
2346 return builder.create<arith::UIToFPOp>(loc, type, integerVal);
2351 auto indexVal = builder.create<linalg::IndexOp>(loc, index);
2406 auto twoPi = rewriter.create<arith::ConstantOp>(loc, twoPiAttr);
2416 Value oy = builder.create<linalg::IndexOp>(loc, 1);
2417 Value ox = builder.create<linalg::IndexOp>(loc, 2);
2418 Value iy = builder.create<linalg::IndexOp>(loc, 3);
2419 Value ix = builder.create<linalg::IndexOp>(loc, 4);
2424 auto iyXoy = builder.create<index::MulOp>(loc, iy, oy);
2425 auto ixXox = builder.create<index::MulOp>(loc, ix, ox);
2427 auto iyRem = builder.create<index::RemUOp>(loc, iyXoy, dimH);
2428 auto ixRem = builder.create<index::RemUOp>(loc, ixXox, dimW);
2433 auto yComponent = builder.create<arith::DivFOp>(loc, iyRemFloat, constH);
2434 auto xComponent = builder.create<arith::DivFOp>(loc, ixRemFloat, constW);
2435 auto sumXY = builder.create<arith::AddFOp>(loc, yComponent, xComponent);
2436 auto angle = builder.create<arith::MulFOp>(loc, twoPi, sumXY);
2440 auto cosAngle = builder.create<math::CosOp>(loc, angle);
2441 auto sinAngle = builder.create<math::SinOp>(loc, angle);
2443 builder.create<arith::MulFOp>(loc, valReal, cosAngle);
2445 builder.create<arith::MulFOp>(loc, valReal, sinAngle);
2449 auto outReal = builder.create<arith::AddFOp>(loc, sumReal, realComponent);
2450 auto outImag = builder.create<arith::SubFOp>(loc, sumImag, imagComponent);
2452 builder.create<linalg::YieldOp>(loc, ValueRange{outReal, outImag});
2526 auto twoPi = rewriter.create<arith::ConstantOp>(loc, twoPiAttr);
2539 Value oy = builder.create<linalg::IndexOp>(loc, 1);
2540 Value ox = builder.create<linalg::IndexOp>(loc, 2);
2541 Value iy = builder.create<linalg::IndexOp>(loc, 3);
2542 Value ix = builder.create<linalg::IndexOp>(loc, 4);
2546 auto iyXoy = builder.create<index::MulOp>(loc, iy, oy);
2547 auto ixXox = builder.create<index::MulOp>(loc, ix, ox);
2549 auto iyRem = builder.create<index::RemUOp>(loc, iyXoy, dimH);
2550 auto ixRem = builder.create<index::RemUOp>(loc, ixXox, dimW);
2557 auto yComponent = builder.create<arith::DivFOp>(loc, iyRemFloat, constH);
2558 auto xComponent = builder.create<arith::DivFOp>(loc, ixRemFloat, constW);
2560 auto sumXY = builder.create<arith::AddFOp>(loc, yComponent, xComponent);
2561 auto angle = builder.create<arith::MulFOp>(loc, twoPi, sumXY);
2564 angle = builder.create<arith::MulFOp>(
2566 rewriter.create<arith::ConstantOp>(
2572 auto cosAngle = builder.create<math::CosOp>(loc, angle);
2573 auto sinAngle = builder.create<math::SinOp>(loc, angle);
2575 auto rcos = builder.create<arith::MulFOp>(loc, valReal, cosAngle);
2576 auto rsin = builder.create<arith::MulFOp>(loc, valImag, sinAngle);
2577 auto realComponent = builder.create<arith::AddFOp>(loc, rcos, rsin);
2579 auto icos = builder.create<arith::MulFOp>(loc, valImag, cosAngle);
2580 auto isin = builder.create<arith::MulFOp>(loc, valReal, sinAngle);
2582 auto imagComponent = builder.create<arith::SubFOp>(loc, icos, isin);
2586 auto outReal = builder.create<arith::AddFOp>(loc, sumReal, realComponent);
2587 auto outImag = builder.create<arith::AddFOp>(loc, sumImag, imagComponent);
2589 builder.create<linalg::YieldOp>(loc, ValueRange{outReal, outImag});