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 commitsfc6c72747a
,109de05cbb
,d0b4663c23
and711bab1e4d
. 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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user