For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
build_edge_mask
def build_edge_mask(index: Int32, lower_bound: Int32, upper_bound: Int32) -> Int16
Computes the per-lane edge mask for a vector access (Apple M5 only).
Bit i of the result is set when element index + i lies in
[lower_bound, upper_bound). Pass it as an *edge_masked_load mask.
Emits the AGX3 edgecheck instruction.
Args:
- index (
Int32): Linear element index of lane 0. - lower_bound (
Int32): Inclusive lower bound of the valid range. - upper_bound (
Int32): Exclusive upper bound of the valid range.
Returns:
Int16: A 16-bit per-lane mask (up to 4 lanes).