Source/Packages

Accelerator.SM86.FieldEncoding

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

794 lines86 declarations28.4 KiBSHA-256 400363ed48c6

def · lines 343–354

sm86FieldDivideByteChunks

Full file
Only width32 uses the already-qualified base256 range identity. Select functions so the unused old power expression is not evaluated. Quotient chunks avoid constructing a power larger than one byte. For width = 8*q+r, floor(value / 256^q) < 2^r exactly means value < 2^width.
343def sm86FieldDivideByteChunks =
344  (lambda unrestricted count : Nat . unrestricted value : Nat .
345    app
346      (nat-eliminate
347        (lambda unrestricted current : Nat . pi unrestricted remainingValue : Nat . Nat)
348        (lambda unrestricted remainingValue : Nat . remainingValue)
349        (lambda unrestricted predecessor : Nat .
350          unrestricted induction : (pi unrestricted remainingValue : Nat . Nat) .
351          unrestricted remainingValue : Nat .
352          induction (naturalDivideUnchecked remainingValue byteNaturalTwoHundredFiftySix))
353        count)
354      value)

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.