Instruction
RCL
Rotates an operand left through the carry flag; APX adds a three-operand form.
- Extensions
- Forms
- 36 (12 Legacy, 24 EVEX)
- Data
- Intel XED v2026.08.23
RCL rotates its operand left through the carry flag: CF and the operand form one ring of 9, 17, 33 or 65 bits, so the bit leaving the top goes into CF and the old CF comes in at bit 0. By one bit, it is a shift left that brings CF in, which is how assembly shifts a number wider than a register: SHL on the lowest word, then RCL by 1 on each word above, each taking in the bit the one below pushed out. RCR is its mirror image, and ROL rotates without CF.
A ring one bit wider
The count, 1, an immediate or CL, is masked to 5 bits, or 6 for a 64-bit operand, as for the other shifts and rotates. Since the ring is one bit wider than the operand, the byte and word forms then take it modulo 9 and 17: an RCL of AL by 9 leaves AL and CF as they were. A 32- or 64-bit operand never makes a full turn, and a masked count of 0 changes no flag.
Only CF and OF
Both manuals define OF for a count of 1 alone, as the exclusive or of the result’s top bit and the new CF. In the 99 recorded cases with larger counts, Zen 5 set OF by the same rule, even after a whole turn of the ring, which left the value and CF alone but still changed OF; code should not rely on it.
In compiled code
Neither GCC 14 nor Clang 23 used RCL at -O2 in our builds. For a 128-bit
x << 1, GCC adds each half to itself with ADD and ADC,
and Clang uses SHLD and LEA; a loop shifting an array of words left by
one bit kept the carried bit in a register.
Cost and other forms
AMD’s Zen 5 guide lists RCL with an immediate count as one macro-op with a latency of one cycle, and as microcoded with the count in CL. Intel’s optimization manual names RCL, with MUL and SHLD, among the instructions of the single slow-integer unit of Skylake, Ice Lake and Golden Cove (Tables 2-14, 2-7 and 2-4). APX adds forms with a new destination register, but none that leaves the flags alone.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
RCL m8, imm8
RCL_MEMb_IMMb | C0 /2 ib | Base instruction set |
RCL r8, imm8
RCL_GPR8_IMMb | C0 /2 ib | Base instruction set |
RCL m16/32/64, imm8
RCL_MEMv_IMMb | C1 /2 ib | Base instruction set |
RCL r16/32/64, imm8
RCL_GPRv_IMMb | C1 /2 ib | Base instruction set |
RCL m8, 1
RCL_MEMb_ONE | D0 /2 | Base instruction set |
RCL r8, 1
RCL_GPR8_ONE | D0 /2 | Base instruction set |
RCL m16/32/64, 1
RCL_MEMv_ONE | D1 /2 | Base instruction set |
RCL r16/32/64, 1
RCL_GPRv_ONE | D1 /2 | Base instruction set |
RCL m8, CL
RCL_MEMb_CL | D2 /2 | Base instruction set |
RCL r8, CL
RCL_GPR8_CL | D2 /2 | Base instruction set |
RCL m16/32/64, CL
RCL_MEMv_CL | D3 /2 | Base instruction set |
RCL r16/32/64, CL
RCL_GPRv_CL | D3 /2 | Base instruction set |
RCL r8, imm8
RCL_GPR8i8_IMM8_APX | EVEX.LLZ.NP.MAP4.WIG C0 /2 ib | APX_F |
RCL m8, imm8
RCL_MEMi8_IMM8_APX | EVEX.LLZ.NP.MAP4.WIG C0 /2 ib | APX_F |
RCL r16/32/64, r16/32/64, imm8 NDD
RCL_GPRv_GPRv_IMM8_APX_N3 | EVEX.LLZ.NP.MAP4.SCALABLE C1 /2 ib ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r16/32/64, m16/32/64, imm8 NDD
RCL_GPRv_MEMv_IMM8_APX_N3 | EVEX.LLZ.NP.MAP4.SCALABLE C1 /2 ib ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r8, 1
RCL_GPR8i8_ONE_APX | EVEX.LLZ.NP.MAP4.WIG D0 /2 | APX_F |
RCL m8, 1
RCL_MEMi8_ONE_APX | EVEX.LLZ.NP.MAP4.WIG D0 /2 | APX_F |
RCL r8, r8, 1 NDD
RCL_GPR8i8_GPR8i8_ONE_APX_N3 | EVEX.LLZ.NP.MAP4.WIG D0 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r8, m8, 1 NDD
RCL_GPR8i8_MEMi8_ONE_APX_N3 | EVEX.LLZ.NP.MAP4.WIG D0 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r16/32/64, 1
RCL_GPRv_ONE_APX | EVEX.LLZ.NP.MAP4.SCALABLE D1 /2 | APX_F |
RCL m16/32/64, 1
RCL_MEMv_ONE_APX | EVEX.LLZ.NP.MAP4.SCALABLE D1 /2 | APX_F |
RCL r16/32/64, r16/32/64, 1 NDD
RCL_GPRv_GPRv_ONE_APX_N3 | EVEX.LLZ.NP.MAP4.SCALABLE D1 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r16/32/64, m16/32/64, 1 NDD
RCL_GPRv_MEMv_ONE_APX_N3 | EVEX.LLZ.NP.MAP4.SCALABLE D1 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r8, CL
RCL_GPR8i8_CL_APX | EVEX.LLZ.NP.MAP4.WIG D2 /2 | APX_F |
RCL m8, CL
RCL_MEMi8_CL_APX | EVEX.LLZ.NP.MAP4.WIG D2 /2 | APX_F |
RCL r8, r8, CL NDD
RCL_GPR8i8_GPR8i8_CL_APX_N3 | EVEX.LLZ.NP.MAP4.WIG D2 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r8, m8, CL NDD
RCL_GPR8i8_MEMi8_CL_APX_N3 | EVEX.LLZ.NP.MAP4.WIG D2 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r16/32/64, CL
RCL_GPRv_CL_APX | EVEX.LLZ.NP.MAP4.SCALABLE D3 /2 | APX_F |
RCL m16/32/64, CL
RCL_MEMv_CL_APX | EVEX.LLZ.NP.MAP4.SCALABLE D3 /2 | APX_F |
RCL r16/32/64, r16/32/64, CL NDD
RCL_GPRv_GPRv_CL_APX_N3 | EVEX.LLZ.NP.MAP4.SCALABLE D3 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r16/32/64, m16/32/64, CL NDD
RCL_GPRv_MEMv_CL_APX_N3 | EVEX.LLZ.NP.MAP4.SCALABLE D3 /2 ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r8, r8, imm8 NDD
RCL_GPR8i8_GPR8i8_IMM8_APX_N3 | EVEX.LLZ.NP.MAP4.WIG C0 /2 ib ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r8, m8, imm8 NDD
RCL_GPR8i8_MEMi8_IMM8_APX_N3 | EVEX.LLZ.NP.MAP4.WIG C0 /2 ib ND=1 | APX_F + APX_NCI_NDD_NF |
RCL r16/32/64, imm8
RCL_GPRv_IMM8_APX | EVEX.LLZ.NP.MAP4.SCALABLE C1 /2 ib | APX_F |
RCL m16/32/64, imm8
RCL_MEMv_IMM8_APX | EVEX.LLZ.NP.MAP4.SCALABLE C1 /2 ib | APX_F |
Latency and throughput
| Model | m8, imm8 | r8, imm8 | m16, imm8m32, imm8m64, imm8 | r16, imm8 | r32, imm8r64, imm8 | m8, 1 | r8, 1r16, 1r32, 1r64, 1 | m16, 1m32, 1m64, 1 | m8, CL | r8, CL | m16, CLm32, CLm64, CL | r16, CL | r32, CLr64, CL |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sandy Bridge | 11 / 3.5p05 | 4 / 2.67p015 | 11 / 3.5p05 | 4 / 2.67p015 | 4 / 2.67p015 | 11 / 3.5p05 | 2 / 1p015 | 11 / 3.5p05 | 11 / 3.5p05 | 5 / 4p05 | 11 / 3.5p05 | 5 / 4p05 | 5 / 4p05 |
| Haswell | 9 / 0.75p0156 | 6 / 2p0156 | 9 / 0.75p0156 | 6 / 2p0156 | 6 / 2p0156 | 9 / 0.75p0156 | 2 / 0.75p0156 | 9 / 0.75p0156 | 16 / 2p0156 | 11 / 2.25p0156 | 16 / 2p0156 | 11 / 2p0156 | 11 / 2p0156 |
| Broadwell | 8 / 0.75p0156 | 6 / 2p0156 | 8 / 0.75p0156 | 6 / 2p0156 | 6 / 2p0156 | 8 / 0.75p0156 | 2 / 0.75p0156 | 8 / 0.75p0156 | 15 / 2p0156 | 11 / 2.25p0156 | 15 / 2p0156 | 11 / 2p0156 | 11 / 2p0156 |
| Skylake, Skylake-SP, Ice Lake | 8 / 0.75p0156 | 6 / 2p0156 | 8 / 0.75p0156 | 6 / 2p0156 | 6 / 2p0156 | 8 / 0.75p0156 | 2 / 0.75p0156 | 8 / 0.75p0156 | 15 / 2.5p0156 | 11 / 2.5p0156 | 15 / 2.5p0156 | 11 / 2p0156 | 11 / 2p0156 |
| Alder Lake, Sapphire Rapids | 13 / 1p0 p1 p5 p6 p11 | 2 / 1p0 p1 p5 p6 p11 | 12 / 1p0 p1 p5 p6 p11 | 2 / 1p0 p1 p5 p6 p11 | 2 / 1p0 p1 p5 p6 p11 | 13 / 1p0 p1 p5 p6 p11 | 2 / 1p0 p1 p5 p6 p11 | 12 / 1p0 p1 p5 p6 p11 | 20 / 2.5p0 p1 p5 p6 p11 | 7 / 2.5p0 p1 p5 p6 p11 | 19 / 2p0 p1 p5 p6 p11 | 8 / 2p0 p1 p5 p6 p11 | 8 / 2p0 p1 p5 p6 p11 |
| Lunar Lake | 13 / 0.67p012345 | 2 / 0.67p012345 | 12 / 0.67p012345 | 2 / 0.67p012345 | 2 / 0.67p012345 | 13 / 0.67p012345 | 2 / 0.67p012345 | 12 / 0.67p012345 | 20 / 1.67p012345 | 7 / 1.67p012345 | 19 / 1.67p012345 | 8 / 1.17p012345 | 8 / 1.17p012345 |
| Bonnell | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 | 1 / 1p0 |
| Silvermont | 4 / 2IEC0 MEC | 1 / 1IEC0 | 4 / 2IEC0 MEC | 1 / 1IEC0 | 1 / 1IEC0 | 4 / 2IEC0 MEC | 1 / 1IEC0 | 4 / 2IEC0 MEC | 4 / 2IEC0 MEC | 1 / 1IEC0 | 4 / 2IEC0 MEC | 1 / 1IEC0 | 1 / 1IEC0 |
| Piledriver | 5 / 2EX0 EX1 | 13 / 12.5EX0 EX1 | 5 / 2EX0 EX1 | 11 / 10.5EX0 EX1 | 8 / 7.5EX0 EX1 | 5 / 2EX0 EX1 | 1 / 1EX0 EX1 | 5 / 2EX0 EX1 | 5 / 2EX0 EX1 | 12 / 12EX0 EX1 | 5 / 2EX0 EX1 | 10 / 10EX0 EX1 | 7 / 7EX0 EX1 |
| Zen, Zen 2 | 100 / 0.25 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 100 / 0.25 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 100 / 0.25 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 100 / 0.25 | 100 / 0.25 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 100 / 0.25 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 |
| Zen 3, Zen 4 | 8 / 4ALU1 ALU2 | 4 / 4ALU1 ALU2 | 8 / 4ALU1 ALU2 | 4 / 4ALU1 ALU2 | 4 / 4ALU1 ALU2 | 5 / 1ALU1 ALU2 | 1 / 1ALU1 ALU2 | 5 / 1ALU1 ALU2 | 8 / 4ALU1 ALU2 | 4 / 4ALU1 ALU2 | 8 / 4ALU1 ALU2 | 4 / 4ALU1 ALU2 | 4 / 4ALU1 ALU2 |
| Jaguar | 4 / 1ALU0 ALU1 | 1 / 0.5ALU0 ALU1 | 4 / 1ALU0 ALU1 | 1 / 0.5ALU0 ALU1 | 1 / 0.5ALU0 ALU1 | 4 / 1ALU0 ALU1 | 1 / 0.5ALU0 ALU1 | 4 / 1ALU0 ALU1 | 4 / 1ALU0 ALU1 | 1 / 0.5ALU0 ALU1 | 4 / 1ALU0 ALU1 | 1 / 0.5ALU0 ALU1 | 1 / 0.5ALU0 ALU1 |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
a = dest.read()
n = count & (0x3F if OSIZE == 64 else 0x1F) # the count is masked,
k = n % (OSIZE + 1) # then taken modulo OSIZE + 1: CF is a
# bit of the rotation (9 for 8 bits)
x = cf << OSIZE | a # CF above the operand
y = x << k | x >> (OSIZE + 1 - k)
r = low(y)
if n != 0: # a count of 0 changes no flag
c = y >> OSIZE & 1 # the bit rotated out of the top;
cf = c # CF as it was when k is 0
of = msb(r) ^ c if n == 1 else UNDEFINED
dest.write(r) # even for a count of 0, a 32-bit register
# gets bits 63:32 cleared
Run on AMD Zen 5 (EPYC 9645): 229 cases. The APX forms were not run: none of these processors has APX.
a = src.read()
n = count & (0x3F if OSIZE == 64 else 0x1F) # the count is masked,
k = n % (OSIZE + 1) # then taken modulo OSIZE + 1: CF is a
# bit of the rotation (9 for 8 bits)
x = cf << OSIZE | a # CF above the operand
y = x << k | x >> (OSIZE + 1 - k)
r = low(y)
if n != 0: # a count of 0 changes no flag
c = y >> OSIZE & 1 # the bit rotated out of the top;
cf = c # CF as it was when k is 0
of = msb(r) ^ c if n == 1 else UNDEFINED
dest.write(r) # the new destination: bits 63:OSIZE
# cleared, even for 8 and 16 bits
Not run on a processor: none of these processors has APX.
Operands
| Operand | Kind | Action |
|---|---|---|
RCL r/m8, imm8 RCL r/m16/32/64, imm8 | ||
r/m8/16/32/64 | explicit | read, write |
imm8 | explicit | read |
RFLAGS | implicit | read, write |
RCL r/m8, 1 RCL r/m16/32/64, 1 | ||
r/m8/16/32/64 | explicit | read, write |
1 | explicit | read |
RFLAGS | implicit | read, write |
RCL r/m8, CL RCL r/m16/32/64, CL | ||
r/m8/16/32/64 | explicit | read, write |
CL | explicit | read |
RFLAGS | implicit | read, conditional write |
RCL r8, r/m8, imm8 NDD RCL r16/32/64, r/m16/32/64, imm8 NDD | ||
r8/16/32/64 | explicit | write |
r/m8/16/32/64 | explicit | read |
imm8 | explicit | read |
RFLAGS | implicit | read, write |
RCL r8, r/m8, 1 NDD RCL r16/32/64, r/m16/32/64, 1 NDD | ||
r8/16/32/64 | explicit | write |
r/m8/16/32/64 | explicit | read |
1 | explicit | read |
RFLAGS | implicit | read, write |
RCL r8, r/m8, CL NDD RCL r16/32/64, r/m16/32/64, CL NDD | ||
r8/16/32/64 | explicit | write |
r/m8/16/32/64 | explicit | read |
CL | explicit | read |
RFLAGS | implicit | read, conditional write |
Flags
| When | OF | CF |
|---|---|---|
RCL r/m8, imm8 RCL r/m16/32/64, imm8 RCL r8, r/m8, imm8 NDD RCL r16/32/64, r/m16/32/64, imm8 NDD | ||
| count 1 | M | TM |
| count 2 or more | U | TM |
RCL r/m8, 1 RCL r/m16/32/64, 1 RCL r8, r/m8, 1 NDD RCL r16/32/64, r/m16/32/64, 1 NDD | ||
| M | TM | |
RCL r/m8, CL RCL r/m16/32/64, CL RCL r8, r/m8, CL NDD RCL r16/32/64, r/m16/32/64, CL NDD | ||
| in some cases | U | TM |
Exceptions
The exception class is XED's name for the set of exception conditions that a form follows. How to read.
- Legacy forms
- none in XED
- EVEX forms
APX-EVEX-INT
CPUID and processors
Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.
| ISA set | CPUID | Processors |
|---|---|---|
I186 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
I86 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
APX_F | APX_F | Nova Lake, Diamond Rapids |
APX_F_N3 | APX_F + APX_NCI_NDD_NF | Same as APX_F |
More General-purpose instructions
- LSS
- MOV
- MOVS
- MOVSX
- MOVSXD
- MOVZX
- MUL
- NEG
- NOP
- NOT
- OR
- OUT
- OUTS
- PAUSE
- POP
- POPA
- POPF
- PUSH
- PUSHA
- PUSHF
- RCR
- RET
- ROL
- ROR
- SALC
- SAR
- SBB
- SCAS
- SETcc
- SHL
- SHLD
- SHR
- SHRD
- STC
- STD
- STI
- STOS
- SUB
- TEST
- UD0
All 109 General-purpose instructions
More APX instructions
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-533 (RCL/
RCR/ ROL/ ROR) - Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 2026)
- AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
- Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
- Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP
The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.