Extensions
Mnemonics
OUTS, OUTSB, OUTSW, OUTSD
Forms
6 (6 Legacy)
Data
Intel XED v2026.08.23

OUTS writes one element, a byte, word or doubleword, from [RSI] to the I/O port in DX, then moves RSI to the next element: up while the direction flag is clear, down while it is set. With a REP prefix it repeats RCX times, so rep outsw sends a buffer to a device’s data port, which OUT would do one register at a time. INS runs the other way; its page covers what the two share, including Intel’s caution about devices that cannot keep up.

What is particular to OUTS

  • The segment may change. The source is DS:rSI, and a segment prefix replaces DS, where INS’s ES is fixed. In 64-bit mode DS adds nothing, but an FS or GS prefix adds that segment’s base.
  • No quadword. With REX.W the element is still a doubleword, both manuals say, and RSI steps by 4.
  • The port first. The permission check of OUT comes before the read of memory. At CPL 3 with IOPL 0, Zen 5 raised #GP for OUTSB, OUTSW and OUTSD, with REX.W, in the REP forms with RCX = 0, and with RSI = 8, in page 0, which the probe leaves unmapped, where a page fault might have been expected. RSI, RCX and memory were left alone.
  • Not buffered. Intel’s Volume 1 treats OUTS and REP OUTS as OUT: the next instruction waits until the write and every earlier store have completed (Table 20-1).
  • Stopping half way. An interrupt or exception during REP OUTS leaves RSI and RCX at the next element, so that the run resumes where it stopped. Intel’s Volume 3 adds that an I/O breakpoint on the port fires after the first element.

From C

glibc’s <sys/io.h> has outsb, outsw and outsl, which take a port, a buffer and a count. At -O2, GCC 14 and Clang 23 move the count into RCX and the port into EDX, while the buffer, the second argument, already arrives in RSI; the inline assembly then emits CLD and REP OUTSW, clearing the direction flag itself (see CLD). AMD’s Zen 5 guide lists OUTS as microcoded.

Forms

Every encoding of OUTS that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
OUTSB OUTSB6EBase instruction set
OUTSW OUTSW66 6FBase instruction set
OUTSD OUTSD6F
REX.W 6F
Base instruction set
REP OUTSB REP_OUTSBF3 6E
F2 6E
Base instruction set
REP OUTSW REP_OUTSW66 F3 6F
66 F2 6F
Base instruction set
REP OUTSD REP_OUTSDF3 6F
F3 REX.W 6F
F2 6F
F2 REX.W 6F
Base instruction set

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
ModelOUTSB
OUTSB
OUTSW
OUTSW
OUTSD
OUTSD
Sandy Bridge100 / 0.33p015100 / 0.33p015100 / 0.33p015
Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake100 / 0.25p0156100 / 0.25p0156100 / 0.25p0156
Alder Lake, Sapphire Rapids100 / 17p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11100 / 18p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11100 / 20p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11
Lunar Lake100 / 0.17p012345100 / 0.17p012345100 / 0.17p012345
Bonnell74 / 37p0174 / 37p0174 / 37p01
Silvermont100 / 1FPC0100 / 1FPC0100 / 1FPC0
Piledriver100 / 0.5EX0 EX1100 / 0.5EX0 EX1100 / 0.5EX0 EX1
Zen, Zen 2100 / 0.25100 / 0.25100 / 0.25
Zen 3, Zen 4100 / 25ALU0 ALU1 ALU2 ALU3100 / 25ALU0 ALU1 ALU2 ALU3100 / 25ALU0 ALU1 ALU2 ALU3
Jaguar100 / 0.5ALU0 ALU1100 / 0.5ALU0 ALU1100 / 0.5ALU0 ALU1

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

All forms but the REP forms
n = min(OSIZE, 32)               # REX.W: still a doubleword
if CPL > iopl and not io_allowed(dx, n):
    fault(GP, 0)                 # as in the probe's cases: CPL 3,
                                 # IOPL 0, the port not allowed
io_write(dx, n, load(aSI, n))    # DS:rSI; an FS or GS prefix adds
                                 # that segment's base
step = -(n // 8) if df else n // 8
aSI = low(aSI + step, ASIZE)

Run on AMD Zen 5 (EPYC 9645): 9 cases. Every one raised an exception, at CPL 3, where the probe runs.

REP forms
n = min(OSIZE, 32)               # REX.W: still a doubleword
if CPL > iopl and not io_allowed(dx, n):
    fault(GP, 0)                 # even when aCX is 0 (Zen 5)
step = -(n // 8) if df else n // 8
s = aSI
for i in range(aCX):             # one port write per element
    io_write(dx, n, load(s, n))
    s = low(s + step, ASIZE)
aSI = s
aCX = 0

Run on AMD Zen 5 (EPYC 9645): 10 cases. Every one raised an exception, at CPL 3, where the probe runs.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
OUTSB OUTSW OUTSD
DXimplicitread
m8/16/32 at [rSI]implicitread
rSIimplicitread, write
RFLAGSimplicitread
REP OUTSB REP OUTSW REP OUTSD
DXimplicitread
m8/16/32 at [rSI]implicitconditional read
rSIimplicitread, conditional write
rCXimplicitread, conditional write
RFLAGSimplicitread

Flags

T tested; blank: not affected. How to read.
DFIOPL
All forms
TT

Attributes

What else XED records about the forms. How to read.

All forms
may abort a TSX transaction
REP forms
repeated: count in rCX

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.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
I186

No CPUID bit: part of the base instruction set.

Every x86-64 processor in XED’s model and Zen 3 to Zen 6
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

All 109 General-purpose instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-173 (OUTS/OUTSB/OUTSW/OUTSD)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  6. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (325384-093, September 2026)
  7. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  8. 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.