Commit Graph

2302 Commits

Author SHA1 Message Date
Marshall Lochbaum
66c0fe041c Get pext and popcount together, since generic pext emulation includes popc 2023-08-05 20:38:54 -04:00
Marshall Lochbaum
056b18edd2 Move pext-based compress loop from C to Singeli 2023-08-05 20:38:54 -04:00
Marshall Lochbaum
7767cf933f Remove boolean Compress overallocation: not needed with w masked off 2023-08-05 20:38:54 -04:00
Marshall Lochbaum
e09d385df5 Simplify pairwise pext implementation; drop 12-bit as no longer competitive 2023-08-05 20:38:54 -04:00
dzaima
7fe1ab930a FFI: permit 𝕨≡⟨⟩, require 𝕩≡⟨⟩ if no arguments are on 𝕩, check list rank 2023-08-05 16:13:07 +03:00
dzaima
682d5986d8 slightly more accurate trailing newline removal for •GetLine 2023-08-04 21:09:45 +03:00
dzaima
a1e4f9bd6f remove multiple trailing newline characters from •GetLine
Windows adds \r\n, and without this the \r stays
2023-08-04 20:52:07 +03:00
dzaima
8e35241e47 Better error messages for unknown namespace key 2023-08-03 22:54:38 +03:00
dzaima
0b6c5189d8 move arithdDispatch declarations to a header
+ rename some things to make more sense
2023-07-31 20:26:05 +03:00
dzaima
627a7e0771 more FFI error checking, plus bugfixes 2023-07-28 15:25:06 +03:00
dzaima
1bc96f5557 extract u8/u16/u32/f32 reading functions 2023-07-28 14:02:22 +03:00
dzaima
1454ca3a1a expand & test FFI error checking 2023-07-28 13:59:25 +03:00
dzaima
79f72d84b8 extract unsigned & f32 copying functions in ffi.c 2023-07-28 13:41:03 +03:00
dzaima
0d7de8b190 define ux in Singeli, replacing Size; return ux from popc/clz/ctz 2023-07-26 17:42:23 +03:00
dzaima
f7a0eb94a3 don't use AVX2 buffer copying for a 16-byte buffer 2023-07-22 21:34:20 +03:00
dzaima
1451395ef5 don't do fancy char stuff for unchecked arith 2023-07-22 21:13:49 +03:00
dzaima
959614c785 use partial application 2023-07-22 18:19:31 +03:00
dzaima
033f3de6b9 remove unnecessary lambda wrappers
also use fmtnat
2023-07-22 18:15:07 +03:00
dzaima
446b2d09ed Singeli renames & docs 2023-07-22 17:37:20 +03:00
dzaima
6e96600878 move unaligned load & store to base.singeli 2023-07-20 00:21:09 +03:00
dzaima
0486adccb5 fix signedness of abs{x} 2023-07-20 00:19:54 +03:00
dzaima
2243fa76c1 better base case list 2023-07-19 21:56:35 +03:00
dzaima
eb46ec8d9c rename __mulhi & __mul32 2023-07-19 21:54:12 +03:00
dzaima
700d69e7dd unpack → zip & mzip; enable slash.singeli SIMD parts for NEON 2023-07-19 21:39:22 +03:00
dzaima
ba2e859dce use existing unpackLo in neq.singeli 2023-07-19 20:56:08 +03:00
dzaima
19b35e1074 fix size comment 2023-07-19 20:11:14 +03:00
dzaima
9945711b5e AVX2 i32 & i64 slash{} via widening load 2023-07-19 20:00:46 +03:00
dzaima
ff9bb258c2 more comments in slash.singeli 2023-07-19 18:50:01 +03:00
dzaima
48111d4873 extract iota{} for AVX-512 2023-07-19 17:24:20 +03:00
dzaima
a0797318ca use has_simd & arch_defvw 2023-07-19 17:03:41 +03:00
dzaima
03c21112c2 make NEON builds work 2023-07-19 16:58:35 +03:00
dzaima
6930bc34b6 further update slash.c implementation comments 2023-07-19 16:51:24 +03:00
Marshall Lochbaum
77188b8e73 Add clmul.singeli 2023-07-19 09:38:37 -04:00
Marshall Lochbaum
301a23fb1f Update where/compress implementation comments 2023-07-19 09:35:40 -04:00
Marshall Lochbaum
c4364aefa6 SSSE3 4-byte compress with half-width table 2023-07-19 08:15:53 -04:00
Marshall Lochbaum
ba837ba01b Remove table-less where/compress methods, as they're not competitive 2023-07-19 07:22:55 -04:00
Marshall Lochbaum
64d65ae837 Never use generic dense compress methods if use_table: where is faster 2023-07-18 21:35:12 -04:00
Marshall Lochbaum
b0e0f210c6 2- and 4-byte Where with unpack and table 2023-07-18 21:10:39 -04:00
Marshall Lochbaum
93e1262864 Avoid using popcount primitive in Singeli if POPCNT isn't present 2023-07-18 16:52:08 -04:00
Marshall Lochbaum
6df283c379 Always increment by full popcount instead of two halves when splitting byte 2023-07-17 17:52:59 -04:00
Marshall Lochbaum
2f6a8e55a1 Always use vectors for for_special_buffered buffer copy 2023-07-17 16:52:10 -04:00
Marshall Lochbaum
8add95b7ab Remove BMI2 where/compress methods 2023-07-17 16:20:30 -04:00
Marshall Lochbaum
f005169518 1- and 2-byte compress with table and SSSE3 2023-07-17 16:19:05 -04:00
Marshall Lochbaum
68978f7e10 Table-based 1- and 2-byte Where 2023-07-17 16:05:06 -04:00
Marshall Lochbaum
fc187afdf2 Extend 1-byte SSE2 Where to 2-byte and 4-byte with unpacked writes 2023-07-17 11:28:04 -04:00
Marshall Lochbaum
8b297ae2dc Dedicated 32-bit Singeli where, taking index offset 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
3bd8d1de68 Extend all Singeli Compress methods to do Where 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
4415869496 Generic Singeli where implementation 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
c484f8ee8d Avoid UB from shifting by 64 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
da5f1faa07 Merge BMI2 slash{} cases, with some simplifications 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
b244ba98f5 Unify slash1{} and slash2{} 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
f5121f6806 Thresholds for compress methods (versus sparse) defined in Singeli 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
824bb04b4d Plain SSE2 1-byte compress 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
f852d12a5c Generic Singeli compress implementation 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
f36426031a Slightly faster table-less compress method 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
84a928863b AVX-512 compress implementations 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
80e93c41c9 Use new undefined{type,len} instead of alloca 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
13b3bcd74b Table-less AVX2 1-byte compress 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
d956ba921b Non-overwriting 1-byte and 2-byte compress/where 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
8f4b1966cb Non-overwriting AVX2 4-byte and 8-byte compress, using a buffer 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
9010f648bb Unify permutevar-based compress implementations 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
0921fc2c62 AVX2 compress implementations using permutevar and lookup tables 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
03d8919307 Add has='pclmul' option and avoid using broadcast 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
871a81ca5f BMI2 pext not-emulation in Singeli 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
1314859a80 clmul-based pext emulation 2023-07-16 21:56:33 -04:00
Marshall Lochbaum
f315a6d3ea Emulate pext instruction in Singeli 2023-07-16 21:56:33 -04:00
dzaima
3946f2cc87 use new Singeli builtins 2023-07-17 02:23:50 +03:00
dzaima
6305a3bd50 change error message of failed path_abs 2023-07-16 16:31:10 +03:00
dzaima
cf6a290e5c •file.RealPath 2023-07-16 01:42:30 +03:00
dzaima
d1e511bebd add padding before allocations & document it 2023-07-13 16:20:37 +03:00
dzaima
9cfc3f3f25 various changes on filling arrays with the same element 2023-07-12 16:23:03 +03:00
vylsaz
e4542f70a6 Implement •term.CharN and •term.RawMode for Windows 2023-07-11 03:15:48 +00:00
vylsaz
ce255c4a53 Enable •file.CreateDir on Windows 2023-07-11 01:11:28 +00:00
dzaima
0601a86f56 don't special-case 2/𝕩 on NEON 2023-07-11 02:40:05 +03:00
dzaima
56a1fc3637 use float getting functions for getting floats 2023-07-10 23:48:07 +03:00
dzaima
9b0299d1a5 fix (<1)≠`5⥊1 2023-07-10 23:25:28 +03:00
dzaima
53266ffd88 fix (<1)⌈`↕10 2023-07-10 23:21:36 +03:00
dzaima
158a3beb2e partially clear object on free in debug mode
catch some more of what valgrind would relatively cheaply
2023-07-10 22:55:19 +03:00
dzaima
acbfcd7302 fix another weird case of 𝕨∾𝕩 2023-07-10 22:55:00 +03:00
dzaima
24fea51bdd fix unshare of fillslice 2023-07-10 22:55:00 +03:00
dzaima
cb9f4dbbc1 remove debug include
:|
2023-07-10 19:19:55 +03:00
dzaima
cd7807fba0 NEON constrep 2023-07-10 17:11:15 +03:00
dzaima
1cea42cad3 use getter over 𝕨 for generic 𝕨⍋𝕩
doesn't change perf, but leads to fast amortized long⍋short
2023-07-10 16:50:02 +03:00
dzaima
bf89d2d561 a little size reduction on write_indices 2023-07-10 16:29:21 +03:00
Marshall Lochbaum
f6d1f9fcab Move utilities from bins to appropriate files 2023-07-10 07:14:44 -04:00
Marshall Lochbaum
492e97e2ca Right argument narrowing for numeric Bins 2023-07-10 07:14:44 -04:00
Marshall Lochbaum
9511598aa3 Fast Bins when either argument is boolean 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
1fa00c9c6f Update bins implementation comments 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
46c6d47055 Permutevar instead of shuffle for 4-byte vector binary search 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
fc57e0012d Shuffle-based 4-byte vector binary search 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
af5ba0a2d2 Switch from Eytzinger to linear search on extra lanes 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
64ae8f9afd Slightly better blend pattern for >16-byte bit table 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
c8d20fbf26 And 2-byte vector binary search on 4 lanes 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
fe92f91ca1 2-byte vector binary search on 2 lanes 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
d19df2693a Merge 1-byte table code with normal bins_lookup 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
f36dc7adba Use max-scan instead of plus-scan for 1-byte Bins table 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
8054597004 Handle up to 64 unique values in bit-table 1-byte Bins 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
b62bd02bc0 Precomputed midpoint bits in vector binary search
Clang already optimized to this but it's more explicit
2023-07-10 07:13:21 -04:00
Marshall Lochbaum
7f5ba961c2 Use default bins_lookup if there's no AVX2 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
1080236433 2-byte vector binary searches 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
d665b90bbf Slightly faster binary search pattern with a blend 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
a711eb72eb Table-based 2-byte Bins, using max-scan 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
724f685a57 Cleanup 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
2c9e07f33d 1-byte Bins up to 32 unique eleemnts by unique lookup then index 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
81da9c586f Table-based 1-byte Bins with >1-byte result 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
0346ff7c2d Use type of ≠𝕨 for Singeli Bins result and allocate outside Singeli 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
e0621f99f8 Unroll vector binary searches for different search depths 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
38671e3fe9 Fast handling for length-1 𝕨 in Bins 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
ed9e8b4057 Table-based 1-byte Bins implementations, including AVX2 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
7161689196 Fix bin_search_vec over-writing 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
302d637129 Allocate binary search result in Singeli, using i8 for vectors 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
70249d8b64 In bins, promote to smallest common int type instead of i32 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
4f93b5849b Fix shape of char⍋num result (was deshaped) 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
ec9b875503 Separate is-sorted check from Bins implementation 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
ff9919dde2 AVX2 binary search on one lane of i8 (unused for now) 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
5424c57b7e Use Singeli float binary search 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
ee84f9fe1f 4-way branchless binary search unrolling 2023-07-10 07:13:21 -04:00
Marshall Lochbaum
464a53463d Generic Singeli version of 32-bit binary search 2023-07-10 07:13:21 -04:00
dzaima
6b5815dcc2 fix shape of k/n‿1⥊1 2023-07-10 02:40:36 +03:00
dzaima
8975be082b fix •ns.Get error message 2023-07-09 15:58:31 +03:00
dzaima
5c7934387a update Singeli submodule, match{} → same{} 2023-06-29 15:19:57 +03:00
dzaima
a67a19dd0b move pair{{a,b}} expanding to base.singeli 2023-06-29 01:31:58 +03:00
dzaima
4ee8dfbbda update Singeli submodule, use destructuring parameters 2023-06-28 00:59:28 +03:00
dzaima
3ae9b14d64 separate arith inits, add comments on init order 2023-06-23 12:10:42 +03:00
dzaima
7618dce2f3 fix return value of overflowed dyadic arith 2023-06-23 12:10:42 +03:00
dzaima
5f43bf16b3 add direct typed array type test macro 2023-06-23 12:10:42 +03:00
dzaima
4dbe72ae03 properly indicate estimating Singeli instructions 2023-06-23 11:51:34 +03:00
dzaima
8f8380749b generic Singeli builds 2023-06-16 11:12:15 +03:00
dzaima
5032c9a3ab remove unnecessary 'over _ to' 2023-06-15 19:12:20 +03:00
dzaima
90e7537225 move maskedLoopPositive to @-based 2023-06-15 19:09:53 +03:00
dzaima
dee29a1a02 block → iter 2023-06-15 18:11:57 +03:00
dzaima
9da567cd57 switch to new Singeli block execution 2023-06-15 18:08:57 +03:00
dzaima
2da457dafa fix el_half 2023-06-15 00:32:19 +03:00
dzaima
4260ef93b3 rename away underscores in __adds and __subs
plus add NEON addw, subw, and mulw (which is renamed from mul1)
2023-06-12 00:52:09 +03:00
dzaima
2a52dff482 @-forms of maskedLoop and muLoop 2023-06-12 00:52:09 +03:00
dzaima
fe8892ce6c rearrange shrm/shlm args, slightly better NEON homMask{[16]u8} 2023-06-12 00:52:09 +03:00
dzaima
336f986986 change error messages in ◶ 2023-06-12 00:52:09 +03:00
dzaima
8542ba071d homMaskX, merging multi-arg homMask 2023-06-07 18:14:18 +03:00
dzaima
934a2b5ae3 rearrange things 2023-06-06 21:44:50 +03:00
dzaima
087bf06cac fix type warnings 2023-06-01 20:12:51 +03:00
dzaima
efa1c4a4ff __declspec(dllexport) 2023-06-01 19:04:34 +03:00
dzaima
78bef5fe32 consistent 𝕨⊏𝕩 error messages across argument types 2023-05-30 14:28:36 +03:00
dzaima
2eb12fef82 fix replxx under os=windows 2023-05-30 13:37:15 +03:00
dzaima
7e5b2e0557 don't unroll/vectorize extremely tiny loop 2023-05-30 12:52:17 +03:00
dzaima
5738712bbb improve environ declaration 2023-05-30 12:52:00 +03:00
dzaima
c03dd349e4 disallow •ReBQN constructing namespaces, ignore RETD in interactive REPL 2023-05-27 16:37:42 +03:00
dzaima
da5280021c rename compile → compileAll 2023-05-27 15:38:57 +03:00
dzaima
227dfa20c7 use isatty as a default for notui 2023-05-25 00:16:16 +03:00
dzaima
55e0409582 don't CTZ(0) in gcd 2023-05-24 15:13:25 +03:00
dzaima
c3681a0557 update type number comments 2023-05-22 14:17:53 +03:00