def tm.int

bend-osdev-acpi@0.1.1.0 · aml_term.bend:75

import bend-osdev-acpi@0.1.1.0/aml_term.bend as AmlTerm
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
import bend-osdev-bytes@0.1.1.0/bytes.bend as B

75def tm.int(+v: W.W64) -> B.Octets:
76  +lo = W.W64.lo(v)
77  +small = U32.is_eq(W.W64.hi(v), 0)
78  tm.int.pick(W.W64.is_zero(v), W.W64.is_eq(v, W.W64.one()), W.W64.is_eq(v, W.W64.max()), Bool.and(small, U32.is_lt(lo, 256)), Bool.and(small, U32.is_lt(lo, 65536)), small, v)

Uses (12)

Used by (1)