PTO-TILE-MODEL-NUMERIC-FORMATS
PTO-TILE-MODEL-NUMERIC-FORMATSASL pseudocode
The complete ASL owner is shown directly below.
// PTO-UNIT: {"id":"PTO-TILE-MODEL-NUMERIC-FORMATS","surface":"tile","classification":["model","numeric","formats"],"depends_on":["PTO-TILE-MODEL-EXECUTION-GENERATION","PTO-ARCH-DATA-TYPES-NUMERIC-CLASSIFICATION","PTO-ARCH-FEATURES-MX-FORMATS","PTO-ARCH-STATE-NUMERIC-STATUS"]}// PTO-REQ-TEPL-CONVERT-001: conversion, quantization, and dequantization.
pure func NormalizeTileInteger(value: Word, data_type: TileDataType) => Wordbegin case data_type of when TileDataType_S4X2 => return SignExtend{PTO_XLEN}(value[3:0]); when TileDataType_U4X2 => return ZeroExtend{PTO_XLEN}(value[3:0]); when TileDataType_S8 => return SignExtend{PTO_XLEN}(value[7:0]); when TileDataType_U8 => return ZeroExtend{PTO_XLEN}(value[7:0]); when TileDataType_S16 => return SignExtend{PTO_XLEN}(value[15:0]); when TileDataType_U16 => return ZeroExtend{PTO_XLEN}(value[15:0]); when TileDataType_S32 => return SignExtend{PTO_XLEN}(value[31:0]); when TileDataType_U32 => return ZeroExtend{PTO_XLEN}(value[31:0]); when TileDataType_S64, TileDataType_U64 => return value; otherwise => return value; end;end;
pure func TileIntegerMinimum(data_type: TileDataType) => Wordbegin assert TileDataTypeIsInteger(data_type); case data_type of when TileDataType_S4X2 => return SignExtend{PTO_XLEN}('1000'); when TileDataType_S8 => return SignExtend{PTO_XLEN}('10000000'); when TileDataType_S16 => return SignExtend{PTO_XLEN}('1000000000000000'); when TileDataType_S32 => return Zeros{PTO_XLEN} + 0xffffffff80000000; when TileDataType_S64 => return Zeros{PTO_XLEN} + 0x8000000000000000; otherwise => return Zeros{PTO_XLEN}; end;end;
pure func TileIntegerMaximum(data_type: TileDataType) => Wordbegin assert TileDataTypeIsInteger(data_type); case data_type of when TileDataType_S4X2 => return Zeros{PTO_XLEN} + 0x7; when TileDataType_U4X2 => return Zeros{PTO_XLEN} + 0xf; when TileDataType_S8 => return Zeros{PTO_XLEN} + 0x7f; when TileDataType_U8 => return Zeros{PTO_XLEN} + 0xff; when TileDataType_S16 => return Zeros{PTO_XLEN} + 0x7fff; when TileDataType_U16 => return Zeros{PTO_XLEN} + 0xffff; when TileDataType_S32 => return Zeros{PTO_XLEN} + 0x7fffffff; when TileDataType_U32 => return Zeros{PTO_XLEN} + 0xffffffff; when TileDataType_S64 => return Zeros{PTO_XLEN} + 0x7fffffffffffffff; when TileDataType_U64 => return Ones{PTO_XLEN}; otherwise => unreachable; end;end;
pure func TileQuantizationScaleLegal(scale: Word) => booleanbegin if !TileNumericEncodingValid(TileDataType_FP32, scale) || scale[31] == '1' then return FALSE; end; let value_class = TileNumericValueClass(TileDataType_FP32, scale); return !NumericValueClassIsNaN(value_class) && !NumericValueClassIsInfinity(value_class) && !NumericValueClassIsZero(value_class);end;
pure func TileQuantizationZeroPointLegal( zero_point: Word, data_type: TileDataType) => booleanbegin if data_type != TileDataType_S8 && data_type != TileDataType_U8 then return FALSE; end; return NormalizeTileInteger(zero_point, data_type) == zero_point;end;
pure func TileConvertIntegerSaturating( value: Word, source_type: TileDataType, destination_type: TileDataType) => Wordbegin assert TileDataTypeIsInteger(source_type); assert TileDataTypeIsInteger(destination_type); let source = NormalizeTileInteger(value, source_type); let minimum = TileIntegerMinimum(destination_type); let maximum = TileIntegerMaximum(destination_type); if TileDataTypeIsSigned(source_type) then if !TileDataTypeIsSigned(destination_type) && SInt(source) < 0 then return minimum; end; if TileDataTypeIsSigned(destination_type) then if SInt(source) < SInt(minimum) then return minimum; end; if SInt(source) > SInt(maximum) then return maximum; end; elsif UInt(source) > UInt(maximum) then return maximum; end; elsif UInt(source) > UInt(maximum) then return maximum; end; return NormalizeTileInteger(source, destination_type);end;
pure func TileConvertIntegerValue( value: Word, source_type: TileDataType, destination_type: TileDataType, saturating: boolean) => Wordbegin if saturating then return TileConvertIntegerSaturating( value, source_type, destination_type); end; return NormalizeTileInteger( NormalizeTileInteger(value, source_type), destination_type);end;
impdef func TileProfileConvert(value: Word, source_type: TileDataType, destination_type: TileDataType, control: NumericExecutionControl) => (Word, bits(5))begin // Profiles replace this raw-encoding rule for floating conversions. return (value, Zeros{5});end;
func TileConvertValue(value: Word, source_type: TileDataType, destination_type: TileDataType, control: NumericExecutionControl) => (Word, bits(5))begin if TileDataTypeIsFloating(source_type) || TileDataTypeIsFloating(destination_type) then return TileProfileConvert(value, source_type, destination_type, control); else // Integer conversion first interprets the source width/signedness, // then truncates or extends into the destination representation. return (TileConvertIntegerValue( value, source_type, destination_type, control.saturating), Zeros{5}); end;end;
func TileCommitConversionResult(destination: TileIndex, result: TileInfo, flags: bits(5))begin // All conversion and padding work is complete before this non-faulting // architectural publish boundary is entered. RecordNumericStatusFlags(flags); _Tiles[[destination]] = result;end;
func TCVT(destination: TileIndex, source: TileIndex, control: NumericExecutionControl)begin var result = _Tiles[[destination]]; let source_tile = _Tiles[[source]]; assert result.rows == source_tile.rows; assert result.columns == source_tile.columns; assert result.valid_rows == source_tile.valid_rows; assert result.valid_columns == source_tile.valid_columns; var conversion_flags = Zeros{5}; result.defined_elements = Zeros{PTO_MODEL_TILE_ELEMENTS}; result.defined_valid_elements = 0; result.packed_defined_elements = ZeroPackedTileDefinedElements(); result.contents_defined = FALSE; 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 source_element = TileLogicalLinearIndex(source_tile, row as integer {0..65535}, column as integer {0..65535}); let destination_element = TileLogicalLinearIndex(result, row as integer {0..65535}, column as integer {0..65535}); let (converted, flags) = TileConvertValue( TileReadLogicalElement(source_tile, source_element), source_tile.data_type, result.data_type, control); result = TileInfoWithLogicalElement(result, destination_element, converted); conversion_flags = conversion_flags OR flags; end; end; result = TileWithValidRegionDefined(result); result = TileWithPadding(result, CurrentBundlePadValue()); result.location = TileLocation_Any; TileCommitConversionResult(destination, result, conversion_flags);end;
impdef func TileProfileQuantize(value: Word, scale: Word, zero_point: Word, source_type: TileDataType, destination_type: TileDataType, control: NumericExecutionControl) => (Word, bits(5))begin assert !IsZero(scale); return ( NormalizeTileInteger(value + zero_point, destination_type), Zeros{5});end;
impdef func TileProfileDequantize(value: Word, scale: Word, zero_point: Word, source_type: TileDataType, destination_type: TileDataType, control: NumericExecutionControl) => (Word, bits(5))begin return (value - zero_point, Zeros{5});end;
func TQUANT(destination: TileIndex, source: TileIndex, scale: Word, zero_point: Word, control: NumericExecutionControl)begin var result = _Tiles[[destination]]; let source_tile = _Tiles[[source]]; assert result.valid_rows == source_tile.valid_rows; assert result.valid_columns == source_tile.valid_columns; var conversion_flags = Zeros{5}; result.defined_elements = Zeros{PTO_MODEL_TILE_ELEMENTS}; result.defined_valid_elements = 0; result.packed_defined_elements = ZeroPackedTileDefinedElements(); result.contents_defined = FALSE; 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 source_element = TileLogicalLinearIndex(source_tile, row as integer {0..65535}, column as integer {0..65535}); let destination_element = TileLogicalLinearIndex(result, row as integer {0..65535}, column as integer {0..65535}); let (converted, flags) = TileProfileQuantize( TileReadLogicalElement(source_tile, source_element), scale, zero_point, source_tile.data_type, result.data_type, control); result = TileInfoWithLogicalElement(result, destination_element, converted); conversion_flags = conversion_flags OR flags; end; end; result = TileWithValidRegionDefined(result); result = TileWithPadding(result, TilePad_Null); result.location = TileLocation_Any; TileCommitConversionResult(destination, result, conversion_flags);end;
func TDEQUANT(destination: TileIndex, source: TileIndex, scale: Word, zero_point: Word, control: NumericExecutionControl)begin var result = _Tiles[[destination]]; let source_tile = _Tiles[[source]]; assert result.valid_rows == source_tile.valid_rows; assert result.valid_columns == source_tile.valid_columns; var conversion_flags = Zeros{5}; result.defined_elements = Zeros{PTO_MODEL_TILE_ELEMENTS}; result.defined_valid_elements = 0; result.packed_defined_elements = ZeroPackedTileDefinedElements(); result.contents_defined = FALSE; 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 source_element = TileLogicalLinearIndex(source_tile, row as integer {0..65535}, column as integer {0..65535}); let destination_element = TileLogicalLinearIndex(result, row as integer {0..65535}, column as integer {0..65535}); let (converted, flags) = TileProfileDequantize( TileReadLogicalElement(source_tile, source_element), scale, zero_point, source_tile.data_type, result.data_type, control); result = TileInfoWithLogicalElement(result, destination_element, converted); conversion_flags = conversion_flags OR flags; end; end; result = TileWithValidRegionDefined(result); result = TileWithPadding(result, TilePad_Null); result.location = TileLocation_Any; TileCommitConversionResult(destination, result, conversion_flags);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 evidence2
PTO-TILE-MODEL-NUMERIC-FORMATS compiles as an independent normative unit
- surfaceTILE
- ownerPTO-TILE-MODEL-NUMERIC-FORMATS
- categorySTATIC-INVARIANT
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-MODEL-NUMERIC-FORMATS-STATIC-001- Path
tests/asl/tile/model/numeric/formats/tile-static-formats-contract-001.asl- Kind / role
- static-invariant
- Pass condition
- the complete model and this unit's static invariant compile
- SHA-256
70b0a31744353ea5a5c9fb254e82c78f1db596e4e14dceecb7ce5c0c4fb547d8
Covers Tile Conversion.
- surfaceTILE
- ownerPTO-TILE-MODEL-NUMERIC-FORMATS
- categoryEXECUTION
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-TILE-TESTTILECONVERSION-EXECUTION-001- Path
tests/asl/tile/model/numeric/formats/tile-exec-conversion-001.asl- Kind / role
- execution
- Pass condition
- TestTileConversion completes without assertion failure
- SHA-256
d6299c98117e52a2c845ca027c52b43feb47ea955b103291cefc1b10a9be03a6
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 history2
Numeric format value classification · accepted
- decision recordADR
- case0048
Decision record
Loading ADR-0048…
Sources and references
- Complete stable ID
ADR-0048- Path
docs/status/decisions/0048-numeric-format-value-classification.md- Affected units
- PTO-ARCH-DATA-TYPES-FORMAT-BF16, PTO-ARCH-DATA-TYPES-FORMAT-DESCRIPTOR, PTO-ARCH-DATA-TYPES-FORMAT-E1M2X2, PTO-ARCH-DATA-TYPES-FORMAT-E2M1X2, PTO-ARCH-DATA-TYPES-FORMAT-E2M3, PTO-ARCH-DATA-TYPES-FORMAT-E3M2, PTO-ARCH-DATA-TYPES-FORMAT-E4M3, PTO-ARCH-DATA-TYPES-FORMAT-E5M2, PTO-ARCH-DATA-TYPES-FORMAT-E8M0, PTO-ARCH-DATA-TYPES-FORMAT-FP16, PTO-ARCH-DATA-TYPES-FORMAT-FP32, PTO-ARCH-DATA-TYPES-FORMAT-FP64, PTO-ARCH-DATA-TYPES-FORMAT-HF32, PTO-ARCH-DATA-TYPES-FORMAT-HIF4X2, PTO-ARCH-DATA-TYPES-FORMAT-HIF8, PTO-ARCH-DATA-TYPES-FORMAT-TF32, PTO-ARCH-DATA-TYPES-NUMERIC-CLASSIFICATION, PTO-ARCH-DATA-TYPES-NUMERIC-FORMATS, PTO-SCALAR-FMAX, PTO-SCALAR-FMIN, PTO-SCALAR-MODEL-FSU-PROFILE, PTO-TILE-MODEL-EXECUTION-COMPARISON, PTO-TILE-MODEL-EXECUTION-FUSED-MULTIPLY-ADD, PTO-TILE-MODEL-EXECUTION-UNARY, PTO-TILE-MODEL-NUMERIC-FORMATS, PTO-TILE-MODEL-ORDERING-SORTING, PTO-TILE-TMAX, PTO-TILE-TMIN
- Affected NDF
- PTO-FMAX-DECISION-BINDING-001, PTO-FMIN-DECISION-BINDING-001, PTO-NUMERIC-FINITE-DECOMPOSITION-001, PTO-NUMERIC-FORMAT-DESCRIPTOR-001, PTO-TMAX-CONTRACT-001, PTO-TMIN-CONTRACT-001
- SHA-256
ce3ecd1851e22b5517d07076ab8bd2db36b6b4582111c761db19240275853d9c
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",
"numeric",
"formats"
],
"documentation": "docs/tile/model/numeric/formats.md",
"id": "PTO-TILE-MODEL-NUMERIC-FORMATS",
"mnemonic": null,
"readiness_subjects": [
"ADR-0048",
"ADR-0096"
],
"semantic_tests": [
"PTO-AVS-TILE-TESTTILECONVERSION-EXECUTION-001"
],
"source": "asl/tile/model/numeric/formats.asl",
"surface": "tile",
"tests": [
"PTO-AVS-TILE-MODEL-NUMERIC-FORMATS-STATIC-001",
"PTO-AVS-TILE-TESTTILECONVERSION-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/numeric/formats.asl
- ASL SHA-256
6214f747a2552d0d8a8c9f81f6fc4320e585304acaaf716416cfe80a6e93da71- Generated documentation
- docs/tile/model/numeric/formats.md · embedded in this page
- Documentation SHA-256
c0a5e3bc717aa9d19e3c43bad6194c9d4859ef8b44e46dc2f7651a35658a9b2d
Exact owners
- ASL PTO-TILE-MODEL-NUMERIC-FORMATS
asl/tile/model/numeric/formats.asl