1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Revert attempts to use POPCNT etc instructions

This reverts commits fc6c72747a, 109de05cbb, d0b4663c23 and
711bab1e4d.

Somebody will have to try harder before submitting this patch again.
I've spent entirely too much time on it already, and the #ifdef maze yet
to be written in order for it to build at all got on my nerves.  The
amount of work needed to get a platform-specific performance improvement
that's barely above the noise level is not worth it.
This commit is contained in:
Alvaro Herrera
2019-02-15 16:32:30 -03:00
parent e89f14e2bb
commit 457aef0f1f
14 changed files with 167 additions and 707 deletions

View File

@ -37,7 +37,6 @@
#include "access/hash.h"
#include "lib/bloomfilter.h"
#include "port/pg_bitutils.h"
#define MAX_HASH_FUNCS 10
@ -188,7 +187,19 @@ double
bloom_prop_bits_set(bloom_filter *filter)
{
int bitset_bytes = filter->m / BITS_PER_BYTE;
uint64 bits_set = pg_popcount((char *) filter->bitset, bitset_bytes);
uint64 bits_set = 0;
int i;
for (i = 0; i < bitset_bytes; i++)
{
unsigned char byte = filter->bitset[i];
while (byte)
{
bits_set++;
byte &= (byte - 1);
}
}
return bits_set / (double) filter->m;
}