aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_s390x.s
diff options
context:
space:
mode:
authorSokolov Yura <funny.falcon@gmail.com>2017-01-05 09:36:27 +0300
committerJosh Bleecher Snyder <josharian@gmail.com>2017-02-10 19:16:29 +0000
commitd03c1248604679e1e6a01253144065bc57da48b8 (patch)
treee668dc946c619cc67b9a5b79df244e58bf0b2233 /src/runtime/asm_s390x.s
parent9f75ecd5e12f2b9988086954933d610cd5647918 (diff)
downloadgo-d03c1248604679e1e6a01253144065bc57da48b8.tar.gz
go-d03c1248604679e1e6a01253144065bc57da48b8.zip
runtime: implement fastrand in go
So it could be inlined. Using bit-tricks it could be implemented without condition (improved trick version by Minux Ma). Simple benchmark shows it is faster on i386 and x86_64, though I don't know will it be faster on other architectures? benchmark old ns/op new ns/op delta BenchmarkFastrand-3 2.79 1.48 -46.95% BenchmarkFastrandHashiter-3 25.9 24.9 -3.86% Change-Id: Ie2eb6d0f598c0bb5fac7f6ad0f8b5e3eddaa361b Reviewed-on: https://go-review.googlesource.com/34782 Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/asm_s390x.s')
-rw-r--r--src/runtime/asm_s390x.s11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/runtime/asm_s390x.s b/src/runtime/asm_s390x.s
index c2212a5f21..50a29e89d2 100644
--- a/src/runtime/asm_s390x.s
+++ b/src/runtime/asm_s390x.s
@@ -851,17 +851,6 @@ TEXT runtime·memeqbodyclc(SB),NOSPLIT|NOFRAME,$0-0
CLC $1, 0(R3), 0(R5)
RET
-TEXT runtime·fastrand(SB), NOSPLIT, $0-4
- MOVD g_m(g), R4
- MOVWZ m_fastrand(R4), R3
- ADD R3, R3
- CMPW R3, $0
- BGE 2(PC)
- XOR $0x88888eef, R3
- MOVW R3, m_fastrand(R4)
- MOVW R3, ret+0(FP)
- RET
-
TEXT bytes·IndexByte(SB),NOSPLIT|NOFRAME,$0-40
MOVD s+0(FP), R3 // s => R3
MOVD s_len+8(FP), R4 // s_len => R4