From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id CB5B13858D20 for ; Wed, 15 May 2024 08:46:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB5B13858D20 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 CB5B13858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::234 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715762812; cv=none; b=TSVuyqZ8RNsJH7cVP1kUXizUZHzE/+rEr6vnT5U8BfzTW3OI6yKETuKjuRpit5qvMO9RsulVsmg/u9L3dMbdS+TLfpfGR/ceIaaWUBg17BnlRkfXsKJ1BndOvrAMXFcxL0oGNM+HPxr/tb9i+OwzJJouLvVRhNS1hVX1JrrMyP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715762812; c=relaxed/simple; bh=/PF9erYOt3twy6PGz7a6Zaax+S1INMyb69G4hrV3LZQ=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=dt/e1QA3Wxzrjq0AVh1OBfiLn1G+bPLyus2wynhcOA2tfrpGip1DWHlSWhIxFoEogX7HsdyCXTW9kfUIAdYx4AfEil2keUwFOuFynHTPIsy5GghXYtp0Pa1yWtcz8oW/BetEN1n1ChlOM8KsC+FSJU4qSrcdFl2dW8vRx2brC3s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2e3b1b6e9d1so79537521fa.2 for ; Wed, 15 May 2024 01:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715762808; x=1716367608; 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=iTnDp05gY2ZFiB9FLEwHICEo3lWPxtmFRY4l5nH1jkg=; b=j48n7y2w9nA8yPvD5TPqcJ+TLU8NM6vwNk4pLSK20/lR897SsZRZMvaKy0gYZ/f01F oXJvZsmoZrXvAldbY9cE3XYO5sxQortRYG4cWBCQ7cufLUys7f26C5CS+bkUdyOmcTSm mYg04rtMmBOudsk0qKK7TD6LZY+KYs7L9OBotmXH4GKBkqBd+N1h9JlNOjqms0sOKAdi /9FB2AqknPW29K8XEifMaQgYa4j3OqeEcvK97/r9LcM5gLLeFL7FS84/0KNXbAw1/CAc bToq244P1vqThZbDWoTECgA3WDAokvHBMGRYW+/Ra2oy9Sc7NmC9FnWchSg+3mNNZGEO kAGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715762808; x=1716367608; 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=iTnDp05gY2ZFiB9FLEwHICEo3lWPxtmFRY4l5nH1jkg=; b=rF7na/eBsCQcYv3BjjYL4O1Tj8okf0jdPpwKJnjfrnGFNcKfqewMCzGrOyu1e/1+iF YTlJYHvq5T6yxoBW3AbJ29faNM5q1AxAzgsNLvWyFeYRm9r2HDMEyaCgABwIU3mJ1vI+ WZEqvv4DvlOYajxCnc5QlFFiuz4mtFLpyigo/g3tcNt4ZGUC9SQ8EtUkSAshdoKr/sqU Bq4SqVZrtNBH/5IdXZUXfeC5Um8PJnoIuJpF4AQEAIHhtF70UzhHPqj8GcoHoSRzAohv cXMADqWh4T3WEeB8oB2wmTRpscIzy8ByN4M27e7AWA+I2mEdJA68W6z1c4j0vvL24l2U b4OA== X-Gm-Message-State: AOJu0YxNZFXy7DL4J2/H5CpHsInz1H04Slpuh1ilWbXgeuEJKlNztzWL LKQHlLWgq8uPELxK/qI7Nw3NhdYmyObHzD5EhpG/33DN36b/k4Qq8Xy+4/MVsAx9D5z2yiJJxIy wUC0HdljNB1rOP646cMtUE5aVIYA= X-Google-Smtp-Source: AGHT+IECPmhZfGgAozhN+dJMIvN4txz6a67fBMX6QnoWBSTEpRF0Mp5/5UqLPuUXI0xZt33yMS4Z29qpf+7WvsERF0c= X-Received: by 2002:a2e:f12:0:b0:2dc:d2c5:ed0 with SMTP id 38308e7fff4ca-2e51ff4d522mr101984541fa.12.1715762807547; Wed, 15 May 2024 01:46:47 -0700 (PDT) MIME-Version: 1.0 References: <20240515070226.3760873-1-lingling.kong@intel.com> In-Reply-To: From: Uros Bizjak Date: Wed, 15 May 2024 10:46:36 +0200 Message-ID: Subject: Re: [PATCH 1/8] [APX NF]: Support APX NF add To: "Kong, Lingling" Cc: "gcc-patches@gcc.gnu.org" , "Liu, Hongtao" , "Wang, Hongyu" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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 Wed, May 15, 2024 at 9:43=E2=80=AFAM Kong, Lingling wrote: > > From: Hongyu Wang > > APX NF(no flags) feature implements suppresses the update of status flags= for arithmetic operations. > > For NF add, it is not clear whether NF add can be faster than lea. If so,= the pattern needs to be adjusted to prefer LEA generation. > > gcc/ChangeLog: > > * config/i386/i386-opts.h (enum apx_features): Add nf > enumeration. > * config/i386/i386.h (TARGET_APX_NF): New. > * config/i386/i386.md (*add_1_nf): New define_insn. > * config/i386/i386.opt: Add apx_nf enumeration. > > gcc/testsuite/ChangeLog: > > * gcc.target/i386/apx-ndd.c: Fixed test. > * gcc.target/i386/apx-nf.c: New test. > > Co-authored-by: Lingling Kong > > Bootstrapped and regtested on x86_64-linux-gnu. And Supported SPEC 2017 r= un normally on Intel software development emulator. > Ok for trunk? > > --- > gcc/config/i386/i386-opts.h | 3 +- > gcc/config/i386/i386.h | 1 + > gcc/config/i386/i386.md | 42 +++++++++++++++++++++++++ > gcc/config/i386/i386.opt | 3 ++ > gcc/testsuite/gcc.target/i386/apx-ndd.c | 2 +- > gcc/testsuite/gcc.target/i386/apx-nf.c | 6 ++++ > 6 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 gc= c/testsuite/gcc.target/i386/apx-nf.c > > diff --git a/gcc/config/i386/i386-opts.h b/gcc/config/i386/i386-opts.h in= dex ef2825803b3..60176ce609f 100644 > --- a/gcc/config/i386/i386-opts.h > +++ b/gcc/config/i386/i386-opts.h > @@ -140,7 +140,8 @@ enum apx_features { > apx_push2pop2 =3D 1 << 1, > apx_ndd =3D 1 << 2, > apx_ppx =3D 1 << 3, > - apx_all =3D apx_egpr | apx_push2pop2 | apx_ndd | apx_ppx, > + apx_nf =3D 1<< 4, > + apx_all =3D apx_egpr | apx_push2pop2 | apx_ndd | apx_ppx | apx_nf, > }; > > #endif > diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 529edf= f93a4..f20ae4726da 100644 > --- a/gcc/config/i386/i386.h > +++ b/gcc/config/i386/i386.h > @@ -55,6 +55,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively= . If not, see #define TARGET_APX_PUSH2POP2 (ix86_apx_features & apx_push2= pop2) #define TARGET_APX_NDD (ix86_apx_features & apx_ndd) #define TARGET= _APX_PPX (ix86_apx_features & apx_ppx) > +#define TARGET_APX_NF (ix86_apx_features & apx_nf) > > #include "config/vxworks-dummy.h" > > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 764b= fe20ff2..4a9e35c4990 100644 > --- a/gcc/config/i386/i386.md > +++ b/gcc/config/i386/i386.md > @@ -6233,6 +6233,48 @@ > } > }) > > > +;; NF instructions. > + > +(define_insn "*add_1_nf" > + [(set (match_operand:SWI 0 "nonimmediate_operand" "=3Drm,rje,r,r,r,r,r= ,r") > + (plus:SWI > + (match_operand:SWI 1 "nonimmediate_operand" "%0,0,0,r,r,rje,jM,= r") > + (match_operand:SWI 2 "x86_64_general_operand" > +"r,e,BM,0,le,r,e,BM")))] > + "TARGET_APX_NF && > + ix86_binary_operator_ok (PLUS, mode, operands, > + TARGET_APX_NDD)" I wonder if we can use "define_subst" to conditionally add flags clobber for !TARGET_APX_NF targets. Even the example for "Define Subst" uses the insn w/ and w/o the clobber, so I think it is worth considering this approach. Uros.