Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c
Date: 2019-02-15 17:00:34
Message-ID: 20190215170034.GA28311@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hmm, this should fix the build, but I'm rushing out to lunch -- maybe
I'm missing something.

diff --git a/src/port/pg_bitutils.c b/src/port/pg_bitutils.c
index 97bfcebe4e1..e0198f3ab35 100644
--- a/src/port/pg_bitutils.c
+++ b/src/port/pg_bitutils.c
@@ -90,9 +90,11 @@ pg_popcount_available(void)
static int
pg_popcount32_choose(uint32 word)
{
+#if defined(HAVE__GET_CPUID) || defined(HAVE__CPUID)
if (pg_popcount_available())
pg_popcount32 = pg_popcount32_hw;
else
+#endif
pg_popcount32 = pg_popcount32_builtin;

return pg_popcount32(word);
@@ -178,9 +180,11 @@ pg_popcount(const char *buf, int bytes)
static int
pg_popcount64_choose(uint64 word)
{
+#if defined(HAVE__GET_CPUID) || defined(HAVE__CPUID)
if (pg_popcount_available())
pg_popcount64 = pg_popcount64_hw;
else
+#endif
pg_popcount64 = pg_popcount64_builtin;

return pg_popcount64(word);

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-02-15 18:05:25 pgsql: Refactor index cost estimation functions in view of IndexClause
Previous Message Alvaro Herrera 2019-02-15 16:40:52 pgsql: Fix compiler builtin usage in new pg_bitutils.c