Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
AVX512F support always returned true due to using -mavx512f as flag instead of -march=native to `try_compile`
  • Loading branch information
theIDinside committed Jul 3, 2024
1 parent e55907c commit 23fcaef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if (SUPPORTS_MACRO_PREFIX_MAP)
set(FLAGS_COMMON "${FLAGS_COMMON} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=")
endif()

try_compile(AVX512F_SUPPORT ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/test/gdb_avx512.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS=-mavx512f)
try_compile(AVX512F_SUPPORT ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src/test/gdb_avx512.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS=-march=native)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS_COMMON} -Wstrict-prototypes -std=gnu11")
# Define __STDC_LIMIT_MACROS so |#include <stdint.h>| works as expected.
Expand Down
3 changes: 0 additions & 3 deletions src/ExtraRegisters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ static const uint64_t PKRU_FEATURE_MASK = 1 << PKRU_FEATURE_BIT;
static const size_t xsave_header_offset = 512;
static const size_t xsave_header_size = 64;
static const size_t xsave_header_end = xsave_header_offset + xsave_header_size;
// This is always at 576 since AVX is always the first optional feature,
// if present.
static const size_t AVX_xsave_offset = 576;
struct RegisterConfig {
int8_t feature;
GdbServerRegister base;
Expand Down

0 comments on commit 23fcaef

Please sign in to comment.