跳到主要内容

PTO-ARCH-DATA-TYPES-FP19

PTO-ARCH-DATA-TYPES-FP19

ASL 伪代码

下面直接显示完整的 ASL 所有者。

// PTO-UNIT: {"id":"PTO-ARCH-DATA-TYPES-FP19","surface":"arch","classification":["data-types","fp19"],"depends_on":["PTO-ARCH-DATA-TYPES-NUMERIC-CLASSIFICATION"]}// FP19 is the architectural scalar/vector parameter carrier used by B.FPATR.// NDF-BEGIN: PTO-FP19-PARAMETER-CARRIER-001// ndf: kind=contract level=L1 layer=architecture status=accepted// FP19 MUST use one sign bit, an eight-bit bias-127 exponent, and a ten-bit// fraction. B.FPATR scales MUST be positive normal values; activation// parameters MUST be positive zero or positive normal values. Subnormal and// non-finite FP19 parameter carriers are illegal before architectural effects.// NDF-END: PTO-FP19-PARAMETER-CARRIER-001
pure func FP19PowerOfTwo(exponent: integer {-136..127}) => realbegin    var result: real = 1.0;    if exponent > 0 then        for step = 1 to exponent looplimit 127 do            result = result * 2.0;        end;    elsif exponent < 0 then        for step = 1 to -exponent looplimit 136 do            result = result / 2.0;        end;    end;    return result;end;
pure func FP19ValueClass(value: bits(19)) => NumericValueClassbegin    let exponent = value[17:10];    let fraction = value[9:0];    if exponent == Ones{8} then        if fraction == Zeros{10} then            if value[18] == '1' then                return NumericValue_NegativeInfinity;            else                return NumericValue_PositiveInfinity;            end;        elsif fraction[9] == '1' then            return NumericValue_QuietNaN;        else            return NumericValue_SignalingNaN;        end;    end;    return NumericValueClassFromFiniteSign(        value[18],        exponent == Zeros{8} && fraction == Zeros{10},        exponent == Zeros{8} && fraction != Zeros{10});end;
pure func FP19FiniteValue(value: bits(19)) => realbegin    let exponent = UInt(value[17:10]);    let fraction = UInt(value[9:0]);    assert exponent != 255;    var magnitude: real = 0.0;    if exponent == 0 then        magnitude = Real(fraction) * FP19PowerOfTwo(-136);    else        magnitude = (1.0 + Real(fraction) / 1024.0) *            FP19PowerOfTwo((exponent - 127) as integer {-126..127});    end;    if value[18] == '1' then return -magnitude; end;    return magnitude;end;
pure func FP19ScaleLegal(value: bits(19)) => booleanbegin    return FP19ValueClass(value) == NumericValue_PositiveNormal;end;
pure func FP19ActivationParameterLegal(value: bits(19)) => booleanbegin    let value_class = FP19ValueClass(value);    return value_class == NumericValue_PositiveZero ||           value_class == NumericValue_PositiveNormal;end;
pure func FP32ToFP19(value: Word) => bits(19)begin    let source = value[31:0];    let source_class = ClassifyFP32(source);    if NumericValueClassIsNaN(source_class) then        return '0111111111100000000';    end;    var exponent: integer {0..256} = UInt(source[30:23]);    var fraction: integer {0..1024} = UInt(source[22:13]);    let discarded = UInt(source[12:0]);    let halfway = 0x1000;    if discarded > halfway ||       (discarded == halfway && fraction MOD 2 == 1) then        assert fraction <= 1023;        fraction = (fraction + 1) as integer {0..1024};        if fraction == 0x400 then            fraction = 0;            if exponent < 255 then                exponent = (exponent + 1) as integer {0..256};            end;        end;    end;    var result = Zeros{19};    assert exponent <= 255;    assert fraction <= 1023;    result[18] = source[31];    result[17:10] = Zeros{8} + (exponent as integer {0..255});    result[9:0] = Zeros{10} + (fraction as integer {0..1023});    return result;end;

架构行为

目的与范围

目的与范围

FP19 是 B.FPATR 使用的 19 位标量和向量参数载体。本单元固定其表示、合法参数域、有限值解释以及从 FP32 的转换。

将载体集中定义在这里,可以在指令产生架构效果之前检查缩放因子和激活参数是否合法。

概念与架构状态

概念与可见状态

  • 其布局包含一个符号位、八位指数和十位小数,指数偏置为 127。
  • FP19ValueClass 根据 19 位字段区分零、次正规数、正规数、无穷大、静默 NaN 和信号 NaN。
  • FP19FiniteValue 解释有限载体;FP32ToFP19 保留 FP32 小数的高十位,并对丢弃位执行舍入到最近值、恰好居中时取偶数。
规则与交互

规则与交互

FP19ScaleLegal 只接受 NumericValue_PositiveNormal。

FP19ActivationParameterLegal 接受 NumericValue_PositiveZero 或 NumericValue_PositiveNormal。

FP32ToFP19 将任意 FP32 NaN 映射为固定载体 0111111111100000000,并正确处理小数进位到指数的情况。

边界与未定义范围

架构边界

次正规数、负值、无穷大和 NaN 都不属于合法缩放因子域。激活参数还允许正零,但不额外允许其他类别。

FP19FiniteValue 断言指数不为 255;调用该函数前,必须先对非有限输入完成分类和拒绝。

使用示例

示例性阅读示例

正正规数缩放因子可以通过 FP19ScaleLegal;相同比特模式若置位符号位,则即使仍是有限值也不能通过。

对于激活参数,正零合法而负零不合法;精确判断以 ASL 归属单元中的数值类别检查为准。

NDF 条款

正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。

    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FP19
    3. categoryFP19-PARAMETER-CARRIER
    4. case001

    规范契约

    contract · L1 · accepted

    FP19 MUST use one sign bit, an eight-bit bias-127 exponent, and a ten-bit fraction. B.FPATR scales MUST be positive normal values; activation parameters MUST be positive zero or positive normal values. Subnormal and non-finite FP19 parameter carriers are illegal before architectural effects.

    来源与引用
    完整稳定 ID
    PTO-FP19-PARAMETER-CARRIER-001
    来源路径
    asl/arch/data-types/fp19.asl
    适用单元
    PTO-ARCH-DATA-TYPES-FP19
    源 SHA-256
    3733d0d930df3f890b4aa5237dfface8f0cc2081f42244f45aae711435865fa6
    条款 SHA-256
    933963f2da6a418a8bb89abf397bd1f33c34df14b804492ff3509011821a1535
    打开精确 canonical source ↗

Evidence index

10 matching entries

Executable evidence4
  • PTO-ARCH-DATA-TYPES-FP19 compiles as an independent normative unit
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FP19
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-DATA-TYPES-FP19-STATIC-001
    Path
    tests/asl/arch/data-types/fp19/arch-static-fp19-contract-001.asl
    Kind / role
    static-invariant
    Requirements
    PTO-FP19-PARAMETER-CARRIER-001
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    50df6e60423b3392350e3af3ee65daebd30fd5d6b262d73f408aaaddb8ab852e
    Open exact source ↗ for PTO-AVS-ARCH-DATA-TYPES-FP19-STATIC-001
  • FP19 classifies and decodes its assigned sign, exponent, and fraction fields
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FP19
    3. categoryBOUNDARY
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-FP19-ENC-001
    Path
    tests/asl/arch/data-types/fp19/arch-bound-fp19-encoding-001.asl
    Kind / role
    boundary
    Requirements
    PTO-FP19-PARAMETER-CARRIER-001
    Pass condition
    zero, finite scales, infinity, NaN, and exact FP32 conversion use canonical FP19 encodings
    SHA-256
    4589d293a72d48a38f0ed10e3ff043b9e40a853c35496e28e57bca7bebf92967
    Open exact source ↗ for PTO-AVS-ARCH-FP19-ENC-001
  • FP19 scale and activation carriers reject subnormal and non-finite encodings
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FP19
    3. categoryBOUNDARY
    4. case002
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-FP19-PARAMETER-DOMAIN-002
    Path
    tests/asl/arch/data-types/fp19/arch-bound-fp19-parameter-domain-002.asl
    Kind / role
    boundary
    Requirements
    PTO-FP19-PARAMETER-CARRIER-001
    Pass condition
    only positive normal scales and positive zero or normal activation parameters are legal
    SHA-256
    972bd0e343c30dbb0c240c2175f0c276b9b8aa6cf9c0ca5cdb1ec36c5a33175e
    Open exact source ↗ for PTO-AVS-ARCH-FP19-PARAMETER-DOMAIN-002
  • Matrix vector parameter preflight rejects subnormal FP19 carriers
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-LEGALITY-MATRIX-POSTPROCESS
    3. categoryBOUNDARY
    4. case002
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-MATRIX-PARAMS-002
    Path
    tests/asl/tile/model/legality/matrix-postprocess/tile-bound-matrix-params-002.asl
    Kind / role
    boundary
    Requirements
    PTO-MATRIX-POSTPROCESS-BITEXACT-001, PTO-FP19-PARAMETER-CARRIER-001
    Pass condition
    normal quantization and activation carriers pass while subnormal and nonzero-unused-bit words reject
    SHA-256
    9103c56ebc98d0f221d43e774a367f91d6e5c7cd530cfaa2b88dc95daec57f49
    Open exact source ↗ for PTO-AVS-TILE-MATRIX-PARAMS-002
Commit-scoped evidence5
  • spec/evidence/release-traceability-readiness.json · closedPTO-EVIDENCE-RELEASE-TRACEABILITY
    Sources 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
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-TRACEABILITY
  • spec/evidence/instruction-contract-closure.json · closedPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Sources 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
    Open exact source ↗ for PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
  • spec/evidence/architecture-readiness.json · openPTO-EVIDENCE-ARCHITECTURE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-ARCHITECTURE-READINESS
    Path
    spec/evidence/architecture-readiness.json
    Kind / role
    architecture maturity and blockers
    SHA-256
    4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
    Open exact source ↗ for PTO-EVIDENCE-ARCHITECTURE-READINESS
  • spec/evidence/release-gate-readiness.json · ready-for-exact-head-verificationPTO-EVIDENCE-RELEASE-GATE-READINESS
    Sources 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
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-GATE-READINESS
  • spec/release-manifest.json · draftPTO-EVIDENCE-RELEASE-MANIFEST
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-MANIFEST
    Path
    spec/release-manifest.json
    Kind / role
    release content and encoding fingerprints
    SHA-256
    1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-MANIFEST
Decision history1
  • Numeric post-process and format operations · accepted
    1. decision recordADR
    2. case0085

    Decision record

    Loading ADR-0085…

    Sources and references
    Complete stable ID
    ADR-0085
    Path
    docs/status/decisions/0085-numeric-postprocess-and-format-operations.md
    Affected units
    PTO-ARCH-DATA-TYPES-FP19, PTO-BLOCK-B-FPATR, PTO-TILE-TCVT
    Affected NDF
    PTO-B-FPATR-MATRIX-POSTPROCESS-001, PTO-FP19-PARAMETER-CARRIER-001, PTO-TCVT-CONTRACT-001
    SHA-256
    d4f1057dcc23ae62c01a08c6c4664b0b6ffa024ae45eafd776f67327d98cb9e9
    Open exact decision source ↗ for ADR-0085

Unit metadata

Open 4 generated metadata fields
id
PTO-ARCH-DATA-TYPES-FP19
surface
arch
classification
[
  "data-types",
  "fp19"
]
depends_on
[
  "PTO-ARCH-DATA-TYPES-NUMERIC-CLASSIFICATION"
]
Open generated traceability record
{
  "classification": [
    "data-types",
    "fp19"
  ],
  "documentation": "docs/arch/data-types/fp19.md",
  "id": "PTO-ARCH-DATA-TYPES-FP19",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0085"
  ],
  "semantic_tests": [
    "PTO-AVS-ARCH-FP19-ENC-001",
    "PTO-AVS-ARCH-FP19-PARAMETER-DOMAIN-002"
  ],
  "source": "asl/arch/data-types/fp19.asl",
  "surface": "arch",
  "tests": [
    "PTO-AVS-ARCH-DATA-TYPES-FP19-STATIC-001",
    "PTO-AVS-ARCH-FP19-ENC-001",
    "PTO-AVS-ARCH-FP19-PARAMETER-DOMAIN-002"
  ]
}

来源与发布信息

展开 commit、路径、hash、版本和规范所有者
发布
0.58.5 · 候选发布
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
3733d0d930df3f890b4aa5237dfface8f0cc2081f42244f45aae711435865fa6
文档 SHA-256
ee7c38219022a91dba0d95b1c61e3e424b7a77ae918cd59c3bec320811e05fee

精确所有者