From 964afc75976cce8d712d97f346d2b8eea9c1f1ee Mon Sep 17 00:00:00 2001
From: Nathan Bossart <nathan@postgresql.org>
Date: Sat, 28 Oct 2023 22:12:45 -0500
Subject: [PATCH v1 1/2] add debug message

---
 src/port/pg_crc32c_sse42_choose.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/port/pg_crc32c_sse42_choose.c b/src/port/pg_crc32c_sse42_choose.c
index 41ff4a35ad..3689c38e92 100644
--- a/src/port/pg_crc32c_sse42_choose.c
+++ b/src/port/pg_crc32c_sse42_choose.c
@@ -30,10 +30,15 @@
 
 #include "port/pg_crc32c.h"
 
+#ifndef FRONTEND
+#include "utils/elog.h"
+#endif
+
 static bool
 pg_crc32c_sse42_available(void)
 {
 	unsigned int exx[4] = {0, 0, 0, 0};
+	bool		result;
 
 #if defined(HAVE__GET_CPUID)
 	__get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);
@@ -43,7 +48,13 @@ pg_crc32c_sse42_available(void)
 #error cpuid instruction not available
 #endif
 
-	return (exx[2] & (1 << 20)) != 0;	/* SSE 4.2 */
+	result = ((exx[2] & (1 << 20)) != 0);	/* SSE 4.2 */
+
+#ifndef FRONTEND
+	elog(DEBUG1, "using sse42 crc32 hardware = %d", result);
+#endif
+
+	return result;
 }
 
 /*
-- 
2.37.1 (Apple Git-137.1)

