Source/Packages

Accelerator.SM86.FieldEncoding

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

794 lines86 declarations28.4 KiBSHA-256 400363ed48c6

def · lines 414–441

sm86PlaceWord32FieldWithValidWord

Full file
The fixed32 constructor makes width/value overflow unrepresentable. Keep the old word-length-before-extent error order and one-field telemetry. Select thunks so malformed output never invokes the unchecked placement.
414def sm86PlaceWord32FieldWithValidWord =
415  (lambda unrestricted position : Nat .
416    unrestricted value : SM86Unsigned32 .
417    unrestricted encoded : Bytes .
418    app
419      (lambda unrestricted extent : Nat .
420        app
421          (nat-eliminate
422            (lambda unrestricted current : Nat .
423              pi unrestricted ignored : Nat . SM86FieldEncodingResult)
424            (lambda unrestricted ignored : Nat .
425              sm86FieldFailure
426                SM86EncodingFieldExtentInvalid
427                position
428                sm86EncodingNaturalThirtyTwo
429                extent
430                (bytes-length encoded))
431            (lambda unrestricted predecessor : Nat .
432              unrestricted induction : (pi unrestricted ignored : Nat . SM86FieldEncodingResult) .
433              unrestricted ignored : Nat .
434              constructor
435                SM86FieldEncodingResult
436                SM86FieldEncodingSucceeded
437                (sm86PlaceWord32BitsUnchecked position value encoded)
438                (sm86FieldTelemetryOne sm86EncodingNaturalThirtyTwo extent))
439            (naturalLessOrEqual extent sm86EncodingNaturalOneHundredTwentyEight))
440          0)
441      (naturalAdd position sm86EncodingNaturalThirtyTwo))

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.