[PATCH] Add loongarch native checksum implementation.

YANG Xudong <yangxudong@ymatrix.cn>

From: YANG Xudong <yangxudong@ymatrix.cn>
To: pgsql-hackers@lists.postgresql.org
Cc: wengyanqing@ymatrix.cn, wanghao@ymatrix.cn
Date: 2023-06-08T05:24:02Z
Lists: pgsql-hackers

Attachments

Hi,

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


See:

[1]: 
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#crc-check-instructions
[2]: 
https://gcc.gnu.org/onlinedocs/gcc/LoongArch-Base-Built-in-Functions.html
[3]: 
https://github.com/llvm/llvm-project/blob/release/16.x/clang/include/clang/Basic/BuiltinsLoongArch.def#L36-L39

Commits

  1. Update Solution.pm for new LoongArch CRC symbol

  2. Use native CRC instructions on 64-bit LoongArch

  3. Recalculate search_path after ALTER ROLE.