Skip to main content

PTO-SCALAR-MODEL-DISPATCH-ALU

PTO-SCALAR-MODEL-DISPATCH-ALU

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-SCALAR-MODEL-DISPATCH-ALU","surface":"scalar","classification":["model","dispatch","alu"],"depends_on":["PTO-SCALAR-MODEL-DISPATCH-DECODE","PTO-SCALAR-MODEL-ALU-SEMANTICS","PTO-SCALAR-ADD","PTO-SCALAR-ADDI","PTO-SCALAR-ADDIW","PTO-SCALAR-ADDW","PTO-SCALAR-AND","PTO-SCALAR-ANDI","PTO-SCALAR-ANDIW","PTO-SCALAR-ANDW","PTO-SCALAR-BCNT","PTO-SCALAR-BIC","PTO-SCALAR-BIS","PTO-SCALAR-BXS","PTO-SCALAR-BXU","PTO-SCALAR-C-ADD","PTO-SCALAR-C-ADDI","PTO-SCALAR-C-AND","PTO-SCALAR-C-MOVI","PTO-SCALAR-C-MOVR","PTO-SCALAR-C-OR","PTO-SCALAR-C-SETC-TGT","PTO-SCALAR-C-SETRET","PTO-SCALAR-C-SEXT-B","PTO-SCALAR-C-SEXT-H","PTO-SCALAR-C-SEXT-W","PTO-SCALAR-C-SLLI","PTO-SCALAR-C-SRLI","PTO-SCALAR-C-SUB","PTO-SCALAR-C-ZEXT-B","PTO-SCALAR-C-ZEXT-H","PTO-SCALAR-C-ZEXT-W","PTO-SCALAR-CLZ","PTO-SCALAR-CSEL","PTO-SCALAR-CTZ","PTO-SCALAR-DIV","PTO-SCALAR-DIVU","PTO-SCALAR-DIVUW","PTO-SCALAR-DIVW","PTO-SCALAR-HL-ADDI","PTO-SCALAR-HL-ADDIW","PTO-SCALAR-HL-ANDI","PTO-SCALAR-HL-ANDIW","PTO-SCALAR-HL-BFI","PTO-SCALAR-HL-CCAT","PTO-SCALAR-HL-CCATW","PTO-SCALAR-HL-DIV","PTO-SCALAR-HL-DIVU","PTO-SCALAR-HL-DIVUW","PTO-SCALAR-HL-DIVW","PTO-SCALAR-HL-LIS","PTO-SCALAR-HL-LIU","PTO-SCALAR-HL-LUI","PTO-SCALAR-HL-MADD","PTO-SCALAR-HL-MADDW","PTO-SCALAR-HL-MIADD","PTO-SCALAR-HL-MISUB","PTO-SCALAR-HL-MUL","PTO-SCALAR-HL-MULU","PTO-SCALAR-HL-ORI","PTO-SCALAR-HL-ORIW","PTO-SCALAR-HL-REM","PTO-SCALAR-HL-REMU","PTO-SCALAR-HL-REMUW","PTO-SCALAR-HL-REMW","PTO-SCALAR-HL-SUBI","PTO-SCALAR-HL-SUBIW","PTO-SCALAR-HL-XORI","PTO-SCALAR-HL-XORIW","PTO-SCALAR-LUI","PTO-SCALAR-MADD","PTO-SCALAR-MADDW","PTO-SCALAR-MAX","PTO-SCALAR-MAXU","PTO-SCALAR-MIN","PTO-SCALAR-MINU","PTO-SCALAR-MUL","PTO-SCALAR-MULU","PTO-SCALAR-MULUW","PTO-SCALAR-MULW","PTO-SCALAR-OR","PTO-SCALAR-ORI","PTO-SCALAR-ORIW","PTO-SCALAR-ORW","PTO-SCALAR-REM","PTO-SCALAR-REMU","PTO-SCALAR-REMUW","PTO-SCALAR-REMW","PTO-SCALAR-REV","PTO-SCALAR-SLL","PTO-SCALAR-SLLI","PTO-SCALAR-SLLIW","PTO-SCALAR-SLLW","PTO-SCALAR-SRA","PTO-SCALAR-SRAI","PTO-SCALAR-SRAIW","PTO-SCALAR-SRAW","PTO-SCALAR-SRL","PTO-SCALAR-SRLI","PTO-SCALAR-SRLIW","PTO-SCALAR-SRLW","PTO-SCALAR-SUB","PTO-SCALAR-SUBI","PTO-SCALAR-SUBIW","PTO-SCALAR-SUBW","PTO-SCALAR-XOR","PTO-SCALAR-XORI","PTO-SCALAR-XORIW","PTO-SCALAR-XORW"]}func ExecuteDecodedBinary(instruction: bits(48),                          form: integer {0..PTO_SCALAR_FORM_COUNT-1},                          operation: ScalarBinaryOperation,                          logical_family: boolean, word_operation: boolean)begin    let destination = ScalarDecodedSelector(instruction, form, ScalarField_RegDst);    let left = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL);    let unmodified_right = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR);    let modifier = ScalarDecodedBinaryRightModifier(instruction, form);    let shift_amount = ScalarDecodedUInt6(instruction, form, ScalarField_shamt);    let right = PrepareScalarRight(unmodified_right, modifier, shift_amount, logical_family);    let result = if word_operation then ScalarBinaryW(operation, left, right)                 else ScalarBinary(operation, left, right);    WriteScalarDestination(destination, result);end;
func ExecuteDecodedImmediateBinary(instruction: bits(48),                                   form: integer {0..PTO_SCALAR_FORM_COUNT-1},                                   operation: ScalarBinaryOperation,                                   immediate_field: ScalarOperandField,                                   word_operation: boolean)begin    let destination = ScalarDecodedSelector(instruction, form, ScalarField_RegDst);    let left = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL);    let right = ScalarDecodedWord(instruction, form, immediate_field);    let result = if word_operation then ScalarBinaryW(operation, left, right)                 else ScalarBinary(operation, left, right);    WriteScalarDestination(destination, result);end;
func ExecuteDecodedSimpleBinary(instruction: bits(48),                                form: integer {0..PTO_SCALAR_FORM_COUNT-1},                                operation: ScalarBinaryOperation,                                word_operation: boolean)begin    let destination = ScalarDecodedSelector(instruction, form, ScalarField_RegDst);    let left = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL);    let right = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR);    let result = if word_operation then ScalarBinaryW(operation, left, right)                 else ScalarBinary(operation, left, right);    WriteScalarDestination(destination, result);end;
func ExecuteDecodedShiftImmediate(instruction: bits(48),                                  form: integer {0..PTO_SCALAR_FORM_COUNT-1},                                  operation: ScalarBinaryOperation,                                  word_operation: boolean)begin    let destination = ScalarDecodedSelector(instruction, form, ScalarField_RegDst);    let left = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL);    let amount = ScalarDecodedWord(instruction, form, ScalarField_shamt);    let result = if word_operation then ScalarBinaryW(operation, left, amount)                 else ScalarBinary(operation, left, amount);    WriteScalarDestination(destination, result);end;
func ExecuteDecodedCompressedBinary(instruction: bits(48),                                    form: integer {0..PTO_SCALAR_FORM_COUNT-1},                                    operation: ScalarBinaryOperation)begin    let left = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL);    let right = ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR);    WriteCompressedTResult(ScalarBinary(operation, left, right));end;
func ExecuteDecodedALUForm(instruction: bits(48),                           form: integer {0..PTO_SCALAR_FORM_COUNT-1})begin    let operation = ScalarOperationOfForm(form);    case operation of        when ScalarOperation_ADD =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_ADD, FALSE, FALSE);        when ScalarOperation_ADDW =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_ADD, FALSE, TRUE);        when ScalarOperation_AND =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_AND, TRUE, FALSE);        when ScalarOperation_ANDW =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_AND, TRUE, TRUE);        when ScalarOperation_OR =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_OR, TRUE, FALSE);        when ScalarOperation_ORW =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_OR, TRUE, TRUE);        when ScalarOperation_SUB =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_SUB, FALSE, FALSE);        when ScalarOperation_SUBW =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_SUB, FALSE, TRUE);        when ScalarOperation_XOR =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_XOR, TRUE, FALSE);        when ScalarOperation_XORW =>            ExecuteDecodedBinary(instruction, form, ScalarBinary_XOR, TRUE, TRUE);
        when ScalarOperation_ADDI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_ADD,                ScalarField_uimm12, FALSE);        when ScalarOperation_ADDIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_ADD,                ScalarField_uimm12, TRUE);        when ScalarOperation_ANDI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_AND,                ScalarField_simm12, FALSE);        when ScalarOperation_ANDIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_AND,                ScalarField_simm12, TRUE);        when ScalarOperation_ORI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_OR,                ScalarField_simm12, FALSE);        when ScalarOperation_ORIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_OR,                ScalarField_simm12, TRUE);        when ScalarOperation_SUBI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_SUB,                ScalarField_uimm12, FALSE);        when ScalarOperation_SUBIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_SUB,                ScalarField_uimm12, TRUE);        when ScalarOperation_XORI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_XOR,                ScalarField_simm12, FALSE);        when ScalarOperation_XORIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_XOR,                ScalarField_simm12, TRUE);
        when ScalarOperation_HL_ADDI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_ADD,                ScalarField_uimm24, FALSE);        when ScalarOperation_HL_ADDIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_ADD,                ScalarField_uimm24, TRUE);        when ScalarOperation_HL_ANDI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_AND,                ScalarField_simm24, FALSE);        when ScalarOperation_HL_ANDIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_AND,                ScalarField_simm24, TRUE);        when ScalarOperation_HL_ORI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_OR,                ScalarField_simm24, FALSE);        when ScalarOperation_HL_ORIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_OR,                ScalarField_simm24, TRUE);        when ScalarOperation_HL_SUBI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_SUB,                ScalarField_uimm24, FALSE);        when ScalarOperation_HL_SUBIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_SUB,                ScalarField_uimm24, TRUE);        when ScalarOperation_HL_XORI =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_XOR,                ScalarField_simm24, FALSE);        when ScalarOperation_HL_XORIW =>            ExecuteDecodedImmediateBinary(instruction, form, ScalarBinary_XOR,                ScalarField_simm24, TRUE);
        when ScalarOperation_C_ADD =>            ExecuteDecodedCompressedBinary(instruction, form, ScalarBinary_ADD);        when ScalarOperation_C_AND =>            ExecuteDecodedCompressedBinary(instruction, form, ScalarBinary_AND);        when ScalarOperation_C_OR =>            ExecuteDecodedCompressedBinary(instruction, form, ScalarBinary_OR);        when ScalarOperation_C_SUB =>            ExecuteDecodedCompressedBinary(instruction, form, ScalarBinary_SUB);        when ScalarOperation_C_ADDI =>            WriteCompressedTResult(ScalarBinary(ScalarBinary_ADD,                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ScalarDecodedWord(instruction, form, ScalarField_simm5)));        when ScalarOperation_C_SLLI =>            WriteCompressedTResult(ScalarBinary(ScalarBinary_SLL,                ReadScalarRegisterOperand(24),                ScalarDecodedWord(instruction, form, ScalarField_uimm5)));        when ScalarOperation_C_SRLI =>            WriteCompressedTResult(ScalarBinary(ScalarBinary_SRL,                ReadScalarRegisterOperand(24),                ScalarDecodedWord(instruction, form, ScalarField_uimm5)));
        when ScalarOperation_SLL =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_SLL, FALSE);        when ScalarOperation_SLLW =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_SLL, TRUE);        when ScalarOperation_SRL =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_SRL, FALSE);        when ScalarOperation_SRLW =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_SRL, TRUE);        when ScalarOperation_SRA =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_SRA, FALSE);        when ScalarOperation_SRAW =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_SRA, TRUE);        when ScalarOperation_SLLI =>            ExecuteDecodedShiftImmediate(instruction, form, ScalarBinary_SLL, FALSE);        when ScalarOperation_SLLIW =>            ExecuteDecodedShiftImmediate(instruction, form, ScalarBinary_SLL, TRUE);        when ScalarOperation_SRLI =>            ExecuteDecodedShiftImmediate(instruction, form, ScalarBinary_SRL, FALSE);        when ScalarOperation_SRLIW =>            ExecuteDecodedShiftImmediate(instruction, form, ScalarBinary_SRL, TRUE);        when ScalarOperation_SRAI =>            ExecuteDecodedShiftImmediate(instruction, form, ScalarBinary_SRA, FALSE);        when ScalarOperation_SRAIW =>            ExecuteDecodedShiftImmediate(instruction, form, ScalarBinary_SRA, TRUE);
        when ScalarOperation_MAX =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_MAX, FALSE);        when ScalarOperation_MAXU =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_MAXU, FALSE);        when ScalarOperation_MIN =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_MIN, FALSE);        when ScalarOperation_MINU =>            ExecuteDecodedSimpleBinary(instruction, form, ScalarBinary_MINU, FALSE);
        when ScalarOperation_DIV =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarDivideSigned(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_DIVU =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarDivideUnsigned(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_DIVW =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarDivideSignedW(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_DIVUW =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarDivideUnsignedW(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_REM =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarRemainderSigned(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_REMU =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarRemainderUnsigned(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_REMW =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarRemainderSignedW(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_REMUW =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarRemainderUnsignedW(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));
        when ScalarOperation_MUL, ScalarOperation_MULU =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MultiplyWord(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_MULW, ScalarOperation_MULUW =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarMultiplyW(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_MADD =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarMultiplyAdd(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcD),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));        when ScalarOperation_MADDW =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarMultiplyAddW(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcD),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR)));
        when ScalarOperation_HL_MUL =>            ExecuteScalarMultiplyPair(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR), TRUE);        when ScalarOperation_HL_MULU =>            ExecuteScalarMultiplyPair(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR), FALSE);        when ScalarOperation_HL_MADD, ScalarOperation_HL_MADDW =>            ExecuteScalarMultiplyAddPair(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcD),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                operation == ScalarOperation_HL_MADDW);
        when ScalarOperation_HL_DIV, ScalarOperation_HL_DIVU =>            ExecuteScalarDividePair(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                operation == ScalarOperation_HL_DIV);        when ScalarOperation_HL_REM, ScalarOperation_HL_REMU =>            ExecuteScalarRemainderPair(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                operation == ScalarOperation_HL_REM);        when ScalarOperation_HL_DIVW, ScalarOperation_HL_DIVUW =>            ExecuteScalarDividePairW(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                operation == ScalarOperation_HL_DIVW);        when ScalarOperation_HL_REMW, ScalarOperation_HL_REMUW =>            ExecuteScalarRemainderPairW(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                operation == ScalarOperation_HL_REMW);
        when ScalarOperation_HL_CCAT =>            ExecuteConcatenatePair(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                ScalarDecodedUInt7(instruction, form, ScalarField_shamt));        when ScalarOperation_HL_CCATW =>            ExecuteConcatenatePairW(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst0),                ScalarDecodedSelector(instruction, form, ScalarField_RegDst1),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                ScalarDecodedUInt7(instruction, form, ScalarField_shamt));
        when ScalarOperation_HL_MIADD, ScalarOperation_HL_MISUB =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarMultiplyImmediateAdd(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                    ScalarDecodedBits19(instruction, form, ScalarField_uimm19),                    operation == ScalarOperation_HL_MISUB));
        when ScalarOperation_BXS, ScalarOperation_BXU =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ExtractBitfield(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ScalarDecodedBitfieldWidth(instruction, form),                    ScalarDecodedUInt6(instruction, form, ScalarField_imms),                    operation == ScalarOperation_BXS));        when ScalarOperation_CLZ, ScalarOperation_CTZ, ScalarOperation_BCNT =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                CountBitfield(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ScalarDecodedBitfieldWidth(instruction, form),                    ScalarDecodedUInt6(instruction, form, ScalarField_imms),                    operation == ScalarOperation_CLZ,                    operation == ScalarOperation_BCNT));        when ScalarOperation_BIC, ScalarOperation_BIS =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ModifyBitfield(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ScalarDecodedBitfieldWidth(instruction, form),                    ScalarDecodedUInt6(instruction, form, ScalarField_imms),                    operation == ScalarOperation_BIS));        when ScalarOperation_REV =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ReverseBitfieldBytes(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ScalarDecodedBitfieldWidth(instruction, form),                    ScalarDecodedUInt6(instruction, form, ScalarField_immr)));        when ScalarOperation_HL_BFI =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                InsertBitfield(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                    ScalarDecodedUInt6(instruction, form, ScalarField_immr),                    ScalarDecodedUInt6(instruction, form, ScalarField_imms)));
        when ScalarOperation_CSEL =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                ScalarConditionalSelect(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcP),                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL),                    ApplySelectModifier(                        ReadDecodedScalarRegister(instruction, form, ScalarField_SrcR),                        ScalarDecodedSelectRightModifier(instruction, form))));
        when ScalarOperation_LUI =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MaterializeLUI(ScalarDecodedBits20(instruction, form, ScalarField_imm20)));        when ScalarOperation_HL_LUI =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MaterializeLongUpper(ScalarDecodedBits32(instruction, form, ScalarField_imm)));        when ScalarOperation_HL_LIS =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MaterializeLongSigned(ScalarDecodedBits32(instruction, form, ScalarField_simm32)));        when ScalarOperation_HL_LIU =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MaterializeLongUnsigned(ScalarDecodedBits32(instruction, form, ScalarField_uimm32)));        when ScalarOperation_C_MOVI =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MoveScalarValue(                    ScalarDecodedWord(instruction, form, ScalarField_simm5)));        when ScalarOperation_C_MOVR =>            WriteScalarDestination(                ScalarDecodedSelector(instruction, form, ScalarField_RegDst),                MoveScalarValue(                    ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL)));
        when ScalarOperation_C_SEXT_B, ScalarOperation_C_ZEXT_B =>            WriteCompressedTResult(ExtendScalarValue(                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL), 8,                operation == ScalarOperation_C_SEXT_B));        when ScalarOperation_C_SEXT_H, ScalarOperation_C_ZEXT_H =>            WriteCompressedTResult(ExtendScalarValue(                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL), 16,                operation == ScalarOperation_C_SEXT_H));        when ScalarOperation_C_SEXT_W, ScalarOperation_C_ZEXT_W =>            WriteCompressedTResult(ExtendScalarValue(                ReadDecodedScalarRegister(instruction, form, ScalarField_SrcL), 32,                operation == ScalarOperation_C_SEXT_W));        when ScalarOperation_C_SETC_TGT =>            SetCompressedCommitTarget(ReadDecodedScalarRegister(                instruction,                form,                ScalarField_SrcL));        when ScalarOperation_C_SETRET =>            SetReturnAddress(ScalarDecodedWord(instruction, form, ScalarField_uimm5));
        otherwise => unreachable;    end;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

8 matching entries

Executable evidence3
  • Covers Canonical Scalar ALU Effects.
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-DISPATCH-ALU
    3. categoryEXECUTION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-ALU-EFFECTS-001
    Path
    tests/asl/scalar/model/dispatch/alu/scalar-exec-effects-001.asl
    Kind / role
    execution
    Pass condition
    ValidateCanonicalScalarALUEffects completes without assertion failure
    SHA-256
    de81611b7012ecad41d811341bffe888965596db96c5454f7bca3f7937e3ddc9
    Open exact source ↗ for PTO-AVS-SCALAR-ALU-EFFECTS-001
  • Covers Canonical Scalar ALU Totality.
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-DISPATCH-ALU
    3. categoryBOUNDARY
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-ALU-TOTALITY-001
    Path
    tests/asl/scalar/model/dispatch/alu/scalar-bound-totality-001.asl
    Kind / role
    boundary
    Pass condition
    ValidateCanonicalScalarALUTotality completes without assertion failure
    SHA-256
    064560543187f75a5b4d9d122fa9046edccf8538d3d1ae1f42ab536071fd1768
    Open exact source ↗ for PTO-AVS-SCALAR-ALU-TOTALITY-001
  • PTO-SCALAR-MODEL-DISPATCH-ALU compiles as an independent normative unit
    1. surfaceSCALAR
    2. ownerPTO-SCALAR-MODEL-DISPATCH-ALU
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-SCALAR-MODEL-DISPATCH-ALU-STATIC-001
    Path
    tests/asl/scalar/model/dispatch/alu/scalar-static-alu-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    6fe7017a432cbb87e0e8ae4b44b0c81e1511decf4ffdd7c7a83c932fc1bd3bc9
    Open exact source ↗ for PTO-AVS-SCALAR-MODEL-DISPATCH-ALU-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

Unit metadata

Open 4 generated metadata fields
id
PTO-SCALAR-MODEL-DISPATCH-ALU
surface
scalar
classification
[
  "model",
  "dispatch",
  "alu"
]
depends_on
[
  "PTO-SCALAR-MODEL-DISPATCH-DECODE",
  "PTO-SCALAR-MODEL-ALU-SEMANTICS",
  "PTO-SCALAR-ADD",
  "PTO-SCALAR-ADDI",
  "PTO-SCALAR-ADDIW",
  "PTO-SCALAR-ADDW",
  "PTO-SCALAR-AND",
  "PTO-SCALAR-ANDI",
  "PTO-SCALAR-ANDIW",
  "PTO-SCALAR-ANDW",
  "PTO-SCALAR-BCNT",
  "PTO-SCALAR-BIC",
  "PTO-SCALAR-BIS",
  "PTO-SCALAR-BXS",
  "PTO-SCALAR-BXU",
  "PTO-SCALAR-C-ADD",
  "PTO-SCALAR-C-ADDI",
  "PTO-SCALAR-C-AND",
  "PTO-SCALAR-C-MOVI",
  "PTO-SCALAR-C-MOVR",
  "PTO-SCALAR-C-OR",
  "PTO-SCALAR-C-SETC-TGT",
  "PTO-SCALAR-C-SETRET",
  "PTO-SCALAR-C-SEXT-B",
  "PTO-SCALAR-C-SEXT-H",
  "PTO-SCALAR-C-SEXT-W",
  "PTO-SCALAR-C-SLLI",
  "PTO-SCALAR-C-SRLI",
  "PTO-SCALAR-C-SUB",
  "PTO-SCALAR-C-ZEXT-B",
  "PTO-SCALAR-C-ZEXT-H",
  "PTO-SCALAR-C-ZEXT-W",
  "PTO-SCALAR-CLZ",
  "PTO-SCALAR-CSEL",
  "PTO-SCALAR-CTZ",
  "PTO-SCALAR-DIV",
  "PTO-SCALAR-DIVU",
  "PTO-SCALAR-DIVUW",
  "PTO-SCALAR-DIVW",
  "PTO-SCALAR-HL-ADDI",
  "PTO-SCALAR-HL-ADDIW",
  "PTO-SCALAR-HL-ANDI",
  "PTO-SCALAR-HL-ANDIW",
  "PTO-SCALAR-HL-BFI",
  "PTO-SCALAR-HL-CCAT",
  "PTO-SCALAR-HL-CCATW",
  "PTO-SCALAR-HL-DIV",
  "PTO-SCALAR-HL-DIVU",
  "PTO-SCALAR-HL-DIVUW",
  "PTO-SCALAR-HL-DIVW",
  "PTO-SCALAR-HL-LIS",
  "PTO-SCALAR-HL-LIU",
  "PTO-SCALAR-HL-LUI",
  "PTO-SCALAR-HL-MADD",
  "PTO-SCALAR-HL-MADDW",
  "PTO-SCALAR-HL-MIADD",
  "PTO-SCALAR-HL-MISUB",
  "PTO-SCALAR-HL-MUL",
  "PTO-SCALAR-HL-MULU",
  "PTO-SCALAR-HL-ORI",
  "PTO-SCALAR-HL-ORIW",
  "PTO-SCALAR-HL-REM",
  "PTO-SCALAR-HL-REMU",
  "PTO-SCALAR-HL-REMUW",
  "PTO-SCALAR-HL-REMW",
  "PTO-SCALAR-HL-SUBI",
  "PTO-SCALAR-HL-SUBIW",
  "PTO-SCALAR-HL-XORI",
  "PTO-SCALAR-HL-XORIW",
  "PTO-SCALAR-LUI",
  "PTO-SCALAR-MADD",
  "PTO-SCALAR-MADDW",
  "PTO-SCALAR-MAX",
  "PTO-SCALAR-MAXU",
  "PTO-SCALAR-MIN",
  "PTO-SCALAR-MINU",
  "PTO-SCALAR-MUL",
  "PTO-SCALAR-MULU",
  "PTO-SCALAR-MULUW",
  "PTO-SCALAR-MULW",
  "PTO-SCALAR-OR",
  "PTO-SCALAR-ORI",
  "PTO-SCALAR-ORIW",
  "PTO-SCALAR-ORW",
  "PTO-SCALAR-REM",
  "PTO-SCALAR-REMU",
  "PTO-SCALAR-REMUW",
  "PTO-SCALAR-REMW",
  "PTO-SCALAR-REV",
  "PTO-SCALAR-SLL",
  "PTO-SCALAR-SLLI",
  "PTO-SCALAR-SLLIW",
  "PTO-SCALAR-SLLW",
  "PTO-SCALAR-SRA",
  "PTO-SCALAR-SRAI",
  "PTO-SCALAR-SRAIW",
  "PTO-SCALAR-SRAW",
  "PTO-SCALAR-SRL",
  "PTO-SCALAR-SRLI",
  "PTO-SCALAR-SRLIW",
  "PTO-SCALAR-SRLW",
  "PTO-SCALAR-SUB",
  "PTO-SCALAR-SUBI",
  "PTO-SCALAR-SUBIW",
  "PTO-SCALAR-SUBW",
  "PTO-SCALAR-XOR",
  "PTO-SCALAR-XORI",
  "PTO-SCALAR-XORIW",
  "PTO-SCALAR-XORW"
]
Open generated traceability record
{
  "classification": [
    "model",
    "dispatch",
    "alu"
  ],
  "documentation": "docs/scalar/model/dispatch/alu.md",
  "id": "PTO-SCALAR-MODEL-DISPATCH-ALU",
  "mnemonic": null,
  "readiness_subjects": [],
  "semantic_tests": [
    "PTO-AVS-SCALAR-ALU-EFFECTS-001",
    "PTO-AVS-SCALAR-ALU-TOTALITY-001"
  ],
  "source": "asl/scalar/model/dispatch/alu.asl",
  "surface": "scalar",
  "tests": [
    "PTO-AVS-SCALAR-ALU-EFFECTS-001",
    "PTO-AVS-SCALAR-ALU-TOTALITY-001",
    "PTO-AVS-SCALAR-MODEL-DISPATCH-ALU-STATIC-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
aae66b82e868949861a1a93427ac9a35091d4ad339ed4535b500b0a1fc408c45
Generated documentation
docs/scalar/model/dispatch/alu.md · embedded in this page
Documentation SHA-256
657ec080cd7b1af7c86989e8280f0cef5abd9b121493286fd83e9b71b7904f19

Exact owners