On Mon, Jan 20, 2025 at 7:02 PM Pádraig Brady <p...@draigbrady.com> wrote: > Well we don't document any platform dependent behavior with --random-source. > I'm not sure if that is the case, but we should document it if platform > dependent.
Got it. I'll verify my understanding that coreutils might behave differently on 32-bit and 64-bit platforms with an experiment. It was a bit tricky to find a 32-bit platform with GNU coreutils, so I stated that without double-checking. I might be misreading the code :-) > > 2) fastrange() ... needs access to 64x64-to-128 multiplication > We already have platform dependent code in coreutils. I'd rather use plain __int128 instead of intrinsics and longlong.h when it's available. It works fine and both GCC and clang do the right thing for 64-bit machines around me. Are there any 32-bit targets that are using GNU coreutils (not busybox) and are worth benchmarking (are not museum relics)? I can imagine Raspberry Pi being one of the popular cases. Any other ideas? > If we had to round to the nearest power of 2 and the bitmask-based one was > cross platform, then this sounds like a reasonable constraint I think. I'd prefer to avoid forcing the user who wants to have 12 MiB chunks on average down to 8 MiB or up to 16 MiB. Unfortunately, desirable rolling hash window size might come from the structure of the file the user is dealing with. And desirable chunk size comes from the user's environment as well. So, I'd rather document those nuances and offer the best performance for each window/chunk combination. And... Thanks so much for prompt replies! :-) -- WBRBW, Leonid Evdokimov, https://darkk.net.ru tel:+79816800702 PGP: 6691 DE6B 4CCD C1C1 76A0 0D4A E1F2 A980 7F50 FAB2