~ubuntu-branches/ubuntu/trusty/musl/trusty-proposed

« back to all changes in this revision

Viewing changes to src/string/i386/memset.s

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2013-09-20 20:54:14 UTC
  • Revision ID: package-import@ubuntu.com-20130920205414-5b61trtmma18w58o
Tags: upstream-0.9.13
ImportĀ upstreamĀ versionĀ 0.9.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.global memset
 
2
.type memset,@function
 
3
memset:
 
4
        mov 8(%esp),%al
 
5
        push %edi
 
6
        mov %al,%ah
 
7
        mov %al,%dl
 
8
        mov 16(%esp),%ecx
 
9
        shl $16,%eax
 
10
        mov 8(%esp),%edi
 
11
        mov %dl,%al
 
12
        mov %dl,%ah
 
13
        cmp $16,%ecx
 
14
        jb 1f
 
15
 
 
16
        mov %eax,-4(%edi,%ecx)
 
17
        shr $2,%ecx
 
18
        rep
 
19
        stosl
 
20
        mov 8(%esp),%eax
 
21
        pop %edi
 
22
        ret
 
23
 
 
24
1:      test %ecx,%ecx
 
25
        jz 1f
 
26
 
 
27
        mov %al,(%edi)
 
28
        mov %al,-1(%edi,%ecx)
 
29
        cmp $2,%ecx
 
30
        jbe 1f
 
31
 
 
32
        mov %al,1(%edi)
 
33
        mov %al,-2(%edi,%ecx)
 
34
        cmp $4,%ecx
 
35
        jbe 1f
 
36
 
 
37
        mov %eax,(%edi)
 
38
        mov %eax,-4(%edi,%ecx)
 
39
        cmp $8,%ecx
 
40
        jbe 1f
 
41
 
 
42
        mov %eax,4(%edi)
 
43
        mov %eax,-8(%edi,%ecx)
 
44
 
 
45
1:      mov 8(%esp),%eax
 
46
        pop %edi
 
47
        ret