操作数与参数
SrcL- Reg5 atomic address source
SrcR- Reg5 atomic operand source
far- flat-address routing hint
rl- release ordering bit
SD.XOR atomically replaces the aligned 64-bit memory value with its bitwise XOR with SrcR; it does not publish the old value.
PTO-SCALAR-SD-XORsd.xor [SrcL], SrcRsd.xor.rl [SrcL], SrcRsd.xor.f [SrcL], SrcRsd.xor.rlf [SrcL], SrcR| 字段 | 位宽 | 有符号性 | 架构角色 | 编码零 |
|---|---|---|---|---|
SrcL | 5 | encoding-defined | Reg5 atomic address source | Encoded zero reads the architectural zero register as the atomic address. |
SrcR | 5 | encoding-defined | Reg5 atomic operand source | Encoded zero supplies numeric zero as the atomic operand. |
far | 1 | encoding-defined | flat-address routing hint | Encoded zero selects the default flat-address route. |
rl | 1 | encoding-defined | release ordering bit | Encoded zero selects relaxed ordering. |
Loading WaveDrom diagram… The encoding table and WaveJSON remain available below.
| Decoded item | Bit range | Value |
|---|---|---|
| Constant | 31:28 | 4'b0011 |
| far | 27 | variable |
| Constant | 26 | 0 |
| rl | 25 | variable |
| SrcR | 24:20 | variable |
| SrcL | 19:15 | variable |
| Constant | 14:0 | 15'b101000000001011 |
{
"reg": [
{
"bits": 15,
"name": "15'b101000000001011"
},
{
"bits": 5,
"name": "SrcL"
},
{
"bits": 5,
"name": "SrcR"
},
{
"bits": 1,
"name": "rl"
},
{
"bits": 1,
"name": "0"
},
{
"bits": 1,
"name": "far"
},
{
"bits": 4,
"name": "4'b0011"
}
],
"config": {
"bits": 32,
"fontsize": 13,
"hspace": 900,
"lanes": 1,
"offset": 0
}
}sd.xor<.{rl, f, rlf}> [SrcL], SrcR
SrcLSrcRfarrl下面是该指令所有者中的 Operation;页面没有重写这段行为。
readonly func InstructionContractOperation_SD_XOR() => ScalarOperationbegin return ScalarOperation_SD_XOR;end;readonly func InstructionContractHandler_SD_XOR() => ScalarSemanticHandlerbegin return ScalarHandler_AtomicReadModifyWrite;end;
pure func InstructionContractAtomicOperation_SD_XOR() => AtomicOperationbegin return Atomic_XOR;end;
pure func InstructionContractAtomicSizeBytes_SD_XOR() => integer {1,2,4,8}begin return 8;end;
pure func InstructionContractPublishesOldValue_SD_XOR() => booleanbegin return FALSE;end;// PTO-INSTRUCTION: {"assembly":["sd.xor<.{rl, f, rlf}> [SrcL], SrcR"],"block":[],"catalog_indices":[395],"catalog_records":[{"asm":"sd.xor<.{rl, f, rlf}> [SrcL], SrcR","constraints":[],"encoding":[{"index":0,"mask":"0xf4007fff","match":"0x3000500b","width_bits":32}],"encoding_kind":"L32","fields":[{"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":"far","pieces":[{"instruction_lsb":27,"value_lsb":0,"width":1}],"signedness":"encoding-defined","width":1},{"name":"rl","pieces":[{"instruction_lsb":25,"value_lsb":0,"width":1}],"signedness":"encoding-defined","width":1}],"form_id":"sd_xor_32_7655ceaf9497","length_bits":32,"mnemonic":"SD.XOR","semantic_family":"AMO","semantic_group":"AMO","semantic_handler":"AtomicReadModifyWrite","semantic_summary":"SD.XOR atomically replaces the aligned 64-bit memory value with its bitwise XOR with SrcR; it does not publish the old value.","status":"accepted"}],"classification":["amo"],"contract":{"block_composition":["none"],"canonical_assembly":["sd.xor [SrcL], SrcR","sd.xor.rl [SrcL], SrcR","sd.xor.f [SrcL], SrcR","sd.xor.rlf [SrcL], SrcR"],"defaults":["SrcL and SrcR are required Reg5 sources. Encoded zero reads the architectural zero register.","rl=0 selects relaxed ordering; rl=1 selects release ordering.","far=0 selects the default flat-address route. far=1 is a routing hint and does not change the architectural address or atomic operation in the reference profile."],"encoding_class":"standalone-encoded","examples":["sd.xor [a0], a1","sd.xor.rl [t#1], u#1","sd.xor.f [sp], a0"],"exceptions":["Misalignment, translation, and permission checks occur before effects in that precedence order and report the original address.","If either read or write preflight fails, the instruction performs no load, store, event, reservation update, result publication, or TPC advance.","An undecodable or operand-illegal form raises Fault_IllegalInstruction before effects."],"field_contracts":{},"field_zero_meanings":{"SrcL":"Encoded zero reads the architectural zero register as the atomic address.","SrcR":"Encoded zero supplies numeric zero as the atomic operand.","far":"Encoded zero selects the default flat-address route.","rl":"Encoded zero selects relaxed ordering."},"legality":["All 32 Reg5 source encodings are assigned: 0..23 select absolute GPRs, 24..27 select T#1..T#4, and 28..31 select U#1..U#4.","The effective address must be aligned to 8 bytes. SrcL, SrcR, far, and rl have no reserved encodings in this form.","The instruction has no destination field and cannot publish the old memory value to a GPR or temporary queue."],"memory_effects":["Atomically read one aligned 8-byte little-endian value, compute the bitwise XOR, and write one 8-byte result to the same location.","Complete both read and write access probes before the memory load or store, and require both probes to resolve to the same translated address.","On success, record one atomic memory event, invalidate an overlapping local reservation, and preserve a nonoverlapping reservation."],"operands":[{"field":"SrcL","role":"Reg5 atomic address source"},{"field":"SrcR","role":"Reg5 atomic operand source"},{"field":"far","role":"flat-address routing hint"},{"field":"rl","role":"release ordering bit"}],"ordering":["rl=0 records the atomic event with relaxed ordering; rl=1 records it with release ordering. This encoding has no acquire bit.","far changes only the route hint in the reference profile and does not change ordering, address arithmetic, or the read-modify-write result."],"standalone_opcode":true,"state_effects":["Snapshot SrcL and SrcR before any memory or architectural effect.","SD.XOR computes the bitwise XOR of the old value and operand at 64-bit width and stores that value; it does not publish the old value.","Successful execution advances TPC by four bytes. On a fault, the instruction does not retire; trap entry saves the original TPC, redirects the live TPC to the trap vector, and recovery restores that TPC for full reissue. GPRs, T/U queues, memory events, reservation state, and memory remain unchanged by the failed instruction."]},"depends_on":["PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING"],"id":"PTO-SCALAR-SD-XOR","mnemonic":"SD.XOR","summary":"SD.XOR atomically replaces the aligned 64-bit memory value with its bitwise XOR with SrcR; it does not publish the old value.","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-SD-XOR-ADR-CONTRACT-001// ndf: kind=contract level=L1 layer=scalar status=accepted// Decisions: ADR-0030.// SD.XOR MUST preflight its complete mnemonic-owned atomic access before// memory, reservation, event, or destination effects and MUST commit the// selected width, ordering, memory update, event, and result atomically.// NDF-END: PTO-SD-XOR-ADR-CONTRACT-001// DOC-BEGIN: decodereadonly func InstructionContractOperation_SD_XOR() => ScalarOperationbegin return ScalarOperation_SD_XOR;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_SD_XOR() => ScalarSemanticHandlerbegin return ScalarHandler_AtomicReadModifyWrite;end;
pure func InstructionContractAtomicOperation_SD_XOR() => AtomicOperationbegin return Atomic_XOR;end;
pure func InstructionContractAtomicSizeBytes_SD_XOR() => integer {1,2,4,8}begin return 8;end;
pure func InstructionContractPublishesOldValue_SD_XOR() => booleanbegin return FALSE;end;// DOC-END: operation
SD.XOR 对一个双字原子执行按位异或并存储结果,但不发布旧值。
ASL DOC 契约选择 ScalarHandler_AtomicReadModifyWrite,访问宽度为 8 字节。
只有读取与写入访问都完成预检后,同一位置的原子读改写才能提交。
SrcL 承载 Reg5 原子地址源;SrcR 承载 Reg5 原子操作数源;far 承载平坦地址路由提示;rl 承载释放排序位。
rl 选择宽松或释放排序;该形式没有获取位;far 是配置档路由提示,在参考配置档中不改变架构结果。
这种仅存储形式没有目的字段;提交成功时会更新内存并发出一个原子事件。
完成的写入会使重叠的本地 64 字节缓存行保留失效,保留不重叠的保留,并让 TPC 前进 4 字节。
有效地址必须按 8 字节对齐。对齐、地址翻译和权限检查都先于架构效果。
预检失败时不会发布目的值、内存事件、保留更新或退役效果;保存的原始 TPC 支持完整重新执行。
本示例只展示一种已接受写法;下方生成的契约仍是权威来源。
初次阅读可从 sd.xor [SrcL], SrcR 开始,再只改变上文说明的排序或路由修饰位。
正文来自 owning ASL。拖拽或按钮只临时改变当前页面显示顺序。
Decisions: ADR-0030. SD.XOR MUST preflight its complete mnemonic-owned atomic access before memory, reservation, event, or destination effects and MUST commit the selected width, ordering, memory update, event, and result atomically.
PTO-SD-XOR-ADR-CONTRACT-001asl/scalar/amo/SD.XOR.asl61db0cfd08eea9d3f0f06de2f1c9d0a50bf9f7e0b0f516d2f044d13a170d520a387d757fadf418d9c4d7155e771dc2be11fd66a1713d5217d825f5479bf50c5713 matching entries
PTO-AVS-SCALAR-SD-XOR-DECODE-001tests/asl/scalar/amo/SD.XOR/scalar-decode-sd-xor-canonical-001.asl807d2407e622d33fcd6e953b73e630afd7421aef11991fc74214c0e4a6daad53PTO-AVS-SCALAR-SD-XOR-FORMS-001tests/asl/scalar/amo/SD.XOR/scalar-bound-sd-xor-forms-001.asle978784cc625aafa77dfac116c7c1caffc453bb41610a3d83a66ed52481ee5d4PTO-AVS-SCALAR-SD-XOR-PRECISE-001tests/asl/scalar/amo/SD.XOR/scalar-fault-sd-xor-precise-001.asl876b4d5bd65ad371c57f5d191feab49c738baca33cedb3e77a123d8af3577e0fPTO-AVS-SCALAR-SD-XOR-STORE-001tests/asl/scalar/amo/SD.XOR/scalar-exec-sd-xor-store-only-001.aslbd749f0eadf2cd81b9d94e449ecac5cfe29c435dae6b1330fe415b5336cc7e10PTO-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-0020…
ADR-0020docs/status/decisions/0020-production-memory-events-and-atomic-corners.md215b18f05d0b53120949373fce6a5ce22f7ab534fb22df24743a9b2b4beb2decLoading ADR-0030…
ADR-0030docs/status/decisions/0030-scalar-amo-totality-and-reservation.md110bd32b3004a8383913ac6053cc7d0a1d0b8e03e3ef7c47d83292c94a6a17ebLoading 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": [
"amo"
],
"documentation": "docs/scalar/amo/SD.XOR.md",
"id": "PTO-SCALAR-SD-XOR",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "SD.XOR",
"ndf_clause": "PTO-INST-SCALAR-SD-XOR"
},
"mnemonic": "SD.XOR",
"readiness_subjects": [
"ADR-0020",
"ADR-0030",
"ADR-0059",
"ADR-0084"
],
"semantic_tests": [
"PTO-AVS-SCALAR-SD-XOR-FORMS-001",
"PTO-AVS-SCALAR-SD-XOR-PRECISE-001",
"PTO-AVS-SCALAR-SD-XOR-STORE-001"
],
"source": "asl/scalar/amo/SD.XOR.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-SD-XOR-DECODE-001",
"PTO-AVS-SCALAR-SD-XOR-FORMS-001",
"PTO-AVS-SCALAR-SD-XOR-PRECISE-001",
"PTO-AVS-SCALAR-SD-XOR-STORE-001"
]
}0.58.5 · 候选发布7dc8b7e5b121d2b2499a2273bebff29e2cd8681261db0cfd08eea9d3f0f06de2f1c9d0a50bf9f7e0b0f516d2f044d13a170d520a1642c012100874578e7d92d1370d4724efce81f1d697e923e11403664a8c7bebasl/scalar/amo/SD.XOR.aslasl/scalar/amo/SD.XOR.aslasl/scalar/amo/SD.XOR.asl