libgo: Update to Go 1.3 release.
[official-gcc.git] / libgo / go / hash / crc32 / crc32_amd64x.go
blobb7e359930a4ca59e2f3445f01a68bcad2cc984c7
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 // +build amd64 amd64p32
7 package crc32
9 // This file contains the code to call the SSE 4.2 version of the Castagnoli
10 // CRC.
12 // haveSSE42 is defined in crc_amd64.s and uses CPUID to test for SSE 4.2
13 // support.
14 func haveSSE42() bool
16 // castagnoliSSE42 is defined in crc_amd64.s and uses the SSE4.2 CRC32
17 // instruction.
18 func castagnoliSSE42(crc uint32, p []byte) uint32
20 var sse42 = haveSSE42()
22 func updateCastagnoli(crc uint32, p []byte) uint32 {
23 if sse42 {
24 return castagnoliSSE42(crc, p)
26 return update(crc, castagnoliTable, p)