The Chip Letter

The Chip Letter

Share this post

The Chip Letter
The Chip Letter
The Long History of REP MOVS
Copy link
Facebook
Email
Notes
More

The Long History of REP MOVS

The complexity of copying data on x86 microprocessors

Babbage's avatar
Babbage
May 21, 2023
∙ Paid
5

Share this post

The Chip Letter
The Chip Letter
The Long History of REP MOVS
Copy link
Facebook
Email
Notes
More
Share
Not Copies! The Intel Pentium Pro improved the performance of the REP MOVS and similar Instructions. Klaus Eifert, CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0>, via Wikimedia Commons

What’s the best way to copy a block of data from one memory location to another on a modern x86 processor?

Perhaps surprisingly, this isn’t a simple question to answer.

Even in 2023, Linus Torvalds himself has felt it necessary to roll up his sleeves and make some changes to improve the implementation of data copying on x86 processors in the Linux kernel.

The choices are between what might be called a RISCy approach and a CISCy approach. Or in other words, between using lots of simple instructions or a small number of complex instructions.

This all sheds some interesting insights into the evolution of the x86 architecture and how complex decisions to optimize code can be.

We’ll start by looking at one x86 instruction that can be used to copy data.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 The Chip Letter
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More