Instruction
LSS
Loads a far pointer from memory into a register and SS, switching the stack segment and pointer with one instruction.
- Extensions
- Forms
- 1 (1 Legacy)
- Data
- Intel XED v2026.08.23
LSS, 0F B2, loads a far pointer from memory, an offset and then a 16-bit selector, into a general register and SS. It is LFS with SS as the segment register, and that page covers the pointer’s sizes, the merge of a 16-bit offset into the low word and the zero-extension of a 32-bit one, which Zen 5 also showed for LSS, and the REX.W form: Intel’s manual reads an 80-bit pointer, AMD’s supports none. Given 2Bh at byte 4 and 0003h at byte 8, where an 80-bit pointer keeps its selector, Zen 5 loaded 2Bh with REX.W: it read 48 bits, as for LFS.
A stack in one instruction
Both vendors’ manuals point to LSS for setting up a stack: it loads SS and the stack pointer in one instruction. A MOV to SS followed by a MOV to ESP relies instead on the processor holding off interrupts for one instruction after the MOV to SS, which AMD’s manual describes, so that none arrives between the two.
Stricter than LFS
A selector for SS must point to a writable data segment whose DPL and RPL both equal the CPL, and a null selector is refused at CPL 3. Zen 5, at CPL 3, loaded only 2Bh, the user data segment of Linux’s GDT, among the selectors that LFS accepted. It raised #GP, with SS unchanged, for the null selector 0003h, 28h (the same segment with RPL 0), the code segments 33h and 23h, 7Bh, a read-only segment, the kernel’s 18h, an empty TLS entry 63h, 83h past the GDT’s end, and 2Fh in a missing LDT.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
LSS r16/32/64, m16:16/32/64
LSS_GPRv_MEMp2 | 0F B2 /r | Base instruction set |
Latency and throughput
| Model | r16, m16:16/32/64r32, m16:16/32/64r64, m16:16/32/64 |
|---|---|
| Sandy Bridge | 100 / 0.33p015 |
| Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake, Alder Lake, Sapphire Rapids | 100 / 0.25p0156 |
| Lunar Lake | 100 / 0.17p012345 |
| Bonnell | 100 / 0.5p1 |
| Silvermont | 100 / 1FPC0 |
| Piledriver | 100 / 0.5EX0 EX1 |
| Zen, Zen 2 | 100 / 0.25 |
| Zen 3, Zen 4 | 100 / 25ALU0 ALU1 ALU2 ALU3 |
| Jaguar | 100 / 0.5ALU0 ALU1 |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
n = OSIZE # the offset's size
if OSIZE == 64: # REX.W: m16:64 on Intel's (SDM
# Volume 2A, LDS/LES/LFS/LGS/LSS,
# rev. 093)
if AMD:
n = 32 # no m16:64, but m16:32 (APM Volume
# 3, LFS and Table B-1, rev. 3.36;
# Zen 5)
off = load(src.address, n) # the offset, then the selector
sel = load(src.address + n // 8, 16)
load_segment(ss, sel) # a writable data segment of DPL and
# RPL = CPL: at CPL 3, never null
dest.write(off) # REX.W on AMD's: bits 63:32 cleared
Run on AMD Zen 5 (EPYC 9645): 15 cases. Its branches for Intel's processors were not run: no Intel processor ran these forms.
Operands
| Operand | Kind | Action |
|---|---|---|
LSS r16/32/64, m16:16/32/64 | ||
r16/32/64 | explicit | write |
m16:16/32/64 | explicit | read |
SS | implicit | write |
Flags
None: XED records no flag that the forms test or change.
Attributes
What else XED records about the forms. How to read.
- All forms
- may abort a TSX transaction
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 |
|---|---|---|
I386 | No CPUID bit: part of the base instruction set. | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More General-purpose 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 2A, page 3-540 (LDS/
LES/ LFS/ LGS/ LSS) - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (325384-093, September 2026)
- AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
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.