Delta Between Two Patch Sets: src/pkg/bytes/asm_386.s
Issue 8056043 :
code review 8056043: runtime: Implement faster equals for strings and bytes. (Closed)
Left Patch Set: diff -r d040d5f08d5d https://khr%40golang.org@code.google.com/p/go/
Right Patch Set: diff -r 52e3407d249f https://khr%40golang.org@code.google.com/p/go/
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
src/pkg/bytes/asm_386.s
src/pkg/bytes/asm_amd64.s
src/pkg/bytes/bytes_decl.go
src/pkg/bytes/bytes_test.go
src/pkg/bytes/equal_test.go
src/pkg/runtime/alg.c
src/pkg/runtime/asm_386.s
src/pkg/runtime/asm_amd64.s
src/pkg/runtime/asm_arm.s
src/pkg/runtime/hashmap.c
src/pkg/runtime/mapspeed_test.go
src/pkg/runtime/runtime.h
src/pkg/runtime/string.goc
src/pkg/runtime/string_test.go
LEFT RIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 TEXT ·IndexByte(SB),7,$0 5 TEXT ·IndexByte(SB),7,$0
6 MOVL s+0(FP), SI 6 MOVL s+0(FP), SI
7 MOVL s_len+4(FP), CX 7 MOVL s_len+4(FP), CX
8 MOVB c+12(FP), AL 8 MOVB c+12(FP), AL
9 MOVL SI, DI 9 MOVL SI, DI
10 CLD; REPN; SCASB 10 CLD; REPN; SCASB
11 JZ 3(PC) 11 JZ 3(PC)
12 MOVL $-1, ret+16(FP) 12 MOVL $-1, ret+16(FP)
13 RET 13 RET
14 SUBL SI, DI 14 SUBL SI, DI
15 SUBL $1, DI 15 SUBL $1, DI
16 MOVL DI, ret+16(FP) 16 MOVL DI, ret+16(FP)
17 RET 17 RET
18
19 TEXT ·Equal(SB),7,$12
20 MOVL a_len+4(FP), BX
21 MOVL b_len+16(FP), CX
22 MOVL $0, AX
23 CMPL BX, CX
24 JNE eqret
25 MOVL a+0(FP), SI
26 MOVL b+12(FP), DI
27 MOVL SI, 0(SP)
28 MOVL DI, 4(SP)
29 MOVL BX, 8(SP)
30 CALL runtime·memeq(SB)
31 eqret:
32 MOVB AX, ret+24(FP)
33 RET
LEFT RIGHT