mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
build: Make sure ifuncs exist when using fp16
Fixes msys compiles on Windows (and everywhere else hopefully). Fixes #4285
This commit is contained in:
parent
3d536f1293
commit
3c9c7a0e72
14
meson.build
14
meson.build
@ -712,12 +712,24 @@ if get_option('f16c').enabled()
|
|||||||
# if !defined(__amd64__) && !defined(__x86_64__)
|
# if !defined(__amd64__) && !defined(__x86_64__)
|
||||||
# error "F16C intrinsics are only available on x86_64"
|
# error "F16C intrinsics are only available on x86_64"
|
||||||
# endif
|
# endif
|
||||||
|
#if !defined __has_attribute
|
||||||
|
# error "No __has_attribute() support"
|
||||||
|
#endif
|
||||||
|
#if !__has_attribute(ifunc)
|
||||||
|
# error "ifunc not supported"
|
||||||
|
#endif
|
||||||
|
static int resolved_ifunc (void) { return 0; }
|
||||||
|
static void *resolve_ifunc (void) { return resolved_ifunc; }
|
||||||
|
int ifunc_test (void) __attribute__((ifunc ("resolve_ifunc")));
|
||||||
|
#else
|
||||||
|
int ifunc_test (void) { return 0; }
|
||||||
#endif
|
#endif
|
||||||
#if defined(__SSE__) || defined(_MSC_VER)
|
#if defined(__SSE__) || defined(_MSC_VER)
|
||||||
# include <immintrin.h>
|
# include <immintrin.h>
|
||||||
#else
|
#else
|
||||||
# error "No F16C intrinsics available"
|
# error "No F16C intrinsics available"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
float f[4] = { 0, };
|
float f[4] = { 0, };
|
||||||
unsigned short h[4] = { 0, };
|
unsigned short h[4] = { 0, };
|
||||||
@ -730,7 +742,7 @@ int main () {
|
|||||||
__builtin_cpu_supports ("f16c");
|
__builtin_cpu_supports ("f16c");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return ifunc_test ();
|
||||||
}'''
|
}'''
|
||||||
if cc.get_id() != 'msvc'
|
if cc.get_id() != 'msvc'
|
||||||
test_f16c_cflags = [ '-mf16c' ]
|
test_f16c_cflags = [ '-mf16c' ]
|
||||||
|
Loading…
Reference in New Issue
Block a user