Skip to main content

PTO-SCALAR-MODEL-FSU-ARITHMETIC

PTO-SCALAR-MODEL-FSU-ARITHMETIC

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-SCALAR-MODEL-FSU-ARITHMETIC","surface":"scalar","classification":["model","fsu","arithmetic"],"depends_on":["PTO-SCALAR-MODEL-SYS-REGISTERS","PTO-ARCH-DATA-TYPES-NUMERIC-CLASSIFICATION"]}// PTO-REQ-SCALAR-FP-001: mathematical floating semantics.// Encoding, NaN payload, exception flag, and rounding-profile rules remain// separate from this real-number value layer.
pure func FloatingBinary(op: FloatingBinaryOperation, left: real, right: real) => realbegin    case op of        when FloatingBinary_ADD => return left + right;        when FloatingBinary_SUB => return left - right;        when FloatingBinary_MUL => return left * right;        when FloatingBinary_DIV => return left / right;        when FloatingBinary_MIN => if left < right then return left; else return right; end;        when FloatingBinary_MAX => if left > right then return left; else return right; end;    end;end;
pure func FloatingCompare(op: FloatingCompareOperation, left: real, right: real) => booleanbegin    case op of        when FloatingCompare_EQ => return left == right;        when FloatingCompare_NE => return left != right;        when FloatingCompare_LT => return left < right;        when FloatingCompare_LE => return left <= right;        when FloatingCompare_GT => return left > right;        when FloatingCompare_GE => return left >= right;    end;end;
impdef func FloatingExponential(value: real) => realbegin    // The executable default is stable; a numeric profile supplies IEEE encoding.    return value;end;
func FloatingUnary(op: FloatingUnaryOperation, value: real) => realbegin    case op of        when FloatingUnary_ABS => if value < 0.0 then return -value; else return value; end;        when FloatingUnary_SQRT =>            assert value >= 0.0;            return SqrtRounded(value, 100);        when FloatingUnary_EXP => return FloatingExponential(value);        when FloatingUnary_RECIP => return 1.0 / value;    end;end;
pure func FloatingFused(op: FloatingFusedOperation, addend: real,                        left: real, right: real) => realbegin    let product = left * right;    case op of        when FloatingFused_MADD => return product + addend;        when FloatingFused_MSUB => return product - addend;        when FloatingFused_NMADD => return -(product + addend);        when FloatingFused_NMSUB => return -(product - addend);    end;end;
impdef func FloatingRoundNearest(value: real) => integerbegin    if value >= 0.0 then return RoundDown(value + 0.5);    else return RoundUp(value - 0.5);    end;end;
func FloatingToInteger(value: real, mode: NumericRoundingMode) => integerbegin    case mode of        when NumericRound_RNE => return FloatingRoundNearest(value);        when NumericRound_RTP => return RoundUp(value);        when NumericRound_RTM => return RoundDown(value);        when NumericRound_RTZ => return RoundTowardsZero(value);        when NumericRound_RNA =>            let lower = RoundDown(value);            let fraction = value - Real(lower);            if fraction < 0.5 then return lower;            elsif fraction > 0.5 then return lower + 1;            elsif value < 0.0 then return lower;            else return lower + 1;            end;        when NumericRound_RTO =>            let lower = RoundDown(value);            let fraction = value - Real(lower);            if fraction == 0.0 then return lower;            elsif lower MOD 2 != 0 then return lower;            else return lower + 1;            end;        when NumericRound_RHB =>            let lower = RoundDown(value);            let fraction = value - Real(lower);            if fraction < 0.5 then return lower;            else return lower + 1;            end;    end;end;
pure func ResolveScalarFPActiveRoundingMode(encoded: bits(3))                                                => NumericRoundingModebegin    if encoded == '001' then return NumericRound_RTM;    elsif encoded == '010' then return NumericRound_RTP;    elsif encoded == '011' then return NumericRound_RTZ;    else return NumericRound_RNE;    end;end;
pure func DecodeBundleRoundingSelection(encoded: bits(3))                                                => TileNumericSelectionbegin    var result = TileNumericSelection {        use_operation_default = encoded == '000',        rounding_mode = NumericRound_RNE,        saturating = FALSE    };    if encoded == '010' then result.rounding_mode = NumericRound_RTZ;    elsif encoded == '011' then result.rounding_mode = NumericRound_RTM;    elsif encoded == '100' then result.rounding_mode = NumericRound_RTP;    elsif encoded == '101' then result.rounding_mode = NumericRound_RNA;    elsif encoded == '110' then result.rounding_mode = NumericRound_RTO;    elsif encoded == '111' then result.rounding_mode = NumericRound_RHB;    end;    return result;end;
// Public conversion controls are not B.DATR encodings. Translate the seven// assigned public ordinals explicitly; ordinal 7 is unassigned.pure func DecodePublicConversionRoundingSelection(encoded: bits(3))                                                => (boolean, TileNumericSelection)begin    if encoded == '000' then return (TRUE, DecodeBundleRoundingSelection('000'));    elsif encoded == '001' then return (TRUE, DecodeBundleRoundingSelection('001'));    elsif encoded == '010' then return (TRUE, DecodeBundleRoundingSelection('101'));    elsif encoded == '011' then return (TRUE, DecodeBundleRoundingSelection('011'));    elsif encoded == '100' then return (TRUE, DecodeBundleRoundingSelection('100'));    elsif encoded == '101' then return (TRUE, DecodeBundleRoundingSelection('010'));    elsif encoded == '110' then return (TRUE, DecodeBundleRoundingSelection('110'));    else return (FALSE, DecodeBundleRoundingSelection('000'));    end;end;
pure func SignedWordToReal(value: Word) => realbegin    return Real(SInt(value));end;
pure func UnsignedWordToReal(value: Word) => realbegin    return Real(UInt(value));end;
func ConvertFloatingEncoding(value: Word, source_type: bits(5),                             destination_type: bits(5),                             rounding_mode: bits(3)) => Wordbegin    let (converted, -) = ScalarFPConvertProfile(        ResolveScalarFPActiveRoundingMode(rounding_mode),        destination_type, source_type, value);    return converted;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 evidence4
  • PTO-SCALAR-MODEL-FSU-ARITHMETIC compiles as an independent normative unit
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-FSU-ARITHMETIC
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-MODEL-FSU-ARITHMETIC-STATIC-001
    Path
    tests/asl/scalar/model/fsu/arithmetic/scalar-static-arithmetic-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    75f3c757212d5f07e16173c1d9934d285b2fae56c3e96066a7dc1979e33d6bd3
    Open exact source ↗ for PTO-AVS-SCALAR-MODEL-FSU-ARITHMETIC-STATIC-001
  • Covers Scalar Floating.
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-FSU-ARITHMETIC
    3. categoryEXECUTION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-TESTSCALARFLOATING-EXECUTION-001
    Path
    tests/asl/scalar/model/fsu/arithmetic/scalar-exec-floating-001.asl
    Kind / role
    execution
    Pass condition
    TestScalarFloating completes without assertion failure
    SHA-256
    f69215340e4386705e0c6015f439b8095a354a3dff748f4b79b48f81ce3ed64d
    Open exact source ↗ for PTO-AVS-SCALAR-TESTSCALARFLOATING-EXECUTION-001
  • Covers Scalar FP Dispatch Effects.
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-FSU-ARITHMETIC
    3. categoryEXECUTION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-TESTSCALARFPDISPATCHEFFECTS-EXECUTION-001
    Path
    tests/asl/scalar/model/fsu/arithmetic/scalar-exec-fp-dispatch-effects-001.asl
    Kind / role
    execution
    Pass condition
    TestScalarFPDispatchEffects completes without assertion failure
    SHA-256
    c524593e05c0f0f763f183dfd80c1e1561563c4d1f9af1d04b19b1c3b99598b5
    Open exact source ↗ for PTO-AVS-SCALAR-TESTSCALARFPDISPATCHEFFECTS-EXECUTION-001
  • Covers Scalar FP Flag Lifecycle.
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-FSU-ARITHMETIC
    3. categorySTATE-TRANSITION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-TESTSCALARFPFLAGLIFECYCLE-STATE-TRANSITION-001
    Path
    tests/asl/scalar/model/fsu/arithmetic/scalar-state-fp-flag-lifecycle-001.asl
    Kind / role
    state-transition
    Pass condition
    TestScalarFPFlagLifecycle completes without assertion failure
    SHA-256
    e659fa5c811e52d03ca94dcd4bd6c67c7dade677b0bd8829cc11b3b04b013c35
    Open exact source ↗ for PTO-AVS-SCALAR-TESTSCALARFPFLAGLIFECYCLE-STATE-TRANSITION-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

Unit metadata

Open 4 generated metadata fields
id
PTO-SCALAR-MODEL-FSU-ARITHMETIC
surface
scalar
classification
[
  "model",
  "fsu",
  "arithmetic"
]
depends_on
[
  "PTO-SCALAR-MODEL-SYS-REGISTERS",
  "PTO-ARCH-DATA-TYPES-NUMERIC-CLASSIFICATION"
]
Open generated traceability record
{
  "classification": [
    "model",
    "fsu",
    "arithmetic"
  ],
  "documentation": "docs/scalar/model/fsu/arithmetic.md",
  "id": "PTO-SCALAR-MODEL-FSU-ARITHMETIC",
  "mnemonic": null,
  "readiness_subjects": [],
  "semantic_tests": [
    "PTO-AVS-SCALAR-TESTSCALARFLOATING-EXECUTION-001",
    "PTO-AVS-SCALAR-TESTSCALARFPDISPATCHEFFECTS-EXECUTION-001",
    "PTO-AVS-SCALAR-TESTSCALARFPFLAGLIFECYCLE-STATE-TRANSITION-001"
  ],
  "source": "asl/scalar/model/fsu/arithmetic.asl",
  "surface": "scalar",
  "tests": [
    "PTO-AVS-SCALAR-MODEL-FSU-ARITHMETIC-STATIC-001",
    "PTO-AVS-SCALAR-TESTSCALARFLOATING-EXECUTION-001",
    "PTO-AVS-SCALAR-TESTSCALARFPDISPATCHEFFECTS-EXECUTION-001",
    "PTO-AVS-SCALAR-TESTSCALARFPFLAGLIFECYCLE-STATE-TRANSITION-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
21bdc927b7c5e13f0db364ccb07d87a8e303b82041212bc2bb289e5fa9377288
Generated documentation
docs/scalar/model/fsu/arithmetic.md · embedded in this page
Documentation SHA-256
b153847a3fac645297eb00f768790d62809cf47b4e8c0c474ee356a9b0eb71b8

Exact owners