Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Greg Burd <greg(at)burd(dot)me>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dave Cramer <davecramer(at)gmail(dot)com>
Subject: Re: [PATCH] Fix ARM64/MSVC atomic memory ordering issues on Win11 by adding explicit DMB barriers
Date: 2025-11-20 22:36:13
Message-ID: aR-X3d34IoWPIw2a@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I took a quick look at 0001.

+#ifdef _MSC_VER
+#include <intrin.h>
+#else
#include <arm_acle.h>
unsigned int crc;

I think you can remove this since we unconditionally do the runtime check
for MSVC. In any case, the missing #endif seems likely to cause
problems.

--- a/src/port/pg_crc32c_armv8.c
+++ b/src/port/pg_crc32c_armv8.c
@@ -14,7 +14,9 @@
*/
#include "c.h"

+#ifndef _MSC_VER
#include <arm_acle.h>
+#endif

Hm. Doesn't MSVC require intrin.h?

--
nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-11-20 23:03:57 Re: 10% drop in code line count in PG 17
Previous Message Melanie Plageman 2025-11-20 22:23:05 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)