页面框架已切换为简体中文。尚未完成本地化的交互标签暂时使用英文;ASL/NDF 源、稳定标识和证据在所有语言中保持原文。
PTO-SCALAR-MODEL-FSU-PROFILE
PTO-SCALAR-MODEL-FSU-PROFILEASL 伪代码
下面直接显示完整的 ASL 所有者。
// PTO-UNIT: {"id":"PTO-SCALAR-MODEL-FSU-PROFILE","surface":"scalar","classification":["model","fsu","profile"],"depends_on":["PTO-SCALAR-MODEL-FSU-ARITHMETIC","PTO-ARCH-STATE-NUMERIC-STATUS"]}// Raw scalar floating-point execution. The portable model fixes carrier,// control/status, comparison, NaN, signed-zero, and destination rules. Numeric// operations that require a concrete floating-point implementation cross one// of the explicit profile hooks below.
pure func ScalarFPSourceTypeCode(source_type: bits(2)) => bits(5)begin if source_type == '00' then return '00000'; elsif source_type == '01' then return '00001'; else return '11111'; end;end;
pure func ScalarSignedIntegerSourceTypeCode(source_type: bits(2)) => bits(5)begin if source_type == '00' then return '01000'; elsif source_type == '01' then return '01001'; else return '11111'; end;end;
pure func ScalarUnsignedIntegerSourceTypeCode(source_type: bits(2)) => bits(5)begin if source_type == '00' then return '00000'; elsif source_type == '01' then return '00001'; else return '11111'; end;end;
pure func ScalarFPTypeCodeSupported(data_type: bits(5)) => booleanbegin return UInt(data_type) <= 14;end;
pure func ScalarIntegerTypeCodeSupported(data_type: bits(5)) => booleanbegin return UInt(data_type) <= 14;end;
readonly func ScalarFPActiveRoundingMode() => NumericRoundingModebegin return ResolveScalarFPActiveRoundingMode(_SystemRegisters.core_state[39:37]);end;
pure func ScalarFPFixedConversionRoundingMode(operation: ScalarOperation) => NumericRoundingModebegin if operation == ScalarOperation_FCVTA then return NumericRound_RNA; elsif operation == ScalarOperation_FCVTM then return NumericRound_RTM; elsif operation == ScalarOperation_FCVTN then return NumericRound_RNE; elsif operation == ScalarOperation_FCVTP then return NumericRound_RTP; elsif operation == ScalarOperation_FCVTZ then return NumericRound_RTZ; else unreachable; end;end;
readonly func ScalarFPFlags() => bits(5)begin return NumericStatusFlags();end;
func ScalarFPRecordFlags(flags: bits(5))begin RecordNumericStatusFlags(flags);end;
pure func NormalizeScalarFPSource(value: Word, data_type: bits(5)) => Wordbegin if data_type == '00001' then return ZeroExtend{PTO_XLEN}(value[31:0]); else return value; end;end;
pure func NormalizeScalarIntegerSource(value: Word, data_type: bits(5)) => Wordbegin if data_type == '00001' then return ZeroExtend{PTO_XLEN}(value[31:0]); elsif data_type == '01001' then return SignExtend{PTO_XLEN}(value[31:0]); else return value; end;end;
pure func NormalizeScalarFPResult(value: Word, data_type: bits(5)) => Wordbegin case UInt(data_type) of when 0 => return value; when 1, 3 => return ZeroExtend{PTO_XLEN}(value[31:0]); when 2 => return ZeroExtend{PTO_XLEN}(value[18:0]); when 4, 5 => return ZeroExtend{PTO_XLEN}(value[15:0]); when 6, 7, 8, 13 => return ZeroExtend{PTO_XLEN}(value[7:0]); when 9, 10 => return ZeroExtend{PTO_XLEN}(value[5:0]); when 11, 12 => return ZeroExtend{PTO_XLEN}(value[3:0]); when 14 => return ZeroExtend{PTO_XLEN}(value[8:0]); otherwise => unreachable; end;end;
pure func NormalizeScalarIntegerResult(value: Word, data_type: bits(5)) => Wordbegin case UInt(data_type) of when 0, 8 => return value; when 1 => return ZeroExtend{PTO_XLEN}(value[31:0]); when 2 => return ZeroExtend{PTO_XLEN}(value[15:0]); when 3 => return ZeroExtend{PTO_XLEN}(value[7:0]); when 4 => return ZeroExtend{PTO_XLEN}(value[3:0]); when 5 => return ZeroExtend{PTO_XLEN}(value[1:0]); when 6, 7 => return ZeroExtend{PTO_XLEN}(value[0:0]); when 9 => return SignExtend{PTO_XLEN}(value[31:0]); when 10 => return SignExtend{PTO_XLEN}(value[15:0]); when 11 => return SignExtend{PTO_XLEN}(value[7:0]); when 12 => return SignExtend{PTO_XLEN}(value[3:0]); when 13 => return SignExtend{PTO_XLEN}(value[1:0]); when 14 => return SignExtend{PTO_XLEN}(value[0:0]); otherwise => unreachable; end;end;
pure func ScalarFP64IsNaN(value: Word) => booleanbegin return NumericValueClassIsNaN( TileNumericValueClass(TileDataType_FP64, value));end;
pure func ScalarFP64IsSignalingNaN(value: Word) => booleanbegin return TileNumericValueClass(TileDataType_FP64, value) == NumericValue_SignalingNaN;end;
pure func ScalarFP64IsZero(value: Word) => booleanbegin return NumericValueClassIsZero( TileNumericValueClass(TileDataType_FP64, value));end;
pure func ScalarFP64OrderKey(value: Word) => Wordbegin if value[63] == '1' then return NOT(value); else return value XOR (Zeros{PTO_XLEN} + 0x8000000000000000); end;end;
pure func ScalarFP32IsNaN(value: bits(32)) => booleanbegin return NumericValueClassIsNaN(TileNumericValueClass( TileDataType_FP32, ZeroExtend{PTO_XLEN}(value)));end;
pure func ScalarFP32IsSignalingNaN(value: bits(32)) => booleanbegin return TileNumericValueClass(TileDataType_FP32, ZeroExtend{PTO_XLEN}(value)) == NumericValue_SignalingNaN;end;
pure func ScalarFP32IsZero(value: bits(32)) => booleanbegin return NumericValueClassIsZero(TileNumericValueClass( TileDataType_FP32, ZeroExtend{PTO_XLEN}(value)));end;
pure func ScalarFPCarrierIsZero(value: Word, data_type: bits(5)) => booleanbegin if data_type == '00001' then return ScalarFP32IsZero(value[31:0]); else return ScalarFP64IsZero(value); end;end;
pure func ScalarFP32OrderKey(value: bits(32)) => bits(32)begin if value[31] == '1' then return NOT(value); else return value XOR (Zeros{32} + 0x80000000); end;end;
pure func ScalarFPIsNaN(value: Word, source_type: bits(2)) => booleanbegin if source_type == '01' then return ScalarFP32IsNaN(value[31:0]); else return ScalarFP64IsNaN(value); end;end;
pure func ScalarFPIsSignalingNaN(value: Word, source_type: bits(2)) => booleanbegin if source_type == '01' then return ScalarFP32IsSignalingNaN(value[31:0]); else return ScalarFP64IsSignalingNaN(value); end;end;
pure func ScalarFPEncodingEqual(left: Word, right: Word, source_type: bits(2)) => booleanbegin if ScalarFPIsNaN(left, source_type) || ScalarFPIsNaN(right, source_type) then return FALSE; elsif source_type == '01' then let left32 = left[31:0]; let right32 = right[31:0]; return left32 == right32 || (ScalarFP32IsZero(left32) && ScalarFP32IsZero(right32)); else return left == right || (ScalarFP64IsZero(left) && ScalarFP64IsZero(right)); end;end;
pure func ScalarFPEncodingLess(left: Word, right: Word, source_type: bits(2)) => booleanbegin if ScalarFPIsNaN(left, source_type) || ScalarFPIsNaN(right, source_type) then return FALSE; elsif source_type == '01' then let left32 = left[31:0]; let right32 = right[31:0]; if ScalarFP32IsZero(left32) && ScalarFP32IsZero(right32) then return FALSE; else return UInt(ScalarFP32OrderKey(left32)) < UInt(ScalarFP32OrderKey(right32)); end; else if ScalarFP64IsZero(left) && ScalarFP64IsZero(right) then return FALSE; else return UInt(ScalarFP64OrderKey(left)) < UInt(ScalarFP64OrderKey(right)); end; end;end;
pure func ScalarFPEncodingCompare(operation: FloatingCompareOperation, left: Word, right: Word, source_type: bits(2)) => booleanbegin if ScalarFPIsNaN(left, source_type) || ScalarFPIsNaN(right, source_type) then return FALSE; end; let equal = ScalarFPEncodingEqual(left, right, source_type); let less = ScalarFPEncodingLess(left, right, source_type); case operation of when FloatingCompare_EQ => return equal; when FloatingCompare_NE => return !equal; when FloatingCompare_LT => return less; when FloatingCompare_LE => return less || equal; when FloatingCompare_GT => return !less && !equal; when FloatingCompare_GE => return !less; end;end;
pure func ScalarFPQuietNaN(source_type: bits(2)) => Wordbegin let data_type = if source_type == '01' then TileDataType_FP32 else TileDataType_FP64; let (available, value) = TileNumericCanonicalNaN(data_type); assert available; return value;end;
pure func ScalarFPMinMax(operation: FloatingBinaryOperation, left: Word, right: Word, source_type: bits(2)) => Wordbegin let left_nan = ScalarFPIsNaN(left, source_type); let right_nan = ScalarFPIsNaN(right, source_type); if left_nan && right_nan then return ScalarFPQuietNaN(source_type); elsif left_nan then return NormalizeScalarFPSource(right, ScalarFPSourceTypeCode(source_type)); elsif right_nan then return NormalizeScalarFPSource(left, ScalarFPSourceTypeCode(source_type)); end;
if source_type == '01' then let left32 = left[31:0]; let right32 = right[31:0]; if ScalarFP32IsZero(left32) && ScalarFP32IsZero(right32) then if operation == FloatingBinary_MAX && left32[31] == '1' && right32[31] == '1' then return Zeros{PTO_XLEN} + 0x80000000; elsif operation == FloatingBinary_MAX then return Zeros{PTO_XLEN}; elsif left32[31] == '1' || right32[31] == '1' then return Zeros{PTO_XLEN} + 0x80000000; else return Zeros{PTO_XLEN}; end; end; elsif ScalarFP64IsZero(left) && ScalarFP64IsZero(right) then if operation == FloatingBinary_MAX && left[63] == '1' && right[63] == '1' then return Zeros{PTO_XLEN} + 0x8000000000000000; elsif operation == FloatingBinary_MAX then return Zeros{PTO_XLEN}; elsif left[63] == '1' || right[63] == '1' then return Zeros{PTO_XLEN} + 0x8000000000000000; else return Zeros{PTO_XLEN}; end; end;
let less = ScalarFPEncodingLess(left, right, source_type); if operation == FloatingBinary_MIN then if less then return left; else return right; end; else if less then return right; else return left; end; end;end;
impdef func ScalarFPBinaryProfile(operation: FloatingBinaryOperation, rounding_mode: NumericRoundingMode, source_type: bits(5), left: Word, right: Word) => (Word, bits(5))begin // Executable identity default. A named numeric profile supplies the // correctly rounded arithmetic result and IEEE exception flags. assert ScalarFPTypeCodeSupported(source_type); return (left, Zeros{5});end;
impdef func ScalarFPUnaryProfile(operation: FloatingUnaryOperation, rounding_mode: NumericRoundingMode, source_type: bits(5), value: Word) => (Word, bits(5))begin assert ScalarFPTypeCodeSupported(source_type); return (value, Zeros{5});end;
impdef func ScalarFPFusedProfile(operation: FloatingFusedOperation, rounding_mode: NumericRoundingMode, source_type: bits(5), addend: Word, left: Word, right: Word) => (Word, bits(5))begin assert ScalarFPTypeCodeSupported(source_type); return (addend, Zeros{5});end;
impdef func ScalarFPToIntegerProfile(rounding_mode: NumericRoundingMode, destination_type: bits(5), source_type: bits(5), value: Word) => (Word, bits(5))begin assert ScalarIntegerTypeCodeSupported(destination_type); assert ScalarFPTypeCodeSupported(source_type); return (value, Zeros{5});end;
impdef func ScalarFPConvertProfile(rounding_mode: NumericRoundingMode, destination_type: bits(5), source_type: bits(5), value: Word) => (Word, bits(5))begin assert ScalarFPTypeCodeSupported(destination_type); assert ScalarFPTypeCodeSupported(source_type); return (value, Zeros{5});end;
impdef func ScalarIntegerToFPProfile(rounding_mode: NumericRoundingMode, source_type: bits(5), destination_type: bits(5), value: Word) => (Word, bits(5))begin assert ScalarIntegerTypeCodeSupported(source_type); assert ScalarFPTypeCodeSupported(destination_type); return (value, Zeros{5});end;
架构行为
该内部模型单元不在双语读者指南迁移范围内;请直接阅读本页的 ASL/NDF 所有者与验证证据。
NDF 条款
正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。
No NDF clause is attached to this unit.
Evidence index
7 matching entries
Executable evidence1
PTO-SCALAR-MODEL-FSU-PROFILE compiles as an independent normative unit
- surfaceSCALAR
- ownerPTO-SCALAR-MODEL-FSU-PROFILE
- categorySTATIC-INVARIANT
- case001
Show exact test source
Sources and references
- Complete stable ID
PTO-AVS-SCALAR-MODEL-FSU-PROFILE-STATIC-001- Path
tests/asl/scalar/model/fsu/profile/scalar-static-profile-contract-001.asl- Kind / role
- static-invariant
- Pass condition
- the complete model and this unit's static invariant compile
- SHA-256
03f43acc843b027876eddf985a01156ad0b8e0c5eb847d27be6189194cdefd75
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
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
Unit metadata
Open 4 generated metadata fields
Open generated traceability record
{
"classification": [
"model",
"fsu",
"profile"
],
"documentation": "docs/scalar/model/fsu/profile.md",
"id": "PTO-SCALAR-MODEL-FSU-PROFILE",
"mnemonic": null,
"readiness_subjects": [
"ADR-0048"
],
"semantic_tests": [],
"source": "asl/scalar/model/fsu/profile.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-MODEL-FSU-PROFILE-STATIC-001"
]
}来源与发布信息
展开 commit、路径、hash、版本和规范所有者
- 发布
0.58.5· 候选发布- Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812- ASL SHA-256
c429ac19ea648dd0b0180a736af1fcd3990cb949b2397ca2e33003b3da593295- 生成文档
- docs/scalar/model/fsu/profile.md · 已融合到当前页面
- 文档 SHA-256
e55fee963910a53f515f95a3e4fdcf9fbf7fa86334a949842a4c3f3ce74c0477
精确所有者
- ASL PTO-SCALAR-MODEL-FSU-PROFILE
asl/scalar/model/fsu/profile.asl