-
Notifications
You must be signed in to change notification settings - Fork 0
/
0005-gmodule-avx.patch
45 lines (42 loc) · 1.24 KB
/
0005-gmodule-avx.patch
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Sat, 26 May 2018 23:23:57 +0000
Subject: [PATCH] gmodule avx
---
gmodule/gmodule.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c
index 3c67e2e..130fb07 100644
--- a/gmodule/gmodule.c
+++ b/gmodule/gmodule.c
@@ -557,8 +557,30 @@ g_module_open_full (const gchar *file_name,
return module;
}
+ name = NULL;
+
+ if (!name && __builtin_cpu_supports("avx512cd"))
+ {
+ name = g_strconcat (file_name, ".avx512", NULL);
+ if (!g_file_test (name, G_FILE_TEST_IS_REGULAR))
+ {
+ g_free (name);
+ name = NULL;
+ }
+ }
+
+ if (!name && __builtin_cpu_supports("avx2"))
+ {
+ name = g_strconcat (file_name, ".avx2", NULL);
+ if (!g_file_test (name, G_FILE_TEST_IS_REGULAR))
+ {
+ g_free (name);
+ name = NULL;
+ }
+ }
+
/* check whether we have a readable file right away */
- if (g_file_test (file_name, G_FILE_TEST_IS_REGULAR))
+ if (!name && g_file_test (file_name, G_FILE_TEST_IS_REGULAR))
name = g_strdup (file_name);
/* try completing file name with standard library suffix */
if (!name)