mirror of
https://github.com/golang/go
synced 2024-11-22 09:44:40 -07:00
19ed0d993c
There are still two places in src/runtime/string.go that use staticbytes, so we cannot delete it just yet. There is a new codegen test to verify that the index calculation is constant-folded, at least on amd64. ppc64, mips[64] and s390x cannot currently do that. There is also a new runtime benchmark to ensure that this does not slow down performance (tested against parent commit): name old time/op new time/op delta ConvT2EByteSized/bool-4 1.07ns ± 1% 1.07ns ± 1% ~ (p=0.060 n=14+15) ConvT2EByteSized/uint8-4 1.06ns ± 1% 1.07ns ± 1% ~ (p=0.095 n=14+15) Updates #37612 Change-Id: I5ec30738edaa48cda78dfab4a78e24a32fa7fd6a Reviewed-on: https://go-review.googlesource.com/c/go/+/221957 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
23 lines
500 B
Go
23 lines
500 B
Go
// asmcheck
|
|
|
|
package codegen
|
|
|
|
// Copyright 2020 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.
|
|
|
|
func booliface() interface{} {
|
|
// amd64:`LEAQ\truntime.staticuint64s\+8\(SB\)`
|
|
return true
|
|
}
|
|
|
|
func smallint8iface() interface{} {
|
|
// amd64:`LEAQ\truntime.staticuint64s\+2024\(SB\)`
|
|
return int8(-3)
|
|
}
|
|
|
|
func smalluint8iface() interface{} {
|
|
// amd64:`LEAQ\truntime.staticuint64s\+24\(SB\)`
|
|
return uint8(3)
|
|
}
|