Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(62)

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/ Created 11 years ago
Right Patch Set: diff -r 52e3407d249f https://khr%40golang.org@code.google.com/p/go/ Created 10 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/bytes/asm_amd64.s » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b