XCHG (R64, R64)
Summary:
"Exchange Register/Memory with Register"
Reference:
https://www.felixcloutier.com/x86/XCHG.html
Extension:
BASE
Category:
DATAXFER
ISA-Set:
I86
CPL:
3
iform:
XCHG_GPRv_GPRv
iclass:
XCHG
ASM:
XCHG
Operands
Operand 1 (r/w): Register (RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15)
Operand 2 (r/w): Register (RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15)
Available performance data
Alder Lake-P
Alder Lake-E
Rocket Lake
Tiger Lake
Ice Lake
Cascade Lake
Cannon Lake
Skylake-X
Coffee Lake
Kaby Lake
Skylake
Broadwell
Haswell
Ivy Bridge
Sandy Bridge
Westmere
Nehalem
Wolfdale
Conroe
Tremont
Goldmont Plus
Goldmont
Airmont
Bonnell
AMD Zen 4
AMD Zen 3
AMD Zen 2
AMD Zen+
Alder Lake-P
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.60
Measured (loop):
0.62
Measured (unrolled):
0.96
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (3 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156B
Alder Lake-E
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Measured (loop):
3.07
Measured (unrolled):
3.56
Number of μops
Executed: 3
Microcode Sequencer (MS): 3
Requires the complex decoder
Rocket Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Tiger Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Ice Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Cascade Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Cannon Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Skylake-X
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
IACA 2.3
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
IACA 3.0
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
Coffee Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Kaby Lake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
Skylake
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (2 other instructions can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
IACA 2.3
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
IACA 3.0
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
Broadwell
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (no other instruction can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
IACA 2.2
Throughput
Computed from the port usage: 0.25
IACA:
0.25 (with the -no_interiteration flag: 0.25)
Number of μops:
1
Port usage:
1*p0156
IACA 2.3
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
IACA 3.0
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
Haswell
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 0.75
Measured (loop):
0.75
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (no other instruction can be decoded with simple decoders in the same cycle)
Port usage:
3*p0156
IACA 2.1
Latency:
3
Throughput
Computed from the port usage: 0.75
IACA:
0.78 (with the -no_interiteration flag: 0.75)
Number of μops:
3
Port usage:
3*p0156
IACA 2.2
Throughput
Computed from the port usage: 0.25
IACA:
0.25 (with the -no_interiteration flag: 0.25)
Number of μops:
1
Port usage:
1*p0156
IACA 2.3
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
IACA 3.0
Throughput
Computed from the port usage: 0.25
IACA:
0.25
Number of μops:
1
Port usage:
1*p0156
Ivy Bridge
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (no other instruction can be decoded with simple decoders in the same cycle)
Port usage:
3*p015
IACA 2.3
Throughput
IACA:
0.00
Number of μops:
0
Sandy Bridge
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Decoded (MITE): 3
Microcode Sequencer (MS): 0
Requires the complex decoder (no other instruction can be decoded with simple decoders in the same cycle)
Port usage:
3*p015
IACA 2.3
Throughput
IACA:
0.00
Number of μops:
0
Westmere
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
0
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Microcode Sequencer (MS): 0
Requires the complex decoder
Port usage:
3*p015
Nehalem
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
0
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Retire slots: 3
Microcode Sequencer (MS): 0
Requires the complex decoder
Port usage:
3*p015
Wolfdale
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
2
Latency operand 2 → 1:
2
Latency operand 2 → 2:
0
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Port usage:
3*p015
Conroe
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
2
Latency operand 2 → 1:
2
Latency operand 2 → 2:
0
Throughput
Computed from the port usage: 1.00
Measured (loop):
1.00
Measured (unrolled):
1.00
Number of μops
Executed: 3
Port usage:
3*p015
Tremont
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
1
Latency operand 2 → 2:
1
Throughput
Measured (loop):
4.02
Measured (unrolled):
4.00
Number of μops
Executed: 3
Microcode Sequencer (MS): 3
Requires the complex decoder
Goldmont Plus
Measurements
Latencies
Latency operand 1 → 1:
2
Latency operand 1 → 2:
1
Latency operand 2 → 1:
2
Latency operand 2 → 2:
1
Throughput
Measured (loop):
4.00
Measured (unrolled):
4.00
Number of μops
Executed: 3
Microcode Sequencer (MS): 3
Requires the complex decoder
Goldmont
Measurements
Latencies
Latency operand 1 → 1:
1
Latency operand 1 → 2:
1
Latency operand 2 → 1:
3
Latency operand 2 → 2:
2
Throughput
Measured (loop):
1.20
Measured (unrolled):
4.00
Number of μops
Executed: 3
Microcode Sequencer (MS): 3
Requires the complex decoder
Airmont
Measurements
Latencies
Latency operand 1 → 1:
3
Latency operand 1 → 2:
3
Latency operand 2 → 1:
3
Latency operand 2 → 2:
3
Throughput
Measured (loop):
1.80
Measured (unrolled):
5.00
Number of μops
Executed: 3
Microcode Sequencer (MS): 3
Requires the complex decoder
Bonnell
Measurements
Latencies
Latency operand 1 → 1:
4
Latency operand 1 → 2:
4
Latency operand 2 → 1:
4
Latency operand 2 → 2:
4
Throughput
Measured (loop):
6.00
Measured (unrolled):
6.00
Number of μops
Executed: 3
Microcode Sequencer (MS): 3
Requires the complex decoder
AMD Zen 4
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
0
Latency operand 2 → 1:
0
Latency operand 2 → 2:
0
Throughput
Measured (loop):
0.33
Measured (unrolled):
0.33
Number of μops
Executed: 2
AMD Zen 3
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
0
Latency operand 2 → 1:
0
Latency operand 2 → 2:
0
Throughput
Measured (loop):
0.33
Measured (unrolled):
0.33
Number of μops
Executed: 2
Documentation
Latency: 1
Throughput: 2.00
Number of μops: 2
AMD Zen 2
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
0
Latency operand 2 → 1:
0
Latency operand 2 → 2:
0
Throughput
Measured (loop):
0.33
Measured (unrolled):
0.33
Number of μops
Executed: 2
Documentation
Latency: 1
Throughput: 2.00
Number of μops: 2
AMD Zen+
Measurements
Latencies
Latency operand 1 → 1:
0
Latency operand 1 → 2:
0
Latency operand 2 → 1:
0
Latency operand 2 → 2:
0
Throughput
Measured (loop):
0.36
Measured (unrolled):
0.33
Number of μops
Executed: 2
Documentation
Latency: 1
Throughput: 2.00
Number of μops: 2