Rev 2153 | Rev 2323 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2153 | Rev 2165 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | .text |
30 | .text |
31 | 31 | ||
32 | .global memcpy |
32 | .global memcpy |
33 | 33 | ||
34 | memcpy: |
34 | memcpy: |
35 | - | ||
36 | add r3, r1, #3 |
35 | add r3, r1, #3 |
37 | bic r3, r3, #3 |
36 | bic r3, r3, #3 |
38 | cmp r1, r3 |
37 | cmp r1, r3 |
39 | stmdb sp!, {r4, lr} |
38 | stmdb sp!, {r4, lr} |
40 | beq case_4 |
39 | beq case_4 |
41 | case_1: |
40 | case_1: |
42 | cmp r2, #0 |
41 | cmp r2, #0 |
43 | movne ip, #0 |
42 | movne ip, #0 |
44 | beq case_3 |
43 | beq case_3 |
45 | case_2: |
44 | case_2: |
46 | ldrb r3, [ip, r1] |
45 | ldrb r3, [ip, r1] |
47 | strb r3, [ip, r0] |
46 | strb r3, [ip, r0] |
48 | add ip, ip, #1 |
47 | add ip, ip, #1 |
49 | cmp ip, r2 |
48 | cmp ip, r2 |
50 | bne case_2 |
49 | bne case_2 |
51 | case_3: |
50 | case_3: |
52 | mov r0, r1 |
51 | mov r0, r1 |
53 | ldmia sp!, {r4, pc} |
52 | ldmia sp!, {r4, pc} |
54 | case_4: |
53 | case_4: |
55 | add r3, r0, #3 |
54 | add r3, r0, #3 |
56 | bic r3, r3, #3 |
55 | bic r3, r3, #3 |
57 | cmp r0, r3 |
56 | cmp r0, r3 |
58 | bne case_1 |
57 | bne case_1 |
59 | movs r4, r2, lsr #2 |
58 | movs r4, r2, lsr #2 |
60 | moveq lr, r4 |
59 | moveq lr, r4 |
61 | beq case_6 |
60 | beq case_6 |
62 | mov lr, #0 |
61 | mov lr, #0 |
63 | mov ip, lr |
62 | mov ip, lr |
64 | case_5: |
63 | case_5: |
65 | ldr r3, [ip, r1] |
64 | ldr r3, [ip, r1] |
66 | add lr, lr, #1 |
65 | add lr, lr, #1 |
67 | cmp lr, r4 |
66 | cmp lr, r4 |
68 | str r3, [ip, r0] |
67 | str r3, [ip, r0] |
69 | add ip, ip, #4 |
68 | add ip, ip, #4 |
70 | bne case_5 |
69 | bne case_5 |
71 | case_6: |
70 | case_6: |
72 | ands r4, r2, #3 |
71 | ands r4, r2, #3 |
73 | beq case_3 |
72 | beq case_3 |
74 | mov r3, lr, lsl #2 |
73 | mov r3, lr, lsl #2 |
75 | add r0, r3, r0 |
74 | add r0, r3, r0 |
76 | add ip, r3, r1 |
75 | add ip, r3, r1 |
77 | mov r2, #0 |
76 | mov r2, #0 |
78 | case_7: |
77 | case_7: |
79 | ldrb r3, [r2, ip] |
78 | ldrb r3, [r2, ip] |
80 | strb r3, [r2, r0] |
79 | strb r3, [r2, r0] |
81 | add r2, r2, #1 |
80 | add r2, r2, #1 |
82 | cmp r2, r4 |
81 | cmp r2, r4 |
83 | bne case_7 |
82 | bne case_7 |
84 | b case_3 |
83 | b case_3 |
85 | 84 | ||
86 | 85 |