Message ID | 20180830051406.118182-1-thiago.macieira@intel.com |
---|---|
State | New |
Headers | show |
Series | [1/1] Move AESNI generation to Skylake and Goldmont | expand |
On Thu, Aug 30, 2018 at 7:14 AM, Thiago Macieira <thiago.macieira@intel.com> wrote: > The instruction set first appeared with Westmere, but not all processors > in that and the next few generations have the instructions. According to > Wikipedia[1], the first generation in which all SKUs have AES > instructions are Skylake and Goldmont. I can't find any Skylake, > Kabylake, Kabylake-R or Cannon Lake currently listed at > https://ark.intel.com that says "Intel® AES New Instructions" "No". > > [1] https://en.wikipedia.org/wiki/AES_instruction_set > > --- > gcc/ > > 2018-08-27 Thiago Macieira <thiago.macieira@intel.com> > > config/i386/i386.c: Update PTA_WESTMERE, PTA_SKYLAKE > and PTA_GOLDMONT LGTM, but let's wait for HJ's opinion. Thanks, Uros. > --- > gcc/config/i386/i386.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index c437c18a29c..8672a666024 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -3479,7 +3479,7 @@ ix86_option_override_internal (bool main_args_p, > | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR; > const wide_int_bitmask PTA_NEHALEM = PTA_CORE2 | PTA_SSE4_1 | PTA_SSE4_2 > | PTA_POPCNT; > - const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_AES | PTA_PCLMUL; > + const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_PCLMUL; > const wide_int_bitmask PTA_SANDYBRIDGE = PTA_WESTMERE | PTA_AVX | PTA_XSAVE > | PTA_XSAVEOPT; > const wide_int_bitmask PTA_IVYBRIDGE = PTA_SANDYBRIDGE | PTA_FSGSBASE > @@ -3488,7 +3488,7 @@ ix86_option_override_internal (bool main_args_p, > | PTA_BMI2 | PTA_LZCNT | PTA_FMA | PTA_MOVBE | PTA_HLE; > const wide_int_bitmask PTA_BROADWELL = PTA_HASWELL | PTA_ADX | PTA_PRFCHW > | PTA_RDSEED; > - const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_CLFLUSHOPT > + const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_AES | PTA_CLFLUSHOPT > | PTA_XSAVEC | PTA_XSAVES | PTA_SGX; > const wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F > | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU > @@ -3505,7 +3505,7 @@ ix86_option_override_internal (bool main_args_p, > | PTA_AVX512F | PTA_AVX512CD; > const wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE; > const wide_int_bitmask PTA_SILVERMONT = PTA_WESTMERE | PTA_MOVBE | PTA_RDRND; > - const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_SHA | PTA_XSAVE > + const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_AES | PTA_SHA | PTA_XSAVE > | PTA_RDSEED | PTA_XSAVEC | PTA_XSAVES | PTA_CLFLUSHOPT | PTA_XSAVEOPT > | PTA_FSGSBASE; > const wide_int_bitmask PTA_GOLDMONT_PLUS = PTA_GOLDMONT | PTA_RDPID > -- > 2.18.0 >
On Wed, Aug 29, 2018 at 11:56 PM, Uros Bizjak <ubizjak@gmail.com> wrote: > On Thu, Aug 30, 2018 at 7:14 AM, Thiago Macieira > <thiago.macieira@intel.com> wrote: >> The instruction set first appeared with Westmere, but not all processors >> in that and the next few generations have the instructions. According to >> Wikipedia[1], the first generation in which all SKUs have AES >> instructions are Skylake and Goldmont. I can't find any Skylake, >> Kabylake, Kabylake-R or Cannon Lake currently listed at >> https://ark.intel.com that says "Intel® AES New Instructions" "No". >> >> [1] https://en.wikipedia.org/wiki/AES_instruction_set >> >> --- >> gcc/ >> >> 2018-08-27 Thiago Macieira <thiago.macieira@intel.com> >> >> config/i386/i386.c: Update PTA_WESTMERE, PTA_SKYLAKE >> and PTA_GOLDMONT > > LGTM, but let's wait for HJ's opinion. > > Thanks, > Uros. > >> --- >> gcc/config/i386/i386.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c >> index c437c18a29c..8672a666024 100644 >> --- a/gcc/config/i386/i386.c >> +++ b/gcc/config/i386/i386.c >> @@ -3479,7 +3479,7 @@ ix86_option_override_internal (bool main_args_p, >> | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR; >> const wide_int_bitmask PTA_NEHALEM = PTA_CORE2 | PTA_SSE4_1 | PTA_SSE4_2 >> | PTA_POPCNT; >> - const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_AES | PTA_PCLMUL; >> + const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_PCLMUL; >> const wide_int_bitmask PTA_SANDYBRIDGE = PTA_WESTMERE | PTA_AVX | PTA_XSAVE >> | PTA_XSAVEOPT; >> const wide_int_bitmask PTA_IVYBRIDGE = PTA_SANDYBRIDGE | PTA_FSGSBASE >> @@ -3488,7 +3488,7 @@ ix86_option_override_internal (bool main_args_p, >> | PTA_BMI2 | PTA_LZCNT | PTA_FMA | PTA_MOVBE | PTA_HLE; >> const wide_int_bitmask PTA_BROADWELL = PTA_HASWELL | PTA_ADX | PTA_PRFCHW >> | PTA_RDSEED; >> - const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_CLFLUSHOPT >> + const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_AES | PTA_CLFLUSHOPT >> | PTA_XSAVEC | PTA_XSAVES | PTA_SGX; >> const wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F >> | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU >> @@ -3505,7 +3505,7 @@ ix86_option_override_internal (bool main_args_p, >> | PTA_AVX512F | PTA_AVX512CD; >> const wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE; >> const wide_int_bitmask PTA_SILVERMONT = PTA_WESTMERE | PTA_MOVBE | PTA_RDRND; >> - const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_SHA | PTA_XSAVE >> + const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_AES | PTA_SHA | PTA_XSAVE >> | PTA_RDSEED | PTA_XSAVEC | PTA_XSAVES | PTA_CLFLUSHOPT | PTA_XSAVEOPT >> | PTA_FSGSBASE; >> const wide_int_bitmask PTA_GOLDMONT_PLUS = PTA_GOLDMONT | PTA_RDPID >> -- >> 2.18.0 >> This is what I checked in. Thanks.
On Thursday, 30 August 2018 09:00:10 PST H.J. Lu wrote: > On Wed, Aug 29, 2018 at 11:56 PM, Uros Bizjak <ubizjak@gmail.com> wrote: > >> gcc/config/i386/i386.c | 6 +++--- > >> 1 file changed, 3 insertions(+), 3 deletions(-) > >> > >> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > >> index c437c18a29c..8672a666024 100644 > >> --- a/gcc/config/i386/i386.c > >> +++ b/gcc/config/i386/i386.c > >> @@ -3479,7 +3479,7 @@ ix86_option_override_internal (bool main_args_p, > >> > >> | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR; > >> > >> const wide_int_bitmask PTA_NEHALEM = PTA_CORE2 | PTA_SSE4_1 | > >> PTA_SSE4_2 > >> > >> | PTA_POPCNT; > >> > >> - const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_AES | > >> PTA_PCLMUL; + const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | > >> PTA_PCLMUL;>> > >> const wide_int_bitmask PTA_SANDYBRIDGE = PTA_WESTMERE | PTA_AVX | > >> PTA_XSAVE > >> > >> | PTA_XSAVEOPT; > >> > >> const wide_int_bitmask PTA_IVYBRIDGE = PTA_SANDYBRIDGE | PTA_FSGSBASE > >> > >> @@ -3488,7 +3488,7 @@ ix86_option_override_internal (bool main_args_p, > >> > >> | PTA_BMI2 | PTA_LZCNT | PTA_FMA | PTA_MOVBE | PTA_HLE; > >> > >> const wide_int_bitmask PTA_BROADWELL = PTA_HASWELL | PTA_ADX | > >> PTA_PRFCHW > >> > >> | PTA_RDSEED; > >> > >> - const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_CLFLUSHOPT > >> + const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_AES | > >> PTA_CLFLUSHOPT>> > >> | PTA_XSAVEC | PTA_XSAVES | PTA_SGX; > >> > >> const wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F > >> > >> | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | > >> | PTA_PKU > >> > >> @@ -3505,7 +3505,7 @@ ix86_option_override_internal (bool main_args_p, > >> > >> | PTA_AVX512F | PTA_AVX512CD; > >> > >> const wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE; > >> const wide_int_bitmask PTA_SILVERMONT = PTA_WESTMERE | PTA_MOVBE | > >> PTA_RDRND;>> > >> - const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_SHA | > >> PTA_XSAVE + const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | > >> PTA_AES | PTA_SHA | PTA_XSAVE>> > >> | PTA_RDSEED | PTA_XSAVEC | PTA_XSAVES | PTA_CLFLUSHOPT | > >> | PTA_XSAVEOPT > >> | PTA_FSGSBASE; > >> > >> const wide_int_bitmask PTA_GOLDMONT_PLUS = PTA_GOLDMONT | PTA_RDPID > >> > >> -- > >> 2.18.0 > > This is what I checked in. > > Thanks. Hello H.J., Uros, Martin Looks like Martin's change in r264052, which moved the code from i386.c to i386.h ended up accidentally reverting my change. Do you want me to re-submit with an update or will one of you simply re-apply? For reference, this change was applied to Clang in https://reviews.llvm.org/ rC341862 and LLVM in https://reviews.llvm.org/rL341862.
On Thu, Feb 21, 2019 at 10:31 AM Thiago Macieira <thiago.macieira@intel.com> wrote: > > On Thursday, 30 August 2018 09:00:10 PST H.J. Lu wrote: > > On Wed, Aug 29, 2018 at 11:56 PM, Uros Bizjak <ubizjak@gmail.com> wrote: > > >> gcc/config/i386/i386.c | 6 +++--- > > >> 1 file changed, 3 insertions(+), 3 deletions(-) > > >> > > >> diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > > >> index c437c18a29c..8672a666024 100644 > > >> --- a/gcc/config/i386/i386.c > > >> +++ b/gcc/config/i386/i386.c > > >> @@ -3479,7 +3479,7 @@ ix86_option_override_internal (bool main_args_p, > > >> > > >> | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR; > > >> > > >> const wide_int_bitmask PTA_NEHALEM = PTA_CORE2 | PTA_SSE4_1 | > > >> PTA_SSE4_2 > > >> > > >> | PTA_POPCNT; > > >> > > >> - const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_AES | > > >> PTA_PCLMUL; + const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | > > >> PTA_PCLMUL;>> > > >> const wide_int_bitmask PTA_SANDYBRIDGE = PTA_WESTMERE | PTA_AVX | > > >> PTA_XSAVE > > >> > > >> | PTA_XSAVEOPT; > > >> > > >> const wide_int_bitmask PTA_IVYBRIDGE = PTA_SANDYBRIDGE | PTA_FSGSBASE > > >> > > >> @@ -3488,7 +3488,7 @@ ix86_option_override_internal (bool main_args_p, > > >> > > >> | PTA_BMI2 | PTA_LZCNT | PTA_FMA | PTA_MOVBE | PTA_HLE; > > >> > > >> const wide_int_bitmask PTA_BROADWELL = PTA_HASWELL | PTA_ADX | > > >> PTA_PRFCHW > > >> > > >> | PTA_RDSEED; > > >> > > >> - const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_CLFLUSHOPT > > >> + const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_AES | > > >> PTA_CLFLUSHOPT>> > > >> | PTA_XSAVEC | PTA_XSAVES | PTA_SGX; > > >> > > >> const wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F > > >> > > >> | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | > > >> | PTA_PKU > > >> > > >> @@ -3505,7 +3505,7 @@ ix86_option_override_internal (bool main_args_p, > > >> > > >> | PTA_AVX512F | PTA_AVX512CD; > > >> > > >> const wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE; > > >> const wide_int_bitmask PTA_SILVERMONT = PTA_WESTMERE | PTA_MOVBE | > > >> PTA_RDRND;>> > > >> - const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_SHA | > > >> PTA_XSAVE + const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | > > >> PTA_AES | PTA_SHA | PTA_XSAVE>> > > >> | PTA_RDSEED | PTA_XSAVEC | PTA_XSAVES | PTA_CLFLUSHOPT | > > >> | PTA_XSAVEOPT > > >> | PTA_FSGSBASE; > > >> > > >> const wide_int_bitmask PTA_GOLDMONT_PLUS = PTA_GOLDMONT | PTA_RDPID > > >> > > >> -- > > >> 2.18.0 > > > > This is what I checked in. > > > > Thanks. > > Hello H.J., Uros, Martin > > Looks like Martin's change in r264052, which moved the code from i386.c to > i386.h ended up accidentally reverting my change. > > Do you want me to re-submit with an update or will one of you simply re-apply? > > For reference, this change was applied to Clang in https://reviews.llvm.org/ > rC341862 and LLVM in https://reviews.llvm.org/rL341862. > Please re-submit it. Thanks.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c437c18a29c..8672a666024 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3479,7 +3479,7 @@ ix86_option_override_internal (bool main_args_p, | PTA_SSE3 | PTA_SSSE3 | PTA_CX16 | PTA_FXSR; const wide_int_bitmask PTA_NEHALEM = PTA_CORE2 | PTA_SSE4_1 | PTA_SSE4_2 | PTA_POPCNT; - const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_AES | PTA_PCLMUL; + const wide_int_bitmask PTA_WESTMERE = PTA_NEHALEM | PTA_PCLMUL; const wide_int_bitmask PTA_SANDYBRIDGE = PTA_WESTMERE | PTA_AVX | PTA_XSAVE | PTA_XSAVEOPT; const wide_int_bitmask PTA_IVYBRIDGE = PTA_SANDYBRIDGE | PTA_FSGSBASE @@ -3488,7 +3488,7 @@ ix86_option_override_internal (bool main_args_p, | PTA_BMI2 | PTA_LZCNT | PTA_FMA | PTA_MOVBE | PTA_HLE; const wide_int_bitmask PTA_BROADWELL = PTA_HASWELL | PTA_ADX | PTA_PRFCHW | PTA_RDSEED; - const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_CLFLUSHOPT + const wide_int_bitmask PTA_SKYLAKE = PTA_BROADWELL | PTA_AES | PTA_CLFLUSHOPT | PTA_XSAVEC | PTA_XSAVES | PTA_SGX; const wide_int_bitmask PTA_SKYLAKE_AVX512 = PTA_SKYLAKE | PTA_AVX512F | PTA_AVX512CD | PTA_AVX512VL | PTA_AVX512BW | PTA_AVX512DQ | PTA_PKU @@ -3505,7 +3505,7 @@ ix86_option_override_internal (bool main_args_p, | PTA_AVX512F | PTA_AVX512CD; const wide_int_bitmask PTA_BONNELL = PTA_CORE2 | PTA_MOVBE; const wide_int_bitmask PTA_SILVERMONT = PTA_WESTMERE | PTA_MOVBE | PTA_RDRND; - const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_SHA | PTA_XSAVE + const wide_int_bitmask PTA_GOLDMONT = PTA_SILVERMONT | PTA_AES | PTA_SHA | PTA_XSAVE | PTA_RDSEED | PTA_XSAVEC | PTA_XSAVES | PTA_CLFLUSHOPT | PTA_XSAVEOPT | PTA_FSGSBASE; const wide_int_bitmask PTA_GOLDMONT_PLUS = PTA_GOLDMONT | PTA_RDPID