File tree Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Expand file tree Collapse file tree 1 file changed +10
-16
lines changed Original file line number Diff line number Diff line change 5
5
#include "go_asm.h"
6
6
#include "textflag.h"
7
7
8
- // memequal(a , b unsafe.Pointer , size uintptr) bool
9
- TEXT runtime·memequal<ABIInternal>(SB) , NOSPLIT|NOFRAME , $ 0 - 25
10
- // short path to handle 0 - byte case
11
- CBZ R2 , equal
12
- // short path to handle equal pointers
13
- CMP R0 , R1
14
- BEQ equal
15
- B memeqbody<>(SB)
16
- equal:
17
- MOVD $ 1 , R0
18
- RET
19
-
20
8
// memequal_varlen(a , b unsafe.Pointer) bool
21
9
TEXT runtime·memequal_varlen<ABIInternal>(SB) , NOSPLIT , $ 0 - 17
22
- CMP R0 , R1
23
- BEQ eq
24
10
MOVD 8 (R26) , R2 // compiler stores size at offset 8 in the closure
25
11
CBZ R2 , eq
26
- B memeqbody< >(SB)
12
+ B runtime·memequal<ABIInternal >(SB)
27
13
eq:
28
14
MOVD $ 1 , R0
29
15
RET
33
19
// R1: pointer b
34
20
// R2: data len
35
21
// at return: result in R0
36
- TEXT memeqbody<>(SB) , NOSPLIT , $ 0
22
+ // memequal(a , b unsafe.Pointer , size uintptr) bool
23
+ TEXT runtime·memequal<ABIInternal>(SB) , NOSPLIT|NOFRAME , $ 0 - 25
24
+ // short path to handle 0 - byte case
25
+ CBZ R2 , equal
26
+ // short path to handle equal pointers
27
+ CMP R0 , R1
28
+ BEQ equal
37
29
CMP $ 1 , R2
38
30
// handle 1 - byte special case for better performance
39
31
BEQ one
91
83
EOR R4 , R5
92
84
CBNZ R5 , not_equal
93
85
B equal
86
+ PCALIGN $ 16
94
87
lt_8:
95
88
TBZ $ 2 , R2 , lt_4
96
89
MOVWU (R0) , R4
103
96
EOR R4 , R5
104
97
CBNZ R5 , not_equal
105
98
B equal
99
+ PCALIGN $ 16
106
100
lt_4:
107
101
TBZ $ 1 , R2 , lt_2
108
102
MOVHU.P 2 (R0) , R4
You can’t perform that action at this time.
0 commit comments