[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Wishful request for next version: '// 1' should produce integer
- From: Sean Conner <sean@...>
- Date: Sat, 8 Jan 2022 18:00:35 -0500
It was thus said that the Great Flyer31 Test once stated:
> By the way for "bit witchraft", it would be very nice if the math
> library would support the VERY useful ARM commands clz and rbit e. g.
> math.clz and math.rbit (Count leading zeros and reverse bits). I know
> that especially "good old Intel CPU''s" are lazy here and partly do
> not support this, and still no standardized c/c++ coding available for
> this - but these two are really VERY useful for bit representation
> checking and if not available in a standardized way by basic software,
> very nerving and time consuming for loops are needed).
You could always make a Lua module for those two instructions. Back in
2020 I wrote a Lua module in x86 assembly  just to wrap the Intel x86
RDTSC instruction, so I don't see why this couldn't be done for the ARM CLZ
and RBIT instructions.
 Overkill? Sure. And silly, as 8K of memory space is consumed by
this very small module when running. But mainly I did it just