PTO-TILE-MODEL-EXECUTION-ELEMENTWISE
PTO-TILE-MODEL-EXECUTION-ELEMENTWISEASL pseudocode
The complete ASL owner is shown directly below.
// PTO-UNIT: {"id":"PTO-TILE-MODEL-EXECUTION-ELEMENTWISE","surface":"tile","classification":["model","execution","elementwise"],"depends_on":["PTO-TILE-MODEL-DEFINEDNESS-ELEMENTS","PTO-TILE-MODEL-EXECUTION-MINMAX","PTO-SCALAR-MODEL-FSU-PROFILE"]}// PTO-REQ-TEPL-001: direct, read-before-write TEPL semantics.
impdef func TileSquareRoot(value: Word) => Wordbegin // A numeric profile replaces this stable raw-encoding default. return value;end;
impdef func TileLogarithm(value: Word) => Wordbegin return value;end;
impdef func TileReciprocal(value: Word) => Wordbegin // The typed SFU special-value path handles representable signed // infinities and status before this finite-profile hook is called. return DivideWordUnsigned(Ones{PTO_XLEN}, value);end;
impdef func TileReciprocalSquareRoot(value: Word) => Wordbegin // One profile operation; this is not two architecturally rounded steps. return value;end;
impdef func TileExponential(value: Word) => Wordbegin return value;end;
pure func TileBinaryValue(op: TileBinaryOperation, left: Word, right: Word) => Wordbegin case op of when TileBinary_ADD => return left + right; when TileBinary_SUB => return left - right; when TileBinary_MUL => return MultiplyWord(left, right); when TileBinary_MAX => if SInt(left) > SInt(right) then return left; else return right; end; when TileBinary_MIN => if SInt(left) < SInt(right) then return left; else return right; end; when TileBinary_AND => return left AND right; when TileBinary_OR => return left OR right; when TileBinary_XOR => return left XOR right; when TileBinary_SHL => return LSL(left, UInt(right[5:0])); when TileBinary_SHR => return LSR(left, UInt(right[5:0])); when TileBinary_DIV => return DivideWordUnsigned(left, right); when TileBinary_REM => return left - MultiplyWord(DivideWordUnsigned(left, right), right); end;end;
pure func TileIntegerOperandValue(value: Word, data_type: TileDataType) => Wordbegin case data_type of when TileDataType_S8 => return SignExtend{PTO_XLEN}(value[7:0]); when TileDataType_S16 => return SignExtend{PTO_XLEN}(value[15:0]); when TileDataType_S32 => return SignExtend{PTO_XLEN}(value[31:0]); when TileDataType_S64 => return value; when TileDataType_U8 => return ZeroExtend{PTO_XLEN}(value[7:0]); when TileDataType_U16 => return ZeroExtend{PTO_XLEN}(value[15:0]); when TileDataType_U32 => return ZeroExtend{PTO_XLEN}(value[31:0]); when TileDataType_U64 => return value; otherwise => unreachable; end;end;
// A scalar bound through B.IOR is one raw Tile element carried in an XLEN// GPR. Bits above the architectural element width never participate in the// Tile operation. Keep this normalization separate from signed integer// interpretation: a later operation decides whether the retained bits are a// floating encoding, a signed integer, or an unsigned integer.pure func TileRawElementValue( value: Word, data_type: TileDataType) => Wordbegin case TileElementBits(data_type) of when 8 => return ZeroExtend{PTO_XLEN}(value[7:0]); when 16 => return ZeroExtend{PTO_XLEN}(value[15:0]); when 32 => return ZeroExtend{PTO_XLEN}(value[31:0]); when 64 => return value; otherwise => // Packed four-bit types do not belong to the closed scalar-VEC // type sets. Retaining the low nibble makes this helper total // without granting those types operation legality. return ZeroExtend{PTO_XLEN}(value[3:0]); end;end;
pure func TileUnsignedElementValue( value: Word, data_type: TileDataType) => Wordbegin case data_type of when TileDataType_S8, TileDataType_U8 => return ZeroExtend{PTO_XLEN}(value[7:0]); when TileDataType_S16, TileDataType_U16 => return ZeroExtend{PTO_XLEN}(value[15:0]); when TileDataType_S32, TileDataType_U32 => return ZeroExtend{PTO_XLEN}(value[31:0]); when TileDataType_S64, TileDataType_U64 => return value; otherwise => unreachable; end;end;
pure func TileIntegerShiftAmount( value: Word, data_type: TileDataType) => integer {0..63}begin case data_type of when TileDataType_S8, TileDataType_U8 => return UInt(value[2:0]); when TileDataType_S16, TileDataType_U16 => return UInt(value[3:0]); when TileDataType_S32, TileDataType_U32 => return UInt(value[4:0]); when TileDataType_S64, TileDataType_U64 => return UInt(value[5:0]); otherwise => unreachable; end;end;
pure func TileIntegerMinMaxValue( operation: TileBinaryOperation, data_type: TileDataType, left: Word, right: Word) => Wordbegin assert operation == TileBinary_MIN || operation == TileBinary_MAX; let left_value = TileIntegerOperandValue(left, data_type); let right_value = TileIntegerOperandValue(right, data_type); if TileDataTypeIsSigned(data_type) then if operation == TileBinary_MIN then if SInt(left_value) <= SInt(right_value) then return left_value; else return right_value; end; else if SInt(left_value) >= SInt(right_value) then return left_value; else return right_value; end; end; end; if operation == TileBinary_MIN then if UInt(left_value) <= UInt(right_value) then return left_value; else return right_value; end; else if UInt(left_value) >= UInt(right_value) then return left_value; else return right_value; end; end;end;
pure func TileIntegerBinaryValue( operation: TileBinaryOperation, data_type: TileDataType, left: Word, right: Word) => Wordbegin let left_value = TileIntegerOperandValue(left, data_type); let right_value = TileIntegerOperandValue(right, data_type); case operation of when TileBinary_ADD => return NormalizeTileInteger(left_value + right_value, data_type); when TileBinary_SUB => return NormalizeTileInteger(left_value - right_value, data_type); when TileBinary_MUL => return NormalizeTileInteger( MultiplyWord(left_value, right_value), data_type); when TileBinary_MAX, TileBinary_MIN => return TileIntegerMinMaxValue( operation, data_type, left_value, right_value); when TileBinary_AND => return TileUnsignedElementValue(left_value AND right_value, data_type); when TileBinary_OR => return TileUnsignedElementValue(left_value OR right_value, data_type); when TileBinary_XOR => return TileUnsignedElementValue(left_value XOR right_value, data_type); when TileBinary_SHL => return TileUnsignedElementValue( LSL(left_value, TileIntegerShiftAmount(right_value, data_type)), data_type); when TileBinary_SHR => let shifted = if TileDataTypeIsSigned(data_type) then ASR(left_value, TileIntegerShiftAmount(right_value, data_type)) else LSR(left_value, TileIntegerShiftAmount(right_value, data_type)); return TileUnsignedElementValue(shifted, data_type); otherwise => unreachable; end;end;
pure func TileCarrierBinaryValue( operation: TileBinaryOperation, data_type: TileDataType, left: Word, right: Word) => Wordbegin assert operation == TileBinary_AND || operation == TileBinary_OR || operation == TileBinary_XOR; var result = Zeros{PTO_XLEN}; case operation of when TileBinary_AND => result = left AND right; when TileBinary_OR => result = left OR right; when TileBinary_XOR => result = left XOR right; otherwise => unreachable; end; return TileRawElementValue(result, data_type);end;
pure func TileSignedModulo(dividend: Word, divisor: Word) => Wordbegin let quotient = ScalarDivideSigned(dividend, divisor); let remainder = dividend - MultiplyWord(quotient, divisor); if IsZero(remainder) || remainder[PTO_XLEN - 1] == divisor[PTO_XLEN - 1] then return remainder; end; return remainder + divisor;end;
pure func TileIntegerDivRemValue(op: TileBinaryOperation, data_type: TileDataType, left: Word, right: Word) => Wordbegin assert op == TileBinary_DIV || op == TileBinary_REM; let dividend = TileIntegerOperandValue(left, data_type); let divisor = TileIntegerOperandValue(right, data_type); assert !IsZero(divisor); if op == TileBinary_DIV then if TileDataTypeIsSigned(data_type) then return ScalarDivideSigned(dividend, divisor); else return DivideWordUnsigned(dividend, divisor); end; elsif TileDataTypeIsSigned(data_type) then return TileSignedModulo(dividend, divisor); else let quotient = DivideWordUnsigned(dividend, divisor); return dividend - MultiplyWord(quotient, divisor); end;end;
impdef func TileProfileFloatingModulo(data_type: TileDataType, left: Word, right: Word) => Wordbegin return left;end;
impdef func TileProfileFloatingModuloFlags( data_type: TileDataType, left: Word, right: Word) => bits(5)begin return Zeros{5};end;
func TileProfileBinaryWithFlags( op: TileBinaryOperation, data_type: TileDataType, left: Word, right: Word) => (Word, bits(5))begin if (op == TileBinary_AND || op == TileBinary_OR || op == TileBinary_XOR) && TileCarrierOnlyDataTypeSupported(data_type) then return ( TileCarrierBinaryValue(op, data_type, left, right), Zeros{5}); elsif (op == TileBinary_DIV || op == TileBinary_REM) && TileDataTypeIsInteger(data_type) then return ( TileIntegerDivRemValue(op, data_type, left, right), Zeros{5}); elsif TileDataTypeIsInteger(data_type) then return ( TileIntegerBinaryValue(op, data_type, left, right), Zeros{5}); elsif op == TileBinary_MIN || op == TileBinary_MAX then let (result, invalid) = TileFloatingMinMaxValue(op, data_type, left, right); return ( result, if invalid then Zeros{5} + 1 else Zeros{5}); elsif op == TileBinary_REM then return ( TileProfileFloatingModulo(data_type, left, right), TileProfileFloatingModuloFlags(data_type, left, right)); else let control = DefaultNumericExecutionControl(); var operation: FloatingBinaryOperation; case op of when TileBinary_ADD => operation = FloatingBinary_ADD; when TileBinary_SUB => operation = FloatingBinary_SUB; when TileBinary_MUL => operation = FloatingBinary_MUL; when TileBinary_DIV => operation = FloatingBinary_DIV; otherwise => unreachable; end; return ScalarFPBinaryProfile( operation, control.rounding_mode, TileDataTypeToEncoding(data_type), left, right); end;end;
func TileProfileBinary(op: TileBinaryOperation, data_type: TileDataType, left: Word, right: Word) => Wordbegin let (result, -) = TileProfileBinaryWithFlags( op, data_type, left, right); return result;end;
func ExecuteTileBinary(op: TileBinaryOperation, destination: TileIndex, source_left: TileIndex, source_right: TileIndex)begin let left_tile = _Tiles[[source_left]]; let right_tile = _Tiles[[source_right]]; assert left_tile.allocated && right_tile.allocated; assert TileShapesMatch(left_tile, right_tile); assert TileShapesMatch(_Tiles[[destination]], left_tile); assert left_tile.data_type == right_tile.data_type; assert _Tiles[[destination]].data_type == left_tile.data_type;
// Snapshot both sources before the first destination write. This defines // source/destination aliasing as read-before-write. for row = 0 to left_tile.valid_rows - 1 looplimit 65536 do for column = 0 to left_tile.valid_columns - 1 looplimit 65536 do let element = TileLogicalLinearIndex(left_tile, row as integer {0..65535}, column as integer {0..65535}); _Tiles[[destination]] = TileInfoWithLogicalElement( _Tiles[[destination]], element, TileProfileBinary(op, left_tile.data_type, TileReadLogicalElement(left_tile, element), TileReadLogicalElement(right_tile, element))); end; end; MarkTileValidRegionDefined(destination); if TileBinaryUsesClosedElementwiseContract(op) then ApplyTilePadding(destination, CurrentBundlePadValue()); end;end;
func ExecuteTileFillScalar(destination: TileIndex, scalar: Word)begin assert TileOperandsLegal_ExecuteTileFillScalar(destination, scalar); var result = _Tiles[[destination]]; let normalized_scalar = TileRawElementValue( scalar, result.data_type); for row = 0 to result.valid_rows - 1 looplimit 65536 do for column = 0 to result.valid_columns - 1 looplimit 65536 do let element = TileLogicalLinearIndex( result, row as integer {0..65535}, column as integer {0..65535}); result = TileInfoWithLogicalElement(result, element, normalized_scalar); end; end; result = TileWithValidRegionDefined(result); result = TileWithPadding(result, CurrentBundlePadValue()); _Tiles[[destination]] = result;end;
func ExecuteTileScalar(op: TileBinaryOperation, destination: TileIndex, source: TileIndex, scalar: Word)begin assert TileOperandsLegal_ExecuteTileScalar( op, destination, source, scalar); let source_tile = _Tiles[[source]]; var result = _Tiles[[destination]]; let normalized_scalar = TileRawElementValue( scalar, source_tile.data_type); var flags = Zeros{5}; for row = 0 to source_tile.valid_rows - 1 looplimit 65536 do for column = 0 to source_tile.valid_columns - 1 looplimit 65536 do let element = TileLogicalLinearIndex(source_tile, row as integer {0..65535}, column as integer {0..65535}); let (value, element_flags) = TileProfileBinaryWithFlags( op, source_tile.data_type, TileReadLogicalElement(source_tile, element), normalized_scalar); result = TileInfoWithLogicalElement(result, element, value); flags = flags OR element_flags; end; end; result = TileWithValidRegionDefined(result); result = TileWithPadding(result, CurrentBundlePadValue()); RecordNumericStatusFlags(flags); _Tiles[[destination]] = result;end;
Architecture behavior
This internal model unit is documented through its normative ASL/NDF owners and validation evidence; it has no reader-guide migration target.
NDF clauses
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
No NDF clause is attached to this unit.
Evidence index
9 matching entries
Executable evidence3
PTO-TILE-MODEL-EXECUTION-ELEMENTWISE compiles as an independent normative unit
- surfaceTILE
- ownerPTO-TILE-MODEL-EXECUTION-ELEMENTWISE
- categorySTATIC-INVARIANT
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-MODEL-EXECUTION-ELEMENTWISE-STATIC-001- Path
tests/asl/tile/model/execution/elementwise/tile-static-elementwise-contract-001.asl- Kind / role
- static-invariant
- Pass condition
- the complete model and this unit's static invariant compile
- SHA-256
c7ba7ab11c1d6c547b0443b93d0d370af10c2a4ff146fa678bcd9c096745ed8e
integer logical operations and exact selection preserve their assigned carriers
- surfaceTILE
- ownerPTO-TILE-MODEL-EXECUTION-ELEMENTWISE
- categoryEXECUTION
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-STAGE4-CARRIER-001- Path
tests/asl/tile/model/execution/elementwise/tile-exec-stage4-carrier-001.asl- Kind / role
- execution
- Pass condition
- U32 AND/XOR use raw width-limited payloads, TSEL copies an FP32 carrier exactly, and invalid TF32 arithmetic preflight rejects
- SHA-256
7370f69918aa6def48ae3e52b1d32962ed7a91eeb22043088073a10b9ff6d314
Covers Tile Elementwise And Aliasing.
- surfaceTILE
- ownerPTO-TILE-MODEL-EXECUTION-ELEMENTWISE
- categoryEXECUTION
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-TESTTILEELEMENTWISEANDALIASING-EXECUTION-001- Path
tests/asl/tile/model/execution/elementwise/tile-exec-and-aliasing-001.asl- Kind / role
- execution
- Pass condition
- TestTileElementwiseAndAliasing completes without assertion failure
- SHA-256
f491848f5b07285b0d8fdd78f8aeb4683fae618cd54560a9d68d66aef66ec272
Commit-scoped evidence5
spec/evidence/release-traceability-readiness.json · closed
PTO-EVIDENCE-RELEASE-TRACEABILITYSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-TRACEABILITY- Path
spec/evidence/release-traceability-readiness.json- Kind / role
- ASL/NDF/documentation/AVS traceability
- SHA-256
c7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3e
spec/evidence/instruction-contract-closure.json · closed
PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURESources and references
- Complete stable ID
PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE- Path
spec/evidence/instruction-contract-closure.json- Kind / role
- mnemonic and encoding contract closure
- SHA-256
3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106a
spec/evidence/architecture-readiness.json · open
PTO-EVIDENCE-ARCHITECTURE-READINESSSources and references
- Complete stable ID
PTO-EVIDENCE-ARCHITECTURE-READINESS- Path
spec/evidence/architecture-readiness.json- Kind / role
- architecture maturity and blockers
- SHA-256
4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
spec/evidence/release-gate-readiness.json · ready-for-exact-head-verification
PTO-EVIDENCE-RELEASE-GATE-READINESSSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-GATE-READINESS- Path
spec/evidence/release-gate-readiness.json- Kind / role
- exact-head gate readiness
- SHA-256
a0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0
spec/release-manifest.json · draft
PTO-EVIDENCE-RELEASE-MANIFESTSources and references
- Complete stable ID
PTO-EVIDENCE-RELEASE-MANIFEST- Path
spec/release-manifest.json- Kind / role
- release content and encoding fingerprints
- SHA-256
1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
Decision history1
Re-encode B.IOT and B.IOS size and PE mode fields · accepted
- decision recordADR
- case0096
Decision record
Loading ADR-0096…
Sources and references
- Complete stable ID
ADR-0096- Path
docs/status/decisions/0096-b-iot-b-ios-sizecode-pemode.md- Affected units
- PTO-ARCH-DATA-TYPES-INTEGER, PTO-ARCH-FEATURES-TILE-ALLOCATION, PTO-ARCH-MEMORY-MODEL-GLOBAL-MEMORY-ACCESS, PTO-ARCH-PROFILE-RESET, PTO-ARCH-PROGRAMMING-MODEL-CORE-PE-TOPOLOGY, PTO-BLOCK-B-IOS, PTO-BLOCK-B-IOT, PTO-BLOCK-MODEL-DISPATCH-COMMANDS, PTO-BLOCK-MODEL-DISPATCH-CUBE-TMATMUL, PTO-BLOCK-MODEL-DISPATCH-DESTINATION-SHAPE, PTO-BLOCK-MODEL-DISPATCH-SHARED-CUBE-MATRIX, PTO-BLOCK-MODEL-DISPATCH-SHARED-TLSU, PTO-BLOCK-MODEL-OPERANDS-SHARED-BINDINGS, PTO-BLOCK-MODEL-OPERANDS-TILE-BINDINGS, PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING, PTO-BLOCK-MODEL-STATE-TYPES, PTO-TILE-MODEL-DEFINEDNESS-ELEMENTS, PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY, PTO-TILE-MODEL-EXECUTION-COMPARISON, PTO-TILE-MODEL-EXECUTION-COMPLEX, PTO-TILE-MODEL-EXECUTION-CUBE, PTO-TILE-MODEL-EXECUTION-ELEMENTWISE, PTO-TILE-MODEL-EXECUTION-EXPANSION, PTO-TILE-MODEL-EXECUTION-FUSED-MULTIPLY-ADD, PTO-TILE-MODEL-EXECUTION-GENERATION, PTO-TILE-MODEL-EXECUTION-IMAGE-TO-COLUMN, PTO-TILE-MODEL-EXECUTION-INDEXED-REARRANGEMENT, PTO-TILE-MODEL-EXECUTION-REARRANGEMENT, PTO-TILE-MODEL-EXECUTION-REDUCTION, PTO-TILE-MODEL-EXECUTION-SORTING, PTO-TILE-MODEL-EXECUTION-UNARY, PTO-TILE-MODEL-LEGALITY-ALLOCATION-CAPACITY, PTO-TILE-MODEL-LEGALITY-DESCRIPTOR-SHAPE, PTO-TILE-MODEL-LEGALITY-IMAGE-TO-COLUMN, PTO-TILE-MODEL-LEGALITY-INDEXED-REARRANGEMENT, PTO-TILE-MODEL-LEGALITY-MATRIX-INFO-DESCRIPTOR, PTO-TILE-MODEL-LEGALITY-MATRIX-POSTPROCESS, PTO-TILE-MODEL-LEGALITY-PE-MASK, PTO-TILE-MODEL-MEMORY-LOAD-STORE, PTO-TILE-MODEL-MEMORY-SHARED-MOVEMENT, PTO-TILE-MODEL-NUMERIC-FORMATS, PTO-TILE-MODEL-ORDERING-SORTING, PTO-TILE-MODEL-SHAPE-VALID-REGION, PTO-TILE-MODEL-STATE-ALLOCATION, PTO-TILE-MODEL-STATE-DESCRIPTORS, PTO-TILE-MODEL-STATE-FEATURE-MAP-DESCRIPTORS, PTO-TILE-MODEL-STATE-SHARED-REGISTERS, PTO-TILE-MODEL-STATE-TYPES, PTO-TILE-TLOAD
- Affected NDF
- PTO-ARCH-GM-ACCESS-001, PTO-B-IOS-SHARED-STATE-001, PTO-B-IOT-STREAM-001, PTO-CUBE-ACCUMULATOR-OUTPUT-001, PTO-TLOAD-CUBE-001, PTO-TLOAD-MEMORY-001
- SHA-256
c4b4fb7bc17878f710015207dc19ddaf22a0cf6989d185b16844714c71e23f62
Unit metadata
Open 4 generated metadata fields
Open generated traceability record
{
"classification": [
"model",
"execution",
"elementwise"
],
"documentation": "docs/tile/model/execution/elementwise.md",
"id": "PTO-TILE-MODEL-EXECUTION-ELEMENTWISE",
"mnemonic": null,
"readiness_subjects": [
"ADR-0096"
],
"semantic_tests": [
"PTO-AVS-TILE-STAGE4-CARRIER-001",
"PTO-AVS-TILE-TESTTILEELEMENTWISEANDALIASING-EXECUTION-001"
],
"source": "asl/tile/model/execution/elementwise.asl",
"surface": "tile",
"tests": [
"PTO-AVS-TILE-MODEL-EXECUTION-ELEMENTWISE-STATIC-001",
"PTO-AVS-TILE-STAGE4-CARRIER-001",
"PTO-AVS-TILE-TESTTILEELEMENTWISEANDALIASING-EXECUTION-001"
]
}Sources and release identity
Show commit, paths, hashes, version, and canonical owners
- Release
0.58.5· Release candidate- Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812- Original ASL
- asl/tile/model/execution/elementwise.asl
- ASL SHA-256
d199ea603541edb77b7a2902615c311633c562366212b074cdd529bf8700dfc1- Generated documentation
- docs/tile/model/execution/elementwise.md · embedded in this page
- Documentation SHA-256
fe5f6a06349ab702fb75dd34f4ddb49c4963489f2a94ed748d27bb1a4aa0114c
Exact owners
- ASL PTO-TILE-MODEL-EXECUTION-ELEMENTWISE
asl/tile/model/execution/elementwise.asl