~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to src/reference/bionic/memcmp.S

  • Committer: Michael Hope
  • Date: 2010-08-30 23:30:25 UTC
  • Revision ID: michael.hope@linaro.org-20100830233025-2f14wknqev6ryj01
Modified the imported versions to build locally.  Added the CSL routines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 * SUCH DAMAGE.
27
27
 */
28
28
 
29
 
#include <machine/cpu-features.h>
30
 
 
31
29
    .text
32
30
 
33
31
    .global memcmp
45
43
 
46
44
memcmp:
47
45
        .fnstart
48
 
        PLD         (r0, #0)
49
 
        PLD         (r1, #0)
 
46
        PLD         [r0, #0]
 
47
        PLD         [r1, #0]
50
48
 
51
49
        /* take of the case where length is 0 or the buffers are the same */
52
50
        cmp         r0, r1
58
56
        /* save registers */
59
57
        stmfd       sp!, {r4, lr}
60
58
        
61
 
        PLD         (r0, #32)
62
 
        PLD         (r1, #32)
 
59
        PLD         [r0, #32]
 
60
        PLD         [r1, #32]
63
61
 
64
62
        /* since r0 hold the result, move the first source
65
63
         * pointer somewhere else
109
107
        subs        r2, r2, #(32 + 4)
110
108
        bmi         1f
111
109
        
112
 
0:      PLD         (r4, #64)
113
 
        PLD         (r1, #64)
 
110
0:      PLD         [r4, #64]
 
111
        PLD         [r1, #64]
114
112
        ldr         r0, [r4], #4
115
113
        ldr         lr, [r1, #4]!
116
114
        eors        r0, r0, ip
198
196
        bic         r1, r1, #3
199
197
        ldr         lr, [r1], #4
200
198
 
201
 
6:      PLD         (r1, #64)
202
 
        PLD         (r4, #64)
 
199
6:      PLD         [r1, #64]
 
200
        PLD         [r4, #64]
203
201
        mov         ip, lr, lsr #16
204
202
        ldr         lr, [r1], #4
205
203
        ldr         r0, [r4], #4