def mask_u32

bendtorch-core@0.1.0.0 · src/storage/route.bend:334

import bendtorch-core@0.1.0.0/src/storage/route.bend as Route
import Base
import bendtorch-core@0.1.0.0/src/storage/model.bend as Model
import bendtorch-core@0.1.0.0/src/storage/size.bend as Size
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

334def mask_u32(+d: Nat, +i: U32, +h: {Nat.is_le(d, 20n) == True{} : Bool},
335  +inside: {Nat.is_lt(U32.to_nat(i), Model.capacity(d)) == True{} : Bool}) ->
336  {i == U32.and(i, U32.sub(Size.capacity(d), 1)) : U32}:
337  match i:
338    case U32{+x}:
339      %mask_cap(d, h) : {U32{x} == U32.and(U32{x}, _) : U32}
340      %Arith.mask_word(32n, d, x, inside) : {U32{x} == U32{_} : U32}
341      {==}

Uses (12)

Used by (1)