Operands and parameters
SrcL- Reg5 atomic address source
SrcR- Reg5 atomic operand source
far- flat-address routing hint
rl- release ordering bit
SW.XOR atomically replaces the aligned 32-bit memory value with its bitwise XOR with SrcR; it does not publish the old value.
PTO-SCALAR-SW-XORsw.xor [SrcL], SrcRsw.xor.rl [SrcL], SrcRsw.xor.f [SrcL], SrcRsw.xor.rlf [SrcL], SrcR| Field | Bits | Signedness | Architectural role | Encoded zero |
|---|---|---|---|---|
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'b011000000001011 |
{
"reg": [
{
"bits": 15,
"name": "15'b011000000001011"
},
{
"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
}
}sw.xor<.{rl, f, rlf}> [SrcL], SrcR
SrcLSrcRfarrlThis Operation comes directly from the instruction owner; the page does not rewrite its behavior.
readonly func InstructionContractOperation_SW_XOR() => ScalarOperationbegin return ScalarOperation_SW_XOR;end;readonly func InstructionContractHandler_SW_XOR() => ScalarSemanticHandlerbegin return ScalarHandler_AtomicReadModifyWrite;end;
pure func InstructionContractAtomicOperation_SW_XOR() => AtomicOperationbegin return Atomic_XOR;end;
pure func InstructionContractAtomicSizeBytes_SW_XOR() => integer {1,2,4,8}begin return 4;end;
pure func InstructionContractPublishesOldValue_SW_XOR() => booleanbegin return FALSE;end;// PTO-INSTRUCTION: {"assembly":["sw.xor<.{rl, f, rlf}> [SrcL], SrcR"],"block":[],"catalog_indices":[450],"catalog_records":[{"asm":"sw.xor<.{rl, f, rlf}> [SrcL], SrcR","constraints":[],"encoding":[{"index":0,"mask":"0xf4007fff","match":"0x3000300b","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":"sw_xor_32_874c32572226","length_bits":32,"mnemonic":"SW.XOR","semantic_family":"AMO","semantic_group":"AMO","semantic_handler":"AtomicReadModifyWrite","semantic_summary":"SW.XOR atomically replaces the aligned 32-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":["sw.xor [SrcL], SrcR","sw.xor.rl [SrcL], SrcR","sw.xor.f [SrcL], SrcR","sw.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":["sw.xor [a0], a1","sw.xor.rl [t#1], u#1","sw.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 4 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 4-byte little-endian value, compute the bitwise XOR, and write one 4-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.","SW.XOR computes the bitwise XOR of the old value and operand at 32-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-SW-XOR","mnemonic":"SW.XOR","summary":"SW.XOR atomically replaces the aligned 32-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-SW-XOR-ADR-CONTRACT-001// ndf: kind=contract level=L1 layer=scalar status=accepted// Decisions: ADR-0030.// SW.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-SW-XOR-ADR-CONTRACT-001// DOC-BEGIN: decodereadonly func InstructionContractOperation_SW_XOR() => ScalarOperationbegin return ScalarOperation_SW_XOR;end;// DOC-END: decode// DOC-BEGIN: operationreadonly func InstructionContractHandler_SW_XOR() => ScalarSemanticHandlerbegin return ScalarHandler_AtomicReadModifyWrite;end;
pure func InstructionContractAtomicOperation_SW_XOR() => AtomicOperationbegin return Atomic_XOR;end;
pure func InstructionContractAtomicSizeBytes_SW_XOR() => integer {1,2,4,8}begin return 4;end;
pure func InstructionContractPublishesOldValue_SW_XOR() => booleanbegin return FALSE;end;// DOC-END: operation
SW.XOR atomically applies bitwise XOR to one word and stores the result without publishing the old value.
The ASL DOC contract selects ScalarHandler_AtomicReadModifyWrite with an access width of 4 bytes.
Read and write access are preflighted before the same-location atomic read-modify-write is allowed to commit.
SrcL carries the Reg5 atomic address source; SrcR carries the Reg5 atomic operand source; far carries the flat-address routing hint; rl carries the release ordering bit.
rl selects relaxed or release ordering; this form has no acquire bit; far is a profile routing hint and does not change the architectural result in the reference profile.
This store-only form has no destination field; successful commit updates memory and emits one atomic event.
A completed write invalidates an overlapping local 64-byte-line reservation, preserves a nonoverlapping reservation, and advances TPC by 4 bytes.
The effective address must be aligned to 4 bytes. Alignment, translation, and permission checks precede architectural effects.
A failing preflight publishes no destination, memory event, reservation update, or retirement effect; the saved original TPC supports full reissue.
This example only shows one accepted spelling; the generated contract below remains authoritative.
For a first reading, use sw.xor [SrcL], SrcR and then vary only the ordering or route modifiers described above.
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
Decisions: ADR-0030. SW.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-SW-XOR-ADR-CONTRACT-001asl/scalar/amo/SW.XOR.asla9f6e6bde64556bc0ca19313681753f847c65cb34d5653e1068144e7f5d3e0aa0337eb2c32312150ec7ffb9927c5caf332dbb8758a7acbc3ea6320fb8d6d846c13 matching entries
PTO-AVS-SCALAR-SW-XOR-DECODE-001tests/asl/scalar/amo/SW.XOR/scalar-decode-sw-xor-canonical-001.aslc20aece432db7162ba96a590d198e2a38ef26c38bc45f575e79f0fc8ac6c5527PTO-AVS-SCALAR-SW-XOR-FORMS-001tests/asl/scalar/amo/SW.XOR/scalar-bound-sw-xor-forms-001.asl12de02b09549cdad0f33ed81692f846786da5bf0131dee01e9db288be032aa2cPTO-AVS-SCALAR-SW-XOR-PRECISE-001tests/asl/scalar/amo/SW.XOR/scalar-fault-sw-xor-precise-001.aslaba13c9468fa6517073f4e5f7c50dfef54b43d1deaf0c01d1b8c8bd95ce31c99PTO-AVS-SCALAR-SW-XOR-STORE-001tests/asl/scalar/amo/SW.XOR/scalar-exec-sw-xor-store-only-001.asl9d2a1b23c06287be7f10a901ce82297ebeab4cd4e9a5c130a39e83b112902739PTO-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/SW.XOR.md",
"id": "PTO-SCALAR-SW-XOR",
"instruction_contract": {
"artifact": "spec/evidence/instruction-contract-closure.json",
"mnemonic": "SW.XOR",
"ndf_clause": "PTO-INST-SCALAR-SW-XOR"
},
"mnemonic": "SW.XOR",
"readiness_subjects": [
"ADR-0020",
"ADR-0030",
"ADR-0059",
"ADR-0084"
],
"semantic_tests": [
"PTO-AVS-SCALAR-SW-XOR-FORMS-001",
"PTO-AVS-SCALAR-SW-XOR-PRECISE-001",
"PTO-AVS-SCALAR-SW-XOR-STORE-001"
],
"source": "asl/scalar/amo/SW.XOR.asl",
"surface": "scalar",
"tests": [
"PTO-AVS-SCALAR-SW-XOR-DECODE-001",
"PTO-AVS-SCALAR-SW-XOR-FORMS-001",
"PTO-AVS-SCALAR-SW-XOR-PRECISE-001",
"PTO-AVS-SCALAR-SW-XOR-STORE-001"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd86812a9f6e6bde64556bc0ca19313681753f847c65cb34d5653e1068144e7f5d3e0aa3deba5dcb9cfb410fcb856521c36dab0bc25cf5e91ad6ad367b4e4f01a465ed2asl/scalar/amo/SW.XOR.aslasl/scalar/amo/SW.XOR.aslasl/scalar/amo/SW.XOR.asl