On Sat, 5 Mar 2016 19:03:24 +0100, Bart (bartjun...@gmail.com) wrote
about "[fpc-pascal] Bitcounting" (in
<camye31xhge_egouaqk7hegk7by0steko5en11dkg3dmjyxd...@mail.gmail.com>):
> Does FreePascal have a routine for counting bits?
[snip]
> Surely this can be done better?
I
En Sat, 05 Mar 2016 12:03:24 -0600, Bart escribió:
Hi,
Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are
1)?
I came up with (extracted from IntToBin()):
function BitCount(N: Int64): Integer;
var
On 3/5/16, Jonas Maebe wrote:
> The "compilerproc" modifier does not influence code generation other
> than symbol mangling. You can just look at the implementation in the
> system unit like for any other routine.
Lazarus code-tools didn't get me there ;-)
Found it
On 05/03/16 23:12, Bart wrote:
On 3/5/16, Jonas Maebe wrote:
>FPC 3.x has system.popcnt
Thanks.
I see it's a compilerproc.
How can I see how it'simplemented?
The "compilerproc" modifier does not influence code generation other
than symbol mangling. You can just
On 3/5/16, Jonas Maebe wrote:
> FPC 3.x has system.popcnt
Thanks.
I see it's a compilerproc.
How can I see how it'simplemented?
Bart
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
El 05/03/16 a las 19:03, Bart escribió:
> Hi,
>
> Does FreePascal have a routine for counting bits?
> So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?
>
> I came up with (extracted from IntToBin()):
>
> function BitCount(N: Int64): Integer;
> var
> Q: QWord;
> i:
On 05/03/16 19:03, Bart wrote:
Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?
FPC 3.x has system.popcnt
Jonas
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
The PopCount functions do exactly that.
On 03/05/2016 07:03 PM, Bart wrote:
Hi,
Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?
I came up with (extracted from IntToBin()):
function BitCount(N: Int64): Integer;
var
On 05/03/2016 18:03, Bart wrote:
Hi,
Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?
I came up with (extracted from IntToBin()):
Have a look at
e Bart <bartjun...@gmail.com>
Enviado: sábado, 5 de março de 2016 15:03
Para: FPC-Pascal users discussions
Assunto: [fpc-pascal] Bitcounting
Hi,
Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?
I came up with (ex
Hi,
Does FreePascal have a routine for counting bits?
So that e.g. BitCount(%100110011) gives 5 (number of bits that are 1)?
I came up with (extracted from IntToBin()):
function BitCount(N: Int64): Integer;
var
Q: QWord;
i: Integer;
begin
Result := 0;
Q := QWord(N);
for i := 0 to
11 matches
Mail list logo