操作数与参数
RegDst- Reg5 destination or discard
SrcL- Reg5 base source
SrcR- Reg5 insertion source
immr- first destination bit
imms- last destination bit
HL.BFI inserts ascending low source bits into an inclusive wrapping destination interval of a snapshotted base value and publishes the XLEN result.
PTO-SCALAR-HL-BFIhl.bfi SrcL, SrcR, M, N, ->{t, u, Rd}| 字段 | 位宽 | 有符号性 | 架构角色 | 编码零 |
|---|---|---|---|---|
RegDst | 5 | encoding-defined | Reg5 destination or discard | Encoded zero discards the result. |
SrcL | 5 | encoding-defined | Reg5 base source | Encoded zero reads the architectural zero GPR base. |
SrcR | 5 | encoding-defined | Reg5 insertion source | Encoded zero reads the architectural zero GPR insertion source. |
immr | 6 | encoding-defined | first destination bit | Encoded zero begins the destination interval at bit zero. |
imms | 6 | encoding-defined | last destination bit | Encoded zero ends the destination interval at bit zero. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| Constant | 47:41 | 7'b0000000 |
| SrcR | 40:36 | variable |
| SrcL | 35:31 | variable |
| Constant | 30:28 | 3'b010 |
| RegDst | 27:23 | variable |
| Constant | 22:16 | 7'b1001101 |
| imms | 15:10 | variable |
| immr | 9:4 | variable |
| Constant | 3:0 | 4'b1110 |
{
"reg": [
{
"bits": 4,
"name": "4'b1110"
},
{
"bits": 6,
"name": "immr"
},
{
"bits": 6,
"name": "imms"
},
{
"bits": 7,
"name": "7'b1001101"
},
{
"bits": 5,
"name": "RegDst"
},
{
"bits": 3,
"name": "3'b010"
},
{
"bits": 5,
"name": "SrcL"
},
{
"bits": 5,
"name": "SrcR"
},
{
"bits": 7,
"name": "7'b0000000"
}
],
"config": {
"bits": 48,
"fontsize": 13,
"hspace": 900,
"lanes": 2,
"offset": 0
}
}hl.bfi SrcL, SrcR, M, N, ->{t, u, Rd}
RegDstSrcLSrcRimmrimms下面是该指令所有者中的 Operation;页面没有重写这段行为。
readonly func InstructionContractOperation_HL_BFI() => ScalarOperationbegin return ScalarOperation_HL_BFI;end;
pure func InstructionContractFirstBit_HL_BFI(encoded_immr: bits(6)) => integer {0..63}begin return UInt(encoded_immr);end;
pure func InstructionContractLastBit_HL_BFI(encoded_imms: bits(6)) => integer {0..63}begin return UInt(encoded_imms);end;readonly func InstructionContractHandler_HL_BFI() => ScalarSemanticHandlerbegin return ScalarHandler_InsertBitfield;end;
pure func InstructionContractResult_HL_BFI( base: Word, source: Word, first: integer {0..63}, last: integer {0..63}) => Wordbegin return InsertBitfield( base, source, first, last);end;// PTO-INSTRUCTION: {"assembly":["hl.bfi SrcL, SrcR, M, N, ->{t, u, Rd}"],"block":[],"catalog_indices":[122],"catalog_records":[{"asm":"hl.bfi SrcL, SrcR, M, N, ->{t, u, Rd}","constraints":[],"encoding":[{"index":0,"mask":"0xfe00707f000f","match":"0x0000204d000e","width_bits":48}],"encoding_kind":"HL48","fields":[{"name":"RegDst","pieces":[{"instruction_lsb":23,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SrcL","pieces":[{"instruction_lsb":31,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"SrcR","pieces":[{"instruction_lsb":36,"value_lsb":0,"width":5}],"signedness":"encoding-defined","width":5},{"name":"immr","pieces":[{"instruction_lsb":4,"value_lsb":0,"width":6}],"signedness":"encoding-defined","width":6},{"name":"imms","pieces":[{"instruction_lsb":10,"value_lsb":0,"width":6}],"signedness":"encoding-defined","width":6}],"form_id":"hl_bfi_48_8adfd476aacc","length_bits":48,"mnemonic":"HL.BFI","semantic_family":"ALU","semantic_group":"ALU","semantic_handler":"InsertBitfield","semantic_summary":"HL.BFI inserts ascending low source bits into an inclusive wrapping destination interval of a snapshotted base value and publishes the XLEN result.","status":"accepted"}],"classification":["alu"],"contract":{"block_composition":["none"],"canonical_assembly":["hl.bfi SrcL, SrcR, M, N, ->{t, u, Rd}"],"defaults":["SrcL, SrcR, immr, imms, and RegDst are required encoded fields; no field can be omitted.","immr directly encodes the first destination bit from 0 through 63. imms directly encodes the last destination bit from 0 through 63.","When imms precedes immr, the inclusive destination interval wraps through bit 63 to bit 0. Equal endpoints select one destination bit."],"encoding_class":"standalone-encoded","examples":["hl.bfi a0, a1, 8, 15, ->a2","hl.bfi t#1, u#1, 63, 0, ->t","hl.bfi a0, zero, 0, 63, ->a0"],"exceptions":["An unavailable selected T/U source raises Fault_IllegalInstruction before the destination effect and before TPC advances. Both sources are preflighted even when their encoded values are equal.","HL.BFI raises no arithmetic, memory, alignment, permission, or control-flow exception."],"field_contracts":{},"field_zero_meanings":{"RegDst":"Encoded zero discards the result.","SrcL":"Encoded zero reads the architectural zero GPR base.","SrcR":"Encoded zero reads the architectural zero GPR insertion source.","immr":"Encoded zero begins the destination interval at bit zero.","imms":"Encoded zero ends the destination interval at bit zero."},"legality":["SrcL and SrcR codes 0..23 select absolute GPRs, 24..27 select T#1..T#4, and 28..31 select U#1..U#4 without consumption.","RegDst codes 0 and 24..29 discard, codes 1..23 write GPRs, code 30 pushes U, and code 31 pushes T.","Every immr and imms value is assigned. The inclusive wrapping interval has a width from 1 through 64."],"memory_effects":["none"],"operands":[{"field":"RegDst","role":"Reg5 destination or discard"},{"field":"SrcL","role":"Reg5 base source"},{"field":"SrcR","role":"Reg5 insertion source"},{"field":"immr","role":"first destination bit"},{"field":"imms","role":"last destination bit"}],"ordering":["Snapshot both sources before any destination effect, including when RegDst aliases SrcL or SrcR.","Publish the result, then advance TPC by six bytes."],"standalone_opcode":true,"state_effects":["Snapshot the base and insertion sources. Starting with source bit zero, replace ascending bits of the inclusive destination interval from immr through imms, wrapping through bit 63 when required; preserve every base bit outside that interval.","Publish the complete XLEN result through the common Reg5 destination map. Relative sources are non-consuming; only a T or U destination push changes a temporary queue.","No memory, reservation, descriptor, numeric-status, block, privilege, branch-target, or other control state changes. Successful execution advances TPC by six bytes."]},"depends_on":["PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING"],"id":"PTO-SCALAR-HL-BFI","mnemonic":"HL.BFI","summary":"HL.BFI inserts ascending low source bits into an inclusive wrapping destination interval of a snapshotted base value and publishes the XLEN result.","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-BFI-DECISION-BINDING-001// ndf: kind=contract level=L1 layer=scalar status=accepted// HL.BFI MUST implement the mnemonic-local canonical assembly, encoded// legality, defaults, state and memory effects, ordering, and fault boundaries// declared in this owner. The operation region below is the executable binding// for every accepted decision that names this mnemonic.// NDF-END: PTO-HL-BFI-DECISION-BINDING-001// DOC-BEGIN: decodereadonly func InstructionContractOperation_HL_BFI() => ScalarOperationbegin return ScalarOperation_HL_BFI;end;
pure func InstructionContractFirstBit_HL_BFI(encoded_immr: bits(6)) => integer {0..63}begin return UInt(encoded_immr);end;
pure func InstructionContractLastBit_HL_BFI(encoded_imms: bits(6)) => integer {0..63}begin return UInt(encoded_imms);end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_HL_BFI() => ScalarSemanticHandlerbegin return ScalarHandler_InsertBitfield;end;
pure func InstructionContractResult_HL_BFI( base: Word, source: Word, first: integer {0..63}, last: integer {0..63}) => Wordbegin return InsertBitfield( base, source, first, last);end;// DOC-END: operation
HL.BFI 是一条 48 位标量 ALU 指令。它把源值从低位开始的连续位插入基值中选定的闭合回绕区间;当前指令契约定义结果发布路径以及任何额外状态效果。
执行时先对编码输入做快照,然后把源值从低位开始的连续位插入基值中选定的闭合回绕区间,最后才产生目标效果。
RegDst 是 5 位字段,选择 Reg5 结果目标,或丢弃结果。SrcL 是 5 位字段,通过 Reg5 选择基值。SrcR 是 5 位字段,通过 Reg5 选择插入位。immr 是 6 位字段,编码闭合区间的首个目标位。imms 是 6 位字段,编码闭合区间的最后目标位。这些角色来自当前指令契约;T/U 源只被读取和快照,不会因源选择而出队。编码零的精确含义列在下方生成的默认值章节中。
所有标量源都在目标效果前完成快照。完成后的值只通过 RegDst 按当前标量目标映射发布;immr 与 imms 用于选择插入区间,并不是发布目标。
该 ALU 操作不产生内存效果。成功完成架构效果后,TPC 前进 6 字节。
该操作不会产生隐藏的标量发布目标或隐式内存访问。架构变化仅限于当前契约列出的状态效果。
位域选择可从位 63 回绕到位 0;宽度与起点的精确编码含义由下方生成的默认值和合法性表给出。
下方生成的合法性表是已分配字段值、保留编码和目标丢弃编码的权威说明。解码与源可用性检查先于架构效果完成。
本示例只用于演示当前 ASL 所有者,不替代规范操作。
以一个小型 HL.BFI 示例说明:基值 0、插入源 0x7、immr=2 与 imms=4 产生结果 0x1c。
正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。
HL.BFI MUST implement the mnemonic-local canonical assembly, encoded legality, defaults, state and memory effects, ordering, and fault boundaries declared in this owner. The operation region below is the executable binding for every accepted decision that names this mnemonic.
PTO-HL-BFI-DECISION-BINDING-001asl/scalar/alu/HL.BFI.asl5ef936119d4b1988d9a1acdfc5cb8fcd4263e4d18f1aab26cbe49c0335f3f4f743af873e0d006a808b459bc85225bf45cc67bdbea966b38e1783dca2736d5b1612 matching entries
PTO-AVS-SCALAR-HL-BFI-ALIAS-001tests/asl/scalar/alu/HL.BFI/scalar-bound-hl-bfi-alias-001.asl05b8c4cddabdbe70f3ea26c6708723614d649f3d9f1eed3421e2b3ed89cdca85PTO-AVS-SCALAR-HL-BFI-DECODE-001tests/asl/scalar/alu/HL.BFI/scalar-decode-hl-bfi-canonical-001.aslfbba9f1e8d38613b6e05b84a34e3dc0f44b7a60ef8fa423266ae1b0561119fa0PTO-AVS-SCALAR-HL-BFI-READINESS-001tests/asl/scalar/alu/HL.BFI/scalar-fault-hl-bfi-readiness-001.asl1f064e3a3f79b82cba0a13effdf79e286c78213ffe42a69c5c7f406198cb9fa5PTO-AVS-SCALAR-HL-BFI-WRAP-001tests/asl/scalar/alu/HL.BFI/scalar-exec-hl-bfi-wrap-001.aslc7d8487a53434a07c39824b49a21505e7d310b41699b0737d21840e8ff5f2169PTO-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.mdf18d13f735cfaf9f2803c754c5818f4af33d1cc42c489f0d9ce060b07bb3a196Loading ADR-0084…
ADR-0084docs/status/decisions/0084-scalar-system-and-queue-operations.mde068992fa81e2c4ac46e492391a2f784141d68e041bf0b9e0586c37217d1e08c{
"classification": [
"alu"
],
"documentation": "docs/scalar/alu/HL.BFI.md",
"id": "PTO-SCALAR-HL-BFI",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "HL.BFI",
"ndf_clause": "PTO-INST-SCALAR-HL-BFI"
},
"mnemonic": "HL.BFI",
"readiness_subjects": [
"ADR-0026",
"ADR-0059",
"ADR-0084"
],
"semantic_tests": [
"PTO-AVS-SCALAR-HL-BFI-ALIAS-001",
"PTO-AVS-SCALAR-HL-BFI-READINESS-001",
"PTO-AVS-SCALAR-HL-BFI-WRAP-001"
],
"source": "asl/scalar/alu/HL.BFI.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-HL-BFI-ALIAS-001",
"PTO-AVS-SCALAR-HL-BFI-DECODE-001",
"PTO-AVS-SCALAR-HL-BFI-READINESS-001",
"PTO-AVS-SCALAR-HL-BFI-WRAP-001"
]
}0.58.5 · 候选发布7dc8b7e5b121d2b2499a2273bebff29e2cd868125ef936119d4b1988d9a1acdfc5cb8fcd4263e4d18f1aab26cbe49c0335f3f4f7bc7284447f82433883cbb56a9f283214d9ab3f445eb610346ef7a7c87f8bd79casl/scalar/alu/HL.BFI.aslasl/scalar/alu/HL.BFI.aslasl/scalar/alu/HL.BFI.asl