i386: Avoid C++ global constructors in every object that includes i386.h
authorJakub Jelinek <jakub@redhat.com>
Thu, 18 Feb 2021 09:32:57 +0000 (10:32 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 18 Feb 2021 09:32:57 +0000 (10:32 +0100)
commita1541628df83eb690954f426d56d268fb57f1af6
treea2a576c41e1d27bf0ffd860455e5b1e6ddfa2a97
parentf72e3d8c9ffb81d25d4fdba10056cd2197e22d64
i386: Avoid C++ global constructors in every object that includes i386.h

When looking at recog.o when working on the recog.[ch] changes to make sure
I have not introduced runtime construction of recog_data variable, I have
noticed that at least in unoptimized build, every single *.o file that
included i386.h has lots of runtime constructors for all the PTA_*
variables.

As we now require C++11, the following patch makes those constexpr so that
they don't need runtime initialization.
I've verified that ~ 8276 bytes long _Z41__static_initialization_and_destruction_0ii
at -O0 is gone from every *.o that included i386.h (and doesn't really need
any global ctors anymore).

2021-02-18  Jakub Jelinek  <jakub@redhat.com>

* wide-int-bitmask.h (wide_int_bitmask::wide_int_bitmask (),
wide_int_bitmask::wide_int_bitmask (uint64_t),
wide_int_bitmask::wide_int_bitmask (uint64_t, uint64_t),
wide_int_bitmask::operator ~ () const,
wide_int_bitmask::operator | (wide_int_bitmask) const,
wide_int_bitmask::operator & (wide_int_bitmask) const): Use constexpr
instead of inline.
* config/i386/i386.h (PTA_3DNOW, PTA_3DNOW_A, PTA_64BIT, PTA_ABM,
PTA_AES, PTA_AVX, PTA_BMI, PTA_CX16, PTA_F16C, PTA_FMA, PTA_FMA4,
PTA_FSGSBASE, PTA_LWP, PTA_LZCNT, PTA_MMX, PTA_MOVBE, PTA_NO_SAHF,
PTA_PCLMUL, PTA_POPCNT, PTA_PREFETCH_SSE, PTA_RDRND, PTA_SSE, PTA_SSE2,
PTA_SSE3, PTA_SSE4_1, PTA_SSE4_2, PTA_SSE4A, PTA_SSSE3, PTA_TBM,
PTA_XOP, PTA_AVX2, PTA_BMI2, PTA_RTM, PTA_HLE, PTA_PRFCHW, PTA_RDSEED,
PTA_ADX, PTA_FXSR, PTA_XSAVE, PTA_XSAVEOPT, PTA_AVX512F, PTA_AVX512ER,
PTA_AVX512PF, PTA_AVX512CD, PTA_NO_TUNE, PTA_SHA, PTA_PREFETCHWT1,
PTA_CLFLUSHOPT, PTA_XSAVEC, PTA_XSAVES, PTA_AVX512DQ, PTA_AVX512BW,
PTA_AVX512VL, PTA_AVX512IFMA, PTA_AVX512VBMI, PTA_CLWB, PTA_MWAITX,
PTA_CLZERO, PTA_NO_80387, PTA_PKU, PTA_AVX5124VNNIW, PTA_AVX5124FMAPS,
PTA_AVX512VPOPCNTDQ, PTA_SGX, PTA_AVX512VNNI, PTA_GFNI, PTA_VAES,
PTA_AVX512VBMI2, PTA_VPCLMULQDQ, PTA_AVX512BITALG, PTA_RDPID,
PTA_PCONFIG, PTA_WBNOINVD, PTA_AVX512VP2INTERSECT, PTA_PTWRITE,
PTA_AVX512BF16, PTA_WAITPKG, PTA_MOVDIRI, PTA_MOVDIR64B, PTA_ENQCMD,
PTA_CLDEMOTE, PTA_SERIALIZE, PTA_TSXLDTRK, PTA_AMX_TILE, PTA_AMX_INT8,
PTA_AMX_BF16, PTA_UINTR, PTA_HRESET, PTA_KL, PTA_WIDEKL, PTA_AVXVNNI,
PTA_X86_64_BASELINE, PTA_X86_64_V2, PTA_X86_64_V3, PTA_X86_64_V4,
PTA_CORE2, PTA_NEHALEM, PTA_WESTMERE, PTA_SANDYBRIDGE, PTA_IVYBRIDGE,
PTA_HASWELL, PTA_BROADWELL, PTA_SKYLAKE, PTA_SKYLAKE_AVX512,
PTA_CASCADELAKE, PTA_COOPERLAKE, PTA_CANNONLAKE, PTA_ICELAKE_CLIENT,
PTA_ICELAKE_SERVER, PTA_TIGERLAKE, PTA_SAPPHIRERAPIDS, PTA_ALDERLAKE,
PTA_KNL, PTA_BONNELL, PTA_SILVERMONT, PTA_GOLDMONT, PTA_GOLDMONT_PLUS,
PTA_TREMONT, PTA_KNM): Use constexpr instead of const.
gcc/config/i386/i386.h
gcc/wide-int-bitmask.h