From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id 7862B3858D3C for ; Fri, 27 Oct 2023 11:40:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7862B3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7862B3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::531 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698406848; cv=none; b=TSp5TFhiFvXnCHO3+U750L0M4wM7R0rJB+8JQp4oPZ1tu2TjZ2GHWJenxzk3/8OYRnuhaUx6KliVcfJPoPe7Rc5GV41Vyek9eRzXB44VoLkGCmLKPREfvzYs/tNCggk4zOxcSGMSoTCXX6a901p9CD1eqMQC/eiS40kpK4De61k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698406848; c=relaxed/simple; bh=WR/laqZI/m7+6RDHRaDe/EGoAgYYepUfugoUhQvRjtQ=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=lzfBWPtuGU+VJXUyz0DqW7A3iXOLXOPs58GPn6on64IOzF+fLot1VkwJ29whSfvk7GBzbjxyvg57g/WRy+RtZWITbaboEtLbK+/gbUswXkAltLgWe2Drb03Ycc2VXXnx4EdfJHRSY+G9K2NOWJXfr4Au648rNFIu8RdQDjcZweA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so6412994a12.1 for ; Fri, 27 Oct 2023 04:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698406845; x=1699011645; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XghEAeWhBr2XWBtkPDklR3gOdHgZ6yiIA5ZDCsWLhUk=; b=mHEoSGCz7caXdun0H+49j+jxkXQICUsNxlR027YOFSavM5PRJA4ccOKJXRyXH/ZhzX q6FYGJT0L7ki4sNqDGdBdwFKnQvsuq+YKDUF3IfvxFqkpwVL/PW25on7iMYaEcIUYEa0 BOqS9dRwUDZ+EQvzvIetSmvQ8BnlRZmYL5oIkSmx4lKKSYYC2k649IBKPSH+kG0PxJvv aR+NGu6fxrfTB3zDN1vg8QNHK1P5KZiCiyEhhwAb3H6XeprAKUcZmxS3ckenbPhMWOvp nTulZOphLHSlzU0AxBHaEe7dLji6oJ+0Oqj3//IxHjItQbHuPkh0di13aJRziiexhACm ADWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698406845; x=1699011645; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XghEAeWhBr2XWBtkPDklR3gOdHgZ6yiIA5ZDCsWLhUk=; b=WZbikF/oy042qM1IMZ7N910pL3IdVDVeCZQg3TQ3sRj/mgYV5GnANn2IMuI3w1URWM mJf5S+BUXsUPIU2m9CIc/bU83NJLdVEdoHdIDae+AjsNqoEupxrTTVAx4vxPtMasC7um PRSD/V62ce4P0E7voUDSkbcIPdPUM6lhHE5yujoUY+KP+i+cqH20weRO+B9XmB6H3yCi 1CSCFm0gl2nWe0JJENKBcg85zva0M5ywxODrhDzKspZ4yir7zZKHWXQ7Vopsrlb1ucfK C7Oy2jVU6J8l1kZZE59t//8pIKiZnVdDR1dyzMIue9O2TVaKKqFcWBTNJAk90h4EFCk0 0cpw== X-Gm-Message-State: AOJu0Yxk6f+f/oIX3taie5l7lWmBU5HzT3UgjKIe8A1qt9bYbvdF0ODE +CA593oeQo5IfDf9W6o69gxCoakD/7/btSWYcEg= X-Google-Smtp-Source: AGHT+IELLAowEWKA0WOeVOFuik4GuYLS7iyfCBUX5SH4TZAhavr8bgTSAcZc3ILf1R44QD+UICOeaziaN0mFrb9ZFGg= X-Received: by 2002:a05:6402:e9c:b0:533:5d3d:7efe with SMTP id h28-20020a0564020e9c00b005335d3d7efemr6638447eda.6.1698406844659; Fri, 27 Oct 2023 04:40:44 -0700 (PDT) MIME-Version: 1.0 References: <20231025064345.5117-1-mayshao-oc@zhaoxin.com> In-Reply-To: From: Uros Bizjak Date: Fri, 27 Oct 2023 13:40:33 +0200 Message-ID: Subject: Re: [PATCH] [x86_64]: Zhaoxin yongfeng enablement To: mayshao Cc: hubicka@ucw.cz, louisqi@zhaoxin.com, hawkwang@zhaoxin.com, xiangjiehong@zhaoxin.com, silviazhao@zhaoxin.com, timhu@zhaoxin.com, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Oct 27, 2023 at 12:20=E2=80=AFPM mayshao w= rote: > > On 2023/10/26 17:34, Uros Bizjak wrote: > > On Wed, Oct 25, 2023 at 8:43=E2=80=AFAM mayshao wrote: > >> > >> Hi all: > >> This patch enables -march/-mtune=3Dyongfeng, costs and tunings ar= e set according to the characteristics of the processor. We add a new md fi= le to describe yongfeng processor. > >> > >> Bootstrapped /regtested X86_64. > >> > >> Ok for trunk? > >> BR > >> Mayshao > >> gcc/ChangeLog: > >> > >> * common/config/i386/cpuinfo.h (get_zhaoxin_cpu): Recognize y= ongfeng. > >> * 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 -ma= rch=3Dnative > >> recognize yongfeng processors. > >> * config/i386/i386-c.cc (ix86_target_macros_internal): Add yo= ngfeng. > >> * config/i386/i386-options.cc (m_YONGFENG): New definition. > >> (m_ZHAOXIN): Ditto. > >> * config/i386/i386.h (enum processor_type): Add PROCESSOR_YON= GFENG. > >> * 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 yongfe= ng. > >> (ix86_adjust_cost): Ditto. > >> * config/i386/x86-tune.def (X86_TUNE_SCHEDULE): Replace m_LUJ= IAZUI 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 pr= ocessor. > >> > >> 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 inlin= e. > > > > 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.