fix ⌽˘ 0‿10⥊2 and (↕0)⊸⊏˘ 10‿10⥊2

This commit is contained in:
dzaima 2024-07-29 00:36:57 +03:00
parent 52f36c61c0
commit 6900ae4b68
3 changed files with 6 additions and 4 deletions

View File

@ -503,7 +503,7 @@ B for_cells_c1(B f, u32 xr, u32 cr, u32 k, B x, u32 chr) { // F⎉cr x; array x,
case n_reverse: {
if (cr == 0) break;
ux csz = xsh[k];
if (csz <= 1) return x;
if (csz <= 1 || IA(x)==0) return x;
u8 xe = TI(x,elType);
if (cr==1 && csz<=64 && xe!=el_bit && xe!=el_B && csz < (128*8 >> arrTypeBitsLog(TY(x)))) {
incG(x); // TODO proper shape moving

View File

@ -580,7 +580,7 @@ B select_cells_base(B inds, B x0, ux csz, ux cam);
#define INDS_BUF_MAX 64 // only need 32 bytes for AVX2 & 16 for NEON, but have more for past-the-end pointers and writes
B select_rows_direct(B x, ux csz, ux cam, void* inds, ux indn, u8 ie) { // ⥊ (indn↑inds As ie)⊸⊏˘ cam‿csz⥊x
assert(csz!=0 && cam!=0);
assert(csz!=0 && cam!=0 && indn!=0);
assert(csz*cam == IA(x));
assert(ie<=el_i32);
@ -767,6 +767,7 @@ B select_rows_B(B x, ux csz, ux cam, B inds) { // consumes inds,x; ⥊ inds⊸
}
ux in = IA(inds);
if (in == 0) return taga(emptyArr(x, 1));
u8 ie = TI(inds,elType);
if (csz<=2? ie!=el_bit : csz<128? ie>el_i8 : !elInt(ie)) {
inds = num_squeeze(inds);

View File

@ -4,6 +4,7 @@
%DEF evar %USE tvar _evar {ok{} r𝕨 ok𝔽{𝕊: •CurrentError@} _tvar 𝕩 {okr? !"TEST FAIL: variation didn't error"; ("TEST FAIL: varying error messages" ! 1=)r !r}}
%DEF eqerr %USE eqvar _eqerr {ok{} r𝕨 ok𝔽{𝕊: •CurrentError@} 𝕩 {okr? !"TEST FAIL: case didn't error"; ("TEST FAIL: varying error messages" ! 1=)r !r}}
%DEF k _k {𝔽•internal.Keep}
%DEF pk _pk {𝔽•internal.PureKeep}
12 10 1 %% 11
1 10 12 %% 11
@ -75,9 +76,9 @@
{˝˘ (2+𝕩)<"hi"}¨ 2345 %% (<"hi")¨ 23,212,2125,21256
{˝¯2 (×´) 2+𝕩}¨ 345 %% (×´)¨ 234,2320,23206
%DEF tcc %USE k %USE var _tcc_ { ! ´ (<𝕨 𝔽_k𝕘'e' 𝕩) ¨ (𝕨 𝔽𝕘'e'V𝕩)¨ "i"LV𝕩}
%DEF tcc %USE pk %USE var _tcc_ { ! ´ (<𝕨 𝔽_pk𝕘'e' 𝕩) ¨ (𝕨 𝔽𝕘'e'V𝕩)¨ "i"LV𝕩}
%USE tcc 2, 20, ¯2, ¯20, 0 {𝕨 _tcc_ ¯1 𝕩 𝕨 _tcc_ ¯1 𝕩} <4, 5, 4520, 456120
%USE tcc , , , <, , {𝕎 _tcc_ ¯1 𝕩 𝕎 _tcc_ 1 𝕩 𝕎 _tcc_ 2 𝕩} <4, 5, 4520, 456120, 2345120
%USE tcc , , , <, , , (0), (1), (2) {𝕎 _tcc_ ¯1 𝕩 𝕎 _tcc_ 1 𝕩 𝕎 _tcc_ 2 𝕩} <4, 5, 4520, 456120, 2345120, 1000, 0100, 0230, 23400
%USE tcc _tcc_ ¯1 428 1_tcc_ ¯1 428 _tcc_ ¯1 42 1_tcc_ ¯1 42
%USE tcc _tcc_ ¯1 428 1_tcc_ ¯1 428 _tcc_ ¯1 42 1_tcc_ ¯1 42