--- zzzz-none-000/linux-3.10.107/arch/x86/lib/memmove_64.S 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/x86/lib/memmove_64.S 2021-02-04 17:41:59.000000000 +0000 @@ -5,9 +5,7 @@ * This assembly file is re-written from memmove_64.c file. * - Copyright 2011 Fenghua Yu */ -#define _STRING_C #include -#include #include #include @@ -24,8 +22,10 @@ * Output: * rax: dest */ +.weak memmove + ENTRY(memmove) - CFI_STARTPROC +ENTRY(__memmove) /* Handle more 32 bytes in loop */ mov %rdi, %rax @@ -41,6 +41,8 @@ jg 2f .Lmemmove_begin_forward: + ALTERNATIVE "", "movq %rdx, %rcx; rep movsb; retq", X86_FEATURE_ERMS + /* * movsq instruction have many startup latency * so we handle small size by general register. @@ -203,21 +205,5 @@ movb %r11b, (%rdi) 13: retq - CFI_ENDPROC - - .section .altinstr_replacement,"ax" -.Lmemmove_begin_forward_efs: - /* Forward moving data. */ - movq %rdx, %rcx - rep movsb - retq -.Lmemmove_end_forward_efs: - .previous - - .section .altinstructions,"a" - altinstruction_entry .Lmemmove_begin_forward, \ - .Lmemmove_begin_forward_efs,X86_FEATURE_ERMS, \ - .Lmemmove_end_forward-.Lmemmove_begin_forward, \ - .Lmemmove_end_forward_efs-.Lmemmove_begin_forward_efs - .previous +ENDPROC(__memmove) ENDPROC(memmove)