Operands and parameters
SrcL- Reg5 addend
simm5- signed five-bit addend
C.ADDI snapshots one complete Reg5 source, sign-extends simm5, adds modulo 2^XLEN, and pushes the result to T.
PTO-SCALAR-C-ADDIc.addi srcL, simm, ->t| Field | Bits | Signedness | Architectural role | Encoded zero |
|---|---|---|---|---|
SrcL | 5 | encoding-defined | Reg5 addend | Encoded zero reads the architectural zero GPR. |
simm5 | 5 | signed | signed five-bit addend | Encoded zero supplies numeric zero. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| simm5 | 15:11 | variable |
| SrcL | 10:6 | variable |
| Constant | 5:0 | 6'b001100 |
{
"reg": [
{
"bits": 6,
"name": "6'b001100"
},
{
"bits": 5,
"name": "SrcL"
},
{
"bits": 5,
"name": "simm5"
}
],
"config": {
"bits": 16,
"fontsize": 13,
"hspace": 640,
"lanes": 1,
"offset": 0
}
}c.addi srcL, simm, ->t
SrcLsimm5This Operation comes directly from the instruction owner; the page does not rewrite its behavior.
readonly func InstructionContractOperation_C_ADDI() => ScalarOperationbegin return ScalarOperation_C_ADDI;end;readonly func InstructionContractHandler_C_ADDI() => ScalarSemanticHandlerbegin return ScalarHandler_ScalarBinary;end;
pure func InstructionContractResult_C_ADDI( left: Word, encoded_immediate: bits(5)) => Wordbegin let immediate = SignExtend{PTO_XLEN}(encoded_immediate); return ScalarBinary( ScalarBinary_ADD, left, immediate);end;// PTO-INSTRUCTION: {"assembly":["c.addi srcL, simm, ->t"],"block":[],"catalog_indices":[24],"catalog_records":[{"asm":"c.addi srcL, simm, ->t","constraints":[],"encoding":[{"index":0,"mask":"0x003f","match":"0x000c","width_bits":16}],"encoding_kind":"C16","fields":[{"name":"SrcL","pieces":[{"instruction_lsb":6,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"simm5","pieces":[{"instruction_lsb":11,"value_lsb":0,"width":5}],"signedness":"signed","width":5}],"form_id":"c_addi_16_3050744f2322","length_bits":16,"mnemonic":"C.ADDI","semantic_family":"ALU","semantic_group":"ALU","semantic_handler":"ScalarBinary","semantic_summary":"C.ADDI snapshots one complete Reg5 source, sign-extends simm5, adds modulo 2^XLEN, and pushes the result to T.","status":"accepted"}],"classification":["alu"],"contract":{"block_composition":["none"],"canonical_assembly":["c.addi srcL, simm, ->t"],"defaults":["SrcL and signed simm5 are required encoded fields; neither can be omitted.","The destination is not encoded: every successful form pushes exactly one result to T."],"encoding_class":"standalone-encoded","examples":["c.addi t#1, -1, ->t"],"exceptions":["Fixed-width addition is total and raises no arithmetic exception.","An unavailable selected T/U source raises Fault_IllegalInstruction before the T push, before TPC advances, and before any other effect."],"field_contracts":{},"field_zero_meanings":{"SrcL":"Encoded zero reads the architectural zero GPR.","simm5":"Encoded zero supplies numeric zero."},"legality":["SrcL codes 0..23 select absolute GPRs, 24..27 select T#1..T#4, and 28..31 select U#1..U#4 without consumption.","Every simm5 encoding is assigned and denotes a signed integer from -16 through +15."],"memory_effects":["none"],"operands":[{"field":"SrcL","role":"Reg5 addend"},{"field":"simm5","role":"signed five-bit addend"}],"ordering":["Snapshot SrcL and sign-extend simm5 before pushing the destination.","Push the result as the newest T entry, then advance TPC by two bytes."],"standalone_opcode":true,"state_effects":["Sign-extend simm5 to XLEN and add it to SrcL modulo 2^PTO_XLEN.","Push exactly one XLEN result to T without consuming the source. Existing T entries shift toward older indices.","No GPR, U queue, memory, reservation, descriptor, numeric-status, block, privilege, predicate, or other control state changes. Successful execution advances TPC by two bytes."]},"depends_on":["PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING"],"id":"PTO-SCALAR-C-ADDI","mnemonic":"C.ADDI","summary":"C.ADDI snapshots one complete Reg5 source, sign-extends simm5, adds modulo 2^XLEN, and pushes the result to T.","surface":"scalar"}// PTO-REVIEW: {"review_method":"formal-definition-read","outcome":"FORMAL-COMPLETE","reviewed_fields":["assembly","encoding","defaults","operation","state","memory","ordering","faults","reserved"]}// DOC-BEGIN: decodereadonly func InstructionContractOperation_C_ADDI() => ScalarOperationbegin return ScalarOperation_C_ADDI;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_C_ADDI() => ScalarSemanticHandlerbegin return ScalarHandler_ScalarBinary;end;
pure func InstructionContractResult_C_ADDI( left: Word, encoded_immediate: bits(5)) => Wordbegin let immediate = SignExtend{PTO_XLEN}(encoded_immediate); return ScalarBinary( ScalarBinary_ADD, left, immediate);end;// DOC-END: operation
C.ADDI is a 16-bit scalar ALU instruction. It performs addition under the complete XLEN value result rules; its current instruction contract defines the result publication path and any additional state effect.
Execution snapshots the encoded inputs, then performs addition under the complete XLEN value result rules, and only afterward performs the destination effects.
SrcL field selects an addend through Reg5.simm5 field carries the signed five-bit addend.These roles come from the current instruction contract. T/U sources are read and snapshotted without being removed from their queues; exact encoded-zero meanings appear in the generated defaults below.
Any scalar source is snapshotted before publication, and the completed instruction pushes exactly one result to T.
This ALU operation has no memory effect. After its successful architectural effects, TPC advances by 2 bytes.
The operation does not introduce a hidden scalar publication target or an implicit memory access. Architectural changes remain limited to the state effects enumerated by the current contract.
Fixed-width arithmetic follows the operation’s wraparound rule without an arithmetic exception. A fixed-bit mismatch or unavailable selected T/U source raises Fault_IllegalInstruction before publication and before TPC advances.
The generated legality table is authoritative for assigned field values, reserved encodings, and destination discard codes. Decode and source availability are checked before architectural effects.
This example illustrates the current ASL owner and does not replace the normative operation.
For a small C.ADDI example, SrcL=7 and simm5=3 produce 10.
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
No NDF clause is attached to this unit.
10 matching entries
PTO-AVS-SCALAR-C-ADDI-DECODE-001tests/asl/scalar/alu/C.ADDI/scalar-decode-c-addi-canonical-001.aslcab098f15e28e1675d4707dfcef15b59fd1268ab4898ebd36aeda3f3c8c9b9a4PTO-AVS-SCALAR-C-ADDI-QUEUE-001tests/asl/scalar/alu/C.ADDI/scalar-exec-c-addi-queue-001.asl0c7b757baaa27dc8c9460d9efebc50b8c0c690eccbf8160d83175be05c62382fPTO-AVS-SCALAR-C-ADDI-READINESS-001tests/asl/scalar/alu/C.ADDI/scalar-fault-c-addi-readiness-001.asl2029aac183773de9d0b571bbe534e73b9652b949b21aadabb009b3433898aec3PTO-EVIDENCE-RELEASE-TRACEABILITYPTO-EVIDENCE-RELEASE-TRACEABILITYspec/evidence/release-traceability-readiness.jsonc7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3ePTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSUREPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSUREspec/evidence/instruction-contract-closure.json3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106aPTO-EVIDENCE-ARCHITECTURE-READINESSPTO-EVIDENCE-ARCHITECTURE-READINESSspec/evidence/architecture-readiness.json4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004PTO-EVIDENCE-RELEASE-GATE-READINESSPTO-EVIDENCE-RELEASE-GATE-READINESSspec/evidence/release-gate-readiness.jsona0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0PTO-EVIDENCE-RELEASE-MANIFESTPTO-EVIDENCE-RELEASE-MANIFESTspec/release-manifest.json1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8Loading ADR-0026…
ADR-0026docs/status/decisions/0026-scalar-alu-totality-and-alias-order.md41d126f224dddc371832120f1b02eab64e426872fdcbea452bad77c90bdec349Loading ADR-0059…
ADR-0059docs/status/decisions/0059-mnemonic-field-encoding-closure.mdf18d13f735cfaf9f2803c754c5818f4af33d1cc42c489f0d9ce060b07bb3a196{
"classification": [
"alu"
],
"documentation": "docs/scalar/alu/C.ADDI.md",
"id": "PTO-SCALAR-C-ADDI",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "C.ADDI",
"ndf_clause": "PTO-INST-SCALAR-C-ADDI"
},
"mnemonic": "C.ADDI",
"readiness_subjects": [
"ADR-0026",
"ADR-0059"
],
"semantic_tests": [
"PTO-AVS-SCALAR-C-ADDI-QUEUE-001",
"PTO-AVS-SCALAR-C-ADDI-READINESS-001"
],
"source": "asl/scalar/alu/C.ADDI.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-C-ADDI-DECODE-001",
"PTO-AVS-SCALAR-C-ADDI-QUEUE-001",
"PTO-AVS-SCALAR-C-ADDI-READINESS-001"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd86812d9372f8281dadcbc0fdbdb86fd79b39c288ba33f6f7dd531391970bd131ab51a82b6838f8b707e9126ab54ad23472eaeb16fef0d451062c88d436873c5130586asl/scalar/alu/C.ADDI.aslasl/scalar/alu/C.ADDI.asl