~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/bytes/asm_amd64.s

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
// license that can be found in the LICENSE file.
4
4
 
5
5
TEXT ·IndexByte(SB),7,$0
6
 
        MOVQ p+0(FP), SI
7
 
        MOVL len+8(FP), BX
8
 
        MOVB b+16(FP), AL
 
6
        MOVQ s+0(FP), SI
 
7
        MOVQ s_len+8(FP), BX
 
8
        MOVB c+24(FP), AL
9
9
        MOVQ SI, DI
10
10
 
11
 
        CMPL BX, $16
 
11
        CMPQ BX, $16
12
12
        JLT small
13
13
 
14
14
        // round up to first 16-byte boundary
63
63
        JZ success
64
64
 
65
65
failure:
66
 
        MOVL $-1, ret+24(FP)
 
66
        MOVQ $-1, ret+32(FP)
67
67
        RET
68
68
 
69
69
// handle for lengths < 16
70
70
small:
71
 
        MOVL BX, CX
 
71
        MOVQ BX, CX
72
72
        REPN; SCASB
73
73
        JZ success
74
 
        MOVL $-1, ret+24(FP)
 
74
        MOVQ $-1, ret+32(FP)
75
75
        RET
76
76
 
77
77
// we've found the chunk containing the byte
81
81
        BSFW DX, DX
82
82
        SUBQ SI, DI
83
83
        ADDQ DI, DX
84
 
        MOVL DX, ret+24(FP)
 
84
        MOVQ DX, ret+32(FP)
85
85
        RET
86
86
 
87
87
success:
88
88
        SUBQ SI, DI
89
89
        SUBL $1, DI
90
 
        MOVL DI, ret+24(FP)
91
 
        RET
92
 
 
93
 
TEXT ·Equal(SB),7,$0
94
 
        MOVL    len+8(FP), BX
95
 
        MOVL    len1+24(FP), CX
96
 
        MOVL    $0, AX
97
 
        CMPL    BX, CX
98
 
        JNE     eqret
99
 
        MOVQ    p+0(FP), SI
100
 
        MOVQ    q+16(FP), DI
101
 
        CLD
102
 
        REP; CMPSB
103
 
        MOVL    $1, DX
104
 
        CMOVLEQ DX, AX
105
 
eqret:
106
 
        MOVB    AX, ret+32(FP)
107
 
        RET
108
 
 
 
90
        MOVQ DI, ret+32(FP)
 
91
        RET