libgo: update to go1.9
[official-gcc.git] / libgo / go / hash / crc32 / crc32_amd64p32.go
blob1ec44cb496a51ea940c87a3d9587ec2ca7912931
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package crc32
7 import "internal/cpu"
9 // This file contains the code to call the SSE 4.2 version of the Castagnoli
10 // CRC.
12 // castagnoliSSE42 is defined in crc32_amd64p32.s and uses the SSE4.2 CRC32
13 // instruction.
14 //go:noescape
15 func castagnoliSSE42(crc uint32, p []byte) uint32
17 func archAvailableCastagnoli() bool {
18 return cpu.X86.HasSSE42
21 func archInitCastagnoli() {
22 if !cpu.X86.HasSSE42 {
23 panic("not available")
25 // No initialization necessary.
28 func archUpdateCastagnoli(crc uint32, p []byte) uint32 {
29 if !cpu.X86.HasSSE42 {
30 panic("not available")
32 return castagnoliSSE42(crc, p)
35 func archAvailableIEEE() bool { return false }
36 func archInitIEEE() { panic("not available") }
37 func archUpdateIEEE(crc uint32, p []byte) uint32 { panic("not available") }