Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S/390: Use getauxval for detecting VXE2 to fix #560 #561

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading