Re: What exactly is our CRC algorithm?

Поиск
Список
Период
Сортировка
От Abhijit Menon-Sen
Тема Re: What exactly is our CRC algorithm?
Дата
Msg-id 20141225062729.GA30176@toroid.org
обсуждение исходный текст
Ответ на Re: What exactly is our CRC algorithm?  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Ответы Re: What exactly is our CRC algorithm?  (Bruce Momjian <bruce@momjian.us>)
Re: What exactly is our CRC algorithm?  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Hi.

Here's a proposed patch to use CPUID at startup to determine if the
SSE4.2 CRC instructions are available, to use them instead of the
slice-by-8 implementation (posted earlier).

A few notes:

1. GCC has included cpuid.h since 4.3.0, so I figured it was safe to
   use. It can be replaced with some inline assembly otherwise.

2. I've also used the crc32b/crc32q instructions directly rather than
   using ".bytes" to encode the instructions; bintuils versions since
   2007 or so have supported them.

3. I've included the MSVC implementation mostly as an example of how to
   extend this to different compilers/platforms. It's written according
   to the documentation for MSVC intrinsics, but I have not tested it.
   Suggestions/improvements are welcome.

-- Abhijit

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Securing "make check" (CVE-2014-0067)
Следующее
От: David Rowley
Дата:
Сообщение: Re: Securing "make check" (CVE-2014-0067)