clear flags on •bit._cast reuse
This commit is contained in:
parent
58d5f47e98
commit
2160f4001d
@ -1512,13 +1512,14 @@ B bitcast_impl(B el0, B el1, B x) {
|
|||||||
if (rl>=USZ_MAX) thrM("•bit._cast: output too large");
|
if (rl>=USZ_MAX) thrM("•bit._cast: output too large");
|
||||||
B r = convert(xct, x);
|
B r = convert(xct, x);
|
||||||
u8 rt = typeOfCast(rct);
|
u8 rt = typeOfCast(rct);
|
||||||
if (rt==t_bitarr && (v(r)->refc!=1 || IS_SLICE(TY(r)))) {
|
if (rt==t_bitarr && (!reusable(r) || IS_SLICE(TY(r)))) {
|
||||||
r = taga(copy(xct, r));
|
r = taga(copy(xct, r));
|
||||||
} else if (v(r)->refc!=1) {
|
} else if (!reusable(r)) {
|
||||||
B pr = r;
|
B pr = r;
|
||||||
Arr* r2 = TI(r,slice)(r, 0, IA(r));
|
Arr* r2 = TI(r,slice)(r, 0, IA(r));
|
||||||
r = taga(arr_shSetI(r2, xr, shObj(pr))); // safe to use pr because r has refcount>1 and slice only consumes one, leaving some behind
|
r = taga(arr_shSetI(r2, xr, shObj(pr))); // safe to use pr because r has refcount>1 and slice only consumes one, leaving some behind
|
||||||
} else {
|
} else {
|
||||||
|
REUSE(r);
|
||||||
#if VERIFY_TAIL
|
#if VERIFY_TAIL
|
||||||
if (xct.s==1 && rct.s!=1) {
|
if (xct.s==1 && rct.s!=1) {
|
||||||
FINISH_OVERALLOC(a(r), offsetof(TyArr,a)+IA(r)/8, offsetof(TyArr,a) + (BIT_N(IA(r))<<3));
|
FINISH_OVERALLOC(a(r), offsetof(TyArr,a)+IA(r)/8, offsetof(TyArr,a) + (BIT_N(IA(r))<<3));
|
||||||
|
|||||||
@ -341,10 +341,14 @@ r←•MakeRand 1 ⋄ ! 1¨⊸≡ ∊{𝕊: 500 r.Deal 1000}¨ ↕4
|
|||||||
|
|
||||||
!"•bit._cast: unsupported width 16 for type 'f'" % ⟨16‿'f',32⟩•bit._cast 128⥊0
|
!"•bit._cast: unsupported width 16 for type 'f'" % ⟨16‿'f',32⟩•bit._cast 128⥊0
|
||||||
!"•bit._cast: unsupported width 32 for type 'f'" % ⟨32,32‿'f'⟩•bit._cast 128⥊0
|
!"•bit._cast: unsupported width 32 for type 'f'" % ⟨32,32‿'f'⟩•bit._cast 128⥊0
|
||||||
!"•bit._cast: unsupported width 0 for type 'u'" % ⟨0‿'u',32⟩•bit._cast 128⥊0
|
!"•bit._cast: unsupported width 0 for type 'u'" % ⟨0‿'u',32⟩•bit._cast 128⥊0
|
||||||
!"•bit._cast: unsupported width 8 for type 'u'" % ⟨8‿'u',32⟩•bit._cast 128⥊0
|
!"•bit._cast: unsupported width 8 for type 'u'" % ⟨8‿'u',32⟩•bit._cast 128⥊0
|
||||||
!"•bit._cast: unsupported width 32 for type 'u'" % ⟨8,32‿'u'⟩•bit._cast 128⥊0
|
!"•bit._cast: unsupported width 32 for type 'u'" % ⟨8,32‿'u'⟩•bit._cast 128⥊0
|
||||||
!"•bit._cast: unsupported width 1 for type 'i'" % ⟨8, 1‿'i'⟩•bit._cast 128⥊0
|
!"•bit._cast: unsupported width 1 for type 'i'" % ⟨8, 1‿'i'⟩•bit._cast 128⥊0
|
||||||
|
|
||||||
|
%USE eqvar ⋄ {𝕊conv: {•internal.Keep 𝕩⍋1 ⋄ •internal.Validate conv •bit._cast 𝕩}_eqvar ↕64}¨ ≠´¨⊸/ ⥊ 8‿16‿32‿64 ⋈⌜ 1‿8‿16‿32‿64
|
||||||
|
%USE eqvar ⋄ {𝕊conv: {•internal.Keep 𝕩⍒1 ⋄ •internal.Validate conv •bit._cast 𝕩}_eqvar ⌽↕64}¨ ≠´¨⊸/ ⥊ 8‿16‿32‿64 ⋈⌜ 1‿8‿16‿32‿64
|
||||||
|
%USE eqvar ⋄ {𝕊conv: {•internal.Squeeze 𝕩 ⋄ •internal.Validate conv •bit._cast 𝕩}_eqvar 64↑2}¨ ≠´¨⊸/ ⥊ ⟨8⟩ ⋈⌜ 1‿8‿16‿32‿64
|
||||||
|
|
||||||
# •platform
|
# •platform
|
||||||
Str ← {!=𝕩 ⋄ !×≠𝕩 ⋄ ! ∧´2=•Type¨𝕩} ⋄ Str •platform.os ⋄ Str •platform.cpu.arch ⋄ Str •platform.bqn.impl_version ⋄ Str •platform.environment
|
Str ← {!=𝕩 ⋄ !×≠𝕩 ⋄ ! ∧´2=•Type¨𝕩} ⋄ Str •platform.os ⋄ Str •platform.cpu.arch ⋄ Str •platform.bqn.impl_version ⋄ Str •platform.environment
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user