Operands and parameters
RegDst- Reg5 loaded-value destination or discard
SrcL- Reg5 address-base source
SrcR- Reg5 register-offset source
SrcRType- register-offset transformation selector
shamt- post-transformation logical-left-shift amount
LH snapshots its scalar sources, forms its encoded address, and loads one aligned little-endian 2-byte value.
PTO-SCALAR-LHlh [SrcL, SrcR<{.sw,.uw,.neg}><<<shamt>], ->{t, u, Rd}| Field | Bits | Signedness | Architectural role | Encoded zero |
|---|---|---|---|---|
RegDst | 5 | encoding-defined | Reg5 loaded-value destination or discard | Encoded zero discards this result without suppressing the instruction's other effects. |
SrcL | 5 | encoding-defined | Reg5 address-base source | Encoded zero reads the architectural zero GPR. |
SrcR | 5 | encoding-defined | Reg5 register-offset source | Encoded zero reads the architectural zero GPR. |
SrcRType | 2 | encoding-defined | register-offset transformation selector | Encoded zero leaves the complete PTO_XLEN register-offset value unchanged. |
shamt | 5 | encoding-defined | post-transformation logical-left-shift amount | Encoded zero performs no shift. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| shamt | 31:27 | variable |
| SrcRType | 26:25 | variable |
| SrcR | 24:20 | variable |
| SrcL | 19:15 | variable |
| Constant | 14:12 | 3'b001 |
| RegDst | 11:7 | variable |
| Constant | 6:0 | 7'b0001001 |
{
"reg": [
{
"bits": 7,
"name": "7'b0001001"
},
{
"bits": 5,
"name": "RegDst"
},
{
"bits": 3,
"name": "3'b001"
},
{
"bits": 5,
"name": "SrcL"
},
{
"bits": 5,
"name": "SrcR"
},
{
"bits": 2,
"name": "SrcRType"
},
{
"bits": 5,
"name": "shamt"
}
],
"config": {
"bits": 32,
"fontsize": 13,
"hspace": 900,
"lanes": 1,
"offset": 0
}
}lh [SrcL, SrcR<{.sw,.uw,.neg}><<<shamt>], ->{t, u, Rd}
RegDstSrcLSrcRSrcRTypeshamtThis Operation comes directly from the instruction owner; the page does not rewrite its behavior.
readonly func InstructionContractOperation_LH() => ScalarOperationbegin return ScalarOperation_LH;end;readonly func InstructionContractHandler_LH() => ScalarSemanticHandlerbegin return ScalarHandler_ExecuteScalarLoad;end;
pure func InstructionContractAGUAction_LH() => ScalarAGUActionbegin return ScalarAGU_Load;end;
pure func InstructionContractAGUAddressKind_LH() => ScalarAGUAddressKindbegin return ScalarAGU_Register;end;
pure func InstructionContractAGUSizeBytes_LH() => integer {1,2,4,8}begin return 2;end;
pure func InstructionContractAGUOffsetScale_LH() => integer {0..3}begin return 0;end;
pure func InstructionContractAGUUpdateMode_LH() => AddressUpdateModebegin return AddressUpdate_None;end;
pure func InstructionContractAGUSignedLoad_LH() => booleanbegin return TRUE;end;
pure func InstructionContractAGUPrefetchReturnsAddress_LH() => booleanbegin return FALSE;end;// PTO-INSTRUCTION: {"assembly":["lh [SrcL, SrcR<{.sw,.uw,.neg}><<<shamt>], ->{t, u, Rd}"],"block":[],"catalog_indices":[326],"catalog_records":[{"agu":{"action":"Load","address_kind":"Register","offset_scale":0,"prefetch_returns_address":false,"signed_load":true,"size_bytes":2,"update_mode":"None"},"asm":"lh [SrcL, SrcR<{.sw,.uw,.neg}><<<shamt>], ->{t, u, Rd}","constraints":[],"encoding":[{"index":0,"mask":"0x0000707f","match":"0x00001009","width_bits":32}],"encoding_kind":"L32","fields":[{"name":"RegDst","pieces":[{"instruction_lsb":7,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SrcL","pieces":[{"instruction_lsb":15,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SrcR","pieces":[{"instruction_lsb":20,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SrcRType","pieces":[{"instruction_lsb":25,"value_lsb":0,"width":2}],"signedness":"encoding-defined","width":2},{"name":"shamt","pieces":[{"instruction_lsb":27,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5}],"form_id":"lh_32_d0f04d7d7696","length_bits":32,"mnemonic":"LH","semantic_family":"AGU","semantic_group":"LDA/BASE_REG","semantic_handler":"ExecuteScalarLoad","semantic_summary":"LH snapshots its scalar sources, forms its encoded address, and loads one aligned little-endian 2-byte value.","status":"accepted"}],"classification":["agu"],"contract":{"block_composition":["none"],"canonical_assembly":["lh [SrcL, SrcR<{.sw,.uw,.neg}><<<shamt>], ->{t, u, Rd}"],"defaults":["Every displayed operand field is encoded explicitly; encoded zero is a value and never denotes omission.","SrcRType=0 leaves SrcR unchanged, SrcRType=1 sign-extends SrcR[31:0], SrcRType=2 zero-extends SrcR[31:0], and SrcRType=3 negates the full PTO_XLEN value. Encoded shamt zero performs no shift."],"encoding_class":"standalone-encoded","examples":["lh [SrcL, SrcR<{.sw,.uw,.neg}><<<shamt>], ->{t, u, Rd}"],"exceptions":["A fixed-bit mismatch, reserved field value, or unavailable selected T/U source raises Fault_IllegalInstruction before instruction effects.","A misaligned 2-byte address raises Fault_DataAlignment before translation or permission. A later permission or bounded-memory failure raises Fault_DataPage at the original address.","A fault emits no successful memory event, performs no partial memory or destination effect, preserves pending writeback, and leaves TPC at the faulting instruction.","Recovery performs a full reissue: every address, source snapshot, preflight, memory operation, and destination is recomputed with no retained progress."],"field_contracts":{},"field_zero_meanings":{"RegDst":"Encoded zero discards this result without suppressing the instruction's other effects.","SrcL":"Encoded zero reads the architectural zero GPR.","SrcR":"Encoded zero reads the architectural zero GPR.","SrcRType":"Encoded zero leaves the complete PTO_XLEN register-offset value unchanged.","shamt":"Encoded zero performs no shift."},"legality":["Every encoded Reg5 source uses the complete domain: codes 0..23 select absolute GPRs, codes 24..27 select T#1..T#4, and codes 28..31 select U#1..U#4 without consumption.","Every Reg5 destination is assigned: codes 1..23 write GPRs, code 30 pushes U, code 31 pushes T, and codes 0 and 24..29 discard only that result.","All four SrcRType values and all shamt values 0..31 are assigned; apply the modifier before the shift.","Each memory address must be aligned to the 2-byte access size; a 2-byte access is the complete transfer unit."],"memory_effects":["After complete preflight, perform one little-endian 2-byte load and record one relaxed load event.","The load preserves memory and reservation state."],"operands":[{"field":"RegDst","role":"Reg5 loaded-value destination or discard"},{"field":"SrcL","role":"Reg5 address-base source"},{"field":"SrcR","role":"Reg5 register-offset source"},{"field":"SrcRType","role":"register-offset transformation selector"},{"field":"shamt","role":"post-transformation logical-left-shift amount"}],"ordering":["Snapshot all explicit and implicit scalar sources before destination or memory effects; duplicate and source/destination aliases observe pre-instruction values.","Complete the relaxed 2-byte memory operation, publish any result or writeback, and then advance TPC."],"standalone_opcode":true,"state_effects":["Form offset = LSL(Modify(SrcR, SrcRType), the encoded shamt) and add it modulo 2^PTO_XLEN to the SrcL base.","After a successful 2-byte load, sign-extend the loaded value to PTO_XLEN and publish it through the destination.","Successful execution advances TPC by 4 bytes; a rejected or faulting attempt does not retire."]},"depends_on":["PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING"],"id":"PTO-SCALAR-LH","mnemonic":"LH","summary":"LH snapshots its scalar sources, forms its encoded address, and loads one aligned little-endian 2-byte value.","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_LH() => ScalarOperationbegin return ScalarOperation_LH;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_LH() => ScalarSemanticHandlerbegin return ScalarHandler_ExecuteScalarLoad;end;
pure func InstructionContractAGUAction_LH() => ScalarAGUActionbegin return ScalarAGU_Load;end;
pure func InstructionContractAGUAddressKind_LH() => ScalarAGUAddressKindbegin return ScalarAGU_Register;end;
pure func InstructionContractAGUSizeBytes_LH() => integer {1,2,4,8}begin return 2;end;
pure func InstructionContractAGUOffsetScale_LH() => integer {0..3}begin return 0;end;
pure func InstructionContractAGUUpdateMode_LH() => AddressUpdateModebegin return AddressUpdate_None;end;
pure func InstructionContractAGUSignedLoad_LH() => booleanbegin return TRUE;end;
pure func InstructionContractAGUPrefetchReturnsAddress_LH() => booleanbegin return FALSE;end;// DOC-END: operation
LH is a standalone 32-bit AGU instruction that forms a register-offset address and loads one aligned little-endian 2-byte value.
LH transforms SrcR according to SrcRType, shifts the transformed value left by the encoded shamt, and adds it modulo 2^PTO_XLEN to the snapshotted SrcL base.
After complete preflight, the instruction performs one little-endian 2-byte load and sign-extends the loaded 2-byte value to PTO_XLEN for destination publication.
This form performs no base-register writeback; its effective address is used only by the selected memory operation.
SrcL supplies the base; SrcR supplies the offset; SrcRType supplies the offset transformation. Every encoded Reg5 source among SrcL, SrcR uses codes 0..23 for GPRs, 24..27 for T#1..T#4, and 28..31 for U#1..U#4 without consumption.RegDst receives the loaded result; destination codes 1..23 write GPRs, 30 pushes U, 31 pushes T, and 0 plus 24..29 discard only that result.SrcRType values 0..3 and all shamt values 0..31 are assigned; transformation precedes the encoded shift.All explicit and implicit scalar sources are snapshotted before memory or destination effects, so aliases observe pre-instruction values.
A successful attempt records one relaxed load event, preserves memory and reservation state, publishes or discards the loaded value, and advances TPC by 4 bytes.
Each effective address must satisfy 2-byte alignment. Misalignment raises Fault_DataAlignment before translation; a later permission or bounded-memory failure raises Fault_DataPage at the original address.
A fault records no successful memory event, performs no partial memory, destination, or writeback effect, preserves pending writeback, and leaves the faulting TPC available for full reissue.
A fixed-bit mismatch, reserved field value, or unavailable selected T/U source raises Fault_IllegalInstruction before instruction effects.
This example demonstrates the address calculation only; exact behavior remains in the current ASL and instruction contract.
With base 0x100, unchanged offset source 2, and shamt=1, the offset is 4 and base plus offset is 0x104. The memory access uses 0x104. If aligned and permitted, the instruction loads 2 bytes from that address.
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
No NDF clause is attached to this unit.
12 matching entries
PTO-AVS-AGU-LH-ALIAS-001tests/asl/scalar/agu/LH/scalar-exec-lh-registers-001.asl2665f2c0dbc47f8e2e2c40e1e41056ce68f1c32a4239f418399f1cf6bed1ced2PTO-AVS-AGU-LH-BOUND-001tests/asl/scalar/agu/LH/scalar-bound-lh-address-001.asl610865652f790171eb2ddf2761893c6c17e7c08ec993c21441e9f2fb54d37d2aPTO-AVS-AGU-LH-EXEC-001tests/asl/scalar/agu/LH/scalar-exec-lh-direct-001.asl3ffa2acbe4dfc7fba89f93fa8f1ef89392d45d63b1360d6268a55944c2e61e8aPTO-AVS-AGU-LH-FAULT-001tests/asl/scalar/agu/LH/scalar-fault-lh-precise-001.aslc8cc1c7485e871a9fd0dba4da7f8ef6ab92a541bd770c714b2866d0787c28354PTO-AVS-SCALAR-LH-DECODE-001tests/asl/scalar/agu/LH/scalar-decode-lh-canonical-001.asl45c043d3406378d7799fb7383d29f1a8e05aaaa714737ea1e73e43bf83a14ccdPTO-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-0029…
ADR-0029docs/status/decisions/0029-scalar-agu-totality-and-restart.md778e7bc53a5ae6487c051d66d0f84b6d697d6302628716bf5c745166ce982eefLoading ADR-0059…
ADR-0059docs/status/decisions/0059-mnemonic-field-encoding-closure.mdf18d13f735cfaf9f2803c754c5818f4af33d1cc42c489f0d9ce060b07bb3a196{
"classification": [
"agu"
],
"documentation": "docs/scalar/agu/LH.md",
"id": "PTO-SCALAR-LH",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "LH",
"ndf_clause": "PTO-INST-SCALAR-LH"
},
"mnemonic": "LH",
"readiness_subjects": [
"ADR-0029",
"ADR-0059"
],
"semantic_tests": [
"PTO-AVS-AGU-LH-ALIAS-001",
"PTO-AVS-AGU-LH-BOUND-001",
"PTO-AVS-AGU-LH-EXEC-001",
"PTO-AVS-AGU-LH-FAULT-001"
],
"source": "asl/scalar/agu/LH.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-AGU-LH-ALIAS-001",
"PTO-AVS-AGU-LH-BOUND-001",
"PTO-AVS-AGU-LH-EXEC-001",
"PTO-AVS-AGU-LH-FAULT-001",
"PTO-AVS-SCALAR-LH-DECODE-001"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd868123d41797fbaeabd762d8e86473f4dfd843b06ab90bf5d4ecfd4a370cadec87e0da5b37b4df041fb92e1f3a55d5666610b83a1139992d56d2c3b6b610a80486ac1asl/scalar/agu/LH.aslasl/scalar/agu/LH.asl