2014-02-06 18:43:22 -07:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2014-03-12 19:12:25 -06:00
|
|
|
// +build !plan9
|
|
|
|
|
2014-09-04 21:05:18 -06:00
|
|
|
#include "textflag.h"
|
2014-02-06 18:43:22 -07:00
|
|
|
|
2014-09-09 15:12:05 -06:00
|
|
|
// NOTE: Windows externalthreadhandler expects memclr to preserve DX.
|
|
|
|
|
2016-10-17 16:41:56 -06:00
|
|
|
// void runtime·memclrNoHeapPointers(void*, uintptr)
|
|
|
|
TEXT runtime·memclrNoHeapPointers(SB), NOSPLIT, $0-8
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVL ptr+0(FP), DI
|
|
|
|
MOVL n+4(FP), BX
|
|
|
|
XORL AX, AX
|
|
|
|
|
|
|
|
// MOVOU seems always faster than REP STOSL.
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
tail:
|
2014-02-06 18:43:22 -07:00
|
|
|
TESTL BX, BX
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JEQ _0
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $2
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _1or2
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $4
|
2015-11-05 13:39:56 -07:00
|
|
|
JB _3
|
|
|
|
JE _4
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $8
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _5through8
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $16
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _9through16
|
2017-04-27 00:30:27 -06:00
|
|
|
CMPB runtime·support_sse2(SB), $1
|
|
|
|
JNE nosse2
|
2014-02-06 18:43:22 -07:00
|
|
|
PXOR X0, X0
|
|
|
|
CMPL BX, $32
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _17through32
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $64
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _33through64
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $128
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _65through128
|
2014-02-06 18:43:22 -07:00
|
|
|
CMPL BX, $256
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JBE _129through256
|
2014-02-06 18:43:22 -07:00
|
|
|
// TODO: use branch table and BSR to make this just a single dispatch
|
|
|
|
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
loop:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVOU X0, 0(DI)
|
|
|
|
MOVOU X0, 16(DI)
|
|
|
|
MOVOU X0, 32(DI)
|
|
|
|
MOVOU X0, 48(DI)
|
|
|
|
MOVOU X0, 64(DI)
|
|
|
|
MOVOU X0, 80(DI)
|
|
|
|
MOVOU X0, 96(DI)
|
|
|
|
MOVOU X0, 112(DI)
|
|
|
|
MOVOU X0, 128(DI)
|
|
|
|
MOVOU X0, 144(DI)
|
|
|
|
MOVOU X0, 160(DI)
|
|
|
|
MOVOU X0, 176(DI)
|
|
|
|
MOVOU X0, 192(DI)
|
|
|
|
MOVOU X0, 208(DI)
|
|
|
|
MOVOU X0, 224(DI)
|
|
|
|
MOVOU X0, 240(DI)
|
|
|
|
SUBL $256, BX
|
|
|
|
ADDL $256, DI
|
|
|
|
CMPL BX, $256
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JAE loop
|
|
|
|
JMP tail
|
2014-02-06 18:43:22 -07:00
|
|
|
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_1or2:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVB AX, (DI)
|
|
|
|
MOVB AX, -1(DI)(BX*1)
|
2014-08-01 07:21:08 -06:00
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_0:
|
2014-02-06 18:43:22 -07:00
|
|
|
RET
|
2015-11-05 13:39:56 -07:00
|
|
|
_3:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVW AX, (DI)
|
2015-11-05 13:39:56 -07:00
|
|
|
MOVB AX, 2(DI)
|
|
|
|
RET
|
|
|
|
_4:
|
|
|
|
// We need a separate case for 4 to make sure we clear pointers atomically.
|
|
|
|
MOVL AX, (DI)
|
2014-02-06 18:43:22 -07:00
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_5through8:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVL AX, (DI)
|
|
|
|
MOVL AX, -4(DI)(BX*1)
|
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_9through16:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVL AX, (DI)
|
|
|
|
MOVL AX, 4(DI)
|
|
|
|
MOVL AX, -8(DI)(BX*1)
|
|
|
|
MOVL AX, -4(DI)(BX*1)
|
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_17through32:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVOU X0, (DI)
|
|
|
|
MOVOU X0, -16(DI)(BX*1)
|
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_33through64:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVOU X0, (DI)
|
|
|
|
MOVOU X0, 16(DI)
|
|
|
|
MOVOU X0, -32(DI)(BX*1)
|
|
|
|
MOVOU X0, -16(DI)(BX*1)
|
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_65through128:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVOU X0, (DI)
|
|
|
|
MOVOU X0, 16(DI)
|
|
|
|
MOVOU X0, 32(DI)
|
|
|
|
MOVOU X0, 48(DI)
|
|
|
|
MOVOU X0, -64(DI)(BX*1)
|
|
|
|
MOVOU X0, -48(DI)(BX*1)
|
|
|
|
MOVOU X0, -32(DI)(BX*1)
|
|
|
|
MOVOU X0, -16(DI)(BX*1)
|
|
|
|
RET
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
_129through256:
|
2014-02-06 18:43:22 -07:00
|
|
|
MOVOU X0, (DI)
|
|
|
|
MOVOU X0, 16(DI)
|
|
|
|
MOVOU X0, 32(DI)
|
|
|
|
MOVOU X0, 48(DI)
|
|
|
|
MOVOU X0, 64(DI)
|
|
|
|
MOVOU X0, 80(DI)
|
|
|
|
MOVOU X0, 96(DI)
|
|
|
|
MOVOU X0, 112(DI)
|
|
|
|
MOVOU X0, -128(DI)(BX*1)
|
|
|
|
MOVOU X0, -112(DI)(BX*1)
|
|
|
|
MOVOU X0, -96(DI)(BX*1)
|
|
|
|
MOVOU X0, -80(DI)(BX*1)
|
|
|
|
MOVOU X0, -64(DI)(BX*1)
|
|
|
|
MOVOU X0, -48(DI)(BX*1)
|
|
|
|
MOVOU X0, -32(DI)(BX*1)
|
|
|
|
MOVOU X0, -16(DI)(BX*1)
|
|
|
|
RET
|
|
|
|
nosse2:
|
|
|
|
MOVL BX, CX
|
|
|
|
SHRL $2, CX
|
|
|
|
REP
|
|
|
|
STOSL
|
|
|
|
ANDL $3, BX
|
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.
Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.
Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.
Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).
Came up as part of CL 167730043.
LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043
2014-10-28 19:50:16 -06:00
|
|
|
JNE tail
|
2014-02-06 18:43:22 -07:00
|
|
|
RET
|