// traceback from goexit1 must hit code range of goexit
BYTE $0x90 // NOP
-// Prefetching doesn't seem to help.
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-4
- RET
-
// Add a module's moduledata to the linked list of moduledata objects. This
// is called from .init_array by a function generated in the linker and so
// follows the platform ABI wrt register preservation -- it only touches AX,
// traceback from goexit1 must hit code range of goexit
BYTE $0x90 // NOP
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
- MOVQ addr+0(FP), AX
- PREFETCHT0 (AX)
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-8
- MOVQ addr+0(FP), AX
- PREFETCHT1 (AX)
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-8
- MOVQ addr+0(FP), AX
- PREFETCHT2 (AX)
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-8
- MOVQ addr+0(FP), AX
- PREFETCHNTA (AX)
- RET
-
// This is called from .init_array and follows the platform, not Go, ABI.
TEXT runtime·addmoduledata(SB),NOSPLIT,$0-0
PUSHQ R15 // The access to global variables below implicitly uses R15, which is callee-save
// traceback from goexit1 must hit code range of goexit
BYTE $0x90 // NOP
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-4
- MOVL addr+0(FP), AX
- PREFETCHT0 (AX)
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-4
- MOVL addr+0(FP), AX
- PREFETCHT1 (AX)
- RET
-
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-4
- MOVL addr+0(FP), AX
- PREFETCHT2 (AX)
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-4
- MOVL addr+0(FP), AX
- PREFETCHNTA (AX)
- RET
-
TEXT ·checkASM(SB),NOSPLIT,$0-1
MOVB $1, ret+0(FP)
RET
// traceback from goexit1 must hit code range of goexit
MOVW R0, R0 // NOP
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-4
- RET
-
// x -> x/1000000, x%1000000, called from Go with args, results on stack.
TEXT runtime·usplit(SB),NOSPLIT,$0-12
MOVW x+0(FP), R0
MOVD R0, R0 // NOP
BL runtime·goexit1(SB) // does not return
-// TODO(aram): use PRFM here.
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-8
- RET
-
TEXT runtime·sigreturn(SB),NOSPLIT,$0-0
RET
// traceback from goexit1 must hit code range of goexit
NOR R0, R0 // NOP
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-8
- RET
-
TEXT ·checkASM(SB),NOSPLIT,$0-1
MOVW $1, R1
MOVB R1, ret+0(FP)
// traceback from goexit1 must hit code range of goexit
NOR R0, R0 // NOP
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-4
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-4
- RET
-
TEXT ·checkASM(SB),NOSPLIT,$0-1
MOVW $1, R1
MOVB R1, ret+0(FP)
// traceback from goexit1 must hit code range of goexit
MOVD R0, R0 // NOP
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-8
- RET
-
TEXT runtime·sigreturn(SB),NOSPLIT,$0-0
RET
// traceback from goexit1 must hit code range of goexit
BYTE $0x07; BYTE $0x00; // 2-byte nop
-TEXT runtime·prefetcht0(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht1(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetcht2(SB),NOSPLIT,$0-8
- RET
-
-TEXT runtime·prefetchnta(SB),NOSPLIT,$0-8
- RET
-
TEXT runtime·sigreturn(SB),NOSPLIT,$0-0
RET
return
}
-// prefetch the bits.
-func (h heapBits) prefetch() {
- prefetchnta(uintptr(unsafe.Pointer((h.bitp))))
-}
-
// next returns the heapBits describing the next pointer-sized word in memory.
// That is, if h describes address p, h.next() describes p+ptrSize.
// Note that next does not modify h. The caller must record the result.
func testAtomic64() {
test_z64 = 42
test_x64 = 0
- prefetcht0(uintptr(unsafe.Pointer(&test_z64)))
- prefetcht1(uintptr(unsafe.Pointer(&test_z64)))
- prefetcht2(uintptr(unsafe.Pointer(&test_z64)))
- prefetchnta(uintptr(unsafe.Pointer(&test_z64)))
if atomic.Cas64(&test_z64, test_x64, 1) {
throw("cas64 failed")
}
func systemstack_switch()
-func prefetcht0(addr uintptr)
-func prefetcht1(addr uintptr)
-func prefetcht2(addr uintptr)
-func prefetchnta(addr uintptr)
-
// round n up to a multiple of a. a must be a power of 2.
func round(n, a uintptr) uintptr {
return (n + a - 1) &^ (a - 1)