File: replace-custom-CPU-feature-detection.patch

package info (click to toggle)
golang-github-aead-poly1305 0.0~git20170715.6cf43fd-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 152 kB
  • sloc: asm: 856; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 699 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 3fee0db0b63511234f7230da50b72414f6258f10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Mon, 16 Jul 2018 23:07:59 +0200
Subject: [PATCH] replace custom CPU feature detection

---
 poly1305_amd64.go | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/poly1305_amd64.go b/poly1305_amd64.go
index cd1a717..41b630f 100644
--- a/poly1305_amd64.go
+++ b/poly1305_amd64.go
@@ -7,13 +7,11 @@
 package poly1305
 
 import (
+	"golang.org/x/sys/cpu"
 	"io"
 )
 
-var useAVX2 = supportsAVX2()
-
-//go:noescape
-func supportsAVX2() bool
+var useAVX2 = cpu.X86.HasAVX2
 
 //go:noescape
 func initialize(state *[7]uint64, key *[32]byte)