Operands and parameters
SrcL- left Reg5 source
SrcR- right Reg5 source
C.ADD snapshots two complete Reg5 sources, adds SrcL and SrcR, and pushes the wrapping XLEN result to T.
PTO-SCALAR-C-ADDc.add srcL, srcR, ->t| Field | Bits | Signedness | Architectural role | Encoded zero |
|---|---|---|---|---|
SrcL | 5 | encoding-defined | left Reg5 source | Encoded zero reads the architectural zero GPR. |
SrcR | 5 | encoding-defined | right Reg5 source | Encoded zero reads the architectural zero GPR. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| SrcR | 15:11 | variable |
| SrcL | 10:6 | variable |
| Constant | 5:0 | 6'b001000 |
{
"reg": [
{
"bits": 6,
"name": "6'b001000"
},
{
"bits": 5,
"name": "SrcL"
},
{
"bits": 5,
"name": "SrcR"
}
],
"config": {
"bits": 16,
"fontsize": 13,
"hspace": 640,
"lanes": 1,
"offset": 0
}
}c.add srcL, srcR, ->t
SrcLSrcRThis Operation comes directly from the instruction owner; the page does not rewrite its behavior.
readonly func InstructionContractOperation_C_ADD() => ScalarOperationbegin return ScalarOperation_C_ADD;end;readonly func InstructionContractHandler_C_ADD() => ScalarSemanticHandlerbegin return ScalarHandler_ScalarBinary;end;
pure func InstructionContractResult_C_ADD( left: Word, right: Word) => Wordbegin return ScalarBinary( ScalarBinary_ADD, left, right);end;// PTO-INSTRUCTION: {"assembly":["c.add srcL, srcR, ->t"],"block":[],"catalog_indices":[23],"catalog_records":[{"asm":"c.add srcL, srcR, ->t","constraints":[],"encoding":[{"index":0,"mask":"0x003f","match":"0x0008","width_bits":16}],"encoding_kind":"C16","fields":[{"name":"SrcL","pieces":[{"instruction_lsb":6,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SrcR","pieces":[{"instruction_lsb":11,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5}],"form_id":"c_add_16_85136d1e4904","length_bits":16,"mnemonic":"C.ADD","semantic_family":"ALU","semantic_group":"ALU","semantic_handler":"ScalarBinary","semantic_summary":"C.ADD snapshots two complete Reg5 sources, adds SrcL and SrcR, and pushes the wrapping XLEN result to T.","status":"accepted"}],"classification":["alu"],"contract":{"block_composition":["none"],"canonical_assembly":["c.add srcL, srcR, ->t"],"defaults":["SrcL and SrcR are required encoded fields; neither source can be omitted.","The destination is not encoded: every successful form pushes exactly one result to T."],"encoding_class":"standalone-encoded","examples":["c.add t#1, u#1, ->t"],"exceptions":["Addition is a total fixed-width operation 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.","SrcR":"Encoded zero reads the architectural zero GPR."},"legality":["Each source code 0..23 selects an absolute GPR, 24..27 selects T#1..T#4, and 28..31 selects U#1..U#4 without consumption.","Duplicate, absolute-relative, and relative-relative source pairs are legal. Every encoded source value is assigned."],"memory_effects":["none"],"operands":[{"field":"SrcL","role":"left Reg5 source"},{"field":"SrcR","role":"right Reg5 source"}],"ordering":["Snapshot both sources before pushing the destination so aliases observe the pre-instruction queue state.","Push the result as the newest T entry, then advance TPC by two bytes."],"standalone_opcode":true,"state_effects":["Compute addition on the two complete XLEN source values.","Push exactly one XLEN result to T. Existing T entries shift toward older indices, the former T#4 is discarded, and no source is consumed.","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-ADD","mnemonic":"C.ADD","summary":"C.ADD snapshots two complete Reg5 sources, adds SrcL and SrcR, and pushes the wrapping XLEN 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_ADD() => ScalarOperationbegin return ScalarOperation_C_ADD;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_C_ADD() => ScalarSemanticHandlerbegin return ScalarHandler_ScalarBinary;end;
pure func InstructionContractResult_C_ADD( left: Word, right: Word) => Wordbegin return ScalarBinary( ScalarBinary_ADD, left, right);end;// DOC-END: operation
C.ADD is a compact 16-bit scalar instruction that adds two complete XLEN Reg5 sources modulo 2^PTO_XLEN and always pushes one result to the T queue.
The instruction snapshots SrcL and SrcR, performs fixed-width addition on the two saved values, and publishes the wrapping result as the newest T entry.
The destination is implicit rather than encoded: every successful C.ADD pushes exactly one value to T.
0..23 select GPRs, 24..27 select T#1..T#4, and 28..31 select U#1..U#4.0 reads the architectural zero GPR.Duplicate sources and every absolute-relative or relative-relative pairing are legal; reading a temporary source does not consume it.
Source snapshotting precedes the implicit T push, so reading T and then pushing T uses the pre-instruction queue contents.
The new result becomes T#1, older T entries shift toward T#4, and the former T#4 is discarded. The U queue remains unchanged, and reading a source does not consume an entry.
Successful execution advances TPC by 2 bytes and does not change GPR, memory, reservation, descriptor, numeric-status, block, privilege, predicate, or other control state.
Addition itself is total and non-trapping. An unavailable selected T/U source raises Fault_IllegalInstruction before the T push, before TPC advances, and before any unrelated state changes.
This walkthrough illustrates the current owner; it is not another instruction definition.
If T#1 contains 5 and U#1 contains 3, c.add t#1, u#1, ->t pushes 8 to T#1, moves the old value 5 to T#2, leaves U#1 equal to 3, and advances TPC by 2 bytes.
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-ADD-DECODE-001tests/asl/scalar/alu/C.ADD/scalar-decode-c-add-canonical-001.asl22d471a65da1a27159db2a4c98251cba5cc8d29c6c1f0e2520b53232bc7ffb86PTO-AVS-SCALAR-C-ADD-QUEUE-001tests/asl/scalar/alu/C.ADD/scalar-exec-c-add-queue-001.aslb0594615e62552ac4d16e0f6bb560827059e15322898e8342003c116e0d42240PTO-AVS-SCALAR-C-ADD-READINESS-001tests/asl/scalar/alu/C.ADD/scalar-fault-c-add-readiness-001.asla854d1e744c3420b6d991b306ac93d9a6b5bc7133940823a18779e4d7eafbef3PTO-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.ADD.md",
"id": "PTO-SCALAR-C-ADD",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "C.ADD",
"ndf_clause": "PTO-INST-SCALAR-C-ADD"
},
"mnemonic": "C.ADD",
"readiness_subjects": [
"ADR-0026",
"ADR-0059"
],
"semantic_tests": [
"PTO-AVS-SCALAR-C-ADD-QUEUE-001",
"PTO-AVS-SCALAR-C-ADD-READINESS-001"
],
"source": "asl/scalar/alu/C.ADD.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-C-ADD-DECODE-001",
"PTO-AVS-SCALAR-C-ADD-QUEUE-001",
"PTO-AVS-SCALAR-C-ADD-READINESS-001"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd868129b7436628a60d16301bba5db8d933dae955d00d0f943bd559da90b35b52d018e4529891a0c963cf3af576b9453c6bc1998c85eb33192213c1029e4582feb3637asl/scalar/alu/C.ADD.aslasl/scalar/alu/C.ADD.asl