From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id D7C353858D1E for ; Wed, 2 Aug 2023 18:49:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7C353858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fe110de46dso1922505e9.1 for ; Wed, 02 Aug 2023 11:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691002195; x=1691606995; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JcfW3bZq/JwI2mTTUL5aNSZrRR/ZNmwAm26Sfnn+yR0=; b=R7Dm44JcxNr2/jn8OCTiWN9dxl7Y25cbh1uVYm2B/nhvF3YNx/DC02XTwXydOPCTFo ybLOnkfBRHjEUFt9xEI5jyggdeEN2M1o7HQcPE9Eq+YXGnhUSGXE7gfsCTedrS+1O0x5 W8OdW9QwUsa3VcPJ0iIeur8tf6vRb7VGw202NcLusbJs0Wqt+AQRxee3KBnqbnVt9EYT sUV9pLZl+YcRl+FqRPL+1/K5YT4IDh8bP6+/36GaI1cJsx+rRi9KTo6y1tbKVI5O4b33 snS88f2opeAx3BN9re506Z18S1gPoCjmfZrHObWag4fLtldLCBNQvZl4/9CmRtVQ0xyo VAHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691002195; x=1691606995; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JcfW3bZq/JwI2mTTUL5aNSZrRR/ZNmwAm26Sfnn+yR0=; b=cP9aYMs3bb+vnik3S0EzMqIbxLCa4oP6TxmuzIex+RqLKlo7PhGqWI71f8ABaBgOYj gojiC8CCQ05lSAChlgy/vTJIk8nneJVu95cdwecgQDUJPRF8Ku7n347CpB58gEuXIpMP jTxky9jA8kSF55Czzk7lQ/U0lme93XDjn2ZbZRxwry9DDWRDMeV7sJdLefBAV3JUz5x/ RtRfRtMw6J05ZpmiVxNZgH70fNsNh+ngrbjrbVGDCLcaxtjG8niuLV0DZZC0cJjiwFrV UO58TsBv7yqBKJWrU1wIa53crenjt4OjHCOrgO4HphCt+zx1Bk39jNBW8QxSbGKqmCZ/ hjRg== X-Gm-Message-State: ABy/qLZTXiP6kzdworSslSTiOQNnsLndq325G2iK9/7FzywOZJQSssjL 62qb+sLr6pYuB3R2oY28h+4= X-Google-Smtp-Source: APBJJlEQdq62TKHE3ZzfY3HudrbLmMV55E2GrxlUv4AI+ee+IHSOdCvIM577Rjr4HXXzokH4zy01MA== X-Received: by 2002:a5d:5010:0:b0:314:216d:c00e with SMTP id e16-20020a5d5010000000b00314216dc00emr5462048wrt.42.1691002195349; Wed, 02 Aug 2023 11:49:55 -0700 (PDT) Received: from [192.168.1.24] (ip-046-005-130-086.um12.pools.vodafone-ip.de. [46.5.130.86]) by smtp.gmail.com with ESMTPSA id k14-20020adfe3ce000000b00317643a93f4sm19644305wrm.96.2023.08.02.11.49.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 11:49:55 -0700 (PDT) Message-ID: <160d3555-0758-c7d1-4a36-2b915d40078a@gmail.com> Date: Wed, 2 Aug 2023 20:49:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: rdapp.gcc@gmail.com Subject: Re: [PATCH] RISC-V: Implement vector "average" autovec pattern. To: =?UTF-8?B?6ZKf5bGF5ZOy?= , gcc-patches , palmer , "kito.cheng" , Jeff Law References: <163c273d-3c01-8ece-21a5-b6ce88174ac0@gmail.com> <939866D72E01A40F+202308022202594195501@rivai.ai> Content-Language: en-US From: Robin Dapp In-Reply-To: <939866D72E01A40F+202308022202594195501@rivai.ai> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,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: > 1. How do you model round to +Inf (avg_floor) and round to -Inf (avg_ceil) ? That's just specified by the +1 or the lack of it in the original pattern. Actually the IFN is just a detour because we would create perfect code if not for the fallback. But as there is currently now way to check for the existence of a narrowing shift we cannot circumvent the fallback. > 2. Is it possible we could use vaadd[u] to model avg ? In principle yes (I first read it wrong that overflow must not happen but the specs actually say that it does not happen). However, we would need to set a rounding mode before vaadd or check its current value and provide a fallback. Off the spot I can't imagine a workaround like two vaadds or so. Regards Robin