Lines Matching defs:shape
42 // Helper to encapsulate a vector's shape (including scalable dims).
48 // Returns vector shape if the type is a vector, otherwise return nullopt.
64 // Broadcasts scalar type into vector type (iff shape is non-scalar).
65 static Type broadcast(Type type, std::optional<VectorShape> shape) {
67 return shape ? VectorType::get(shape->sizes, type, shape->scalableFlags)
71 // Broadcasts scalar value into vector (iff shape is non-scalar).
73 std::optional<VectorShape> shape) {
75 auto type = broadcast(value.getType(), shape);
76 return shape ? builder.create<BroadcastOp>(type, value) : value;
97 // shape.
108 // If input shape matches target vector width, we can just call the
119 // Maybe expand operands to the higher rank vector shape that we'll use to
125 // Expand shape from [..., innerDim] to [..., expansionDim, vectorWidth].
138 // Iterate over all outer dimensions of the compute shape vector type.
167 // Reshape back to the original vector shape.
226 std::optional<VectorShape> shape = vectorShape(arg);
229 return broadcast(builder, value, shape);
233 auto i32Vec = broadcast(i32, shape);
234 auto f32Vec = broadcast(builder.getF32Type(), shape);
266 std::optional<VectorShape> shape = vectorShape(arg);
269 return broadcast(builder, value, shape);
272 auto f32Vec = broadcast(builder.getF32Type(), shape);
292 std::optional<VectorShape> shape = vectorShape(x);
295 return broadcast(builder, floatCst(builder, 0.0f, elementType), shape);
390 std::optional<VectorShape> shape = vectorShape(op.getOperand());
395 auto one = broadcast(builder, f32Cst(builder, 1.0), shape);
398 auto twoThirds = broadcast(builder, f32Cst(builder, 0.66), shape);
407 return broadcast(builder, value, shape);
489 std::optional<VectorShape> shape = vectorShape(op.getResult());
496 auto zero = broadcast(builder, f32Cst(builder, 0.0f), shape);
497 auto pi = broadcast(builder, f32Cst(builder, 3.14159265359f), shape);
513 auto halfPi = broadcast(builder, f32Cst(builder, 1.57079632679f), shape);
520 broadcast(builder, f32Cst(builder, -1.57079632679f), shape);
528 Value cstNan = broadcast(builder, f32FromBits(builder, 0x7fc00000), shape);
555 std::optional<VectorShape> shape = vectorShape(op.getOperand());
559 return broadcast(builder, value, shape);
643 std::optional<VectorShape> shape = vectorShape(op.getOperand());
647 return broadcast(builder, value, shape);
790 std::optional<VectorShape> shape = vectorShape(op.getOperand());
794 return broadcast(builder, value, shape);
845 std::optional<VectorShape> shape = vectorShape(operand);
849 return broadcast(builder, value, shape);
940 std::optional<VectorShape> shape = vectorShape(operand);
944 return broadcast(builder, value, shape);
1018 std::optional<VectorShape> shape = vectorShape(operand);
1022 return broadcast(builder, value, shape);
1128 const std::optional<VectorShape> shape, Value value,
1134 return broadcast(builder, value, shape);
1163 auto shape = vectorShape(op.getOperand().getType());
1174 return broadcast(builder, value, shape);
1226 x = clampWithNormals(builder, shape, x, -87.8f, 88.8f);
1268 n = clampWithNormals(builder, shape, n, -127.0f, 127.0f);
1284 auto i32Vec = broadcast(builder.getI32Type(), shape);
1320 std::optional<VectorShape> shape = vectorShape(op.getOperand());
1324 return broadcast(builder, value, shape);
1390 std::optional<VectorShape> shape = vectorShape(op.getOperand());
1394 return broadcast(builder, value, shape);
1404 auto i32Vec = broadcast(builder.getI32Type(), shape);
1517 std::optional<VectorShape> shape = vectorShape(operand);
1523 floatTy = broadcast(floatTy, shape);
1524 intTy = broadcast(intTy, shape);
1528 return broadcast(b, value, shape);
1606 std::optional<VectorShape> shape = vectorShape(op.getOperand());
1609 if (!shape || shape->sizes.empty() || shape->sizes.back() % 8 != 0)
1614 return broadcast(builder, value, shape);