Fix __attribute__((target(...))) usage.
authorNathan Bossart <[email protected]>
Thu, 7 Nov 2024 21:27:32 +0000 (15:27 -0600)
committerNathan Bossart <[email protected]>
Thu, 7 Nov 2024 21:27:32 +0000 (15:27 -0600)
The commonly supported way to specify multiple target options is to
surround the entire list with quotes and to use a comma (with no
extra spaces) as the delimiter.

Oversight in commit f78667bd91.

Discussion: https://postgr.es/m/Zy0jya8nF8CPpv3B%40nathan

config/c-compiler.m4
configure
meson.build
src/port/pg_popcount_avx512.c

index c7eb896f14a4782a74124a3a92052163e19cedac..a129edb88e1b710e197124ab23b38f4aaf1bf42d 100644 (file)
@@ -733,7 +733,7 @@ AC_DEFUN([PGAC_AVX512_POPCNT_INTRINSICS],
 AC_CACHE_CHECK([for _mm512_popcnt_epi64], [Ac_cachevar],
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <immintrin.h>
     #if defined(__has_attribute) && __has_attribute (target)
-    __attribute__((target("avx512vpopcntdq","avx512bw")))
+    __attribute__((target("avx512vpopcntdq,avx512bw")))
     #endif
     static int popcount_test(void)
     {
index 3a7332f834943d23c414070d57a6118d48babc5a..4b01b682b15e621ed75719988e4694faaea7d603 100755 (executable)
--- a/configure
+++ b/configure
@@ -17324,7 +17324,7 @@ else
 /* end confdefs.h.  */
 #include <immintrin.h>
     #if defined(__has_attribute) && __has_attribute (target)
-    __attribute__((target("avx512vpopcntdq","avx512bw")))
+    __attribute__((target("avx512vpopcntdq,avx512bw")))
     #endif
     static int popcount_test(void)
     {
index 9eddd72a27ec9622fd5819a235e2551912fc8ec5..5b0510cef78b8d1a66627528f77a03c68d919829 100644 (file)
@@ -2184,7 +2184,7 @@ if host_cpu == 'x86_64'
 #include <immintrin.h>
 
 #if defined(__has_attribute) && __has_attribute (target)
-__attribute__((target("avx512vpopcntdq","avx512bw")))
+__attribute__((target("avx512vpopcntdq,avx512bw")))
 #endif
 int main(void)
 {
index b598e86554974157fa5e9442249e1f04da11c63d..1ab2847bf2d621eaa3f9b50d1351c74dac15d5a6 100644 (file)
@@ -106,7 +106,7 @@ pg_popcount_avx512_available(void)
  * pg_popcount_avx512
  *     Returns the number of 1-bits in buf
  */
-pg_attribute_target("avx512vpopcntdq", "avx512bw")
+pg_attribute_target("avx512vpopcntdq,avx512bw")
 uint64
 pg_popcount_avx512(const char *buf, int bytes)
 {
@@ -162,7 +162,7 @@ pg_popcount_avx512(const char *buf, int bytes)
  * pg_popcount_masked_avx512
  *     Returns the number of 1-bits in buf after applying the mask to each byte
  */
-pg_attribute_target("avx512vpopcntdq", "avx512bw")
+pg_attribute_target("avx512vpopcntdq,avx512bw")
 uint64
 pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask)
 {