操作数与参数
RegDst- absolute GPR destination
imm32- signed 32-bit 4 KiB page displacement
HL.ADDTPC - Add a signed 4 KiB page displacement to the current TPC.
PTO-SCALAR-HL-ADDTPChl.addtpc imm, ->{t, u, Rd}| 字段 | 位宽 | 有符号性 | 架构角色 | 编码零 |
|---|---|---|---|---|
RegDst | 5 | encoding-defined | absolute GPR destination | Encoded zero names the architectural zero GPR. |
imm32 | 32 | encoding-defined | signed 32-bit 4 KiB page displacement | Encoded zero contributes a zero page displacement and produces the current instruction TPC. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| imm32 | 47:28 | variable |
| RegDst | 27:23 | variable |
| Constant | 22:16 | 7'b0000111 |
| imm32 | 15:4 | variable |
| Constant | 3:0 | 4'b1110 |
{
"reg": [
{
"bits": 4,
"name": "4'b1110"
},
{
"bits": 12,
"name": "imm32"
},
{
"bits": 7,
"name": "7'b0000111"
},
{
"bits": 5,
"name": "RegDst"
},
{
"bits": 20,
"name": "imm32"
}
],
"config": {
"bits": 48,
"fontsize": 13,
"hspace": 900,
"lanes": 2,
"offset": 0
}
}hl.addtpc imm, ->{t, u, Rd}
RegDstimm32下面是该指令所有者中的 Operation;页面没有重写这段行为。
readonly func InstructionContractOperation_HL_ADDTPC() => ScalarOperationbegin return ScalarOperation_HL_ADDTPC;end;readonly func InstructionContractHandler_HL_ADDTPC() => ScalarSemanticHandlerbegin return ScalarHandler_AddToPC;end;
pure func InstructionContractUsesTPC_HL_ADDTPC() => booleanbegin return TRUE;end;
pure func InstructionContractImmediateWidth_HL_ADDTPC() => integer {32}begin return 32;end;
pure func InstructionContractImmediateIsSigned_HL_ADDTPC() => booleanbegin return TRUE;end;
pure func InstructionContractPageShift_HL_ADDTPC() => integer {12}begin return 12;end;
pure func InstructionContractWritesTPC_HL_ADDTPC() => booleanbegin return FALSE;end;
pure func InstructionContractTarget_HL_ADDTPC( base: Word, page_offset: Word) => Wordbegin return base + LSL(page_offset, 12);end;// PTO-INSTRUCTION: {"assembly":["hl.addtpc imm, ->{t, u, Rd}"],"block":[],"catalog_indices":[119],"catalog_records":[{"asm":"hl.addtpc imm, ->{t, u, Rd}","constraints":[{"field":"RegDst","operator":"not-equal","value":10}],"encoding":[{"index":0,"mask":"0x0000007f000f","match":"0x00000007000e","width_bits":48}],"encoding_kind":"HL48","fields":[{"name":"RegDst","pieces":[{"instruction_lsb":23,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"imm32","pieces":[{"instruction_lsb":28,"value_lsb":0,"width":20},{"instruction_lsb":4,"value_lsb":20,"width":12}],"signedness":"encoding-defined","width":32}],"form_id":"hl_addtpc_48_2e8e692eea09","length_bits":48,"mnemonic":"HL.ADDTPC","semantic_family":"BRU","semantic_group":"BRU","semantic_handler":"AddToPC","semantic_summary":"HL.ADDTPC - Add a signed 4 KiB page displacement to the current TPC.","status":"accepted"}],"classification":["bru"],"contract":{"block_composition":["none"],"canonical_assembly":["hl.addtpc imm, ->{t, u, Rd}"],"defaults":["The imm32 field is sign-extended and scaled by 4096 bytes; encoded zero contributes a zero page displacement and produces the current instruction TPC.","The selected assembly form determines which fields are present; every present field carries its encoded value and no encoded zero means omission."],"encoding_class":"standalone-encoded","examples":["hl.addtpc imm, ->{t, u, Rd}"],"exceptions":["Reserved field encodings raise Fault_IllegalInstruction before effects; handler-specific arithmetic, memory, control-flow, system-register, and privilege faults follow the embedded normative ASL operation."],"field_contracts":{},"field_zero_meanings":{"RegDst":"Encoded zero names the architectural zero GPR.","imm32":"Encoded zero contributes a zero page displacement and produces the current instruction TPC."},"legality":["hl_addtpc_48_2e8e692eea09.RegDst excludes 10; the excluded encoding is reserved."],"memory_effects":["none"],"operands":[{"field":"RegDst","role":"absolute GPR destination"},{"field":"imm32","role":"signed 32-bit 4 KiB page displacement"}],"ordering":["Read the current instruction TPC before computing the wrapping XLEN result.","After the destination effect, the scalar dispatch boundary advances TPC by six bytes."],"standalone_opcode":true,"state_effects":["HL.ADDTPC writes TPC + (SignExtend(imm32) << 12), wrapping at XLEN, through the selected Reg5 destination.","The instruction does not install a control-flow target and does not directly modify TPC."]},"depends_on":["PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING"],"id":"PTO-SCALAR-HL-ADDTPC","mnemonic":"HL.ADDTPC","summary":"HL.ADDTPC - Add a signed 4 KiB page displacement to the current TPC.","surface":"scalar"}// PTO-REVIEW: {"review_method":"formal-definition-read","outcome":"FORMAL-COMPLETE","reviewed_fields":["assembly","encoding","defaults","operation","state","memory","ordering","faults","reserved"]}// NDF-BEGIN: PTO-HL-ADDTPC-PAGE-001// ndf: kind=contract level=L1 layer=scalar status=accepted// HL.ADDTPC MUST add SignExtend(imm32) shifted left by twelve to the current// instruction TPC, MUST wrap at XLEN, and MUST write only through the selected// Reg5 destination. It MUST NOT install a control-flow target or directly// advance TPC. Encoded immediate zero MUST produce the current TPC.// NDF-END: PTO-HL-ADDTPC-PAGE-001// DOC-BEGIN: decodereadonly func InstructionContractOperation_HL_ADDTPC() => ScalarOperationbegin return ScalarOperation_HL_ADDTPC;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_HL_ADDTPC() => ScalarSemanticHandlerbegin return ScalarHandler_AddToPC;end;
pure func InstructionContractUsesTPC_HL_ADDTPC() => booleanbegin return TRUE;end;
pure func InstructionContractImmediateWidth_HL_ADDTPC() => integer {32}begin return 32;end;
pure func InstructionContractImmediateIsSigned_HL_ADDTPC() => booleanbegin return TRUE;end;
pure func InstructionContractPageShift_HL_ADDTPC() => integer {12}begin return 12;end;
pure func InstructionContractWritesTPC_HL_ADDTPC() => booleanbegin return FALSE;end;
pure func InstructionContractTarget_HL_ADDTPC( base: Word, page_offset: Word) => Wordbegin return base + LSL(page_offset, 12);end;// DOC-END: operation
HL.ADDTPC 根据当前 TPC 形成页相对地址,但不执行控制转移。
有符号 32 位立即数先扩展并左移 12 位,再与快照的当前 TPC 按 2^PTO_XLEN 取模相加。
计算出的地址通过编码目的位置发布,不会被安装为下一条 TPC。
RegDst 选择编码指定的目的位置或丢弃行为。imm32 提供编码立即数或位移。结果先通过编码目的位置发布,成功分派随后让 TPC 前进 6 字节。
该指令不分支,也不访问内存或保留状态。
编码、保留字段值和源可用性都会在目的、控制或 TPC 效果前检查。
下面的示例只帮助理解当前所有者,不构成第二份语义定义。
hl.addtpc imm, ->{t, u, Rd} 把页相对地址作为数据发布,随后继续顺序执行。
正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。
HL.ADDTPC MUST add SignExtend(imm32) shifted left by twelve to the current instruction TPC, MUST wrap at XLEN, and MUST write only through the selected Reg5 destination. It MUST NOT install a control-flow target or directly advance TPC. Encoded immediate zero MUST produce the current TPC.
PTO-HL-ADDTPC-PAGE-001asl/scalar/bru/HL.ADDTPC.aslac4bb8f066da78115f67554e55ba5efdb5ec4cfee68e0abd65d74a182356d47754a041ba1580aa716edc5bdc3521777c1006e2cc2d1b0aa3367d242f8b73674915 matching entries
PTO-AVS-BRU-HL-ADDTPC-BOUND-001tests/asl/scalar/bru/HL.ADDTPC/scalar-bound-hl-addtpc-fields-001.asl26daacf26c168f2400acea06e22d4d76a775d2798dd9033968100326d95b585bPTO-AVS-BRU-HL-ADDTPC-EXEC-001tests/asl/scalar/bru/HL.ADDTPC/scalar-exec-hl-addtpc-direct-001.aslbff1809a9c5c6bef2f519a5ac8549ff6a90e0daff655b4c9c1c03d8429ecdf48PTO-AVS-SCALAR-HL-ADDTPC-DECODE-001tests/asl/scalar/bru/HL.ADDTPC/scalar-decode-hl-addtpc-canonical-001.asl2ebb5458ab44f6d05333b49b1d602485138c2fc15b45a4eb58e5431458e2bda0PTO-AVS-SCALAR-HL-ADDTPC-PAGE-001tests/asl/scalar/bru/HL.ADDTPC/scalar-exec-hl-addtpc-page-001.asl360dee840f7a7efbd3260c794513c91e9ba4abde708ae9ac5a503a8927a42993PTO-AVS-SCALAR-HL-ADDTPC-SIGNED-001tests/asl/scalar/bru/HL.ADDTPC/scalar-bound-hl-addtpc-signed-001.asl6e5511ad6103a5d0730d3ec23789bda0c804b72abcb20bab73ad0b0c3acb7dbePTO-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-0021…
ADR-0021docs/status/decisions/0021-scalar-pc-relative-and-return-address.md99c06f12ee973312181938672a9e059a0dc5a0c4e08effd666616b8006e5f5f9Loading ADR-0027…
ADR-0027docs/status/decisions/0027-scalar-bru-totality-and-target-legality.md9289112d250e31f4222dcd27d20bda791be7a1b57764af7ed9b187e767b7acedLoading ADR-0059…
ADR-0059docs/status/decisions/0059-mnemonic-field-encoding-closure.mdf18d13f735cfaf9f2803c754c5818f4af33d1cc42c489f0d9ce060b07bb3a196Loading ADR-0066…
ADR-0066docs/status/decisions/0066-addtpc-page-scaled-immediate.md6f1c29b7c8a5229b7dfa5e8e087c170361de086751250bba9a95b11300f532fdLoading ADR-0084…
ADR-0084docs/status/decisions/0084-scalar-system-and-queue-operations.mde068992fa81e2c4ac46e492391a2f784141d68e041bf0b9e0586c37217d1e08c{
"classification": [
"bru"
],
"documentation": "docs/scalar/bru/HL.ADDTPC.md",
"id": "PTO-SCALAR-HL-ADDTPC",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "HL.ADDTPC",
"ndf_clause": "PTO-INST-SCALAR-HL-ADDTPC"
},
"mnemonic": "HL.ADDTPC",
"readiness_subjects": [
"ADR-0021",
"ADR-0027",
"ADR-0059",
"ADR-0066",
"ADR-0084"
],
"semantic_tests": [
"PTO-AVS-BRU-HL-ADDTPC-BOUND-001",
"PTO-AVS-BRU-HL-ADDTPC-EXEC-001",
"PTO-AVS-SCALAR-HL-ADDTPC-PAGE-001",
"PTO-AVS-SCALAR-HL-ADDTPC-SIGNED-001"
],
"source": "asl/scalar/bru/HL.ADDTPC.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-BRU-HL-ADDTPC-BOUND-001",
"PTO-AVS-BRU-HL-ADDTPC-EXEC-001",
"PTO-AVS-SCALAR-HL-ADDTPC-DECODE-001",
"PTO-AVS-SCALAR-HL-ADDTPC-PAGE-001",
"PTO-AVS-SCALAR-HL-ADDTPC-SIGNED-001"
]
}0.58.5 · 候选发布7dc8b7e5b121d2b2499a2273bebff29e2cd86812ac4bb8f066da78115f67554e55ba5efdb5ec4cfee68e0abd65d74a182356d4770322f962589d26e2650e355a310b13febdef8c2d75f51de69b0da9c191988fbcasl/scalar/bru/HL.ADDTPC.aslasl/scalar/bru/HL.ADDTPC.aslasl/scalar/bru/HL.ADDTPC.asl