Re: Using POPCNT and other advanced bit manipulation instructions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Using POPCNT and other advanced bit manipulation instructions
Date
Msg-id 17612.1550123202@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using POPCNT and other advanced bit manipulation instructions  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
List pgsql-hackers
Gavin Flower <GavinFlower@archidevsys.co.nz> writes:
> From my memory of reading of K&R many moons ago, it said that C only 
> guarantees that the lengths are such that
> byte <= half word <= word <= long

Indeed.

> But I don't recall ever seeing a long less than 32 bits!

I'm not sure offhand what C89 said, but C99 requires "short" to be
at least 16 bits, "long" to be at least 32 bits, and "long long"
to be at least 64; see the minimum allowed values for SHRT_MAX etc.

C99 does permit "int" to be only 16 bits, but Postgres doesn't
pretend to work on such an architecture, and nobody's made one
since the (early?) 90s.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Gavin Flower
Date:
Subject: Re: Using POPCNT and other advanced bit manipulation instructions
Next
From: Andrey Lepikhov
Date:
Subject: Re: WAL insert delay settings