Skip to main content

PTO-ARCH-DATA-TYPES-FORMAT-HIF8

PTO-ARCH-DATA-TYPES-FORMAT-HIF8

ASL pseudocode

This Operation comes directly from the instruction owner; the page does not rewrite its behavior.

// PTO-REQ-HARDWARE-NUMERIC-001: exact HiF8 dynamic encoding.
pure func HiF8NumericFormatDescriptor() => NumericFormatDescriptorbegin    return NumericFormatDescriptor {        available = TRUE, kind = NumericFormatKind_HiF8,        carrier_bits = 8, lane_bits = 8, lanes_per_carrier = 1,        sign_bits = 1, sign_bit = 7,        exponent_bits_min = 0, exponent_bits_max = 4,        fraction_bits_min = 1, fraction_bits_max = 3,        exponent_bias_available = FALSE, exponent_bias = 0,        required_low_zero_bits = 0, required_high_zero_bits = 0,        has_zero = TRUE, has_signed_zero = FALSE, has_subnormal = TRUE,        has_infinity = TRUE, has_quiet_nan = TRUE,        has_signaling_nan = FALSE    };end;
pure func HiF8DecodeDotField(value: bits(8))    => (HiF8DotField, integer {0..4}, integer {1..3})begin    if value[6:3] == '0000' then        return (HiF8DotField_Denormal, 0, 3);    elsif value[6:3] == '0001' then        return (HiF8DotField_D0, 0, 3);    elsif value[6:4] == '001' then        return (HiF8DotField_D1, 1, 3);    elsif value[6:5] == '01' then        return (HiF8DotField_D2, 2, 3);    elsif value[6:5] == '10' then        return (HiF8DotField_D3, 3, 2);    else return (HiF8DotField_D4, 4, 1);    end;end;
pure func HiF8FiniteDecomposition(value: bits(8))    => (boolean, boolean, Word, integer {-1074..1023})begin    if value == '10000000' || value == '01101111' ||       value == '11101111' then        return (FALSE, FALSE, Zeros{PTO_XLEN}, 0);    end;    let (dot, exponent_bits, fraction_bits) = HiF8DecodeDotField(value);    case dot of        when HiF8DotField_Denormal =>            let mantissa = value[2:0];            if mantissa == Zeros{3} then                return (TRUE, FALSE, Zeros{PTO_XLEN}, 0);            else return (TRUE, value[7] == '1', Zeros{PTO_XLEN} + 1,                         (UInt(mantissa) - 23)                             as integer {-1074..1023});            end;        when HiF8DotField_D0 =>            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 3) +                        ZeroExtend{PTO_XLEN}(value[2:0]), -3);        when HiF8DotField_D1 =>            var actual_exponent: integer {-15..15} = 1;            if value[3] == '1' then actual_exponent = -1; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 3) +                        ZeroExtend{PTO_XLEN}(value[2:0]),                    (actual_exponent - 3) as integer {-1074..1023});        when HiF8DotField_D2 =>            let magnitude = 2 + UInt(value[3]);            var actual_exponent: integer {-15..15} = magnitude;            if value[4] == '1' then actual_exponent = 0 - magnitude; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 3) +                        ZeroExtend{PTO_XLEN}(value[2:0]),                    (actual_exponent - 3) as integer {-1074..1023});        when HiF8DotField_D3 =>            let magnitude = 4 + UInt(value[3:2]);            var actual_exponent: integer {-15..15} = magnitude;            if value[4] == '1' then actual_exponent = 0 - magnitude; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 2) +                        ZeroExtend{PTO_XLEN}(value[1:0]),                    (actual_exponent - 2) as integer {-1074..1023});        when HiF8DotField_D4 =>            let magnitude = 8 + UInt(value[3:1]);            var actual_exponent: integer {-15..15} = magnitude;            if value[4] == '1' then actual_exponent = 0 - magnitude; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 1) +                        ZeroExtend{PTO_XLEN}(value[0:0]),                    (actual_exponent - 1) as integer {-1074..1023});    end;end;pure func ClassifyHiF8(value: bits(8)) => NumericValueClassbegin    if value == '10000000' then return NumericValue_QuietNaN;    elsif value == '01101111' then return NumericValue_PositiveInfinity;    elsif value == '11101111' then return NumericValue_NegativeInfinity;    elsif value == Zeros{8} then return NumericValue_PositiveZero;    elsif UInt(value[6:0]) <= 7 then        return NumericValueClassFromFiniteSign(value[7], FALSE, TRUE);    else return NumericValueClassFromFiniteSign(value[7], FALSE, FALSE);    end;end;
pure func HiF8CanonicalNaN() => Wordbegin    return Zeros{PTO_XLEN} + 0x80;end;
View the complete ASL owner
// PTO-UNIT: {"id":"PTO-ARCH-DATA-TYPES-FORMAT-HIF8","surface":"arch","classification":["data-types","formats","hif8"],"depends_on":["PTO-ARCH-DATA-TYPES-FORMAT-DESCRIPTOR"]}// DOC-BEGIN: operation// PTO-REQ-HARDWARE-NUMERIC-001: exact HiF8 dynamic encoding.
pure func HiF8NumericFormatDescriptor() => NumericFormatDescriptorbegin    return NumericFormatDescriptor {        available = TRUE, kind = NumericFormatKind_HiF8,        carrier_bits = 8, lane_bits = 8, lanes_per_carrier = 1,        sign_bits = 1, sign_bit = 7,        exponent_bits_min = 0, exponent_bits_max = 4,        fraction_bits_min = 1, fraction_bits_max = 3,        exponent_bias_available = FALSE, exponent_bias = 0,        required_low_zero_bits = 0, required_high_zero_bits = 0,        has_zero = TRUE, has_signed_zero = FALSE, has_subnormal = TRUE,        has_infinity = TRUE, has_quiet_nan = TRUE,        has_signaling_nan = FALSE    };end;
pure func HiF8DecodeDotField(value: bits(8))    => (HiF8DotField, integer {0..4}, integer {1..3})begin    if value[6:3] == '0000' then        return (HiF8DotField_Denormal, 0, 3);    elsif value[6:3] == '0001' then        return (HiF8DotField_D0, 0, 3);    elsif value[6:4] == '001' then        return (HiF8DotField_D1, 1, 3);    elsif value[6:5] == '01' then        return (HiF8DotField_D2, 2, 3);    elsif value[6:5] == '10' then        return (HiF8DotField_D3, 3, 2);    else return (HiF8DotField_D4, 4, 1);    end;end;
pure func HiF8FiniteDecomposition(value: bits(8))    => (boolean, boolean, Word, integer {-1074..1023})begin    if value == '10000000' || value == '01101111' ||       value == '11101111' then        return (FALSE, FALSE, Zeros{PTO_XLEN}, 0);    end;    let (dot, exponent_bits, fraction_bits) = HiF8DecodeDotField(value);    case dot of        when HiF8DotField_Denormal =>            let mantissa = value[2:0];            if mantissa == Zeros{3} then                return (TRUE, FALSE, Zeros{PTO_XLEN}, 0);            else return (TRUE, value[7] == '1', Zeros{PTO_XLEN} + 1,                         (UInt(mantissa) - 23)                             as integer {-1074..1023});            end;        when HiF8DotField_D0 =>            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 3) +                        ZeroExtend{PTO_XLEN}(value[2:0]), -3);        when HiF8DotField_D1 =>            var actual_exponent: integer {-15..15} = 1;            if value[3] == '1' then actual_exponent = -1; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 3) +                        ZeroExtend{PTO_XLEN}(value[2:0]),                    (actual_exponent - 3) as integer {-1074..1023});        when HiF8DotField_D2 =>            let magnitude = 2 + UInt(value[3]);            var actual_exponent: integer {-15..15} = magnitude;            if value[4] == '1' then actual_exponent = 0 - magnitude; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 3) +                        ZeroExtend{PTO_XLEN}(value[2:0]),                    (actual_exponent - 3) as integer {-1074..1023});        when HiF8DotField_D3 =>            let magnitude = 4 + UInt(value[3:2]);            var actual_exponent: integer {-15..15} = magnitude;            if value[4] == '1' then actual_exponent = 0 - magnitude; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 2) +                        ZeroExtend{PTO_XLEN}(value[1:0]),                    (actual_exponent - 2) as integer {-1074..1023});        when HiF8DotField_D4 =>            let magnitude = 8 + UInt(value[3:1]);            var actual_exponent: integer {-15..15} = magnitude;            if value[4] == '1' then actual_exponent = 0 - magnitude; end;            return (TRUE, value[7] == '1',                    LSL(Zeros{PTO_XLEN} + 1, 1) +                        ZeroExtend{PTO_XLEN}(value[0:0]),                    (actual_exponent - 1) as integer {-1074..1023});    end;end;pure func ClassifyHiF8(value: bits(8)) => NumericValueClassbegin    if value == '10000000' then return NumericValue_QuietNaN;    elsif value == '01101111' then return NumericValue_PositiveInfinity;    elsif value == '11101111' then return NumericValue_NegativeInfinity;    elsif value == Zeros{8} then return NumericValue_PositiveZero;    elsif UInt(value[6:0]) <= 7 then        return NumericValueClassFromFiniteSign(value[7], FALSE, TRUE);    else return NumericValueClassFromFiniteSign(value[7], FALSE, FALSE);    end;end;
pure func HiF8CanonicalNaN() => Wordbegin    return Zeros{PTO_XLEN} + 0x80;end;// DOC-END: operation

Architecture behavior

purpose scope

Purpose and scope

This unit gives HiF8 its exact eight-bit format description, dynamic dot-field decoding, finite decomposition, value classification, and canonical NaN.

It exists so consumers can reason from raw carriers without substituting a host floating-point type for the architecture-defined encoding.

concepts state

Concepts and visible state

  • HiF8NumericFormatDescriptor records one sign bit, a variable 0..4-bit exponent, a 1..3-bit fraction, one eight-bit lane, and no fixed exponent bias.
  • HiF8DecodeDotField maps the carrier's dot field to HiF8DotField_Denormal or HiF8DotField_D0 through HiF8DotField_D4, together with the active exponent and fraction widths.
  • HiF8FiniteDecomposition returns availability, sign, an integer significand, and a base-two exponent; ClassifyHiF8 supplies the corresponding value class.
rules interactions

Rules and interactions

The raw carriers 0x80, 0x6f, and 0xef are non-finite: the first is the quiet NaN and the latter two are positive and negative infinity.

The all-zero carrier is positive zero. Carriers whose low seven bits are in 1..7 classify as signed subnormals; the remaining finite carriers classify as signed normals.

HiF8CanonicalNaN returns 0x80, matching the classification rule rather than inventing a second NaN encoding.

boundaries

Architectural boundaries

The descriptor advertises zero, subnormal, infinity, and quiet NaN support, but not signed zero or signaling NaN support.

The decomposition reports unavailable for every non-finite carrier; callers must consult availability before using its significand and exponent outputs.

example usage

illustrative reading example

For 0x01, the decoder selects HiF8DotField_Denormal; the value is available, positive, and subnormal, with the exact magnitude represented by the returned integer significand and exponent.

For 0x80, classification returns NumericValue_QuietNaN and finite decomposition reports unavailable.

This is a reading example of the two APIs, not a new arithmetic rule.

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

8 matching entries

Executable evidence2
  • PTO-ARCH-DATA-TYPES-FORMAT-HIF8 compiles as an independent normative unit
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FORMAT-HIF8
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-DATA-TYPES-FORMAT-HIF8-STATIC-001
    Path
    tests/asl/arch/data-types/formats/hif8/arch-static-hif8-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    fc8d132d8a3c3f53ce9f9d7eff7e45e97248c8065b39098e0cbc99b0a8b1921a
    Open exact source ↗ for PTO-AVS-ARCH-DATA-TYPES-FORMAT-HIF8-STATIC-001
  • HiF8 exposes its exact descriptor and finite-value decomposition.
    1. surfaceARCH
    2. ownerPTO-ARCH-DATA-TYPES-FORMAT-HIF8
    3. categoryBOUNDARY
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-ARCH-HIF8-DECOMP-001
    Path
    tests/asl/arch/data-types/formats/hif8/arch-bound-hif8-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
    12250e47f7ee38605ce521d2db8c778afd485227af4e450ad82194d08a15eb16
    Open exact source ↗ for PTO-AVS-ARCH-HIF8-DECOMP-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-HIF8
surface
arch
classification
[
  "data-types",
  "formats",
  "hif8"
]
depends_on
[
  "PTO-ARCH-DATA-TYPES-FORMAT-DESCRIPTOR"
]
Open generated traceability record
{
  "classification": [
    "data-types",
    "formats",
    "hif8"
  ],
  "documentation": "docs/arch/data-types/formats/hif8.md",
  "id": "PTO-ARCH-DATA-TYPES-FORMAT-HIF8",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0048"
  ],
  "semantic_tests": [
    "PTO-AVS-ARCH-HIF8-DECOMP-001"
  ],
  "source": "asl/arch/data-types/formats/hif8.asl",
  "surface": "arch",
  "tests": [
    "PTO-AVS-ARCH-DATA-TYPES-FORMAT-HIF8-STATIC-001",
    "PTO-AVS-ARCH-HIF8-DECOMP-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
44dbda4ee90a1dcb8f96cf7d087492e6a18d9b6e4e4b3d84b0cada344804578c
Generated documentation
docs/arch/data-types/formats/hif8.md · embedded in this page
Documentation SHA-256
093f9407c984e65584350f4eb7c1430ac429d285ff320148131ae31a52728e5c

Exact owners