From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by sourceware.org (Postfix) with ESMTPS id 77D463848001 for ; Tue, 22 Jun 2021 10:17:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77D463848001 Received: by mail-qv1-xf35.google.com with SMTP id 5so8950659qvf.1 for ; Tue, 22 Jun 2021 03:17:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=njyQ5/O/19jPEcgZyT8UYcdBSOKGCFbIsiwx3gVvluA=; b=VC5YkgxHjdaD/Rfz5LCJzq0ncUgS0rHLKk/6NFB4B9ezow2RLAAT8tmSnm4+X8Ljjt vS2ZgbRAbtUKTCL4RbZhZWDJQcmodlQY9d5/DOlbtCp7bs/MkjlrlYtO+rmulBFX5Jrv Ni2CCXYLOkqwhvm/5MOAmuAeht8js5AA07O6C5F8sqc60pHxa3DaWBJhMepNXP1HjQZR Sy+z6Y6dXC7TXKvEwtlG++5ggmDgC/s5V97qETzPAbfqjJJ/z+PeTuOBf2cOCsKZEkjk fNmrMXwqrmgtcVeFJxbn0EkAD/dW8lfofkl3VOIycP4qWPtDhAf28acoYsL7u7UbQ0Gs 93lA== X-Gm-Message-State: AOAM532mcPm5Ea+/LV/49XfEqu/Uw17fCy+1hSdonz7uFca9R7ZjM4bp CziKWPhssqzM7/pvtNkweixbxwNgMjVGAEZd+SA= X-Google-Smtp-Source: ABdhPJyZ9gtlk3eT+Zm9ufc6a81LInNbhFba1lt7bdPvFmOIsBYvbMFO5xzezcLkDlVzjBVcsKkHwn3bCn5YBjJ19Qo= X-Received: by 2002:a05:6214:258c:: with SMTP id fq12mr24778549qvb.30.1624357033969; Tue, 22 Jun 2021 03:17:13 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Uros Bizjak Date: Tue, 22 Jun 2021 12:17:02 +0200 Message-ID: Subject: Re: [PATCH][RFC] Add x86 subadd SLP pattern To: Richard Biener , Uros Bizjak , Hongtao Liu , "gcc-patches@gcc.gnu.org" , Richard Sandiford Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 10:17:15 -0000 On Tue, Jun 22, 2021 at 11:42 AM Richard Sandiford wrote: > >> Well, the pattern is called addsub in the x86 world because highpart > >> does add and lowpart does sub. In left-to-right writing systems > >> highpart comes before lowpart, so you have addsub. > > > > The other targets mentioned do not seem to agree but I can live > > with that, thus I'll change back to addsub. > > FWIW, subadd sounds clearer to me too. It seems surprising to put > imaginary before real when interpreting something as complex, for example= . > > Putting the highpart first feels especially odd on an LE system like x86= =E2=80=A6 The XMM vector is documented left to right with MSB at the left (c.f. most significant *DIGIT* of the number at the left) xmm[MSB] .... xmm[LSB] so, looking at x86 ADDSUBPD insn documentation: xmm2[127:64] xmm2[63:0] ( + -) xmm1[127:64] xmm1[63:0] (=3D) xmm1[127:64] holds ADD xmm1[63:0] holds SUB xmm1[127:64] xmm1 [63:0] ADD SUB Uros.