def W64.bits.lo

bend-osdev-word64@0.1.1.0 · word64.bend:29

import bend-osdev-word64@0.1.1.0/word64.bend as Word64
import Base

29# Splitting a Word(m + n) into its low m and high n bits (bits are stored
30# least significant first), and joining them back. Named under W64, not Word,
31# so that they cannot clash with Base if it gains Word.lo, Word.hi or Word.cat.
32def W64.bits.lo(m: Nat, n: Nat, w: Word(Nat.add(m, n))) -> Word(m):
33  match m:
34    case 0n:
35      WNil{}
36    case 1n+p:
37      match w:
38        case WCon{h, t}:
39          WCon{h, W64.bits.lo(p, n, t)}

Uses (5)

Used by (22)