We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb939ea commit 844b730Copy full SHA for 844b730
src/mem/x86_64.rs
@@ -1,5 +1,15 @@
1
use super::c_int;
2
3
+// On recent Intel processors, "rep movsb" and "rep stosb" have been enhanced to
4
+// select the best microarchitecural implemenetation based on length and
5
+// alignment. This allows for very fast memcmp/memset implementations.
6
+// See "Intel® 64 and IA-32 Architectures Optimization Reference Manual"
7
+// - Enhanced REP MOVSB and STOSB operation (ERMSB) (section 3.7.7)
8
+// - Fast Short REP MOV (FSRM)
9
+//
10
+// While the "rep cmpsb" instructions have not seen similar optimizations, they
11
+// are still faster than our simple fallback implementations for memcmp/bcmp.
12
+
13
#[inline(always)]
14
unsafe fn copy_forward(dest: *mut u8, src: *const u8, count: usize) {
15
asm!(
0 commit comments