-
Notifications
You must be signed in to change notification settings - Fork 84
Feature/refactor noodle masked load (WIP) #216
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
6d6c291
2819dc3
9af996b
b3e88e4
5f8729a
d626381
b34aacd
5fa22e6
edea9d1
288491d
bd91134
76b2b4b
f441213
630f7b2
fce10b5
b3d7174
e71fb5c
2c78b77
59ffac5
6c24e61
8739a6c
fc5059a
0a35a46
85a77e3
73695e4
49eb18e
8a49e20
8498467
7e7f604
db52ce6
b5e1384
19947f7
6259783
cafd524
a119693
decabdf
c1659b8
2731a33
4d4940d
a9ca0e4
31afacc
4f27a70
70b2a28
c597f69
74ab418
c043730
43c053a
026f761
0e7874f
17467ff
94fe406
7295b9c
dc6b8ae
be20c2c
a837cf3
305a041
02ae2a3
0af2ba8
1ae0d15
756ef40
e3c237a
0c97e5f
f4840ad
db2a6d6
67b414f
d0ae940
361feb6
f6250ae
ee0c8f7
69e6176
d0a017d
4ab0730
bf6200e
4934852
88b1bec
ef66877
1a43178
3fc6c8a
6de45b4
0e0147e
a4972aa
911a98d
48105cd
9d34941
90ac746
7133ac5
00d1807
6d8599e
e6cfd11
0f967b9
dbdbfe9
1ce45a3
9f8758d
101f608
66289cd
842e680
e6b97a9
eef3f06
8c7fdf1
b4bba94
8f26c5e
d054911
8a54576
07305d1
4fbabb6
38431d1
68db36f
0ec7b4e
4bc70b3
b6b69a4
75dbede
978105a
762f405
7c1835c
684f0ce
b7ee910
fc5a423
941cc71
6595254
7f2f7d2
91f0cb6
6765b35
4fb3a48
dc78dc1
ab4f837
c652345
5209c79
4344d2f
e843ac8
6834663
a344cd3
85a6973
ad42abe
1d25f9b
d85d306
adedf2a
4918f81
16604f9
0d2f9cc
db7b23a
9a17474
93d3e7e
9aa6144
b7d1bc0
354fda4
2e88df1
da88abf
72afe16
35c0711
e369681
22a24f1
98d7434
a26661c
55cae8c
7a2ccd7
e8e2957
6900806
1320d01
983a3a5
9e1c43b
0e40310
24ae167
3884f59
6beeb37
0d5ce27
ee8a3c2
e85f7cc
5e4a1ed
981576a
4d539f2
9445f49
1619dba
7909b91
c4b7a44
1fdeedf
5a4d900
aa8af26
a659555
02474c4
de94286
71bbf97
9c139c3
21c45f3
9d0599a
b5f1a82
80f84a1
44b026a
35acf49
b152286
5e5d6d2
8d1c7c4
9c92c7b
d5cd29b
aecd920
a97d576
08b904b
393dee3
41fb015
574e525
343e523
d611fcb
c3a6bb3
44b893a
d24d67c
129015a
8455cba
b5cde5e
b068087
a8e9b90
14c9222
7c53b4e
b32ca71
62cb8d6
20f4f54
dfacf75
f57928e
8c7b503
23aeaec
f5e508b
be9ce68
3beda7e
6332cb9
9fd0ce5
d3f6d2a
519bd64
a26bed9
e15ad93
c8ba7fa
8cba258
49e6fe1
1b915cf
2aa5e1c
44f19c1
a7a1284
306e861
ef37e60
10d9574
3113d1c
ad70693
17fb9f4
d4fde85
9f66822
476cefb
5f65b9f
0e2f6c1
5814d32
db3b0e9
f866b72
de66c74
9a53b19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,15 +86,21 @@ hwlm_error_t scanSingleMain(const struct noodTable *n, const u8 *buf, | |
| DEBUG_PRINTF("d - d0: %ld \n", d - d0); | ||
| #if defined(HAVE_MASKED_LOADS) | ||
| uint8_t l = d - d0; | ||
| typename SuperVector<S>::comparemask_type mask = ~SuperVector<S>::single_load_mask(l); | ||
| typename SuperVector<S>::comparemask_type mask = ~SuperVector<S>::load_mask(l); | ||
| SuperVector<S> chars = SuperVector<S>::loadu_maskz(d0, mask) & caseMask; | ||
| typename SuperVector<S>::comparemask_type z = mask1.eqmask(chars); | ||
| DEBUG_PRINTF("mask: %08llx\n", mask); | ||
| hwlm_error_t rv = single_zscan<S>(n, d0, buf, z, len, cbi); | ||
| #else | ||
| uint8_t l = d0 + S - d; | ||
| DEBUG_PRINTF("l: %d \n", l); | ||
| SuperVector<S> chars = SuperVector<S>::loadu_maskz(d, l) & caseMask; | ||
| chars.print8("chars"); | ||
| typename SuperVector<S>::comparemask_type z = mask1.eqmask(chars); | ||
| DEBUG_PRINTF("z: %08llx\n", (u64a) z); | ||
| z = SuperVector<S>::iteration_mask(z); | ||
| DEBUG_PRINTF("z: %08llx\n", (u64a) z); | ||
|
|
||
| hwlm_error_t rv = single_zscan<S>(n, d, buf, z, len, cbi); | ||
| #endif | ||
| chars.print32("chars"); | ||
|
markos marked this conversation as resolved.
|
||
|
|
@@ -125,6 +131,8 @@ hwlm_error_t scanSingleMain(const struct noodTable *n, const u8 *buf, | |
| uint8_t l = buf_end - d; | ||
| SuperVector<S> chars = SuperVector<S>::loadu_maskz(d, l) & caseMask; | ||
| typename SuperVector<S>::comparemask_type z = mask1.eqmask(chars); | ||
| z = SuperVector<S>::iteration_mask(z); | ||
|
|
||
| hwlm_error_t rv = single_zscan<S>(n, d, buf, z, len, cbi); | ||
| RETURN_IF_TERMINATED(rv); | ||
| } | ||
|
|
@@ -160,12 +168,12 @@ hwlm_error_t scanDoubleMain(const struct noodTable *n, const u8 *buf, | |
| const u8 *d0 = ROUNDDOWN_PTR(d, S); | ||
| #if defined(HAVE_MASKED_LOADS) | ||
| uint8_t l = d - d0; | ||
| typename SuperVector<S>::comparemask_type mask = ~SuperVector<S>::double_load_mask(l); | ||
| typename SuperVector<S>::comparemask_type mask = ~SuperVector<S>::load_mask(l); | ||
| SuperVector<S> chars = SuperVector<S>::loadu_maskz(d0, mask) & caseMask; | ||
| typename SuperVector<S>::comparemask_type z1 = mask1.eqmask(chars); | ||
| typename SuperVector<S>::comparemask_type z2 = mask2.eqmask(chars); | ||
| typename SuperVector<S>::comparemask_type z = (z1 << SuperVector<S>::mask_width()) & z2; | ||
| DEBUG_PRINTF("z: %0llx\n", z); | ||
|
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. Why deleting the debug print here? when you added more of the likes for the scanSingle function
Author
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. z has a different type in each architecture, this DEBUG_PRINTF fails to compile on some architectures, so I need to make it work and compile on all architectures. 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. What confuse me is that in the previous function, you added
Author
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. yes, that's what I did locally after I realized I could just cast it :) |
||
| z = SuperVector<S>::iteration_mask(z); | ||
| lastz1 = z1 >> (S - 1); | ||
|
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 think this assume |
||
|
|
||
| DEBUG_PRINTF("mask: %08llx\n", mask); | ||
|
|
@@ -176,8 +184,9 @@ hwlm_error_t scanDoubleMain(const struct noodTable *n, const u8 *buf, | |
| chars.print8("chars"); | ||
|
markos marked this conversation as resolved.
|
||
| typename SuperVector<S>::comparemask_type z1 = mask1.eqmask(chars); | ||
| typename SuperVector<S>::comparemask_type z2 = mask2.eqmask(chars); | ||
|
|
||
| typename SuperVector<S>::comparemask_type z = (z1 << SuperVector<S>::mask_width()) & z2; | ||
| z = SuperVector<S>::iteration_mask(z); | ||
|
|
||
| hwlm_error_t rv = double_zscan<S>(n, d, buf, z, len, cbi); | ||
| lastz1 = z1 >> (l - 1); | ||
|
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. same issue with mask_width() |
||
| #endif | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -525,11 +525,26 @@ really_inline SuperVector<16> SuperVector<16>::load(void const *ptr) | |
| template <> | ||
| really_inline SuperVector<16> SuperVector<16>::loadu_maskz(void const *ptr, uint8_t const len) | ||
| { | ||
| SuperVector mask = Ones_vshr(16 -len); | ||
| SuperVector<16> v = loadu(ptr); | ||
| SuperVector mask = Ones_vshr(16 - len); | ||
| SuperVector v = loadu(ptr); | ||
| return mask & v; | ||
| } | ||
|
|
||
| template <> | ||
| really_inline SuperVector<16> SuperVector<16>::loadu_maskz(void const *ptr, typename base_type::comparemask_type const mask) | ||
| { | ||
| DEBUG_PRINTF("mask = %08llx\n", mask); | ||
| SuperVector v = loadu(ptr); | ||
| (void)mask; | ||
| return v; // FIXME: & mask | ||
|
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. FIXME |
||
| } | ||
|
|
||
| template<> | ||
| really_inline typename SuperVector<16>::comparemask_type SuperVector<16>::findLSB(typename SuperVector<16>::comparemask_type &z) | ||
| { | ||
| return findAndClearLSB_64(&z) >> 2; | ||
| } | ||
|
|
||
| template<> | ||
| really_inline SuperVector<16> SuperVector<16>::alignr(SuperVector<16> &other, int8_t offset) | ||
| { | ||
|
|
||
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.
debug print?