Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's called REP MOVSB (or MOVSW, MOVSD, maybe also MOVSQ?). It has existed since the 8086 day; and for reasons I don't know, it supposedly works well for big blocks these days (>1K or so) but is supposedly slower than register moves for small blocks.


> it supposedly works well for big blocks these days (>1K or so) but is supposedly slower than register moves for small blocks.

On current processors with Fast Short REP MOVSB (FSRM), REP MOVSB is the fastest method for all sizes. On processors without FSRM, but with ERMS, REP MOVSB is faster for anything longer than ~128 bytes.


Thanks! Is there a simple rule-of-the-thumb about when can one rely on FSRM?


You should check the corresponding CPUID bit, but in general, Ice Lake and newer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: