forked from intel/hyperscan
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Feature/refactor noodle masked load (WIP) #216
Draft
markos
wants to merge
10
commits into
develop
Choose a base branch
from
feature/refactor-noodle-masked-load
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d4fde85
refactor Noodle to use the same loop as Shufti/Truffle, now it's at l…
markos 9f66822
define HAVE_MASKED_LOADS for AVX512
markos 476cefb
fix loadu_maskz, remove old defines
markos 5f65b9f
fix types of z in debug prints
markos 0e2f6c1
refactor Noodle Single/Double to use masked loads
markos 5814d32
remove unneeded shifts
markos db3b0e9
comparemask_type is u64a on Arm, use single load_mask
f866b72
fix debug formats for z on arm
de66c74
fix debug prints for z on ppc64le
markos 9a53b19
add missing findLSB for ppc64le
markos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,35 +46,7 @@ | |
#endif | ||
#endif // VS_SIMDE_BACKEND | ||
|
||
#if defined(HAVE_SIMD_512_BITS) | ||
using Z_TYPE = u64a; | ||
#define Z_BITS 64 | ||
#define Z_SHIFT 63 | ||
#define Z_POSSHIFT 0 | ||
#define DOUBLE_LOAD_MASK(l) ((~0ULL) >> (Z_BITS -(l))) | ||
#define SINGLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL) | ||
#elif defined(HAVE_SIMD_256_BITS) | ||
using Z_TYPE = u32; | ||
#define Z_BITS 32 | ||
#define Z_SHIFT 31 | ||
#define Z_POSSHIFT 0 | ||
#define DOUBLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL) | ||
#define SINGLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL) | ||
#elif defined(HAVE_SIMD_128_BITS) | ||
#if !defined(VS_SIMDE_BACKEND) && (defined(ARCH_ARM32) || defined(ARCH_AARCH64)) | ||
using Z_TYPE = u64a; | ||
#define Z_BITS 64 | ||
#define Z_POSSHIFT 2 | ||
#define DOUBLE_LOAD_MASK(l) ((~0ULL) >> (Z_BITS - (l))) | ||
#else | ||
using Z_TYPE = u32; | ||
#define Z_BITS 32 | ||
#define Z_POSSHIFT 0 | ||
#define DOUBLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL) | ||
#endif | ||
#define Z_SHIFT 15 | ||
#define SINGLE_LOAD_MASK(l) (((1ULL) << (l)) - 1ULL) | ||
#endif | ||
#include <util/bitutils.h> | ||
|
||
// Define a common assume_aligned using an appropriate compiler built-in, if | ||
// it's available. Note that we need to handle C or C++ compilation. | ||
|
@@ -138,7 +110,7 @@ struct BaseVector<64> | |
static constexpr u16 previous_size = 32; | ||
}; | ||
|
||
// 128 bit implementation | ||
// 256 bit implementation | ||
template <> | ||
struct BaseVector<32> | ||
{ | ||
|
@@ -158,7 +130,11 @@ struct BaseVector<16> | |
static constexpr bool is_valid = true; | ||
static constexpr u16 size = 16; | ||
using type = m128; | ||
#if defined(ARCH_ARM32) || defined(ARCH_AARCH64) | ||
using comparemask_type = u64a; | ||
#else | ||
using comparemask_type = u32; | ||
#endif | ||
static constexpr bool has_previous = false; | ||
using previous_type = u64a; | ||
static constexpr u16 previous_size = 8; | ||
|
@@ -257,9 +233,12 @@ class SuperVector : public BaseVector<SIZE> | |
static typename base_type::comparemask_type | ||
iteration_mask(typename base_type::comparemask_type mask); | ||
|
||
static typename base_type::comparemask_type load_mask(uint8_t const len) { return (((1ULL) << (len)) - 1ULL); } | ||
static typename base_type::comparemask_type findLSB(typename base_type::comparemask_type &z); | ||
static SuperVector loadu(void const *ptr); | ||
static SuperVector load(void const *ptr); | ||
static SuperVector loadu_maskz(void const *ptr, uint8_t const len); | ||
static SuperVector loadu_maskz(void const *ptr, typename base_type::comparemask_type const len); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you add the implementation for arm later on, but I didn't see any implementation for ppc64 ? |
||
SuperVector alignr(SuperVector &other, int8_t offset); | ||
|
||
template<bool emulateIntel=true> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXME