Attached a new patch with fixes based on the comment below.


On 2023/6/13 18:26, John Naylor wrote:

On Thu, Jun 8, 2023 at 12:24 PM YANG Xudong <yangxud...@ymatrix.cn <mailto:yangxud...@ymatrix.cn>> wrote:
 >
 > This patch tries to add loongarch native crc32 check with crcc.*
 > instructions to postgresql.
 >
 > The patch is tested on my Loongson 3A5000 machine with Loong Arch Linux
 > and GCC 13.1.0 / clang 16.0.0 with
 >
 > - default ./configure
 > - default meson setup

I took a quick look at this, and it seems mostly in line with other architectures we support for CRC. I have a couple questions and comments:

configure.ac <http://configure.ac>:

+AC_SUBST(CFLAGS_CRC)
 > This seems to be an unnecessary copy-paste. I think we only need one,
after all checks have run.


Removed the extra line.


meson.build

+  if cc.links(prog, name: '__builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w, and __builtin_loongarch_crcc_w_d_w without -march=loongarch64',
+      args: test_c_args)
+    # Use LoongArch CRC instruction unconditionally
+    cdata.set('USE_LOONGARCH_CRC32C', 1)
+    have_optimized_crc = true
+  elif cc.links(prog, name: '__builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w, and __builtin_loongarch_crcc_w_d_w with -march=loongarch64',
+      args: test_c_args + ['-march=loongarch64'])
+    # Use LoongArch CRC instruction unconditionally

For x86 and Arm, if it fails to link without an -march flag, we allow for a runtime check. The flags "-march=armv8-a+crc" and "-msse4.2" are for instructions not found on all platforms. The patch also checks both ways, and each one results in "Use LoongArch CRC instruction unconditionally". The -march flag here is general, not specific. In other words, if this only runs inside "+elif host_cpu == 'loongarch64'", why do we need both with -march and without?


Removed the elif branch.


Also, I don't have a Loongarch machine for testing. Could you show that the instructions are found in the binary, maybe using objdump and grep? Or a performance test?


The output of the objdump command `objdump -dS ../postgres-build/tmp_install/usr/local/pgsql/bin/postgres | grep -B 30 -A 10 crcc` is attached.

Also the output of make check is attached.


I run a simple test program to compare the performance of pg_comp_crc32c_loongarch and pg_comp_crc32c_sb8 on my test machine. The result is that pg_comp_crc32c_loongarch is over 2x faster than pg_comp_crc32c_sb8.


In the future, you may also consider running the buildfarm client on a machine dedicated for testing. That will give us quick feedback if some future new code doesn't work on this platform. More information here:

https://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto <https://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto>


I will contact the loongson community (https://github.com/loongson-community) to see if they are able to provide some machine for buildfarm or not.


--
John Naylor
EDB: http://www.enterprisedb.com <http://www.enterprisedb.com>

--
YANG Xudong
From c6441c9e446d13ddf60b1f5432114a5289968403 Mon Sep 17 00:00:00 2001
From: YANG Xudong <yangxud...@ymatrix.cn>
Date: Wed, 14 Jun 2023 09:49:49 +0800
Subject: [PATCH] Add loongarch native checksum implementation.

---
 config/c-compiler.m4           |  34 ++++++++++
 configure                      | 116 +++++++++++++++++++++++++++++++--
 configure.ac                   |  37 ++++++++---
 meson.build                    |  24 +++++++
 src/include/pg_config.h.in     |   3 +
 src/include/port/pg_crc32c.h   |   9 +++
 src/port/Makefile              |   5 ++
 src/port/meson.build           |   3 +
 src/port/pg_crc32c_loongarch.c |  72 ++++++++++++++++++++
 9 files changed, 288 insertions(+), 15 deletions(-)
 create mode 100644 src/port/pg_crc32c_loongarch.c

diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 5be8f0f08d..eb3af009c4 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -661,3 +661,37 @@ if test x"$Ac_cachevar" = x"yes"; then
 fi
 undefine([Ac_cachevar])dnl
 ])# PGAC_ARMV8_CRC32C_INTRINSICS
+
+# PGAC_LOONGARCH_CRC32C_INTRINSICS
+# ---------------------------
+# Check if the compiler supports the LoongArch CRCC instructions, using
+# __builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w,
+# __builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w
+# intrinsic functions.
+#
+# If the intrinsics are supported, sets pgac_loongarch_crc32c_intrinsics,
+# and CFLAGS_CRC.
+AC_DEFUN([PGAC_LOONGARCH_CRC32C_INTRINSICS],
+[define([Ac_cachevar], [AS_TR_SH([pgac_cv_loongarch_crc32c_intrinsics_$1])])dnl
+AC_CACHE_CHECK(
+  [for __builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, 
__builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w with 
CFLAGS=$1],
+  [Ac_cachevar],
+[pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS $1"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([],
+  [unsigned int crc = 0;
+   crc = __builtin_loongarch_crcc_w_b_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_h_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_w_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_d_w(0, crc);
+   /* return computed value, to prevent the above being optimized away */
+   return crc == 0;])],
+  [Ac_cachevar=yes],
+  [Ac_cachevar=no])
+CFLAGS="$pgac_save_CFLAGS"])
+if test x"$Ac_cachevar" = x"yes"; then
+  CFLAGS_CRC="$1"
+  pgac_loongarch_crc32c_intrinsics=yes
+fi
+undefine([Ac_cachevar])dnl
+])# PGAC_LOONGARCH_CRC32C_INTRINSICS
diff --git a/configure b/configure
index 1b415142d1..fa4a0fdcb3 100755
--- a/configure
+++ b/configure
@@ -18114,6 +18114,94 @@ fi
 
 fi
 
+# Check for LoongArch CRC intrinsics to do CRC calculations.
+#
+# Check if __builtin_loongarch_crcc_* intrinsics can be used
+# with the default compiler flags.
+# CFLAGS_CRC is set if the extra flag is required.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 
__builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, 
__builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w with CFLAGS=" 
>&5
+$as_echo_n "checking for __builtin_loongarch_crcc_w_b_w, 
__builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w and 
__builtin_loongarch_crcc_w_d_w with CFLAGS=... " >&6; }
+if ${pgac_cv_loongarch_crc32c_intrinsics_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS "
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+unsigned int crc = 0;
+   crc = __builtin_loongarch_crcc_w_b_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_h_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_w_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_d_w(0, crc);
+   /* return computed value, to prevent the above being optimized away */
+   return crc == 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  pgac_cv_loongarch_crc32c_intrinsics_=yes
+else
+  pgac_cv_loongarch_crc32c_intrinsics_=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$pgac_cv_loongarch_crc32c_intrinsics_" >&5
+$as_echo "$pgac_cv_loongarch_crc32c_intrinsics_" >&6; }
+if test x"$pgac_cv_loongarch_crc32c_intrinsics_" = x"yes"; then
+  CFLAGS_CRC=""
+  pgac_loongarch_crc32c_intrinsics=yes
+fi
+
+if test x"$pgac_loongarch_crc32c_intrinsics" != x"yes"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 
__builtin_loongarch_crcc_w_b_w, __builtin_loongarch_crcc_w_h_w, 
__builtin_loongarch_crcc_w_w_w and __builtin_loongarch_crcc_w_d_w with 
CFLAGS=-march=loongarch64" >&5
+$as_echo_n "checking for __builtin_loongarch_crcc_w_b_w, 
__builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w and 
__builtin_loongarch_crcc_w_d_w with CFLAGS=-march=loongarch64... " >&6; }
+if ${pgac_cv_loongarch_crc32c_intrinsics__march_loongarch64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS -march=loongarch64"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+unsigned int crc = 0;
+   crc = __builtin_loongarch_crcc_w_b_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_h_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_w_w(0, crc);
+   crc = __builtin_loongarch_crcc_w_d_w(0, crc);
+   /* return computed value, to prevent the above being optimized away */
+   return crc == 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  pgac_cv_loongarch_crc32c_intrinsics__march_loongarch64=yes
+else
+  pgac_cv_loongarch_crc32c_intrinsics__march_loongarch64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$pgac_cv_loongarch_crc32c_intrinsics__march_loongarch64" >&5
+$as_echo "$pgac_cv_loongarch_crc32c_intrinsics__march_loongarch64" >&6; }
+if test x"$pgac_cv_loongarch_crc32c_intrinsics__march_loongarch64" = x"yes"; 
then
+  CFLAGS_CRC="-march=loongarch64"
+  pgac_loongarch_crc32c_intrinsics=yes
+fi
+
+fi
+
 
 
 # Select CRC-32C implementation.
@@ -18132,7 +18220,7 @@ fi
 #
 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
 # in the template or configure command line.
-if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test x"$USE_SSE42_CRC32C" = x"" 
&& test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test 
x"$USE_ARMV8_CRC32C" = x"" && test x"$USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK" = 
x""; then
+if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test x"$USE_SSE42_CRC32C" = x"" 
&& test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test 
x"$USE_ARMV8_CRC32C" = x"" && test x"$USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK" = 
x"" && test x"$USE_LOONGARCH_CRC32C" = x""; then
   # Use Intel SSE 4.2 if available.
   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" 
= x"1" ; then
     USE_SSE42_CRC32C=1
@@ -18150,10 +18238,15 @@ if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test 
x"$USE_SSE42_CRC32C" = x"" &&
         if test x"$pgac_armv8_crc32c_intrinsics" = x"yes"; then
           USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK=1
         else
-          # fall back to slicing-by-8 algorithm, which doesn't require any
-          # special CPU support.
-          USE_SLICING_BY_8_CRC32C=1
-       fi
+          if test x"$pgac_loongarch_crc32c_intrinsics" = x"yes"; then
+            # LoongArch CRCC instructions.
+            USE_LOONGARCH_CRC32C=1
+          else
+            # fall back to slicing-by-8 algorithm, which doesn't require any
+            # special CPU support.
+            USE_SLICING_BY_8_CRC32C=1
+          fi
+        fi
       fi
     fi
   fi
@@ -18194,12 +18287,21 @@ $as_echo "#define USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK 
1" >>confdefs.h
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: ARMv8 CRC 
instructions with runtime check" >&5
 $as_echo "ARMv8 CRC instructions with runtime check" >&6; }
       else
+        if test x"$USE_LOONGARCH_CRC32C" = x"1"; then
+
+$as_echo "#define USE_LOONGARCH_CRC32C 1" >>confdefs.h
+
+          PG_CRC32C_OBJS="pg_crc32c_loongarch.o"
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: LoongArch CRCC 
instructions" >&5
+$as_echo "LoongArch CRCC instructions" >&6; }
+        else
 
 $as_echo "#define USE_SLICING_BY_8_CRC32C 1" >>confdefs.h
 
-        PG_CRC32C_OBJS="pg_crc32c_sb8.o"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
+          PG_CRC32C_OBJS="pg_crc32c_sb8.o"
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: slicing-by-8" >&5
 $as_echo "slicing-by-8" >&6; }
+        fi
       fi
     fi
   fi
diff --git a/configure.ac b/configure.ac
index 09558ada0f..a312a33eaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2126,6 +2126,16 @@ if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
   PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc])
 fi
 
+# Check for LoongArch CRC intrinsics to do CRC calculations.
+#
+# Check if __builtin_loongarch_crcc_* intrinsics can be used
+# with the default compiler flags.
+# CFLAGS_CRC is set if the extra flag is required.
+PGAC_LOONGARCH_CRC32C_INTRINSICS([])
+if test x"$pgac_loongarch_crc32c_intrinsics" != x"yes"; then
+  PGAC_LOONGARCH_CRC32C_INTRINSICS([-march=loongarch64])
+fi
+
 AC_SUBST(CFLAGS_CRC)
 
 # Select CRC-32C implementation.
@@ -2144,7 +2154,7 @@ AC_SUBST(CFLAGS_CRC)
 #
 # You can override this logic by setting the appropriate USE_*_CRC32 flag to 1
 # in the template or configure command line.
-if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test x"$USE_SSE42_CRC32C" = x"" 
&& test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test 
x"$USE_ARMV8_CRC32C" = x"" && test x"$USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK" = 
x""; then
+if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test x"$USE_SSE42_CRC32C" = x"" 
&& test x"$USE_SSE42_CRC32C_WITH_RUNTIME_CHECK" = x"" && test 
x"$USE_ARMV8_CRC32C" = x"" && test x"$USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK" = 
x"" && test x"$USE_LOONGARCH_CRC32C" = x""; then
   # Use Intel SSE 4.2 if available.
   if test x"$pgac_sse42_crc32_intrinsics" = x"yes" && test x"$SSE4_2_TARGETED" 
= x"1" ; then
     USE_SSE42_CRC32C=1
@@ -2162,10 +2172,15 @@ if test x"$USE_SLICING_BY_8_CRC32C" = x"" && test 
x"$USE_SSE42_CRC32C" = x"" &&
         if test x"$pgac_armv8_crc32c_intrinsics" = x"yes"; then
           USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK=1
         else
-          # fall back to slicing-by-8 algorithm, which doesn't require any
-          # special CPU support.
-          USE_SLICING_BY_8_CRC32C=1
-       fi
+          if test x"$pgac_loongarch_crc32c_intrinsics" = x"yes"; then
+            # LoongArch CRCC instructions.
+            USE_LOONGARCH_CRC32C=1
+          else
+            # fall back to slicing-by-8 algorithm, which doesn't require any
+            # special CPU support.
+            USE_SLICING_BY_8_CRC32C=1
+          fi
+        fi
       fi
     fi
   fi
@@ -2193,9 +2208,15 @@ else
         PG_CRC32C_OBJS="pg_crc32c_armv8.o pg_crc32c_sb8.o 
pg_crc32c_armv8_choose.o"
         AC_MSG_RESULT(ARMv8 CRC instructions with runtime check)
       else
-        AC_DEFINE(USE_SLICING_BY_8_CRC32C, 1, [Define to 1 to use software 
CRC-32C implementation (slicing-by-8).])
-        PG_CRC32C_OBJS="pg_crc32c_sb8.o"
-        AC_MSG_RESULT(slicing-by-8)
+        if test x"$USE_LOONGARCH_CRC32C" = x"1"; then
+          AC_DEFINE(USE_LOONGARCH_CRC32C, 1, [Define to 1 to use LoongArch 
CRCC instructions.])
+          PG_CRC32C_OBJS="pg_crc32c_loongarch.o"
+          AC_MSG_RESULT(LoongArch CRCC instructions)
+        else
+          AC_DEFINE(USE_SLICING_BY_8_CRC32C, 1, [Define to 1 to use software 
CRC-32C implementation (slicing-by-8).])
+          PG_CRC32C_OBJS="pg_crc32c_sb8.o"
+          AC_MSG_RESULT(slicing-by-8)
+        fi
       fi
     fi
   fi
diff --git a/meson.build b/meson.build
index 82f2782673..77a9b985df 100644
--- a/meson.build
+++ b/meson.build
@@ -2073,6 +2073,30 @@ int main(void)
     cdata.set('USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK', 1)
     have_optimized_crc = true
   endif
+
+elif host_cpu == 'loongarch64'
+
+  prog = '''
+int main(void)
+{
+    unsigned int crc = 0;
+    crc = __builtin_loongarch_crcc_w_b_w(0, crc);
+    crc = __builtin_loongarch_crcc_w_h_w(0, crc);
+    crc = __builtin_loongarch_crcc_w_w_w(0, crc);
+    crc = __builtin_loongarch_crcc_w_d_w(0, crc);
+
+    /* return computed value, to prevent the above being optimized away */
+    return crc == 0;
+}
+'''
+
+  if cc.links(prog, name: '__builtin_loongarch_crcc_w_b_w, 
__builtin_loongarch_crcc_w_h_w, __builtin_loongarch_crcc_w_w_w, and 
__builtin_loongarch_crcc_w_d_w',
+      args: test_c_args)
+    # Use LoongArch CRC instruction unconditionally
+    cdata.set('USE_LOONGARCH_CRC32C', 1)
+    have_optimized_crc = true
+  endif
+
 endif
 
 if not have_optimized_crc
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 6d572c3820..1f253566e4 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -724,6 +724,9 @@
 /* Define to 1 to build with LLVM based JIT support. (--with-llvm) */
 #undef USE_LLVM
 
+/* Define to 1 to use LoongArch CRCC instructions. */
+#undef USE_LOONGARCH_CRC32C
+
 /* Define to 1 to build with LZ4 support. (--with-lz4) */
 #undef USE_LZ4
 
diff --git a/src/include/port/pg_crc32c.h b/src/include/port/pg_crc32c.h
index 7f8779261c..d085f1dc00 100644
--- a/src/include/port/pg_crc32c.h
+++ b/src/include/port/pg_crc32c.h
@@ -58,6 +58,15 @@ extern pg_crc32c pg_comp_crc32c_sse42(pg_crc32c crc, const 
void *data, size_t le
 
 extern pg_crc32c pg_comp_crc32c_armv8(pg_crc32c crc, const void *data, size_t 
len);
 
+#elif defined(USE_LOONGARCH_CRC32C)
+/* Use LoongArch CRCC instructions. */
+
+#define COMP_CRC32C(crc, data, len)                                            
        \
+       ((crc) = pg_comp_crc32c_loongarch((crc), (data), (len)))
+#define FIN_CRC32C(crc) ((crc) ^= 0xFFFFFFFF)
+
+extern pg_crc32c pg_comp_crc32c_loongarch(pg_crc32c crc, const void *data, 
size_t len);
+
 #elif defined(USE_SSE42_CRC32C_WITH_RUNTIME_CHECK) || 
defined(USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK)
 
 /*
diff --git a/src/port/Makefile b/src/port/Makefile
index 711f59e32b..1933b0e750 100644
--- a/src/port/Makefile
+++ b/src/port/Makefile
@@ -98,6 +98,11 @@ pg_crc32c_armv8.o: CFLAGS+=$(CFLAGS_CRC)
 pg_crc32c_armv8_shlib.o: CFLAGS+=$(CFLAGS_CRC)
 pg_crc32c_armv8_srv.o: CFLAGS+=$(CFLAGS_CRC)
 
+# all versions of pg_crc32c_loongarch.o need CFLAGS_CRC
+pg_crc32c_loongarch.o: CFLAGS+=$(CFLAGS_CRC)
+pg_crc32c_loongarch_shlib.o: CFLAGS+=$(CFLAGS_CRC)
+pg_crc32c_loongarch_srv.o: CFLAGS+=$(CFLAGS_CRC)
+
 #
 # Shared library versions of object files
 #
diff --git a/src/port/meson.build b/src/port/meson.build
index 24416b9bfc..3e77b2493a 100644
--- a/src/port/meson.build
+++ b/src/port/meson.build
@@ -92,6 +92,9 @@ replace_funcs_pos = [
   ['pg_crc32c_armv8_choose', 'USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK'],
   ['pg_crc32c_sb8', 'USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK'],
 
+  # loongarch
+  ['pg_crc32c_loongarch', 'USE_LOONGARCH_CRC32C'],
+
   # generic fallback
   ['pg_crc32c_sb8', 'USE_SLICING_BY_8_CRC32C'],
 ]
diff --git a/src/port/pg_crc32c_loongarch.c b/src/port/pg_crc32c_loongarch.c
new file mode 100644
index 0000000000..b54fe12ff5
--- /dev/null
+++ b/src/port/pg_crc32c_loongarch.c
@@ -0,0 +1,72 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_crc32c_loongarch.c
+ *       Compute CRC-32C checksum using LoongArch CRCC instructions
+ *
+ * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ *
+ * IDENTIFICATION
+ *       src/port/pg_crc32c_loongarch.c
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "c.h"
+
+#include "port/pg_crc32c.h"
+
+pg_crc32c
+pg_comp_crc32c_loongarch(pg_crc32c crc, const void *data, size_t len)
+{
+       const unsigned char *p = data;
+       const unsigned char *pend = p + len;
+
+       /*
+        * Aligned memory access is significantly faster.
+        * Process leading bytes so that the loop below starts with a pointer 
aligned to eight bytes.
+        */
+       if (!PointerIsAligned(p, uint16) &&
+               p + 1 <= pend)
+       {
+               crc = __builtin_loongarch_crcc_w_b_w(*p, crc);
+               p += 1;
+       }
+       if (!PointerIsAligned(p, uint32) &&
+               p + 2 <= pend)
+       {
+               crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
+               p += 2;
+       }
+       if (!PointerIsAligned(p, uint64) &&
+               p + 4 <= pend)
+       {
+               crc = __builtin_loongarch_crcc_w_w_w(*(uint32 *) p, crc);
+               p += 4;
+       }
+
+       /* Process eight bytes at a time, as far as we can. */
+       while (p + 8 <= pend)
+       {
+               crc = __builtin_loongarch_crcc_w_d_w(*(uint64 *) p, crc);
+               p += 8;
+       }
+
+       /* Process remaining 0-7 bytes. */
+       if (p + 4 <= pend)
+       {
+               crc = __builtin_loongarch_crcc_w_w_w(*(uint32 *) p, crc);
+               p += 4;
+       }
+       if (p + 2 <= pend)
+       {
+               crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
+               p += 2;
+       }
+       if (p < pend)
+       {
+               crc = __builtin_loongarch_crcc_w_b_w(*p, crc);
+       }
+
+       return crc;
+}
-- 
2.41.0

  62a548:       47fff9bf        bnez            $t1, -8(0x7ffff8)       # 
62a540 <strlcpy+0x2c>
                        ;
        }

        return (s - src - 1);           /* count does not include NUL */
  62a54c:       00119584        sub.d           $a0, $t0, $a1
}
  62a550:       02fffc84        addi.d          $a0, $a0, -1(0xfff)
  62a554:       4c000020        jirl            $zero, $ra, 0

000000000062a558 <pg_comp_crc32c_loongarch>:

        /*
         * Aligned memory access is significantly faster.
         * Process leading bytes so that the loop below starts with a pointer 
aligned to eight bytes.
         */
        if (!PointerIsAligned(p, uint16) &&
  62a558:       034004ae        andi            $t2, $a1, 0x1
{
  62a55c:       0015008d        move            $t1, $a0
        const unsigned char *pend = p + len;
  62a560:       001098a6        add.d           $a2, $a1, $a2
        if (!PointerIsAligned(p, uint16) &&
  62a564:       001500ac        move            $t0, $a1
  62a568:       40000dc0        beqz            $t2, 12(0xc)    # 62a574 
<pg_comp_crc32c_loongarch+0x1c>
                p + 1 <= pend)
  62a56c:       02c004ae        addi.d          $t2, $a1, 1(0x1)
        if (!PointerIsAligned(p, uint16) &&
  62a570:       6c00ecce        bgeu            $a2, $t2, 236(0xec)     # 
62a65c <pg_comp_crc32c_loongarch+0x104>
        {
                crc = __builtin_loongarch_crcc_w_b_w(*p, crc);
                p += 1;
        }
        if (!PointerIsAligned(p, uint32) &&
  62a574:       03400d8e        andi            $t2, $t0, 0x3
  62a578:       40000dc0        beqz            $t2, 12(0xc)    # 62a584 
<pg_comp_crc32c_loongarch+0x2c>
                p + 2 <= pend)
  62a57c:       02c008ae        addi.d          $t2, $a1, 2(0x2)
        if (!PointerIsAligned(p, uint32) &&
  62a580:       6c00c4ce        bgeu            $a2, $t2, 196(0xc4)     # 
62a644 <pg_comp_crc32c_loongarch+0xec>
        {
                crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
                p += 2;
        }
        if (!PointerIsAligned(p, uint64) &&
  62a584:       03401d8c        andi            $t0, $t0, 0x7
  62a588:       40001d80        beqz            $t0, 28(0x1c)   # 62a5a4 
<pg_comp_crc32c_loongarch+0x4c>
                p + 4 <= pend)
  62a58c:       02c010ac        addi.d          $t0, $a1, 4(0x4)
        if (!PointerIsAligned(p, uint64) &&
  62a590:       6800a4cc        bltu            $a2, $t0, 164(0xa4)     # 
62a634 <pg_comp_crc32c_loongarch+0xdc>
        {
                crc = __builtin_loongarch_crcc_w_w_w(*(uint32 *) p, crc);
  62a594:       240000ae        ldptr.w         $t2, $a1, 0
                p += 4;
  62a598:       00150185        move            $a1, $t0
                crc = __builtin_loongarch_crcc_w_w_w(*(uint32 *) p, crc);
  62a59c:       002735cc        crcc.w.w.w      $t0, $t2, $t1
  62a5a0:       0040818d        slli.w          $t1, $t0, 0x0
        }

        /* Process eight bytes at a time, as far as we can. */
        while (p + 8 <= pend)
  62a5a4:       02c020ae        addi.d          $t2, $a1, 8(0x8)
  62a5a8:       6800ccce        bltu            $a2, $t2, 204(0xcc)     # 
62a674 <pg_comp_crc32c_loongarch+0x11c>
                p += 4;
  62a5ac:       001501cc        move            $t0, $t2
        {
                crc = __builtin_loongarch_crcc_w_d_w(*(uint64 *) p, crc);
  62a5b0:       260000a4        ldptr.d         $a0, $a1, 0
  62a5b4:       00150185        move            $a1, $t0
        while (p + 8 <= pend)
  62a5b8:       02c0218c        addi.d          $t0, $t0, 8(0x8)
                crc = __builtin_loongarch_crcc_w_d_w(*(uint64 *) p, crc);
  62a5bc:       0027b484        crcc.w.d.w      $a0, $a0, $t1
  62a5c0:       0040808d        slli.w          $t1, $a0, 0x0
        while (p + 8 <= pend)
  62a5c4:       6fffeccc        bgeu            $a2, $t0, -20(0x3ffec)  # 
62a5b0 <pg_comp_crc32c_loongarch+0x58>
  62a5c8:       0011b8c5        sub.d           $a1, $a2, $t2
  62a5cc:       00450ca5        srli.d          $a1, $a1, 0x3
  62a5d0:       02c004cc        addi.d          $t0, $a2, 1(0x1)
  62a5d4:       02c005cf        addi.d          $t3, $t2, 1(0x1)
  62a5d8:       00410ca5        slli.d          $a1, $a1, 0x3
  62a5dc:       0012bd8c        sltu            $t0, $t0, $t3
  62a5e0:       0013b0a5        masknez         $a1, $a1, $t0
  62a5e4:       001095c5        add.d           $a1, $t2, $a1
  62a5e8:       001501a4        move            $a0, $t1
                p += 8;
        }

        /* Process remaining 0-7 bytes. */
        if (p + 4 <= pend)
  62a5ec:       02c010ac        addi.d          $t0, $a1, 4(0x4)
  62a5f0:       680014cc        bltu            $a2, $t0, 20(0x14)      # 
62a604 <pg_comp_crc32c_loongarch+0xac>
        {
                crc = __builtin_loongarch_crcc_w_w_w(*(uint32 *) p, crc);
  62a5f4:       240000a4        ldptr.w         $a0, $a1, 0
                p += 4;
  62a5f8:       00150185        move            $a1, $t0
                crc = __builtin_loongarch_crcc_w_w_w(*(uint32 *) p, crc);
  62a5fc:       00273484        crcc.w.w.w      $a0, $a0, $t1
  62a600:       00408084        slli.w          $a0, $a0, 0x0
        }
        if (p + 2 <= pend)
  62a604:       02c008ac        addi.d          $t0, $a1, 2(0x2)
  62a608:       680014cc        bltu            $a2, $t0, 20(0x14)      # 
62a61c <pg_comp_crc32c_loongarch+0xc4>
        {
                crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
  62a60c:       2a4000ad        ld.hu           $t1, $a1, 0
                p += 2;
  62a610:       00150185        move            $a1, $t0
                crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
  62a614:       002691a4        crcc.w.h.w      $a0, $t1, $a0
  62a618:       00408084        slli.w          $a0, $a0, 0x0
        }
        if (p < pend)
  62a61c:       6c0014a6        bgeu            $a1, $a2, 20(0x14)      # 
62a630 <pg_comp_crc32c_loongarch+0xd8>
        {
                crc = __builtin_loongarch_crcc_w_b_w(*p, crc);
  62a620:       2a0000ac        ld.bu           $t0, $a1, 0
  62a624:       00261184        crcc.w.b.w      $a0, $t0, $a0
  62a628:       00408084        slli.w          $a0, $a0, 0x0
        }

        return crc;
  62a62c:       4c000020        jirl            $zero, $ra, 0
}
  62a630:       4c000020        jirl            $zero, $ra, 0
        while (p + 8 <= pend)
  62a634:       02c020ae        addi.d          $t2, $a1, 8(0x8)
  62a638:       001501a4        move            $a0, $t1
  62a63c:       6fff70ce        bgeu            $a2, $t2, -144(0x3ff70) # 
62a5ac <pg_comp_crc32c_loongarch+0x54>
  62a640:       53ffc7ff        b               -60(0xfffffc4)  # 62a604 
<pg_comp_crc32c_loongarch+0xac>
                crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
  62a644:       2a4000af        ld.hu           $t3, $a1, 0
                p += 2;
  62a648:       001501cc        move            $t0, $t2
        if (!PointerIsAligned(p, uint64) &&
  62a64c:       001501c5        move            $a1, $t2
                crc = __builtin_loongarch_crcc_w_h_w(*(uint16 *) p, crc);
  62a650:       0026b5ed        crcc.w.h.w      $t1, $t3, $t1
  62a654:       004081ad        slli.w          $t1, $t1, 0x0
                p += 2;
  62a658:       53ff2fff        b               -212(0xfffff2c) # 62a584 
<pg_comp_crc32c_loongarch+0x2c>
                crc = __builtin_loongarch_crcc_w_b_w(*p, crc);
  62a65c:       2a0000af        ld.bu           $t3, $a1, 0
                p += 1;
  62a660:       001501cc        move            $t0, $t2
        if (!PointerIsAligned(p, uint32) &&
  62a664:       001501c5        move            $a1, $t2
                crc = __builtin_loongarch_crcc_w_b_w(*p, crc);
  62a668:       002611ed        crcc.w.b.w      $t1, $t3, $a0
  62a66c:       004081ad        slli.w          $t1, $t1, 0x0
                p += 1;
  62a670:       53ff07ff        b               -252(0xfffff04) # 62a574 
<pg_comp_crc32c_loongarch+0x1c>
        while (p + 8 <= pend)
  62a674:       001501a4        move            $a0, $t1
  62a678:       53ff77ff        b               -140(0xfffff74) # 62a5ec 
<pg_comp_crc32c_loongarch+0x94>

000000000062a67c <bsearch_arg>:
void *
bsearch_arg(const void *key, const void *base0,
make -C ./src/backend generated-headers
make[1]: Entering directory '/home/yxd/playspace/postgres-build/src/backend'
make -C catalog distprep generated-header-symlinks
make -C nodes distprep generated-header-symlinks
make -C utils distprep generated-header-symlinks
prereqdir=`cd 'storage/lmgr/' >/dev/null && pwd` && \
  cd '../../src/include/storage/' && rm -f lwlocknames.h && \
  ln -s "$prereqdir/lwlocknames.h" .
make[2]: Entering directory 
'/home/yxd/playspace/postgres-build/src/backend/nodes'
make[2]: Nothing to be done for 'distprep'.
prereqdir=`cd './' >/dev/null && pwd` && \
cd '../../../src/include/nodes/' && for file in nodetags.h; do \
  rm -f $file && ln -s "$prereqdir/$file" . ; \
done
make[2]: Entering directory 
'/home/yxd/playspace/postgres-build/src/backend/utils'
make[2]: Nothing to be done for 'distprep'.
prereqdir=`cd './' >/dev/null && pwd` && \
cd '../../../src/include/utils/' && for file in fmgroids.h fmgrprotos.h 
errcodes.h; do \
  rm -f $file && ln -s "$prereqdir/$file" . ; \
done
sed -f 
/home/yxd/playspace/postgres-build/../postgres/src/backend/utils/Gen_dummy_probes.sed
 /home/yxd/playspace/postgres-build/../postgres/src/backend/utils/probes.d 
>probes.h
touch ../../../src/include/utils/header-stamp
touch ../../../src/include/nodes/header-stamp
make[2]: Leaving directory 
'/home/yxd/playspace/postgres-build/src/backend/nodes'
make[2]: Entering directory 
'/home/yxd/playspace/postgres-build/src/backend/catalog'
make[2]: Nothing to be done for 'distprep'.
prereqdir=`cd './' >/dev/null && pwd` && \
cd '../../../src/include/catalog/' && for file in pg_proc_d.h pg_type_d.h 
pg_attribute_d.h pg_class_d.h pg_attrdef_d.h pg_constraint_d.h pg_inherits_d.h 
pg_index_d.h pg_operator_d.h pg_opfamily_d.h pg_opclass_d.h pg_am_d.h 
pg_amop_d.h pg_amproc_d.h pg_language_d.h pg_largeobject_metadata_d.h 
pg_largeobject_d.h pg_aggregate_d.h pg_statistic_d.h pg_statistic_ext_d.h 
pg_statistic_ext_data_d.h pg_rewrite_d.h pg_trigger_d.h pg_event_trigger_d.h 
pg_description_d.h pg_cast_d.h pg_enum_d.h pg_namespace_d.h pg_conversion_d.h 
pg_depend_d.h pg_database_d.h pg_db_role_setting_d.h pg_tablespace_d.h 
pg_authid_d.h pg_auth_members_d.h pg_shdepend_d.h pg_shdescription_d.h 
pg_ts_config_d.h pg_ts_config_map_d.h pg_ts_dict_d.h pg_ts_parser_d.h 
pg_ts_template_d.h pg_extension_d.h pg_foreign_data_wrapper_d.h 
pg_foreign_server_d.h pg_user_mapping_d.h pg_foreign_table_d.h pg_policy_d.h 
pg_replication_origin_d.h pg_default_acl_d.h pg_init_privs_d.h pg_seclabel_d.h 
pg_shseclabel_d.h pg_collation_d.h pg_parameter_acl_d.h 
pg_partitioned_table_d.h pg_range_d.h pg_transform_d.h pg_sequence_d.h 
pg_publication_d.h pg_publication_namespace_d.h pg_publication_rel_d.h 
pg_subscription_d.h pg_subscription_rel_d.h schemapg.h system_fk_info.h; do \
  rm -f $file && ln -s "$prereqdir/$file" . ; \
done
cd '../../../src/include/utils/' && rm -f probes.h && \
    ln -s "../../../src/backend/utils/probes.h" .
make[2]: Leaving directory 
'/home/yxd/playspace/postgres-build/src/backend/utils'
touch ../../../src/include/catalog/header-stamp
make[2]: Leaving directory 
'/home/yxd/playspace/postgres-build/src/backend/catalog'
make[1]: Leaving directory '/home/yxd/playspace/postgres-build/src/backend'
rm -rf '/home/yxd/playspace/postgres-build'/tmp_install
/usr/bin/mkdir -p '/home/yxd/playspace/postgres-build'/tmp_install/log
make -C '.' DESTDIR='/home/yxd/playspace/postgres-build'/tmp_install install 
>'/home/yxd/playspace/postgres-build'/tmp_install/log/install.log 2>&1
make -j1 -C src/test/regress checkprep 
>>'/home/yxd/playspace/postgres-build'/tmp_install/log/install.log 2>&1
make -C src/test/regress check
make[1]: Entering directory 
'/home/yxd/playspace/postgres-build/src/test/regress'
make -C ../../../src/port all
make[2]: Entering directory '/home/yxd/playspace/postgres-build/src/port'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/yxd/playspace/postgres-build/src/port'
make -C ../../../src/common all
make[2]: Entering directory '/home/yxd/playspace/postgres-build/src/common'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/yxd/playspace/postgres-build/src/common'
make -C ../../../contrib/spi
make[2]: Entering directory '/home/yxd/playspace/postgres-build/contrib/spi'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/yxd/playspace/postgres-build/contrib/spi'
echo "# +++ regress check in src/test/regress +++" && 
PATH="/home/yxd/playspace/postgres-build/tmp_install/usr/local/pgsql/bin:/home/yxd/playspace/postgres-build/src/test/regress:$PATH"
 
LD_LIBRARY_PATH="/home/yxd/playspace/postgres-build/tmp_install/usr/local/pgsql/lib"
  ../../../src/test/regress/pg_regress --temp-instance=./tmp_check 
--inputdir=/home/yxd/playspace/postgres-build/../postgres/src/test/regress 
--bindir=     --dlpath=. --max-concurrent-tests=20  
--schedule=/home/yxd/playspace/postgres-build/../postgres/src/test/regress/parallel_schedule
  
# +++ regress check in src/test/regress +++
# using temp instance on port 61696 with PID 815947
ok 1         - test_setup                                284 ms
# parallel group (20 tests):  int4 text txid char pg_lsn oid int2 name uuid 
regproc boolean varchar float8 float4 money int8 enum bit rangetypes numeric
ok 2         + boolean                                   196 ms
ok 3         + char                                      170 ms
ok 4         + name                                      179 ms
ok 5         + varchar                                   196 ms
ok 6         + text                                      149 ms
ok 7         + int2                                      178 ms
ok 8         + int4                                      130 ms
ok 9         + int8                                      210 ms
ok 10        + oid                                       177 ms
ok 11        + float4                                    201 ms
ok 12        + float8                                    196 ms
ok 13        + bit                                       229 ms
ok 14        + numeric                                   561 ms
ok 15        + txid                                      158 ms
ok 16        + uuid                                      186 ms
ok 17        + enum                                      221 ms
ok 18        + money                                     200 ms
ok 19        + rangetypes                                531 ms
ok 20        + pg_lsn                                    175 ms
ok 21        + regproc                                   190 ms
# parallel group (20 tests):  md5 circle line path macaddr8 numerology lseg 
point interval macaddr time timetz date inet strings box polygon 
multirangetypes timestamp timestamptz
ok 22        + strings                                   261 ms
ok 23        + md5                                       115 ms
ok 24        + numerology                                157 ms
ok 25        + point                                     172 ms
ok 26        + lseg                                      167 ms
ok 27        + line                                      121 ms
ok 28        + box                                       361 ms
ok 29        + path                                      134 ms
ok 30        + polygon                                   383 ms
ok 31        + circle                                    119 ms
ok 32        + date                                      202 ms
ok 33        + time                                      179 ms
ok 34        + timetz                                    188 ms
ok 35        + timestamp                                 471 ms
ok 36        + timestamptz                               482 ms
ok 37        + interval                                  172 ms
ok 38        + inet                                      229 ms
ok 39        + macaddr                                   177 ms
ok 40        + macaddr8                                  143 ms
ok 41        + multirangetypes                           382 ms
# parallel group (12 tests):  unicode misc_sanity expressions comments xid 
tstypes type_sanity horology geometry mvcc opr_sanity regex
ok 42        + geometry                                  195 ms
ok 43        + horology                                  193 ms
ok 44        + tstypes                                   159 ms
ok 45        + regex                                     471 ms
ok 46        + type_sanity                               178 ms
ok 47        + opr_sanity                                401 ms
ok 48        + misc_sanity                                68 ms
ok 49        + comments                                  107 ms
ok 50        + expressions                               104 ms
ok 51        + unicode                                    65 ms
ok 52        + xid                                       150 ms
ok 53        + mvcc                                      200 ms
# parallel group (5 tests):  copydml copyselect copy insert_conflict insert
ok 54        + copy                                       80 ms
ok 55        + copyselect                                 59 ms
ok 56        + copydml                                    44 ms
ok 57        + insert                                    298 ms
ok 58        + insert_conflict                           161 ms
# parallel group (7 tests):  create_function_c create_type create_operator 
create_schema create_misc create_procedure create_table
ok 59        + create_function_c                          48 ms
ok 60        + create_misc                                82 ms
ok 61        + create_operator                            60 ms
ok 62        + create_procedure                           89 ms
ok 63        + create_table                              393 ms
ok 64        + create_type                                53 ms
ok 65        + create_schema                              78 ms
# parallel group (5 tests):  create_view index_including index_including_gist 
create_index_spgist create_index
ok 66        + create_index                              737 ms
ok 67        + create_index_spgist                       508 ms
ok 68        + create_view                               299 ms
ok 69        + index_including                           305 ms
ok 70        + index_including_gist                      323 ms
# parallel group (16 tests):  errors create_cast roleattributes 
create_aggregate hash_func drop_if_exists select create_function_sql 
typed_table create_am constraints infinite_recurse vacuum updatable_views 
inherit triggers
ok 71        + create_aggregate                          162 ms
ok 72        + create_function_sql                       284 ms
ok 73        + create_cast                               131 ms
ok 74        + constraints                               392 ms
ok 75        + triggers                                 1041 ms
ok 76        + select                                    234 ms
ok 77        + inherit                                   762 ms
ok 78        + typed_table                               294 ms
ok 79        + vacuum                                    640 ms
ok 80        + drop_if_exists                            215 ms
ok 81        + updatable_views                           757 ms
ok 82        + roleattributes                            142 ms
ok 83        + create_am                                 339 ms
ok 84        + hash_func                                 179 ms
ok 85        + errors                                    101 ms
ok 86        + infinite_recurse                          503 ms
ok 87        - sanity_check                              115 ms
# parallel group (20 tests):  select_distinct_on namespace select_implicit 
delete case select_having random select_into prepared_xacts portals union 
transactions subselect select_distinct arrays update hash_index join aggregates 
btree_index
ok 88        + select_into                               266 ms
ok 89        + select_distinct                           517 ms
ok 90        + select_distinct_on                        142 ms
ok 91        + select_implicit                           197 ms
ok 92        + select_having                             210 ms
ok 93        + subselect                                 500 ms
ok 94        + union                                     465 ms
ok 95        + case                                      207 ms
ok 96        + join                                      936 ms
ok 97        + aggregates                               1133 ms
ok 98        + transactions                              474 ms
ok 99        + random                                    233 ms
ok 100       + portals                                   380 ms
ok 101       + arrays                                    552 ms
ok 102       + btree_index                              2003 ms
ok 103       + hash_index                                932 ms
ok 104       + update                                    699 ms
ok 105       + delete                                    201 ms
ok 106       + namespace                                 159 ms
ok 107       + prepared_xacts                            355 ms
# parallel group (20 tests):  drop_operator init_privs security_label lock 
tablesample object_address collate password replica_identity identity 
groupingsets matview generated rowsecurity spgist gin gist brin join_hash 
privileges
ok 108       + brin                                     2754 ms
ok 109       + gin                                      1403 ms
ok 110       + gist                                     1441 ms
ok 111       + spgist                                   1249 ms
ok 112       + privileges                               3351 ms
ok 113       + init_privs                                137 ms
ok 114       + security_label                            216 ms
ok 115       + collate                                   392 ms
ok 116       + matview                                   836 ms
ok 117       + lock                                      254 ms
ok 118       + replica_identity                          492 ms
ok 119       + rowsecurity                              1105 ms
ok 120       + object_address                            339 ms
ok 121       + tablesample                               298 ms
ok 122       + groupingsets                              826 ms
ok 123       + drop_operator                             118 ms
ok 124       + password                                  458 ms
ok 125       + identity                                  693 ms
ok 126       + generated                                 938 ms
ok 127       + join_hash                                2758 ms
# parallel group (2 tests):  brin_bloom brin_multi
ok 128       + brin_bloom                                110 ms
ok 129       + brin_multi                                246 ms
# parallel group (16 tests):  dbsize tid async alter_operator tidrangescan tsrf 
tidscan sysviews create_role misc_functions alter_generic incremental_sort misc 
merge collate.icu.utf8 create_table_like
ok 130       + create_table_like                         445 ms
ok 131       + alter_generic                             265 ms
ok 132       + alter_operator                            150 ms
ok 133       + misc                                      340 ms
ok 134       + async                                     135 ms
ok 135       + dbsize                                    109 ms
ok 136       + merge                                     369 ms
ok 137       + misc_functions                            239 ms
ok 138       + sysviews                                  219 ms
ok 139       + tsrf                                      165 ms
ok 140       + tid                                       112 ms
ok 141       + tidscan                                   216 ms
ok 142       + tidrangescan                              156 ms
ok 143       + collate.icu.utf8                          395 ms
ok 144       + incremental_sort                          323 ms
ok 145       + create_role                               219 ms
# parallel group (7 tests):  collate.linux.utf8 collate.windows.win1252 amutils 
psql_crosstab rules psql stats_ext
ok 146       + rules                                     335 ms
ok 147       + psql                                      356 ms
ok 148       + psql_crosstab                              67 ms
ok 149       + amutils                                    58 ms
ok 150       + stats_ext                                1821 ms
ok 151       + collate.linux.utf8                         30 ms
ok 152       + collate.windows.win1252                    30 ms
ok 153       - select_parallel                          1919 ms
ok 154       - write_parallel                            240 ms
ok 155       - vacuum_parallel                           159 ms
# parallel group (2 tests):  subscription publication
ok 156       + publication                               338 ms
ok 157       + subscription                               65 ms
# parallel group (17 tests):  xmlmap combocid advisory_lock equivclass 
portals_p2 guc functional_deps tsdicts dependency select_views window bitmapops 
cluster tsearch foreign_data indirect_toast foreign_key
ok 158       + select_views                              352 ms
ok 159       + portals_p2                                194 ms
ok 160       + foreign_key                              1250 ms
ok 161       + cluster                                   626 ms
ok 162       + dependency                                260 ms
ok 163       + guc                                       210 ms
ok 164       + bitmapops                                 582 ms
ok 165       + combocid                                  164 ms
ok 166       + tsearch                                   645 ms
ok 167       + tsdicts                                   248 ms
ok 168       + foreign_data                              830 ms
ok 169       + window                                    525 ms
ok 170       + xmlmap                                    162 ms
ok 171       + functional_deps                           241 ms
ok 172       + advisory_lock                             185 ms
ok 173       + indirect_toast                            893 ms
ok 174       + equivclass                                186 ms
# parallel group (7 tests):  json_encoding jsonpath jsonpath_encoding sqljson 
jsonb_jsonpath json jsonb
ok 175       + json                                      153 ms
ok 176       + jsonb                                     266 ms
ok 177       + json_encoding                              56 ms
ok 178       + jsonpath                                   58 ms
ok 179       + jsonpath_encoding                          65 ms
ok 180       + jsonb_jsonpath                            131 ms
ok 181       + sqljson                                   116 ms
# parallel group (18 tests):  prepare returning plancache xml limit conversion 
copy2 polymorphism rowtypes sequence with temp rangefuncs truncate largeobject 
domain plpgsql alter_table
ok 182       + plancache                                 310 ms
ok 183       + limit                                     329 ms
ok 184       + plpgsql                                   889 ms
ok 185       + copy2                                     456 ms
ok 186       + temp                                      541 ms
ok 187       + domain                                    599 ms
ok 188       + rangefuncs                                552 ms
ok 189       + prepare                                   179 ms
ok 190       + conversion                                402 ms
ok 191       + truncate                                  552 ms
ok 192       + alter_table                              1563 ms
ok 193       + sequence                                  507 ms
ok 194       + polymorphism                              482 ms
ok 195       + rowtypes                                  490 ms
ok 196       + returning                                 245 ms
ok 197       + largeobject                               592 ms
ok 198       + with                                      518 ms
ok 199       + xml                                       313 ms
# parallel group (12 tests):  hash_part reloptions partition_info explain 
compression memoize indexing partition_join stats partition_aggregate 
partition_prune tuplesort
ok 200       + partition_join                           1295 ms
ok 201       + partition_prune                          1589 ms
ok 202       + reloptions                                186 ms
ok 203       + hash_part                                 166 ms
ok 204       + indexing                                 1225 ms
ok 205       + partition_aggregate                      1382 ms
ok 206       + partition_info                            187 ms
ok 207       + tuplesort                                2142 ms
ok 208       + explain                                   243 ms
ok 209       + compression                               307 ms
ok 210       + memoize                                   317 ms
ok 211       + stats                                    1321 ms
# parallel group (2 tests):  event_trigger oidjoins
ok 212       + event_trigger                             126 ms
ok 213       + oidjoins                                  240 ms
ok 214       - fast_default                              144 ms
ok 215       - tablespace                                308 ms
1..215
# All 215 tests passed.
make[1]: Leaving directory '/home/yxd/playspace/postgres-build/src/test/regress'

Reply via email to