[PATCH i386 8/8] [AVX-512] Add SHA support.

H.J. Lu hjl.tools@gmail.com
Thu Jan 30 19:13:00 GMT 2014


On Mon, Dec 30, 2013 at 4:55 AM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Hello,
> On 19 Nov 15:36, Uros Bizjak wrote:
>> Please also add new command options to g++.dg/other/sse-2.C and
>> g++.dg/other/sse-3.C
> Done (to i386-[23].C).
>> > --mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd @gol
>> > +-mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -msha -mno-sha @gol
>>
>> No need to document negative option here.
> Fxed.
>
> I am testing patch in the bootom and will commit it tomorrow if no more inputs
> and testing will pass.
>
> --
> Thanks, K
>
> ---
>  gcc/common/config/i386/i386-common.c          | 18 ++++-
>  gcc/config.gcc                                |  6 +-
>  gcc/config/i386/cpuid.h                       |  1 +
>  gcc/config/i386/driver-i386.c                 |  6 +-
>  gcc/config/i386/i386-c.c                      |  2 +
>  gcc/config/i386/i386.c                        | 46 ++++++++++++-
>  gcc/config/i386/i386.h                        |  2 +
>  gcc/config/i386/i386.opt                      |  4 ++
>  gcc/config/i386/immintrin.h                   |  2 +
>  gcc/config/i386/shaintrin.h                   | 99 +++++++++++++++++++++++++++
>  gcc/config/i386/sse.md                        | 90 ++++++++++++++++++++++++
>  gcc/doc/invoke.texi                           |  8 ++-
>  gcc/testsuite/g++.dg/other/i386-2.C           |  2 +-
>  gcc/testsuite/g++.dg/other/i386-3.C           |  2 +-
>  gcc/testsuite/gcc.target/i386/avx-1.c         |  3 +
>  gcc/testsuite/gcc.target/i386/i386.exp        | 14 ++++
>  gcc/testsuite/gcc.target/i386/sha-check.h     | 37 ++++++++++
>  gcc/testsuite/gcc.target/i386/sha1msg1-1.c    | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha1msg1-2.c    | 42 ++++++++++++
>  gcc/testsuite/gcc.target/i386/sha1msg2-1.c    | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha1msg2-2.c    | 44 ++++++++++++
>  gcc/testsuite/gcc.target/i386/sha1nexte-1.c   | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha1nexte-2.c   | 36 ++++++++++
>  gcc/testsuite/gcc.target/i386/sha1rnds4-1.c   | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha1rnds4-2.c   | 93 +++++++++++++++++++++++++
>  gcc/testsuite/gcc.target/i386/sha256msg1-1.c  | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha256msg1-2.c  | 48 +++++++++++++
>  gcc/testsuite/gcc.target/i386/sha256msg2-1.c  | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha256msg2-2.c  | 49 +++++++++++++
>  gcc/testsuite/gcc.target/i386/sha256rnds2-1.c | 13 ++++
>  gcc/testsuite/gcc.target/i386/sha256rnds2-2.c | 85 +++++++++++++++++++++++
>  gcc/testsuite/gcc.target/i386/sse-13.c        |  3 +
>  gcc/testsuite/gcc.target/i386/sse-14.c        |  6 +-
>  gcc/testsuite/gcc.target/i386/sse-22.c        |  9 ++-
>  gcc/testsuite/gcc.target/i386/sse-23.c        |  5 +-
>  35 files changed, 836 insertions(+), 17 deletions(-)
>
...
> +
> +  /* SHA */
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha1msg1, 0, IX86_BUILTIN_SHA1MSG1, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha1msg2, 0, IX86_BUILTIN_SHA1MSG2, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha1nexte, 0, IX86_BUILTIN_SHA1NEXTE, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha1rnds4, 0, IX86_BUILTIN_SHA1RNDS4, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI_INT },
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha256msg1, 0, IX86_BUILTIN_SHA256MSG1, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha256msg2, 0, IX86_BUILTIN_SHA256MSG2, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
> +  { OPTION_MASK_ISA_SSE2, CODE_FOR_sha256rnds2, 0, IX86_BUILTIN_SHA256RNDS2, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI_V4SI },
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Is OPTION_MASK_ISA_SSE2 intentional?
Should it be OPTION_MASK_ISA_SHA?
>  };
>


-- 
H.J.



More information about the Gcc-patches mailing list