From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 29EAB385828B for ; Mon, 20 Nov 2023 09:11:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29EAB385828B 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 29EAB385828B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700471504; cv=none; b=DCtLmoAHiEqGDSSAbEebDQ+ecVGrElfpkG2a1eyIpXxUoGyLxIb7g3Amcp0GTed2g0+YUtUcXgxhGkQJyzqmQM4KZ7tJNUsgXGqTr6keyjfmhATAyx4/EMoC/bqsTZWiThMtZZaHdwR3ui65jirLoLeA4R5dl+jCbxls4HdIhGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700471504; c=relaxed/simple; bh=F/lnNA1dX1xxhB9T1qO36gQshFLI4Jb31K9RRZOTd1g=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=nMSUuxXd2eZdOaeFwzgb6y25r32tOCdoLrB7LWi0W2hkHKhnQbkTpM59i+O6NfoqLpbloae3wriEVMoa3UCUufbx3c8kfarxeZ/My9RFN6yHrG6tLcUQPO+oVOC4KgF+j+wO42NjBjkiRjl5kDaZggo8EAAXugnlHdxL475Y610= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c5087d19a6so49794491fa.0 for ; Mon, 20 Nov 2023 01:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700471500; x=1701076300; darn=gcc.gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TkomXGiPG4nngz/CV0SwBt5fw0h5aZI7a6WkjuYqLxo=; b=nRam4Irj1WR7jaamoGB1GVc0z3JVMdfImuoKBhqGUIMxa5s2+CX/5fa+JBF0TQniEO PP1jAsufxSDiMghTZj3OTxpSmNDyMy6byawFLn91ZX/B74m6+7i9nMvA0EFBVdsfP1Qj R4THutwBrjAaf1odm26Eykh+jv4+4q4qq3RV9SvX3p0bi4lqvX+iHiwlmiBiPJGotfAc BAtaCKZPI4K5jbd+9cZgtjq1dCCpe2FlEwyPXl4vSCHZZgBc+EwHnzNtXxuG/1m0BIoY 7+FxBC3LmzMTUk/3uacHCorlOK1BmWcnhq0dKDPKC4V0yvIPRBrqoHIWXQP84OA0KnAJ kiYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700471500; x=1701076300; h=content-transfer-encoding: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=TkomXGiPG4nngz/CV0SwBt5fw0h5aZI7a6WkjuYqLxo=; b=GxJ6jEZ4s5D1EDyipqxmAzaROE7V6bscJksrHsJ5g8PQ1GPCRbMBHnz7NJ0RP826iG P1Ti7FsqvJcr0HULASe0BxNYODD/eq6sv5vVyGsdvTkaUURdeePf80zTmaJrx5pinuP8 vTf4IzP+srHP1AMkVdkvPZwjnaae8O0/YQx76YlsMM/gakP6ZeExuzYThYEjEOnj5LdW VRti/kpLIXSSdPINjxAZ3YijQNzGDSi8D6qgBJZ5vTDjouj7+UC+aJ2qmr5WuCTRwYn4 calg1EnA+yhGwaXFNvVHBM461Ch4P87AAerScwgeNDdIuke9wvp+6NdVNnI+y4zmN+pf LC5A== X-Gm-Message-State: AOJu0YzLkO8/neYR+fUlzr2lmchN/4dpABC24ChM2nyIslih+NLqzl/U gJyAs8QqWgVcqVLhxO7QmNBRKgYWfNadSptyidM= X-Google-Smtp-Source: AGHT+IHM5J19Y8E8uNYp117i0IRrlXgx6L7poo4TJYK5jmybF/RTtWv9CsQRP22ycks0f6uQeiyYlOj3HmCnoqKGM9I= X-Received: by 2002:a2e:b306:0:b0:2bc:d6a8:1efd with SMTP id o6-20020a2eb306000000b002bcd6a81efdmr4701148lja.39.1700471500476; Mon, 20 Nov 2023 01:11:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Mon, 20 Nov 2023 10:08:01 +0100 Message-ID: Subject: Re: [PATCH 0/4] Add vector pair support to PowerPC attribute((vector_size(32))) To: Michael Meissner , Richard Biener , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_MANYTO,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Mon, Nov 20, 2023 at 9:56=E2=80=AFAM Michael Meissner wrote: > > On Mon, Nov 20, 2023 at 08:24:35AM +0100, Richard Biener wrote: > > I wouldn't expose the "fake" larger modes to the vectorizer but rather > > adjust m_suggested_unroll_factor (which you already do to some extent). > > Thanks. I figure I first need to fix the shuffle byes issue first and ge= t a > clean test run (with the flag enabled by default), before delving into th= e > vectorization issues. > > But testing has shown that at least in the loop I was looking at, that us= ing > vector pair instructions (either through the built-ins I had previously p= osted > or with these patches), that even if I turn off unrolling completely for = the > vector pair case, it still is faster than unrolling the loop 4 times for = using > vector types (or auto vectorization). Note, of course the margin is much > smaller in this case. But unrolling 2 times or doubling the vector mode size results in exactly the same - using a lager vectorization factor. > > vector double: (a * b) + c, unroll 4 loop time: 0.55483 > vector double: (a * b) + c, unroll default loop time: 0.55638 > vector double: (a * b) + c, unroll 0 loop time: 0.55686 > vector double: (a * b) + c, unroll 2 loop time: 0.55772 > > vector32, w/vector pair: (a * b) + c, unroll 4 loop time: 0.48257 > vector32, w/vector pair: (a * b) + c, unroll 2 loop time: 0.50782 > vector32, w/vector pair: (a * b) + c, unroll default loop time: 0.50864 > vector32, w/vector pair: (a * b) + c, unroll 0 loop time: 0.52224 > > Of course being micro-benchmarks, it doesn't mean that this translates to= the > behavior on actual code. I guess the difference is from how RTL handles the larger modes vs. more instructions with the smaller mode (if you don't immediately expose the smaller modes during RTL expansion). I'd compare assembly of vector double with unroll 2 and vector32 with unrol= l 0. Richard. > > > -- > Michael Meissner, IBM > PO Box 98, Ayer, Massachusetts, USA, 01432 > email: meissner@linux.ibm.com