From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 84E5F3858D1E for ; Fri, 30 Sep 2022 16:08:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 84E5F3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E10671424; Fri, 30 Sep 2022 09:08:18 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C6D03F792; Fri, 30 Sep 2022 09:08:11 -0700 (PDT) From: Richard Sandiford To: Prathamesh Kulkarni Mail-Followup-To: Prathamesh Kulkarni ,gcc Patches , Richard Biener , richard.sandiford@arm.com Cc: gcc Patches , Richard Biener Subject: Re: Extend fold_vec_perm to fold VEC_PERM_EXPR in VLA manner References: Date: Fri, 30 Sep 2022 17:08:10 +0100 In-Reply-To: (Richard Sandiford via Gcc-patches's message of "Fri, 30 Sep 2022 17:00:03 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-39.0 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Richard Sandiford via Gcc-patches writes: > Prathamesh Kulkarni writes: >> Sorry to ask a silly question but in which case shall we select 2nd vector ? >> For num_poly_int_coeffs == 2, >> a1 /trunc n1 == (a1 + 0x) / (n1.coeffs[0] + n1.coeffs[1]*x) >> If a1/trunc n1 succeeds, >> 0 / n1.coeffs[1] == a1/n1.coeffs[0] == 0. >> So, a1 has to be < n1.coeffs[0] ? > > Remember that a1 is itself a poly_int. It's not necessarily a constant. > > E.g. the TRN1 .D instruction maps to a VEC_PERM_EXPR with the selector: > > { 0, 2 + 2x, 1, 4 + 2x, 2, 6 + 2x, ... } Sorry, should have been: { 0, 2 + 2x, 2, 4 + 2x, 4, 6 + 2x, ... } > which is an interleaving of the two patterns: > > { 0, 2, 4, ... } a0 = 0, a1 = 2, S = 2 > { 2 + 2x, 4 + 2x, 6 + 2x } a0 = 2 + 2x, a1 = 4 + 2x, S = 2