Skip to content

Commit

Permalink
S/390: Use getauxval to fix #560
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas-Krebbel authored and blapie committed Aug 2, 2024
1 parent 2052121 commit fd871b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
6 changes: 0 additions & 6 deletions src/libm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -833,12 +833,6 @@ if (SLEEF_ARCH_S390X)
add_dependencies(disps390x_128_obj disps390x_128.c_generated renamedsp128.h_generated ${TARGET_HEADERS})
target_sources(${TARGET_LIBSLEEF} PRIVATE $<TARGET_OBJECTS:disps390x_128_obj>)

if(COMPILER_SUPPORTS_VXE2)
add_library(tryvxe2_obj OBJECT tryvxe2.c)
target_compile_options(tryvxe2_obj PRIVATE ${FLAGS_ENABLE_VXE2})
set_target_properties(tryvxe2_obj PROPERTIES ${COMMON_TARGET_PROPERTIES})
target_sources(${TARGET_LIBSLEEF} PRIVATE $<TARGET_OBJECTS:tryvxe2_obj>)
endif()
endif(SLEEF_ARCH_S390X)

# --------------------------------------------------------------------
Expand Down
11 changes: 9 additions & 2 deletions src/libm/disps390x_128.c.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <assert.h>
#include <signal.h>
#include <setjmp.h>
#include <sys/auxv.h>

#include "misc.h"

Expand All @@ -15,9 +16,15 @@

#include "dispatcher.h"

static int cpuSupportsVXE2() {
static int ret = -1;
if (ret == -1)
ret = !!(getauxval(AT_HWCAP) & HWCAP_S390_VXRS_EXT2);
return ret;
}

#ifdef ENABLE_VXE2
void sleef_tryVXE2();
#define SUBST_IF_EXT1(funcvxe2) if (cpuSupportsExt(sleef_tryVXE2)) p = funcvxe2;
#define SUBST_IF_EXT1(funcvxe2) if (cpuSupportsVXE2()) p = funcvxe2;
#else
#define SUBST_IF_EXT1(funcvxe2)
#endif
Expand Down
8 changes: 0 additions & 8 deletions src/libm/tryvxe2.c

This file was deleted.

0 comments on commit fd871b5

Please sign in to comment.