aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/internal/bytealg/bytealg.go
blob: b91eb0075ba5f0217888fc7e6ca84d637f01c6d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2018 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.

// +build ignore_for_gccgo

package bytealg

import (
	"internal/cpu"
	"unsafe"
)

// Offsets into internal/cpu records for use in assembly.
const (
	x86_HasSSE2   = unsafe.Offsetof(cpu.X86.HasSSE2)
	x86_HasSSE42  = unsafe.Offsetof(cpu.X86.HasSSE42)
	x86_HasAVX2   = unsafe.Offsetof(cpu.X86.HasAVX2)
	x86_HasPOPCNT = unsafe.Offsetof(cpu.X86.HasPOPCNT)
	s390x_HasVX   = unsafe.Offsetof(cpu.S390X.HasVX)
)

// MaxLen is the maximum length of the string to be searched for (argument b) in Index.
var MaxLen int = 32