/// Produce all the floating-point [`ir::Scalar`]s. /// /// Note that `F32` must appear before other sizes; this is how we /// represent conversion rank. pubfn float_scalars() -> impl Iterator<Item = ir::Scalar> + Clone {
[
ir::Scalar::ABSTRACT_FLOAT,
ir::Scalar::F32,
ir::Scalar::F16,
ir::Scalar::F64,
]
.into_iter()
}
/// Produce all the floating-point [`ir::Scalar`]s, but omit /// abstract types, for #7405. pubfn float_scalars_unimplemented_abstract() -> impl Iterator<Item = ir::Scalar> + Clone {
[ir::Scalar::F32, ir::Scalar::F16, ir::Scalar::F64].into_iter()
}
/// Produce the scalar and vector [`ir::TypeInner`]s that have `s` as /// their scalar. pubfn scalar_or_vecn(scalar: ir::Scalar) -> impl Iterator<Item = ir::TypeInner> {
[
ir::TypeInner::Scalar(scalar),
ir::TypeInner::Vector {
size: ir::VectorSize::Bi,
scalar,
},
ir::TypeInner::Vector {
size: ir::VectorSize::Tri,
scalar,
},
ir::TypeInner::Vector {
size: ir::VectorSize::Quad,
scalar,
},
]
.into_iter()
}
/// Construct a [`Rule`] for an operation with the given /// argument types and return type. pubfn rule<const N: usize>(args: [ir::TypeInner; N], ret: ir::TypeInner) -> Rule {
Rule {
arguments: Vec::from_iter(args.into_iter().map(TypeResolution::Value)),
conclusion: Conclusion::Value(ret),
}
}
/// Construct a [`List`] from the given rules. pubfn list(rules: impl Iterator<Item = Rule>) -> List {
List::from_rules(rules.collect())
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.