Source/Packages

Accelerator.SM86.InstructionEncoding

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

2,937 lines191 declarations105.3 KiBSHA-256 0462dcc8328a

def · lines 1716–1728

sm86EncodeBranch

Full file
BRA (relative branch, opcode 0x947): the loop back-edge. Field layout mirrors the golden reference (offset@32(32) = relative BYTE offset from PC+16, descriptor@64(32) = 0x03800000 for a forward branch, 0x0383ffff for a backward branch). The guard predicate (@12) and negate bit (@15) and the control word (@105) are laid down by the shared instruction header, so `@!P0 BRA` reuses the SAME predicate machinery as every predicated instruction. This is a real field-packing encoder (a COMPONENT), never a golden-byte substitute; nvdisasm-verified on the SM86 profile.
1716def sm86EncodeBranch =
1717  (lambda unrestricted guard : SM86InstructionGuard .
1718    unrestricted offset : SM86Unsigned32 .
1719    unrestricted descriptor : SM86Unsigned32 .
1720    unrestricted control : SM86Control .
1721    sm86EncodeInstructionFields
1722      sm86OpcodeBranch
1723      guard
1724      control
1725      (sm86InstructionPrependWord32Field
1726        sm86InstructionNaturalThirtyTwo
1727        offset
1728        (sm86InstructionOneWord32Field sm86InstructionNaturalSixtyFour descriptor)))

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.