1
0
mirror of https://github.com/golang/go synced 2024-11-26 07:47:57 -07:00

[dev.typeparams] runtime, internal/bytealg: remove regabi fallback code on AMD64

As we commit to always enabling register ABI on AMD64, remove the
fallback code.

Change-Id: I30556858ba4bac367495fa94f6a8682ecd771196
Reviewed-on: https://go-review.googlesource.com/c/go/+/341152
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Cherry Mui 2021-08-02 18:28:40 -04:00
parent eeb7899137
commit d7d4f28a06
6 changed files with 0 additions and 309 deletions

View File

@ -6,7 +6,6 @@
#include "textflag.h" #include "textflag.h"
TEXT ·Compare<ABIInternal>(SB),NOSPLIT,$0-56 TEXT ·Compare<ABIInternal>(SB),NOSPLIT,$0-56
#ifdef GOEXPERIMENT_regabiargs
// AX = a_base (want in SI) // AX = a_base (want in SI)
// BX = a_len (want in BX) // BX = a_len (want in BX)
// CX = a_cap (unused) // CX = a_cap (unused)
@ -15,17 +14,9 @@ TEXT ·Compare<ABIInternal>(SB),NOSPLIT,$0-56
// R8 = b_cap (unused) // R8 = b_cap (unused)
MOVQ SI, DX MOVQ SI, DX
MOVQ AX, SI MOVQ AX, SI
#else
MOVQ a_base+0(FP), SI
MOVQ a_len+8(FP), BX
MOVQ b_base+24(FP), DI
MOVQ b_len+32(FP), DX
LEAQ ret+48(FP), R9
#endif
JMP cmpbody<>(SB) JMP cmpbody<>(SB)
TEXT runtime·cmpstring<ABIInternal>(SB),NOSPLIT,$0-40 TEXT runtime·cmpstring<ABIInternal>(SB),NOSPLIT,$0-40
#ifdef GOEXPERIMENT_regabiargs
// AX = a_base (want in SI) // AX = a_base (want in SI)
// BX = a_len (want in BX) // BX = a_len (want in BX)
// CX = b_base (want in DI) // CX = b_base (want in DI)
@ -33,13 +24,6 @@ TEXT runtime·cmpstring<ABIInternal>(SB),NOSPLIT,$0-40
MOVQ AX, SI MOVQ AX, SI
MOVQ DI, DX MOVQ DI, DX
MOVQ CX, DI MOVQ CX, DI
#else
MOVQ a_base+0(FP), SI
MOVQ a_len+8(FP), BX
MOVQ b_base+16(FP), DI
MOVQ b_len+24(FP), DX
LEAQ ret+32(FP), R9
#endif
JMP cmpbody<>(SB) JMP cmpbody<>(SB)
// input: // input:
@ -47,12 +31,8 @@ TEXT runtime·cmpstring<ABIInternal>(SB),NOSPLIT,$0-40
// DI = b // DI = b
// BX = alen // BX = alen
// DX = blen // DX = blen
#ifndef GOEXPERIMENT_regabiargs
// R9 = address of output word (stores -1/0/1 here)
#else
// output: // output:
// AX = output (-1/0/1) // AX = output (-1/0/1)
#endif
TEXT cmpbody<>(SB),NOSPLIT,$0-0 TEXT cmpbody<>(SB),NOSPLIT,$0-0
CMPQ SI, DI CMPQ SI, DI
JEQ allsame JEQ allsame
@ -100,9 +80,6 @@ diff16:
CMPB CX, (DI)(BX*1) CMPB CX, (DI)(BX*1)
SETHI AX SETHI AX
LEAQ -1(AX*2), AX // convert 1/0 to +1/-1 LEAQ -1(AX*2), AX // convert 1/0 to +1/-1
#ifndef GOEXPERIMENT_regabiargs
MOVQ AX, (R9)
#endif
RET RET
// 0 through 16 bytes left, alen>=8, blen>=8 // 0 through 16 bytes left, alen>=8, blen>=8
@ -128,9 +105,6 @@ diff8:
SHRQ CX, AX // move a's bit to bottom SHRQ CX, AX // move a's bit to bottom
ANDQ $1, AX // mask bit ANDQ $1, AX // mask bit
LEAQ -1(AX*2), AX // 1/0 => +1/-1 LEAQ -1(AX*2), AX // 1/0 => +1/-1
#ifndef GOEXPERIMENT_regabiargs
MOVQ AX, (R9)
#endif
RET RET
// 0-7 bytes in common // 0-7 bytes in common
@ -169,9 +143,6 @@ di_finish:
SHRQ CX, SI // move a's bit to bottom SHRQ CX, SI // move a's bit to bottom
ANDQ $1, SI // mask bit ANDQ $1, SI // mask bit
LEAQ -1(SI*2), AX // 1/0 => +1/-1 LEAQ -1(SI*2), AX // 1/0 => +1/-1
#ifndef GOEXPERIMENT_regabiargs
MOVQ AX, (R9)
#endif
RET RET
allsame: allsame:
@ -181,9 +152,6 @@ allsame:
SETGT AX // 1 if alen > blen SETGT AX // 1 if alen > blen
SETEQ CX // 1 if alen == blen SETEQ CX // 1 if alen == blen
LEAQ -1(CX)(AX*2), AX // 1,0,-1 result LEAQ -1(CX)(AX*2), AX // 1,0,-1 result
#ifndef GOEXPERIMENT_regabiargs
MOVQ AX, (R9)
#endif
RET RET
// this works for >= 64 bytes of data. // this works for >= 64 bytes of data.

View File

@ -7,7 +7,6 @@
// memequal(a, b unsafe.Pointer, size uintptr) bool // memequal(a, b unsafe.Pointer, size uintptr) bool
TEXT runtime·memequal<ABIInternal>(SB),NOSPLIT,$0-25 TEXT runtime·memequal<ABIInternal>(SB),NOSPLIT,$0-25
#ifdef GOEXPERIMENT_regabiargs
// AX = a (want in SI) // AX = a (want in SI)
// BX = b (want in DI) // BX = b (want in DI)
// CX = size (want in BX) // CX = size (want in BX)
@ -20,22 +19,9 @@ neq:
MOVQ BX, DI MOVQ BX, DI
MOVQ CX, BX MOVQ CX, BX
JMP memeqbody<>(SB) JMP memeqbody<>(SB)
#else
MOVQ a+0(FP), SI
MOVQ b+8(FP), DI
CMPQ SI, DI
JEQ eq
MOVQ size+16(FP), BX
LEAQ ret+24(FP), AX
JMP memeqbody<>(SB)
eq:
MOVB $1, ret+24(FP)
RET
#endif
// memequal_varlen(a, b unsafe.Pointer) bool // memequal_varlen(a, b unsafe.Pointer) bool
TEXT runtime·memequal_varlen<ABIInternal>(SB),NOSPLIT,$0-17 TEXT runtime·memequal_varlen<ABIInternal>(SB),NOSPLIT,$0-17
#ifdef GOEXPERIMENT_regabiargs
// AX = a (want in SI) // AX = a (want in SI)
// BX = b (want in DI) // BX = b (want in DI)
// 8(DX) = size (want in BX) // 8(DX) = size (want in BX)
@ -48,29 +34,13 @@ neq:
MOVQ BX, DI MOVQ BX, DI
MOVQ 8(DX), BX // compiler stores size at offset 8 in the closure MOVQ 8(DX), BX // compiler stores size at offset 8 in the closure
JMP memeqbody<>(SB) JMP memeqbody<>(SB)
#else
MOVQ a+0(FP), SI
MOVQ b+8(FP), DI
CMPQ SI, DI
JEQ eq
MOVQ 8(DX), BX // compiler stores size at offset 8 in the closure
LEAQ ret+16(FP), AX
JMP memeqbody<>(SB)
eq:
MOVB $1, ret+16(FP)
RET
#endif
// Input: // Input:
// a in SI // a in SI
// b in DI // b in DI
// count in BX // count in BX
#ifndef GOEXPERIMENT_regabiargs
// address of result byte in AX
#else
// Output: // Output:
// result in AX // result in AX
#endif
TEXT memeqbody<>(SB),NOSPLIT,$0-0 TEXT memeqbody<>(SB),NOSPLIT,$0-0
CMPQ BX, $8 CMPQ BX, $8
JB small JB small
@ -104,11 +74,7 @@ hugeloop:
SUBQ $64, BX SUBQ $64, BX
CMPL DX, $0xffff CMPL DX, $0xffff
JEQ hugeloop JEQ hugeloop
#ifdef GOEXPERIMENT_regabiargs
XORQ AX, AX // return 0 XORQ AX, AX // return 0
#else
MOVB $0, (AX)
#endif
RET RET
// 64 bytes at a time using ymm registers // 64 bytes at a time using ymm registers
@ -129,11 +95,7 @@ hugeloop_avx2:
CMPL DX, $0xffffffff CMPL DX, $0xffffffff
JEQ hugeloop_avx2 JEQ hugeloop_avx2
VZEROUPPER VZEROUPPER
#ifdef GOEXPERIMENT_regabiargs
XORQ AX, AX // return 0 XORQ AX, AX // return 0
#else
MOVB $0, (AX)
#endif
RET RET
bigloop_avx2: bigloop_avx2:
@ -150,11 +112,7 @@ bigloop:
SUBQ $8, BX SUBQ $8, BX
CMPQ CX, DX CMPQ CX, DX
JEQ bigloop JEQ bigloop
#ifdef GOEXPERIMENT_regabiargs
XORQ AX, AX // return 0 XORQ AX, AX // return 0
#else
MOVB $0, (AX)
#endif
RET RET
// remaining 0-8 bytes // remaining 0-8 bytes
@ -162,11 +120,7 @@ leftover:
MOVQ -8(SI)(BX*1), CX MOVQ -8(SI)(BX*1), CX
MOVQ -8(DI)(BX*1), DX MOVQ -8(DI)(BX*1), DX
CMPQ CX, DX CMPQ CX, DX
#ifdef GOEXPERIMENT_regabiargs
SETEQ AX SETEQ AX
#else
SETEQ (AX)
#endif
RET RET
small: small:
@ -201,10 +155,5 @@ di_finish:
SUBQ SI, DI SUBQ SI, DI
SHLQ CX, DI SHLQ CX, DI
equal: equal:
#ifdef GOEXPERIMENT_regabiargs
SETEQ AX SETEQ AX
#else
SETEQ (AX)
#endif
RET RET

View File

@ -277,7 +277,6 @@ TEXT gogo<>(SB), NOSPLIT, $0
// Switch to m->g0's stack, call fn(g). // Switch to m->g0's stack, call fn(g).
// Fn must never return. It should gogo(&g->sched) // Fn must never return. It should gogo(&g->sched)
// to keep running g. // to keep running g.
#ifdef GOEXPERIMENT_regabiargs
TEXT runtime·mcall<ABIInternal>(SB), NOSPLIT, $0-8 TEXT runtime·mcall<ABIInternal>(SB), NOSPLIT, $0-8
MOVQ AX, DX // DX = fn MOVQ AX, DX // DX = fn
@ -306,38 +305,6 @@ goodm:
POPQ AX POPQ AX
JMP runtime·badmcall2(SB) JMP runtime·badmcall2(SB)
RET RET
#else
TEXT runtime·mcall(SB), NOSPLIT, $0-8
MOVQ fn+0(FP), DI
get_tls(CX)
MOVQ g(CX), AX // save state in g->sched
MOVQ 0(SP), BX // caller's PC
MOVQ BX, (g_sched+gobuf_pc)(AX)
LEAQ fn+0(FP), BX // caller's SP
MOVQ BX, (g_sched+gobuf_sp)(AX)
MOVQ BP, (g_sched+gobuf_bp)(AX)
// switch to m->g0 & its stack, call fn
MOVQ g(CX), BX
MOVQ g_m(BX), BX
MOVQ m_g0(BX), SI
CMPQ SI, AX // if g == m->g0 call badmcall
JNE 3(PC)
MOVQ $runtime·badmcall(SB), AX
JMP AX
MOVQ SI, g(CX) // g = m->g0
MOVQ SI, R14 // set the g register
MOVQ (g_sched+gobuf_sp)(SI), SP // sp = m->g0->sched.sp
PUSHQ AX
MOVQ DI, DX
MOVQ 0(DI), DI
CALL DI
POPQ AX
MOVQ $runtime·badmcall2(SB), AX
JMP AX
RET
#endif
// systemstack_switch is a dummy routine that systemstack leaves at the bottom // systemstack_switch is a dummy routine that systemstack leaves at the bottom
// of the G stack. We need to distinguish the routine that // of the G stack. We need to distinguish the routine that
@ -465,7 +432,6 @@ TEXT runtime·morestack_noctxt(SB),NOSPLIT,$0
MOVL $0, DX MOVL $0, DX
JMP runtime·morestack(SB) JMP runtime·morestack(SB)
#ifdef GOEXPERIMENT_regabireflect
// spillArgs stores return values from registers to a *internal/abi.RegArgs in R12. // spillArgs stores return values from registers to a *internal/abi.RegArgs in R12.
TEXT ·spillArgs(SB),NOSPLIT,$0-0 TEXT ·spillArgs(SB),NOSPLIT,$0-0
MOVQ AX, 0(R12) MOVQ AX, 0(R12)
@ -521,15 +487,6 @@ TEXT ·unspillArgs(SB),NOSPLIT,$0-0
MOVQ 176(R12), X13 MOVQ 176(R12), X13
MOVQ 184(R12), X14 MOVQ 184(R12), X14
RET RET
#else
// spillArgs stores return values from registers to a pointer in R12.
TEXT ·spillArgs(SB),NOSPLIT,$0-0
RET
// unspillArgs loads args into registers from a pointer in R12.
TEXT ·unspillArgs(SB),NOSPLIT,$0-0
RET
#endif
// reflectcall: call a function with the given argument list // reflectcall: call a function with the given argument list
// func call(stackArgsType *_type, f *FuncVal, stackArgs *byte, stackArgsSize, stackRetOffset, frameSize uint32, regArgs *abi.RegArgs). // func call(stackArgsType *_type, f *FuncVal, stackArgs *byte, stackArgsSize, stackRetOffset, frameSize uint32, regArgs *abi.RegArgs).
@ -988,61 +945,34 @@ done:
// func memhash(p unsafe.Pointer, h, s uintptr) uintptr // func memhash(p unsafe.Pointer, h, s uintptr) uintptr
// hash function using AES hardware instructions // hash function using AES hardware instructions
TEXT runtime·memhash<ABIInternal>(SB),NOSPLIT,$0-32 TEXT runtime·memhash<ABIInternal>(SB),NOSPLIT,$0-32
#ifdef GOEXPERIMENT_regabiargs
// AX = ptr to data // AX = ptr to data
// BX = seed // BX = seed
// CX = size // CX = size
#endif
CMPB runtime·useAeshash(SB), $0 CMPB runtime·useAeshash(SB), $0
JEQ noaes JEQ noaes
#ifndef GOEXPERIMENT_regabiargs
MOVQ p+0(FP), AX // ptr to data
MOVQ s+16(FP), CX // size
LEAQ ret+24(FP), DX
#endif
JMP aeshashbody<>(SB) JMP aeshashbody<>(SB)
noaes: noaes:
JMP runtime·memhashFallback<ABIInternal>(SB) JMP runtime·memhashFallback<ABIInternal>(SB)
// func strhash(p unsafe.Pointer, h uintptr) uintptr // func strhash(p unsafe.Pointer, h uintptr) uintptr
TEXT runtime·strhash<ABIInternal>(SB),NOSPLIT,$0-24 TEXT runtime·strhash<ABIInternal>(SB),NOSPLIT,$0-24
#ifdef GOEXPERIMENT_regabiargs
// AX = ptr to string struct // AX = ptr to string struct
// BX = seed // BX = seed
#endif
CMPB runtime·useAeshash(SB), $0 CMPB runtime·useAeshash(SB), $0
JEQ noaes JEQ noaes
#ifndef GOEXPERIMENT_regabiargs
MOVQ p+0(FP), AX // ptr to string struct
#endif
MOVQ 8(AX), CX // length of string MOVQ 8(AX), CX // length of string
MOVQ (AX), AX // string data MOVQ (AX), AX // string data
#ifndef GOEXPERIMENT_regabiargs
LEAQ ret+16(FP), DX
#endif
JMP aeshashbody<>(SB) JMP aeshashbody<>(SB)
noaes: noaes:
JMP runtime·strhashFallback<ABIInternal>(SB) JMP runtime·strhashFallback<ABIInternal>(SB)
// AX: data // AX: data
#ifdef GOEXPERIMENT_regabiargs
// BX: hash seed // BX: hash seed
#else
// h+8(FP): hash seed
#endif
// CX: length // CX: length
#ifdef GOEXPERIMENT_regabiargs
// At return: AX = return value // At return: AX = return value
#else
// DX: address to put return value
#endif
TEXT aeshashbody<>(SB),NOSPLIT,$0-0 TEXT aeshashbody<>(SB),NOSPLIT,$0-0
// Fill an SSE register with our seeds. // Fill an SSE register with our seeds.
#ifdef GOEXPERIMENT_regabiargs
MOVQ BX, X0 // 64 bits of per-table hash seed MOVQ BX, X0 // 64 bits of per-table hash seed
#else
MOVQ h+8(FP), X0 // 64 bits of per-table hash seed
#endif
PINSRW $4, CX, X0 // 16 bits of length PINSRW $4, CX, X0 // 16 bits of length
PSHUFHW $0, X0, X0 // repeat length 4 times total PSHUFHW $0, X0, X0 // repeat length 4 times total
MOVO X0, X1 // save unscrambled seed MOVO X0, X1 // save unscrambled seed
@ -1079,11 +1009,7 @@ final1:
AESENC X1, X1 // scramble combo 3 times AESENC X1, X1 // scramble combo 3 times
AESENC X1, X1 AESENC X1, X1
AESENC X1, X1 AESENC X1, X1
#ifdef GOEXPERIMENT_regabiargs
MOVQ X1, AX // return X1 MOVQ X1, AX // return X1
#else
MOVQ X1, (DX)
#endif
RET RET
endofpage: endofpage:
@ -1099,11 +1025,7 @@ endofpage:
aes0: aes0:
// Return scrambled input seed // Return scrambled input seed
AESENC X0, X0 AESENC X0, X0
#ifdef GOEXPERIMENT_regabiargs
MOVQ X0, AX // return X0 MOVQ X0, AX // return X0
#else
MOVQ X0, (DX)
#endif
RET RET
aes16: aes16:
@ -1133,11 +1055,7 @@ aes17to32:
// combine results // combine results
PXOR X3, X2 PXOR X3, X2
#ifdef GOEXPERIMENT_regabiargs
MOVQ X2, AX // return X2 MOVQ X2, AX // return X2
#else
MOVQ X2, (DX)
#endif
RET RET
aes33to64: aes33to64:
@ -1179,11 +1097,7 @@ aes33to64:
PXOR X6, X4 PXOR X6, X4
PXOR X7, X5 PXOR X7, X5
PXOR X5, X4 PXOR X5, X4
#ifdef GOEXPERIMENT_regabiargs
MOVQ X4, AX // return X4 MOVQ X4, AX // return X4
#else
MOVQ X4, (DX)
#endif
RET RET
aes65to128: aes65to128:
@ -1267,11 +1181,7 @@ aes65to128:
PXOR X9, X8 PXOR X9, X8
// X15 must be zero on return // X15 must be zero on return
PXOR X15, X15 PXOR X15, X15
#ifdef GOEXPERIMENT_regabiargs
MOVQ X8, AX // return X8 MOVQ X8, AX // return X8
#else
MOVQ X8, (DX)
#endif
RET RET
aes129plus: aes129plus:
@ -1389,37 +1299,22 @@ aesloop:
PXOR X9, X8 PXOR X9, X8
// X15 must be zero on return // X15 must be zero on return
PXOR X15, X15 PXOR X15, X15
#ifdef GOEXPERIMENT_regabiargs
MOVQ X8, AX // return X8 MOVQ X8, AX // return X8
#else
MOVQ X8, (DX)
#endif
RET RET
// func memhash32(p unsafe.Pointer, h uintptr) uintptr // func memhash32(p unsafe.Pointer, h uintptr) uintptr
// ABIInternal for performance. // ABIInternal for performance.
TEXT runtime·memhash32<ABIInternal>(SB),NOSPLIT,$0-24 TEXT runtime·memhash32<ABIInternal>(SB),NOSPLIT,$0-24
#ifdef GOEXPERIMENT_regabiargs
// AX = ptr to data // AX = ptr to data
// BX = seed // BX = seed
#endif
CMPB runtime·useAeshash(SB), $0 CMPB runtime·useAeshash(SB), $0
JEQ noaes JEQ noaes
#ifdef GOEXPERIMENT_regabiargs
MOVQ BX, X0 // X0 = seed MOVQ BX, X0 // X0 = seed
#else
MOVQ p+0(FP), AX // ptr to data
MOVQ h+8(FP), X0 // seed
#endif
PINSRD $2, (AX), X0 // data PINSRD $2, (AX), X0 // data
AESENC runtime·aeskeysched+0(SB), X0 AESENC runtime·aeskeysched+0(SB), X0
AESENC runtime·aeskeysched+16(SB), X0 AESENC runtime·aeskeysched+16(SB), X0
AESENC runtime·aeskeysched+32(SB), X0 AESENC runtime·aeskeysched+32(SB), X0
#ifdef GOEXPERIMENT_regabiargs
MOVQ X0, AX // return X0 MOVQ X0, AX // return X0
#else
MOVQ X0, ret+16(FP)
#endif
RET RET
noaes: noaes:
JMP runtime·memhash32Fallback<ABIInternal>(SB) JMP runtime·memhash32Fallback<ABIInternal>(SB)
@ -1427,28 +1322,16 @@ noaes:
// func memhash64(p unsafe.Pointer, h uintptr) uintptr // func memhash64(p unsafe.Pointer, h uintptr) uintptr
// ABIInternal for performance. // ABIInternal for performance.
TEXT runtime·memhash64<ABIInternal>(SB),NOSPLIT,$0-24 TEXT runtime·memhash64<ABIInternal>(SB),NOSPLIT,$0-24
#ifdef GOEXPERIMENT_regabiargs
// AX = ptr to data // AX = ptr to data
// BX = seed // BX = seed
#else
#endif
CMPB runtime·useAeshash(SB), $0 CMPB runtime·useAeshash(SB), $0
JEQ noaes JEQ noaes
#ifdef GOEXPERIMENT_regabiargs
MOVQ BX, X0 // X0 = seed MOVQ BX, X0 // X0 = seed
#else
MOVQ p+0(FP), AX // ptr to data
MOVQ h+8(FP), X0 // seed
#endif
PINSRQ $1, (AX), X0 // data PINSRQ $1, (AX), X0 // data
AESENC runtime·aeskeysched+0(SB), X0 AESENC runtime·aeskeysched+0(SB), X0
AESENC runtime·aeskeysched+16(SB), X0 AESENC runtime·aeskeysched+16(SB), X0
AESENC runtime·aeskeysched+32(SB), X0 AESENC runtime·aeskeysched+32(SB), X0
#ifdef GOEXPERIMENT_regabiargs
MOVQ X0, AX // return X0 MOVQ X0, AX // return X0
#else
MOVQ X0, ret+16(FP)
#endif
RET RET
noaes: noaes:
JMP runtime·memhash64Fallback<ABIInternal>(SB) JMP runtime·memhash64Fallback<ABIInternal>(SB)
@ -1925,146 +1808,61 @@ TEXT runtime·debugCallPanicked(SB),NOSPLIT,$16-16
// The tail call makes these stubs disappear in backtraces. // The tail call makes these stubs disappear in backtraces.
// Defined as ABIInternal since they do not use the stack-based Go ABI. // Defined as ABIInternal since they do not use the stack-based Go ABI.
TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicIndex<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicIndex<ABIInternal>(SB) JMP runtime·goPanicIndex<ABIInternal>(SB)
TEXT runtime·panicIndexU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicIndexU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicIndexU<ABIInternal>(SB) JMP runtime·goPanicIndexU<ABIInternal>(SB)
TEXT runtime·panicSliceAlen<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceAlen<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX MOVQ CX, AX
MOVQ DX, BX MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAlen<ABIInternal>(SB) JMP runtime·goPanicSliceAlen<ABIInternal>(SB)
TEXT runtime·panicSliceAlenU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceAlenU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX MOVQ CX, AX
MOVQ DX, BX MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAlenU<ABIInternal>(SB) JMP runtime·goPanicSliceAlenU<ABIInternal>(SB)
TEXT runtime·panicSliceAcap<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceAcap<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX MOVQ CX, AX
MOVQ DX, BX MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAcap<ABIInternal>(SB) JMP runtime·goPanicSliceAcap<ABIInternal>(SB)
TEXT runtime·panicSliceAcapU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceAcapU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX MOVQ CX, AX
MOVQ DX, BX MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSliceAcapU<ABIInternal>(SB) JMP runtime·goPanicSliceAcapU<ABIInternal>(SB)
TEXT runtime·panicSliceB<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceB<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSliceB<ABIInternal>(SB) JMP runtime·goPanicSliceB<ABIInternal>(SB)
TEXT runtime·panicSliceBU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceBU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSliceBU<ABIInternal>(SB) JMP runtime·goPanicSliceBU<ABIInternal>(SB)
TEXT runtime·panicSlice3Alen<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3Alen<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3Alen<ABIInternal>(SB) JMP runtime·goPanicSlice3Alen<ABIInternal>(SB)
TEXT runtime·panicSlice3AlenU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3AlenU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3AlenU<ABIInternal>(SB) JMP runtime·goPanicSlice3AlenU<ABIInternal>(SB)
TEXT runtime·panicSlice3Acap<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3Acap<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3Acap<ABIInternal>(SB) JMP runtime·goPanicSlice3Acap<ABIInternal>(SB)
TEXT runtime·panicSlice3AcapU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3AcapU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSlice3AcapU<ABIInternal>(SB) JMP runtime·goPanicSlice3AcapU<ABIInternal>(SB)
TEXT runtime·panicSlice3B<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3B<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX MOVQ CX, AX
MOVQ DX, BX MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSlice3B<ABIInternal>(SB) JMP runtime·goPanicSlice3B<ABIInternal>(SB)
TEXT runtime·panicSlice3BU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3BU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, AX MOVQ CX, AX
MOVQ DX, BX MOVQ DX, BX
#else
MOVQ CX, x+0(FP)
MOVQ DX, y+8(FP)
#endif
JMP runtime·goPanicSlice3BU<ABIInternal>(SB) JMP runtime·goPanicSlice3BU<ABIInternal>(SB)
TEXT runtime·panicSlice3C<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3C<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSlice3C<ABIInternal>(SB) JMP runtime·goPanicSlice3C<ABIInternal>(SB)
TEXT runtime·panicSlice3CU<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSlice3CU<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ AX, x+0(FP)
MOVQ CX, y+8(FP)
#endif
JMP runtime·goPanicSlice3CU<ABIInternal>(SB) JMP runtime·goPanicSlice3CU<ABIInternal>(SB)
TEXT runtime·panicSliceConvert<ABIInternal>(SB),NOSPLIT,$0-16 TEXT runtime·panicSliceConvert<ABIInternal>(SB),NOSPLIT,$0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ DX, AX MOVQ DX, AX
#else
MOVQ DX, x+0(FP)
MOVQ BX, y+8(FP)
#endif
JMP runtime·goPanicSliceConvert<ABIInternal>(SB) JMP runtime·goPanicSliceConvert<ABIInternal>(SB)
#ifdef GOOS_android #ifdef GOOS_android

View File

@ -13,14 +13,9 @@
// func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr) // func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
// ABIInternal for performance. // ABIInternal for performance.
TEXT runtime·memclrNoHeapPointers<ABIInternal>(SB), NOSPLIT, $0-16 TEXT runtime·memclrNoHeapPointers<ABIInternal>(SB), NOSPLIT, $0-16
#ifdef GOEXPERIMENT_regabiargs
// AX = ptr // AX = ptr
// BX = n // BX = n
MOVQ AX, DI // DI = ptr MOVQ AX, DI // DI = ptr
#else
MOVQ ptr+0(FP), DI
MOVQ n+8(FP), BX
#endif
XORQ AX, AX XORQ AX, AX
// MOVOU seems always faster than REP STOSQ. // MOVOU seems always faster than REP STOSQ.

View File

@ -34,18 +34,12 @@
// func memmove(to, from unsafe.Pointer, n uintptr) // func memmove(to, from unsafe.Pointer, n uintptr)
// ABIInternal for performance. // ABIInternal for performance.
TEXT runtime·memmove<ABIInternal>(SB), NOSPLIT, $0-24 TEXT runtime·memmove<ABIInternal>(SB), NOSPLIT, $0-24
#ifdef GOEXPERIMENT_regabiargs
// AX = to // AX = to
// BX = from // BX = from
// CX = n // CX = n
MOVQ AX, DI MOVQ AX, DI
MOVQ BX, SI MOVQ BX, SI
MOVQ CX, BX MOVQ CX, BX
#else
MOVQ to+0(FP), DI
MOVQ from+8(FP), SI
MOVQ n+16(FP), BX
#endif
// REP instructions have a high startup cost, so we handle small sizes // REP instructions have a high startup cost, so we handle small sizes
// with some straightline code. The REP MOVSQ instruction is really fast // with some straightline code. The REP MOVSQ instruction is really fast

View File

@ -46,11 +46,7 @@
// Defined as ABIInternal so as to avoid introducing a wrapper, // Defined as ABIInternal so as to avoid introducing a wrapper,
// which would render runtime.getcallerpc ineffective. // which would render runtime.getcallerpc ineffective.
TEXT runtime·raceread<ABIInternal>(SB), NOSPLIT, $0-8 TEXT runtime·raceread<ABIInternal>(SB), NOSPLIT, $0-8
#ifdef GOEXPERIMENT_regabiargs
MOVQ AX, RARG1 MOVQ AX, RARG1
#else
MOVQ addr+0(FP), RARG1
#endif
MOVQ (SP), RARG2 MOVQ (SP), RARG2
// void __tsan_read(ThreadState *thr, void *addr, void *pc); // void __tsan_read(ThreadState *thr, void *addr, void *pc);
MOVQ $__tsan_read(SB), AX MOVQ $__tsan_read(SB), AX
@ -76,11 +72,7 @@ TEXT runtime·racereadpc(SB), NOSPLIT, $0-24
// Defined as ABIInternal so as to avoid introducing a wrapper, // Defined as ABIInternal so as to avoid introducing a wrapper,
// which would render runtime.getcallerpc ineffective. // which would render runtime.getcallerpc ineffective.
TEXT runtime·racewrite<ABIInternal>(SB), NOSPLIT, $0-8 TEXT runtime·racewrite<ABIInternal>(SB), NOSPLIT, $0-8
#ifdef GOEXPERIMENT_regabiargs
MOVQ AX, RARG1 MOVQ AX, RARG1
#else
MOVQ addr+0(FP), RARG1
#endif
MOVQ (SP), RARG2 MOVQ (SP), RARG2
// void __tsan_write(ThreadState *thr, void *addr, void *pc); // void __tsan_write(ThreadState *thr, void *addr, void *pc);
MOVQ $__tsan_write(SB), AX MOVQ $__tsan_write(SB), AX
@ -131,13 +123,8 @@ TEXT runtime·racereadrangepc1(SB), NOSPLIT, $0-24
// Defined as ABIInternal so as to avoid introducing a wrapper, // Defined as ABIInternal so as to avoid introducing a wrapper,
// which would render runtime.getcallerpc ineffective. // which would render runtime.getcallerpc ineffective.
TEXT runtime·racewriterange<ABIInternal>(SB), NOSPLIT, $0-16 TEXT runtime·racewriterange<ABIInternal>(SB), NOSPLIT, $0-16
#ifdef GOEXPERIMENT_regabiargs
MOVQ AX, RARG1 MOVQ AX, RARG1
MOVQ BX, RARG2 MOVQ BX, RARG2
#else
MOVQ addr+0(FP), RARG1
MOVQ size+8(FP), RARG2
#endif
MOVQ (SP), RARG3 MOVQ (SP), RARG3
// void __tsan_write_range(ThreadState *thr, void *addr, uintptr size, void *pc); // void __tsan_write_range(ThreadState *thr, void *addr, uintptr size, void *pc);
MOVQ $__tsan_write_range(SB), AX MOVQ $__tsan_write_range(SB), AX