跳到主要内容

PTO-ARCH-DATA-TYPES-FORMAT-BF16

PTO-ARCH-DATA-TYPES-FORMAT-BF16

ASL 伪代码

下面是该指令所有者中的 Operation;页面没有重写这段行为。

// PTO-REQ-HARDWARE-NUMERIC-001: exact BF16 encoding and finite values.
pure func BF16NumericFormatDescriptor() => NumericFormatDescriptorbegin    return NumericFormatDescriptor {        available = TRUE, kind = NumericFormatKind_FixedBinary,        carrier_bits = 16, lane_bits = 16, lanes_per_carrier = 1,        sign_bits = 1, sign_bit = 15,        exponent_bits_min = 8, exponent_bits_max = 8,        fraction_bits_min = 7, fraction_bits_max = 7,        exponent_bias_available = TRUE, exponent_bias = 127,        required_low_zero_bits = 0, required_high_zero_bits = 0,        has_zero = TRUE, has_signed_zero = TRUE, has_subnormal = TRUE,        has_infinity = TRUE, has_quiet_nan = TRUE,        has_signaling_nan = TRUE    };end;
pure func BF16FiniteDecomposition(value: bits(16))    => (boolean, boolean, Word, integer {-1074..1023})begin    let exponent = value[14:7];    let fraction = value[6:0];    if exponent == Ones{8} then        return (FALSE, FALSE, Zeros{PTO_XLEN}, 0);    elsif exponent == Zeros{8} then        if fraction == Zeros{7} then            return (TRUE, value[15] == '1', Zeros{PTO_XLEN}, 0);        else return (TRUE, value[15] == '1',                     ZeroExtend{PTO_XLEN}(fraction), -133);        end;    else return (TRUE, value[15] == '1',                 LSL(Zeros{PTO_XLEN} + 1, 7) +                     ZeroExtend{PTO_XLEN}(fraction),                 (UInt(exponent) - (127 + 7))                     as integer {-1074..1023});    end;end;pure func ClassifyBF16(value: bits(16)) => NumericValueClassbegin    let exponent = value[14:7];    let fraction = value[6:0];    if exponent == Ones{8} then        if fraction == Zeros{7} then            if value[15] == '1' then return NumericValue_NegativeInfinity;            else return NumericValue_PositiveInfinity;            end;        elsif fraction[6] == '1' then return NumericValue_QuietNaN;        else return NumericValue_SignalingNaN;        end;    end;    return NumericValueClassFromFiniteSign(value[15],        exponent == Zeros{8} && fraction == Zeros{7},        exponent == Zeros{8} && fraction != Zeros{7});end;
pure func BF16CanonicalNaN() => Wordbegin    return Zeros{PTO_XLEN} + 0x7fc0;end;
pure func BF16SignedZeroEncodings() => (Word, Word)begin    return (Zeros{PTO_XLEN}, Zeros{PTO_XLEN} + 0x8000);end;
查看完整 ASL 所有者
// PTO-UNIT: {"id":"PTO-ARCH-DATA-TYPES-FORMAT-BF16","surface":"arch","classification":["data-types","formats","bf16"],"depends_on":["PTO-ARCH-DATA-TYPES-FORMAT-DESCRIPTOR"]}// DOC-BEGIN: operation// PTO-REQ-HARDWARE-NUMERIC-001: exact BF16 encoding and finite values.
pure func BF16NumericFormatDescriptor() => NumericFormatDescriptorbegin    return NumericFormatDescriptor {        available = TRUE, kind = NumericFormatKind_FixedBinary,        carrier_bits = 16, lane_bits = 16, lanes_per_carrier = 1,        sign_bits = 1, sign_bit = 15,        exponent_bits_min = 8, exponent_bits_max = 8,        fraction_bits_min = 7, fraction_bits_max = 7,        exponent_bias_available = TRUE, exponent_bias = 127,        required_low_zero_bits = 0, required_high_zero_bits = 0,        has_zero = TRUE, has_signed_zero = TRUE, has_subnormal = TRUE,        has_infinity = TRUE, has_quiet_nan = TRUE,        has_signaling_nan = TRUE    };end;
pure func BF16FiniteDecomposition(value: bits(16))    => (boolean, boolean, Word, integer {-1074..1023})begin    let exponent = value[14:7];    let fraction = value[6:0];    if exponent == Ones{8} then        return (FALSE, FALSE, Zeros{PTO_XLEN}, 0);    elsif exponent == Zeros{8} then        if fraction == Zeros{7} then            return (TRUE, value[15] == '1', Zeros{PTO_XLEN}, 0);        else return (TRUE, value[15] == '1',                     ZeroExtend{PTO_XLEN}(fraction), -133);        end;    else return (TRUE, value[15] == '1',                 LSL(Zeros{PTO_XLEN} + 1, 7) +                     ZeroExtend{PTO_XLEN}(fraction),                 (UInt(exponent) - (127 + 7))                     as integer {-1074..1023});    end;end;pure func ClassifyBF16(value: bits(16)) => NumericValueClassbegin    let exponent = value[14:7];    let fraction = value[6:0];    if exponent == Ones{8} then        if fraction == Zeros{7} then            if value[15] == '1' then return NumericValue_NegativeInfinity;            else return NumericValue_PositiveInfinity;            end;        elsif fraction[6] == '1' then return NumericValue_QuietNaN;        else return NumericValue_SignalingNaN;        end;    end;    return NumericValueClassFromFiniteSign(value[15],        exponent == Zeros{8} && fraction == Zeros{7},        exponent == Zeros{8} && fraction != Zeros{7});end;
pure func BF16CanonicalNaN() => Wordbegin    return Zeros{PTO_XLEN} + 0x7fc0;end;
pure func BF16SignedZeroEncodings() => (Word, Word)begin    return (Zeros{PTO_XLEN}, Zeros{PTO_XLEN} + 0x8000);end;// DOC-END: operation

架构行为

目的与范围

用途与范围

BF16 是 PTO 已分配的数值格式。本页帮助读者把载体布局、有限值分解和值分类联系起来;确切契约仍由 ASL 所有者中的 BF16NumericFormatDescriptor、BF16FiniteDecomposition 和 ClassifyBF16 定义。

概念与架构状态

载体与字段

描述符使用 16 位载体、16 位逻辑 lane,并且每个载体包含 1 个 lane。lane 的符号位位于 15,具有 8 个指数位、7 个尾数位,指数偏置为 127。

载体中除符号、指数和尾数字段以外,没有额外的约束位。

规则与交互

分解与分类

BF16FiniteDecomposition 先报告有限值分解是否可用;可用时返回符号、整数有效数和二进制指数。ClassifyBF16 则独立地把原始 lane 归入该格式所支持的零、次正规数、正规数、无穷大或 NaN 类别。

它具有带符号零、次正规数、无穷大、静默 NaN 和信号 NaN。全 1 指数不提供有限值分解;尾数为零时表示无穷大,尾数非零时进入 NaN 类别。

边界与未定义范围

边界与确切编码

0x0000 和 0x8000 分别是正零与负零编码;0x7fc0 是规范静默 NaN。

有限值分解函数在返回的元组中报告可用性;值分类是另一个函数的独立结果。

使用示例

示例性阅读示例

下面的示例只演示如何阅读这些函数,不增加编码规则。

例如,0x0001 分解为正的有效数 1 和指数 -133;0x7f80 则分类为正无穷大,并且没有有限值分解。

NDF 条款

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

No NDF clause is attached to this unit.

Evidence index

8 matching entries

Executable evidence2
  • BF16 exposes its exact descriptor and finite-value decomposition.
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FORMAT-BF16
    3. categoryBOUNDARY
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-BF16-DECOMP-001
    Path
    tests/asl/arch/data-types/formats/bf16/arch-bound-bf16-decomp-001.asl
    Kind / role
    boundary
    Requirements
    PTO-NUMERIC-FINITE-DECOMPOSITION-001
    Pass condition
    Field metadata, finite boundaries, unavailable special values, and existing value-class rules agree.
    SHA-256
    0365cd116d6e360bc1dea6039b3adab8593befce550a249064f8d8bbb4d15892
    Open exact source ↗ for PTO-AVS-ARCH-BF16-DECOMP-001
  • PTO-ARCH-DATA-TYPES-FORMAT-BF16 compiles as an independent normative unit
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FORMAT-BF16
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-DATA-TYPES-FORMAT-BF16-STATIC-001
    Path
    tests/asl/arch/data-types/formats/bf16/arch-static-bf16-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    c4f3367ae73298b1e0c3cc6b865876f045ac3c63c4c83cb8a45f4b48152e2692
    Open exact source ↗ for PTO-AVS-ARCH-DATA-TYPES-FORMAT-BF16-STATIC-001
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 format value classification · accepted
    1. decision recordADR
    2. 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
    Open exact decision source ↗ for ADR-0048

Unit metadata

Open 4 generated metadata fields
id
PTO-ARCH-DATA-TYPES-FORMAT-BF16
surface
arch
classification
[
  "data-types",
  "formats",
  "bf16"
]
depends_on
[
  "PTO-ARCH-DATA-TYPES-FORMAT-DESCRIPTOR"
]
Open generated traceability record
{
  "classification": [
    "data-types",
    "formats",
    "bf16"
  ],
  "documentation": "docs/arch/data-types/formats/bf16.md",
  "id": "PTO-ARCH-DATA-TYPES-FORMAT-BF16",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0048"
  ],
  "semantic_tests": [
    "PTO-AVS-ARCH-BF16-DECOMP-001"
  ],
  "source": "asl/arch/data-types/formats/bf16.asl",
  "surface": "arch",
  "tests": [
    "PTO-AVS-ARCH-BF16-DECOMP-001",
    "PTO-AVS-ARCH-DATA-TYPES-FORMAT-BF16-STATIC-001"
  ]
}

来源与发布信息

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

精确所有者