-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmemmove_amd64.s
99 lines (96 loc) · 1.75 KB
/
memmove_amd64.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include "textflag.h"
TEXT ·MemMoveSSE2(SB),NOSPLIT,$0-16
MOVQ dst+0(FP), DI
MOVQ src+8(FP), SI
MOVQ $8, CX
loop1:
MOVOU 0x00(SI), X0
MOVOU 0x10(SI), X1
MOVOU 0x20(SI), X2
MOVOU 0x30(SI), X3
MOVOU 0x40(SI), X4
MOVOU 0x50(SI), X5
MOVOU 0x60(SI), X6
MOVOU 0x70(SI), X7
MOVOU 0x80(SI), X8
MOVOU 0x90(SI), X9
MOVOU 0xa0(SI), X10
MOVOU 0xb0(SI), X11
MOVOU 0xc0(SI), X12
MOVOU 0xd0(SI), X13
MOVOU 0xe0(SI), X14
MOVOU 0xf0(SI), X15
MOVOU X0, 0x00(DI)
MOVOU X1, 0x10(DI)
MOVOU X2, 0x20(DI)
MOVOU X3, 0x30(DI)
MOVOU X4, 0x40(DI)
MOVOU X5, 0x50(DI)
MOVOU X6, 0x60(DI)
MOVOU X7, 0x70(DI)
MOVOU X8, 0x80(DI)
MOVOU X9, 0x90(DI)
MOVOU X10, 0xa0(DI)
MOVOU X11, 0xb0(DI)
MOVOU X12, 0xc0(DI)
MOVOU X13, 0xd0(DI)
MOVOU X14, 0xe0(DI)
MOVOU X15, 0xf0(DI)
ADDQ $256, SI
ADDQ $256, DI
DECQ CX
JNE loop1
RET
TEXT ·MemMoveAVX(SB),NOSPLIT,$0-16
MOVQ dst+0(FP), DI
MOVQ src+8(FP), SI
MOVQ $8, CX
loop2:
MOVHDU 0x00(SI), X0
MOVHDU 0x20(SI), X1
MOVHDU 0x40(SI), X2
MOVHDU 0x60(SI), X3
MOVHDU 0x80(SI), X4
MOVHDU 0xa0(SI), X5
MOVHDU 0xc0(SI), X6
MOVHDU 0xe0(SI), X7
MOVHDU X0, 0x00(DI)
MOVHDU X1, 0x20(DI)
MOVHDU X2, 0x40(DI)
MOVHDU X3, 0x60(DI)
MOVHDU X4, 0x80(DI)
MOVHDU X5, 0xa0(DI)
MOVHDU X6, 0xc0(DI)
MOVHDU X7, 0xe0(DI)
ADDQ $256, SI
ADDQ $256, DI
DECQ CX
JNE loop2
VZEROUPPER
RET
TEXT ·MemMove(SB),NOSPLIT,$0-16
MOVQ dst+0(FP), DI
MOVQ src+8(FP), SI
MOVQ $32, CX
loop3:
MOVQ 0x00(SI), R8
MOVQ 0x08(SI), R9
MOVQ 0x10(SI), R10
MOVQ 0x18(SI), R11
MOVQ 0x20(SI), R12
MOVQ 0x28(SI), R13
MOVQ 0x30(SI), R14
MOVQ 0x38(SI), R15
MOVQ R8, 0x00(DI)
MOVQ R9, 0x08(DI)
MOVQ R10, 0x10(DI)
MOVQ R11, 0x18(DI)
MOVQ R12, 0x20(DI)
MOVQ R13, 0x28(DI)
MOVQ R14, 0x30(DI)
MOVQ R15, 0x38(DI)
ADDQ $64, SI
ADDQ $64, DI
DECQ CX
JNE loop3
RET