On Fri, Oct 27, 2023 at 12:20 PM mayshao <mayshao...@zhaoxin.com> wrote: > > On 2023/10/26 17:34, Uros Bizjak wrote: > > On Wed, Oct 25, 2023 at 8:43 AM mayshao <mayshao...@zhaoxin.com> wrote: > >> > >> Hi all: > >> This patch enables -march/-mtune=yongfeng, costs and tunings are set > >> according to the characteristics of the processor. We add a new md file to > >> describe yongfeng processor. > >> > >> Bootstrapped /regtested X86_64. > >> > >> Ok for trunk? > >> BR > >> Mayshao > >> gcc/ChangeLog: > >> > >> * common/config/i386/cpuinfo.h (get_zhaoxin_cpu): Recognize > >> yongfeng. > >> * common/config/i386/i386-common.cc: Add yongfeng. > >> * common/config/i386/i386-cpuinfo.h (enum processor_subtypes): > >> Add ZHAOXIN_FAM7H_YONGFENG. > >> * config.gcc: Add yongfeng. > >> * config/i386/driver-i386.cc (host_detect_local_cpu): Let > >> -march=native > >> recognize yongfeng processors. > >> * config/i386/i386-c.cc (ix86_target_macros_internal): Add > >> yongfeng. > >> * config/i386/i386-options.cc (m_YONGFENG): New definition. > >> (m_ZHAOXIN): Ditto. > >> * config/i386/i386.h (enum processor_type): Add > >> PROCESSOR_YONGFENG. > >> * config/i386/i386.md: Add yongfeng. > >> * config/i386/lujiazui.md: Fix typo. > >> * config/i386/x86-tune-costs.h (struct processor_costs): Add > >> yongfeng costs. > >> * config/i386/x86-tune-sched.cc (ix86_issue_rate): Add yongfeng. > >> (ix86_adjust_cost): Ditto. > >> * config/i386/x86-tune.def (X86_TUNE_SCHEDULE): Replace > >> m_LUJIAZUI by m_ZHAOXIN. > >> (X86_TUNE_PARTIAL_REG_DEPENDENCY): Ditto. > >> (X86_TUNE_SSE_PARTIAL_REG_DEPENDENCY): Ditto. > >> (X86_TUNE_SSE_PARTIAL_REG_FP_CONVERTS_DEPENDENCY): Ditto. > >> (X86_TUNE_SSE_PARTIAL_REG_CONVERTS_DEPENDENCY): Ditto. > >> (X86_TUNE_MOVX): Ditto. > >> (X86_TUNE_MEMORY_MISMATCH_STALL): Ditto. > >> (X86_TUNE_FUSE_CMP_AND_BRANCH_32): Ditto. > >> (X86_TUNE_FUSE_CMP_AND_BRANCH_64): Ditto. > >> (X86_TUNE_FUSE_CMP_AND_BRANCH_SOFLAGS): Ditto. > >> (X86_TUNE_FUSE_ALU_AND_BRANCH): Ditto. > >> (X86_TUNE_ACCUMULATE_OUTGOING_ARGS): Ditto. > >> (X86_TUNE_USE_LEAVE): Ditto. > >> (X86_TUNE_PUSH_MEMORY): Ditto. > >> (X86_TUNE_LCP_STALL): Ditto. > >> (X86_TUNE_INTEGER_DFMODE_MOVES): Ditto. > >> (X86_TUNE_OPT_AGU): Ditto. > >> (X86_TUNE_PREFER_KNOWN_REP_MOVSB_STOSB): Ditto. > >> (X86_TUNE_MISALIGNED_MOVE_STRING_PRO_EPILOGUES): Ditto. > >> (X86_TUNE_USE_SAHF): Ditto. > >> (X86_TUNE_USE_BT): Ditto. > >> (X86_TUNE_AVOID_FALSE_DEP_FOR_BMI): Ditto. > >> (X86_TUNE_ONE_IF_CONV_INSN): Ditto. > >> (X86_TUNE_AVOID_MFENCE): Ditto. > >> (X86_TUNE_EXPAND_ABS): Ditto. > >> (X86_TUNE_USE_SIMODE_FIOP): Ditto. > >> (X86_TUNE_USE_FFREEP): Ditto. > >> (X86_TUNE_EXT_80387_CONSTANTS): Ditto. > >> (X86_TUNE_SSE_UNALIGNED_LOAD_OPTIMAL): Ditto. > >> (X86_TUNE_SSE_UNALIGNED_STORE_OPTIMAL): Ditto. > >> (X86_TUNE_SSE_TYPELESS_STORES): Ditto. > >> (X86_TUNE_SSE_LOAD0_BY_PXOR): Ditto. > >> (X86_TUNE_USE_GATHER_2PARTS): Add m_YONGFENG. > >> (X86_TUNE_USE_GATHER_4PARTS): Ditto. > >> (X86_TUNE_USE_GATHER_8PARTS): Ditto. > >> (X86_TUNE_AVOID_128FMA_CHAINS): Ditto. > >> * doc/extend.texi: Add details about yongfeng. > >> * doc/invoke.texi: Ditto. > >> * config/i386/yongfeng.md: New file for decribing yongfeng > >> processor. > >> > >> gcc/testsuite/ChangeLog: > >> > >> * g++.target/i386/mv32.C: Handle new march. > >> * gcc.target/i386/funcspec-56.inc: Ditto. > > > > LGTM. > > > > There are a couple of comments that needs to be fixed, please see inline. > > > > BTW: A couple of days ago, I have added a new tunung flag [1]. I > > considered Zhaoxin cores a modern core, but please review the new flag > > anyway. > > > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634280.html > > > > Thanks, > > Uros. > > > Hi Uros: > Thanks for your review. I have fix the errors that you comment, > please review the attached patch again. > I have review the new tuning flag[1]. When a write of 64 bits or > less is followed by a read of a smaller size which is fully contained > in the write address range, regardless of alignement, Zhaoxin > processors will do store forwarding.
The patch is OK. Thanks, Uros.