summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2021-03-10 09:37:49 +0000
committerDaiki Ueno <ueno@gnu.org>2021-03-10 09:37:49 +0000
commit07b8091ef442b93e648b1b5f614751db2eaf89f4 (patch)
tree74b96084cb9029089c521039264ab413bb2bbb0b
parentba6e4b17bf74e58a8101f825011434b497eacbaa (diff)
parent83ac883f8c05f4bde916e4f4d69b6d6645a0b174 (diff)
downloadgnutls-07b8091ef442b93e648b1b5f614751db2eaf89f4.tar.gz
Merge branch 'wip/dueno/getcpuid' into 'master'
x86: toggle polarity of check_fast_pclmul See merge request gnutls/gnutls!1400
-rw-r--r--lib/accelerated/x86/x86-common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/accelerated/x86/x86-common.c b/lib/accelerated/x86/x86-common.c
index ea4f0238b6..80d37f49d5 100644
--- a/lib/accelerated/x86/x86-common.c
+++ b/lib/accelerated/x86/x86-common.c
@@ -308,14 +308,14 @@ static int check_fast_pclmul(void)
unsigned int a,b,c,d;
unsigned int family,model;
- if (__get_cpuid(1, &a, &b, &c, &d))
+ if (!__get_cpuid(1, &a, &b, &c, &d))
return 0;
family = ((a >> 8) & 0x0F);
model = ((a >> 4) & 0x0F) + ((a >> 12) & 0xF0);
- if(((family == 0x6) && (model == 0xf || model == 0x19)) ||
- ((family == 0x7) && (model == 0x1B || model == 0x3B)))
+ if (((family == 0x6) && (model == 0xf || model == 0x19)) ||
+ ((family == 0x7) && (model == 0x1B || model == 0x3B)))
return 1;
else
return 0;
@@ -584,7 +584,7 @@ void register_x86_padlock_crypto(unsigned capabilities)
/* register GCM ciphers */
_gnutls_debug_log
("Zhaoxin GCM accelerator was detected\n");
- if (check_avx_movbe() && !check_fast_pclmul()) {
+ if (check_avx_movbe() && check_fast_pclmul()) {
_gnutls_debug_log
("Zhaoxin GCM accelerator (AVX) was detected\n");
ret =