1
0
mirror of https://github.com/fumiama/blake2b-simd.git synced 2026-06-10 04:50:30 +08:00

Detect SSE automatically and enable corresponding optimized code path.

With this change, following happens.

```
if sse {
   compressSSE()
   return
}
compressGeneric()
```

compressGeneric is used as a fallback when SSE is not detected.
This commit is contained in:
Harshavardhana
2016-06-25 00:25:28 -07:00
committed by Harshavardhana
parent 83ff4cf5f4
commit 3a46db1cb4
10 changed files with 1553 additions and 1456 deletions

15
cpuid_386.s Normal file
View File

@@ -0,0 +1,15 @@
// Copyright (c) 2015 Klaus Post, released under MIT License. See LICENSE file.
// +build 386,!gccgo
// func cpuid(op uint32) (eax, ebx, ecx, edx uint32)
TEXT ·cpuid(SB), 7, $0
XORL CX, CX
MOVL op+0(FP), AX
CPUID
MOVL AX, eax+4(FP)
MOVL BX, ebx+8(FP)
MOVL CX, ecx+12(FP)
MOVL DX, edx+16(FP)
RET