1// asmcheck -gcflags=-spectre=index 2 3//go:build amd64 4 5// Copyright 2020 The Go Authors. All rights reserved. 6// Use of this source code is governed by a BSD-style 7// license that can be found in the LICENSE file. 8 9package codegen 10 11func IndexArray(x *[10]int, i int) int { 12 // amd64:`CMOVQCC` 13 return x[i] 14} 15 16func IndexString(x string, i int) byte { 17 // amd64:`CMOVQ(LS|CC)` 18 return x[i] 19} 20 21func IndexSlice(x []float64, i int) float64 { 22 // amd64:`CMOVQ(LS|CC)` 23 return x[i] 24} 25 26func SliceArray(x *[10]int, i, j int) []int { 27 // amd64:`CMOVQHI` 28 return x[i:j] 29} 30 31func SliceString(x string, i, j int) string { 32 // amd64:`CMOVQHI` 33 return x[i:j] 34} 35 36func SliceSlice(x []float64, i, j int) []float64 { 37 // amd64:`CMOVQHI` 38 return x[i:j] 39} 40