-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopcount--1.0.0.sql
More file actions
29 lines (23 loc) · 888 Bytes
/
Copy pathpopcount--1.0.0.sql
File metadata and controls
29 lines (23 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION popcount" to load this file. \quit
/*
Computes number of bits set in bit(n) data types.
*/
CREATE FUNCTION popcount(bit) RETURNS int
AS '$libdir/popcount', 'popcount'
LANGUAGE C immutable strict;
CREATE FUNCTION popcount32(bit) RETURNS int
AS '$libdir/popcount', 'popcount32'
LANGUAGE C immutable strict;
CREATE FUNCTION popcount64(bit) RETURNS int
AS '$libdir/popcount', 'popcount64'
LANGUAGE C immutable strict;
CREATE FUNCTION popcountAsm(bit) RETURNS int
AS '$libdir/popcount', 'popcountAsm'
LANGUAGE C immutable strict;
CREATE FUNCTION popcountAsm64(bit) RETURNS int
AS '$libdir/popcount', 'popcountAsm64'
LANGUAGE C immutable strict;
CREATE FUNCTION popcount256(bit) RETURNS int
AS '$libdir/popcount', 'popcount256'
LANGUAGE C immutable strict;