~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to arch/x86/lib/memmove_64.S

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#define _STRING_C
9
9
#include <linux/linkage.h>
10
10
#include <asm/dwarf2.h>
 
11
#include <asm/cpufeature.h>
11
12
 
12
13
#undef memmove
13
14
 
24
25
 */
25
26
ENTRY(memmove)
26
27
        CFI_STARTPROC
 
28
 
27
29
        /* Handle more 32bytes in loop */
28
30
        mov %rdi, %rax
29
31
        cmp $0x20, %rdx
31
33
 
32
34
        /* Decide forward/backward copy mode */
33
35
        cmp %rdi, %rsi
34
 
        jb      2f
 
36
        jge .Lmemmove_begin_forward
 
37
        mov %rsi, %r8
 
38
        add %rdx, %r8
 
39
        cmp %rdi, %r8
 
40
        jg 2f
35
41
 
 
42
.Lmemmove_begin_forward:
36
43
        /*
37
44
         * movsq instruction have many startup latency
38
45
         * so we handle small size by general register.
78
85
        rep movsq
79
86
        movq %r11, (%r10)
80
87
        jmp 13f
 
88
.Lmemmove_end_forward:
 
89
 
81
90
        /*
82
91
         * Handle data backward by movsq.
83
92
         */
194
203
13:
195
204
        retq
196
205
        CFI_ENDPROC
 
206
 
 
207
        .section .altinstr_replacement,"ax"
 
208
.Lmemmove_begin_forward_efs:
 
209
        /* Forward moving data. */
 
210
        movq %rdx, %rcx
 
211
        rep movsb
 
212
        retq
 
213
.Lmemmove_end_forward_efs:
 
214
        .previous
 
215
 
 
216
        .section .altinstructions,"a"
 
217
        .align 8
 
218
        .quad .Lmemmove_begin_forward
 
219
        .quad .Lmemmove_begin_forward_efs
 
220
        .word X86_FEATURE_ERMS
 
221
        .byte .Lmemmove_end_forward-.Lmemmove_begin_forward
 
222
        .byte .Lmemmove_end_forward_efs-.Lmemmove_begin_forward_efs
 
223
        .previous
197
224
ENDPROC(memmove)