310 lines
4.2 KiB
ArmAsm
310 lines
4.2 KiB
ArmAsm
.file "memory.c"
|
|
.text
|
|
.p2align 4,,15
|
|
.globl memsetb
|
|
.type memsetb, @function
|
|
memsetb:
|
|
.LFB2:
|
|
.cfi_startproc
|
|
movq %rdi, %rax
|
|
testb $7, %al
|
|
je .L10
|
|
testq %rdx, %rdx
|
|
leaq -1(%rdx), %r8
|
|
je .L3
|
|
movl %esi, %edx
|
|
movq %rdi, %rcx
|
|
jmp .L4
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L21:
|
|
subq $1, %r8
|
|
cmpq $-1, %r8
|
|
je .L3
|
|
.L4:
|
|
addq $1, %rcx
|
|
movb %dl, -1(%rcx)
|
|
testb $7, %cl
|
|
jne .L21
|
|
.L2:
|
|
cmpq $8, %r8
|
|
ja .L5
|
|
testq %r8, %r8
|
|
je .L22
|
|
.L6:
|
|
addq %rcx, %r8
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L9:
|
|
addq $1, %rcx
|
|
movb %sil, -1(%rcx)
|
|
cmpq %rcx, %r8
|
|
jne .L9
|
|
rep ret
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L3:
|
|
movq $-1, %r8
|
|
.L5:
|
|
movslq %esi, %rcx
|
|
movq %rcx, %rdx
|
|
movq %rcx, %rdi
|
|
salq $48, %rdi
|
|
salq $56, %rdx
|
|
orq %rdi, %rdx
|
|
movq %rcx, %rdi
|
|
orq %rcx, %rdx
|
|
salq $40, %rdi
|
|
orq %rdi, %rdx
|
|
movq %rcx, %rdi
|
|
salq $32, %rdi
|
|
orq %rdi, %rdx
|
|
movq %rcx, %rdi
|
|
salq $24, %rdi
|
|
orq %rdi, %rdx
|
|
movq %rcx, %rdi
|
|
salq $8, %rcx
|
|
salq $16, %rdi
|
|
orq %rdi, %rdx
|
|
orq %rcx, %rdx
|
|
movq %rax, %rcx
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L8:
|
|
subq $8, %r8
|
|
addq $8, %rcx
|
|
movq %rdx, -8(%rcx)
|
|
cmpq $8, %r8
|
|
ja .L8
|
|
jmp .L6
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L22:
|
|
rep ret
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L10:
|
|
movq %rdi, %rcx
|
|
movq %rdx, %r8
|
|
jmp .L2
|
|
.cfi_endproc
|
|
.LFE2:
|
|
.size memsetb, .-memsetb
|
|
.p2align 4,,15
|
|
.globl memsetw
|
|
.type memsetw, @function
|
|
memsetw:
|
|
.LFB3:
|
|
.cfi_startproc
|
|
testb $1, %dil
|
|
jne .L24
|
|
testb $7, %dil
|
|
je .L35
|
|
testq %rdx, %rdx
|
|
leaq -1(%rdx), %r8
|
|
movl %esi, %eax
|
|
movq %rdi, %rcx
|
|
jne .L31
|
|
jmp .L47
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L48:
|
|
subq $1, %r8
|
|
cmpq $-1, %r8
|
|
je .L27
|
|
.L31:
|
|
addq $2, %rcx
|
|
movw %ax, -2(%rcx)
|
|
testb $7, %cl
|
|
jne .L48
|
|
.L25:
|
|
cmpq $4, %r8
|
|
ja .L27
|
|
testq %r8, %r8
|
|
je .L28
|
|
.L32:
|
|
xorl %edx, %edx
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L34:
|
|
movw %si, (%rcx,%rdx,2)
|
|
addq $1, %rdx
|
|
cmpq %r8, %rdx
|
|
jne .L34
|
|
.L28:
|
|
movq %rdi, %rax
|
|
ret
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L47:
|
|
movq $-1, %r8
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L27:
|
|
movslq %esi, %rdx
|
|
movq %rdx, %rax
|
|
movq %rdx, %r9
|
|
salq $48, %rax
|
|
salq $32, %r9
|
|
orq %r9, %rax
|
|
orq %rdx, %rax
|
|
salq $16, %rdx
|
|
orq %rdx, %rax
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L33:
|
|
subq $4, %r8
|
|
addq $8, %rcx
|
|
movq %rax, -8(%rcx)
|
|
cmpq $4, %r8
|
|
ja .L33
|
|
jmp .L32
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L24:
|
|
testq %rdx, %rdx
|
|
je .L28
|
|
xorl %eax, %eax
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L29:
|
|
movw %si, (%rdi,%rax,2)
|
|
addq $1, %rax
|
|
cmpq %rax, %rdx
|
|
jne .L29
|
|
leaq (%rdi,%rdx,2), %rax
|
|
ret
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L35:
|
|
movq %rdi, %rcx
|
|
movq %rdx, %r8
|
|
jmp .L25
|
|
.cfi_endproc
|
|
.LFE3:
|
|
.size memsetw, .-memsetw
|
|
.p2align 4,,15
|
|
.globl memsetd
|
|
.type memsetd, @function
|
|
memsetd:
|
|
.LFB4:
|
|
.cfi_startproc
|
|
movq %rdi, %rax
|
|
ret
|
|
.cfi_endproc
|
|
.LFE4:
|
|
.size memsetd, .-memsetd
|
|
.p2align 4,,15
|
|
.globl memsetq
|
|
.type memsetq, @function
|
|
memsetq:
|
|
.LFB5:
|
|
.cfi_startproc
|
|
testq %rdx, %rdx
|
|
movq %rdi, %rax
|
|
je .L51
|
|
xorl %ecx, %ecx
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L52:
|
|
movq %rsi, (%rax,%rcx,8)
|
|
addq $1, %rcx
|
|
cmpq %rdx, %rcx
|
|
jne .L52
|
|
.L51:
|
|
rep ret
|
|
.cfi_endproc
|
|
.LFE5:
|
|
.size memsetq, .-memsetq
|
|
.p2align 4,,15
|
|
.globl memzero
|
|
.type memzero, @function
|
|
memzero:
|
|
.LFB6:
|
|
.cfi_startproc
|
|
movq %rsi, %rdx
|
|
movabsq $memsetb, %rax
|
|
xorl %esi, %esi
|
|
jmp *%rax
|
|
.cfi_endproc
|
|
.LFE6:
|
|
.size memzero, .-memzero
|
|
.p2align 4,,15
|
|
.globl memcpy
|
|
.type memcpy, @function
|
|
memcpy:
|
|
.LFB7:
|
|
.cfi_startproc
|
|
testq %rdx, %rdx
|
|
movq %rdi, %rax
|
|
je .L59
|
|
testb $1, %sil
|
|
movq %rsi, %rcx
|
|
jne .L91
|
|
.L60:
|
|
testb $7, %al
|
|
je .L61
|
|
andl $7, %ecx
|
|
jne .L89
|
|
jmp .L61
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L62:
|
|
movsw
|
|
subq $2, %rdx
|
|
.L89:
|
|
cmpq $2, %rdx
|
|
ja .L62
|
|
.L61:
|
|
cmpq $8, %rdx
|
|
jbe .L63
|
|
leaq -9(%rdx), %r10
|
|
xorl %ecx, %ecx
|
|
shrq $3, %r10
|
|
leaq 8(,%r10,8), %r9
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L64:
|
|
movq (%rsi,%rcx), %r8
|
|
movq %r8, (%rdi,%rcx)
|
|
addq $8, %rcx
|
|
cmpq %rcx, %r9
|
|
jne .L64
|
|
negq %r10
|
|
addq %r9, %rsi
|
|
addq %r9, %rdi
|
|
leaq -8(%rdx,%r10,8), %rdx
|
|
.L65:
|
|
xorl %ecx, %ecx
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L66:
|
|
movzbl (%rsi,%rcx), %r8d
|
|
movw %r8w, (%rdi,%rcx,2)
|
|
addq $1, %rcx
|
|
cmpq %rdx, %rcx
|
|
jne .L66
|
|
.L59:
|
|
rep ret
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L63:
|
|
testq %rdx, %rdx
|
|
jne .L65
|
|
rep ret
|
|
.p2align 4,,10
|
|
.p2align 3
|
|
.L91:
|
|
testb $1, %al
|
|
je .L60
|
|
movzbl (%rsi), %r8d
|
|
leaq 1(%rdi), %rdi
|
|
subq $1, %rdx
|
|
addq $1, %rsi
|
|
movb %r8b, (%rax)
|
|
jmp .L60
|
|
.cfi_endproc
|
|
.LFE7:
|
|
.size memcpy, .-memcpy
|
|
.ident "GCC: (GNU) 7.3.0"
|