RE: CRC32C Parallel Computation Optimization on ARM

From: Xiang Gao <Xiang(dot)Gao(at)arm(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: CRC32C Parallel Computation Optimization on ARM
Date: 2023-11-07 08:05:45
Message-ID: DB9PR08MB69910E10543F4EEBAB13FBEAF5A9A@DB9PR08MB6991.eurprd08.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 6 Nov 2023 13:16:13PM -0600, Nathan Bossart wrote:
>>> The idea is that we don't want to start forcing runtime checks on builds
>>>where we aren't already doing runtime checks. IOW if the compiler can use
>>>the ARMv8 CRC instructions with the default compiler flags, we should only
>>>use vmull_p64() if it can also be used with the default compiler flags.
>>
>>This is the newest patch, I think the code for which crc algorithm to
>>choose is a bit complicated. Maybe we can just use USE_ARMV8_VMULL only,
>>and do runtime checks on the vmull_p64 instruction at all times. This
>>will not affect the existing builds, because this is a new instruction
>>and new logic. In addition, it can also reduce the complexity of the
>>code.

>I don't think we can. AFAICT a runtime check necessitates a function
>pointer or a branch, both of which incurred an impact on performance in my
>tests. It looks like this latest patch still does the runtime check even
>for the USE_ARMV8_CRC32C case.

I think I understand what you mean, this is the latest patch. Thank you!
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Attachment Content-Type Size
0006-crc32c-parallel-computation-optimization-on-arm.patch application/octet-stream 18.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-11-07 08:20:27 Re: Add recovery to pg_control and remove backup_label
Previous Message Michael Paquier 2023-11-07 08:01:16 Re: Adding facility for injection points (or probe points?) for more advanced tests