Re: Using POPCNT and other advanced bit manipulation instructions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Using POPCNT and other advanced bit manipulation instructions
Date: 2019-02-14 05:46:42
Message-ID: 17612.1550123202@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Lepikhov 2019-02-14 06:10:20 Re: WAL insert delay settings
Previous Message Gavin Flower 2019-02-14 05:29:24 Re: Using POPCNT and other advanced bit manipulation instructions