Skip to content

Commit

Permalink
Merge pull request #143 from VectorCamp/develop
Browse files Browse the repository at this point in the history
Prepare for new release 5.4.9
  • Loading branch information
markos authored Mar 23, 2023
2 parents 6d8599e + 8c7fdf1 commit b4bba94
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 23 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project (vectorscan C CXX)

set (HS_MAJOR_VERSION 5)
set (HS_MINOR_VERSION 4)
set (HS_PATCH_VERSION 8)
set (HS_PATCH_VERSION 9)
set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION})

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down Expand Up @@ -544,7 +544,6 @@ endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_CXX_FLAGS}")

add_subdirectory(util)
add_subdirectory(doc/dev-reference)

# PCRE check, we have a fixed requirement for PCRE to use Chimera
Expand Down Expand Up @@ -588,7 +587,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
endif()

set(RAGEL_C_FLAGS "-Wno-unused")
set(RAGEL_C_FLAGS "-Wno-unused -funsigned-char")

set_source_files_properties(
${CMAKE_BINARY_DIR}/src/parser/Parser.cpp
Expand All @@ -604,6 +603,8 @@ set_source_files_properties(

ragelmaker(src/parser/control_verbs.rl)

add_subdirectory(util)

SET(hs_HEADERS
src/hs.h
src/hs_common.h
Expand Down
2 changes: 1 addition & 1 deletion cmake/ragel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function(ragelmaker src_rl)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${src_dir}/${src_file}.cpp
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${src_dir}
COMMAND ${RAGEL} ${CMAKE_CURRENT_SOURCE_DIR}/${src_rl} -o ${rl_out}
COMMAND ${RAGEL} ${CMAKE_CURRENT_SOURCE_DIR}/${src_rl} -o ${rl_out} -G0
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src_rl}
)
add_custom_target(ragel_${src_file} DEPENDS ${rl_out})
Expand Down
2 changes: 1 addition & 1 deletion src/fdr/teddy_runtime_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static really_inline
m512 vectoredLoad512(m512 *p_mask, const u8 *ptr, const size_t start_offset,
const u8 *lo, const u8 *hi, const u8 *hbuf, size_t hlen,
const u32 nMasks) {
m512 val;
m512 val = zeroes512();

uintptr_t copy_start;
uintptr_t copy_len;
Expand Down
2 changes: 1 addition & 1 deletion src/hs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

#define HS_MAJOR 5
#define HS_MINOR 4
#define HS_PATCH 0
#define HS_PATCH 9

#include "hs_compile.h"
#include "hs_runtime.h"
Expand Down
1 change: 1 addition & 0 deletions src/parser/Parser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ unichar readUtf8CodePoint4c(const char *s) {

%%{
machine regex;
alphtype unsigned char;

action throwUnsupportedEscape {
ostringstream str;
Expand Down
1 change: 1 addition & 0 deletions src/parser/control_verbs.rl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const char *read_control_verbs(const char *ptr, const char *end, size_t start,

%%{
machine ControlVerbs;
alphtype unsigned char;

# Verbs that we recognise but do not support.
unhandledVerbs = '(*' (
Expand Down
4 changes: 2 additions & 2 deletions src/util/arch/common/simd_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static really_inline m256 loadu2x128(const void *ptr) {
// aligned store
static really_inline void store256(void *ptr, m256 a) {
assert(ISALIGNED_N(ptr, alignof(m256)));
ptr = assume_aligned(ptr, 16);
ptr = vectorscan_assume_aligned(ptr, 16);
*(m256 *)ptr = a;
}

Expand Down Expand Up @@ -486,7 +486,7 @@ static really_inline m384 load384(const void *ptr) {
// aligned store
static really_inline void store384(void *ptr, m384 a) {
assert(ISALIGNED_16(ptr));
ptr = assume_aligned(ptr, 16);
ptr = vectorscan_assume_aligned(ptr, 16);
*(m384 *)ptr = a;
}

Expand Down
4 changes: 2 additions & 2 deletions src/util/arch/x86/simd_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,14 @@ static really_inline m128 andnot128(m128 a, m128 b) {
// aligned load
static really_inline m128 load128(const void *ptr) {
assert(ISALIGNED_N(ptr, alignof(m128)));
ptr = assume_aligned(ptr, 16);
ptr = vectorscan_assume_aligned(ptr, 16);
return _mm_load_si128((const m128 *)ptr);
}

// aligned store
static really_inline void store128(void *ptr, m128 a) {
assert(ISALIGNED_N(ptr, alignof(m128)));
ptr = assume_aligned(ptr, 16);
ptr = vectorscan_assume_aligned(ptr, 16);
*(m128 *)ptr = a;
}

Expand Down
8 changes: 4 additions & 4 deletions src/util/simd_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
// it's available. Note that we need to handle C or C++ compilation.
#ifdef __cplusplus
# ifdef HAVE_CXX_BUILTIN_ASSUME_ALIGNED
# define assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# define vectorscan_assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# endif
#else
# ifdef HAVE_CC_BUILTIN_ASSUME_ALIGNED
# define assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# define vectorscan_assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# endif
#endif

// Fallback to identity case.
#ifndef assume_aligned
#define assume_aligned(x, y) (x)
#ifndef vectorscan_assume_aligned
#define vectorscan_assume_aligned(x, y) (x)
#endif

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion src/util/supervector/arch/arm/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ template <>
really_inline SuperVector<16> SuperVector<16>::load(void const *ptr)
{
assert(ISALIGNED_N(ptr, alignof(SuperVector::size)));
ptr = assume_aligned(ptr, SuperVector::size);
ptr = vectorscan_assume_aligned(ptr, SuperVector::size);
return {vld1q_s32((const int32_t *)ptr)};
}

Expand Down
6 changes: 3 additions & 3 deletions src/util/supervector/arch/x86/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ template <>
really_inline SuperVector<16> SuperVector<16>::load(void const *ptr)
{
assert(ISALIGNED_N(ptr, alignof(SuperVector::size)));
ptr = assume_aligned(ptr, SuperVector::size);
ptr = vectorscan_assume_aligned(ptr, SuperVector::size);
return _mm_load_si128((const m128 *)ptr);
}

Expand Down Expand Up @@ -1119,7 +1119,7 @@ template <>
really_inline SuperVector<32> SuperVector<32>::load(void const *ptr)
{
assert(ISALIGNED_N(ptr, alignof(SuperVector::size)));
ptr = assume_aligned(ptr, SuperVector::size);
ptr = vectorscan_assume_aligned(ptr, SuperVector::size);
return {_mm256_load_si256((const m256 *)ptr)};
}

Expand Down Expand Up @@ -1769,7 +1769,7 @@ template <>
really_inline SuperVector<64> SuperVector<64>::load(void const *ptr)
{
assert(ISALIGNED_N(ptr, alignof(SuperVector::size)));
ptr = assume_aligned(ptr, SuperVector::size);
ptr = vectorscan_assume_aligned(ptr, SuperVector::size);
return {_mm512_load_si512((const m512 *)ptr)};
}

Expand Down
8 changes: 4 additions & 4 deletions src/util/supervector/supervector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ using Z_TYPE = u32;
// it's available. Note that we need to handle C or C++ compilation.
#ifdef __cplusplus
# ifdef HAVE_CXX_BUILTIN_ASSUME_ALIGNED
# define assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# define vectorscan_assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# endif
#else
# ifdef HAVE_CC_BUILTIN_ASSUME_ALIGNED
# define assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# define vectorscan_assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# endif
#endif

// Fallback to identity case.
#ifndef assume_aligned
#define assume_aligned(x, y) (x)
#ifndef vectorscan_assume_aligned
#define vectorscan_assume_aligned(x, y) (x)
#endif

template <uint16_t SIZE>
Expand Down
1 change: 1 addition & 0 deletions tools/hscollider/ColliderCorporaParser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ char unhex(const char *start, UNUSED const char *end) {

%%{
machine FileCorporaParser;
alphtype unsigned char;

action accumulateNum {
num = (num * 10) + (fc - '0');
Expand Down
4 changes: 3 additions & 1 deletion util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS} ${HS_CXX_FLAGS}")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR})

message("RAGEL_C_FLAGS" ${RAGEL_C_FLAGS})

set_source_files_properties(
${CMAKE_BINARY_DIR}/tools/ExpressionParser.cpp
${CMAKE_BINARY_DIR}/util/ExpressionParser.cpp
PROPERTIES
COMPILE_FLAGS "${RAGEL_C_FLAGS}")

Expand Down
1 change: 1 addition & 0 deletions util/ExpressionParser.rl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ enum ParamKey {

%%{
machine ExpressionParser;
alphtype unsigned char;

action accumulateNum {
num = (num * 10) + (fc - '0');
Expand Down

0 comments on commit b4bba94

Please sign in to comment.