1 Star 0 Fork 0

黄梓健 / go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
spectre.go 722 Bytes
一键复制 编辑 原始数据 按行查看 历史
// +build amd64
// asmcheck -gcflags=-spectre=index
// 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.
package codegen
func IndexArray(x *[10]int, i int) int {
// amd64:`CMOVQCC`
return x[i]
}
func IndexString(x string, i int) byte {
// amd64:`CMOVQCC`
return x[i]
}
func IndexSlice(x []float64, i int) float64 {
// amd64:`CMOVQCC`
return x[i]
}
func SliceArray(x *[10]int, i, j int) []int {
// amd64:`CMOVQHI`
return x[i:j]
}
func SliceString(x string, i, j int) string {
// amd64:`CMOVQHI`
return x[i:j]
}
func SliceSlice(x []float64, i, j int) []float64 {
// amd64:`CMOVQHI`
return x[i:j]
}
1
https://gitee.com/HUANG_ZI_JIAN/go.git
git@gitee.com:HUANG_ZI_JIAN/go.git
HUANG_ZI_JIAN
go
go
1d78139128d6

搜索帮助

53164aa7 5694891 3bd8fe86 5694891