Skip to content

Commit 58ca089

Browse files
Andreas-Krebbelblapie
authored andcommitted
S/390: Use getauxval to fix #560
1 parent 0e47fcc commit 58ca089

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/libm/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -833,12 +833,6 @@ if (SLEEF_ARCH_S390X)
833833
add_dependencies(disps390x_128_obj disps390x_128.c_generated renamedsp128.h_generated ${TARGET_HEADERS})
834834
target_sources(${TARGET_LIBSLEEF} PRIVATE $<TARGET_OBJECTS:disps390x_128_obj>)
835835

836-
if(COMPILER_SUPPORTS_VXE2)
837-
add_library(tryvxe2_obj OBJECT tryvxe2.c)
838-
target_compile_options(tryvxe2_obj PRIVATE ${FLAGS_ENABLE_VXE2})
839-
set_target_properties(tryvxe2_obj PROPERTIES ${COMMON_TARGET_PROPERTIES})
840-
target_sources(${TARGET_LIBSLEEF} PRIVATE $<TARGET_OBJECTS:tryvxe2_obj>)
841-
endif()
842836
endif(SLEEF_ARCH_S390X)
843837

844838
# --------------------------------------------------------------------

src/libm/disps390x_128.c.org

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <assert.h>
88
#include <signal.h>
99
#include <setjmp.h>
10+
#include <sys/auxv.h>
1011

1112
#include "misc.h"
1213

@@ -15,9 +16,15 @@
1516

1617
#include "dispatcher.h"
1718

19+
static int cpuSupportsVXE2() {
20+
static int ret = -1;
21+
if (ret == -1)
22+
ret = !!(getauxval(AT_HWCAP) & HWCAP_S390_VXRS_EXT2);
23+
return ret;
24+
}
25+
1826
#ifdef ENABLE_VXE2
19-
void sleef_tryVXE2();
20-
#define SUBST_IF_EXT1(funcvxe2) if (cpuSupportsExt(sleef_tryVXE2)) p = funcvxe2;
27+
#define SUBST_IF_EXT1(funcvxe2) if (cpuSupportsVXE2()) p = funcvxe2;
2128
#else
2229
#define SUBST_IF_EXT1(funcvxe2)
2330
#endif

src/libm/tryvxe2.c

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)