asciilifeform: likewise the ability to refer to Foo'First and Foo'Last -- arrays know their size; and taking a slice from a nonexistent portion behaves SANELY (i.e. is a slice of size 0, and it is legal to assign another array to it, this is a null op)
asciilifeform: the 'index arrays from whatever' thing in ada is genius, it abolished the megatonnes of increments and decrements that litter c proggies and inevitably lead to 'fencepost' eggog
asciilifeform: ( which is WHY i numbered'em from 1 !! )
asciilifeform: ergo foo.Z(foo.Z'First .. 4) gives you the lower 4 words, for instance
asciilifeform: so you can see that the words are indexed from 1
asciilifeform: pleeez, folx, write in re typos, or any item that is unclear ( unclear is in itself a bug in critical code )
asciilifeform: ( oh, typo in comment : '-- J1 := Remaining J of Y' of course oughta be '-- Y1 := Remaining J of Y' )
asciilifeform: mod6, phf , et al -- see if you grasp how the thing worx.
asciilifeform: so there is no handwave away, 'average case will be better'. there IS no average case distinct from the others here.
asciilifeform: there are NO best-cases, or worst-cases.
asciilifeform: also gotta understand what the F in 'ffa' means. it means that N**2 takes exactly same time as N**N☟︎
asciilifeform: ( or, charitably, because ada committee could not rely on ALL cpu having ability to return top word of mul, or even HAVING an iron mul )
asciilifeform: this is all because compiler is maliciously retarded
asciilifeform: not to mention the shift and AND in the bottomhw/tophw subs
asciilifeform: doing FIVE ( yes, it's five ) machine muls, in there, and 5 machine adds ( instead of motherfucking ZERO ) JUST TO GET THE UPPER WORD of word*word mul, is not.☟︎
asciilifeform: the former is also afaik going nowhere.
asciilifeform: main thing nuking the speed is the W_Mul thing and the fact that we copy EVERY split. the latter is not avoidable given as we ban pointers
asciilifeform: mod6: i mentioned all of the ones i could think of -- larger base case ( trivially necessary ), and parallelized recursing ( unacceptable in the msdos port, or on single-cored machines of whatever type, however )
asciilifeform: ( not to mention ~worthless for mircea_popescu's prize-problem of 'pure rsa link b/w 2 machines' )
asciilifeform: so we end up having to do FOUR multiplications !! and buncha additions, to get it
asciilifeform: the INFURIATING thing is that, just as with the addition/subtraction carry bit (last month's thread), the compiler DOES NOT give us portable access to the upper word of MUL reg,reg
asciilifeform: ( 8192bit exponentiation: ~10min with egyptological mul; 20.5s was with first-grade mul; 17.7 with karatsuba posted today )☟︎
asciilifeform: base case definitely should not be 1.
asciilifeform: ^ this oughta suffice, for whoever wants to try.
asciilifeform: but keep in mind mod6 et al that where before you had package ALU is new FFA(Width => Width, Word => OS.Machine_Word); you will now have, e.g., package ALU is new FFA(Word => OS.Machine_Word);
asciilifeform: likewise 'bitness' of an FZ refers solely to the number of bits available in it, and does NOT and never will depend on their ~contents~ ( unlike non-fixed bignumatrons )
asciilifeform: ( you physically cannot have karatsuba or anything of the kind if you cannot make FZs of several sizes. however the F remains, it is still impermissible to involve FZs of variant bitnesses in any arithmetical operation when invoking . )
asciilifeform: in all other respects, same semantics as previously.
asciilifeform: mod6: if you want to test, keep in mind that you gotta Foo : FZ(Bits) ; now, rather than Foo : FZ;
asciilifeform: and, unrelatedly, karatsuba parallelizes (into 3 forks) without any substantial effort, so can also speed up whatever the bare bone speed ends up being, 3x
asciilifeform: because at present the base case of the recursion is L=1 , and probably ought to be 4, or even 8 machinewords;
asciilifeform: while we're on subj of storms at sea -- i admit to having wondered why orlol isn't designing a small sub ( it doesn't need to have gigantic pressure hull, or even ~any maneuvering ability while under -- but only to ride out storms by submerging). afaik it dun get any moar storm-proof than a sub.