Source/Packages

Accelerator.SM86.FieldEncoding

packages/hardware/architectures/nvidia-sm86/src/Accelerator/SM86/FieldEncoding.alpha

794 lines86 declarations28.4 KiBSHA-256 400363ed48c6

def · lines 384–409

sm86PlaceWord32BitsUnchecked

Full file
A fixed32 field keeps its already bounded four-byte representation. Each reused bit loop sees one byte only; target positions may be unaligned.
384def sm86PlaceWord32BitsUnchecked =
385  (lambda unrestricted position : Nat .
386    unrestricted value : SM86Unsigned32 .
387    unrestricted encoded : Bytes .
388    eliminate
389      SM86Unsigned32
390      (lambda unrestricted current : SM86Unsigned32 . Bytes)
391      value
392      (branch
393        SM86Unsigned32Value
394        byte0
395        byte1
396        byte2
397        byte3
398        .
399        then (sm86PlaceFieldBitsUnchecked (naturalAdd position 24) sm86EncodingNaturalEight (byte-to-nat byte3))
400          (sm86PlaceFieldBitsUnchecked
401            (naturalAdd position sm86EncodingNaturalSixteen)
402            sm86EncodingNaturalEight
403            (byte-to-nat byte2))
404          (sm86PlaceFieldBitsUnchecked
405            (naturalAdd position sm86EncodingNaturalEight)
406            sm86EncodingNaturalEight
407            (byte-to-nat byte1))
408          (sm86PlaceFieldBitsUnchecked position sm86EncodingNaturalEight (byte-to-nat byte0))
409          encoded))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.