From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 294E93858004 for ; Wed, 25 Oct 2023 16:31:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 294E93858004 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 294E93858004 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698251506; cv=none; b=SOj+UG+rccIHu8FIbue9dsbGHdYKuauO7Wa4FRAq/UWHvuksj+WcIS6JKd0NyncsEKbBcbnS5p2HU1d9BaKxs8iQAGPpeiATzI6gTZrikKE/iW7mzH0guD8hblyEMJ0RkAz0rSC4Jyi7bR7mSJMHqOHmyx+g0TKu7nXluerQOTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698251506; c=relaxed/simple; bh=5GB/4axDL+33o3xh7MJnLwOJUe07TnBJh0fLSHb+Hk4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Zm4pek2YlWk/SLQxyDZH3eXXACVe4tF+0Aq1JvTVzCkMN4i9Bd7Ghg5un5oM66zelJrRSYlVhIKwXvkC/XGzLVIdNwaJPuv8Lde9EevCXvukh/vATFU3y4hltwRPhOxQ4coe4WGa0LadojrUFfPe+jQZnxrUisBuIgb/bSq1W8Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6be840283ceso4943886b3a.3 for ; Wed, 25 Oct 2023 09:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1698251504; x=1698856304; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RDacoO2pTIjAlGMMCchKSVm82xwMG/QzGrhVQZzENcM=; b=v7Zt2RB1yKba6CTz0nGrutqZ0AISEdZbO3yNSrpydlY/VMpqSt4dukzEU8d7OvboEx PHIRKg0O5TsBOaES7c5CpUpk4zbZoRgxQNeKRt3fFbkCmKpWPKPdESyCXKdRtcLcXwck 0TGyXzReuggJHyij7RE+ykodRRHs5Wz9qyF2l552gitqjP4VxM8UvsuMw9DNkoXYIlgF iZCVatiLjvggrOt+v6Qrr41c96nPJ7XjUlTCidIbJyJ3Sp1TyGX0zRD/Ym2D1elL25h2 b9rM8owecRPynkEZn7AsWv8mnnARlov+wz3M4G+CBnC2SPMa/Q1v9SmsYr1FTQBJwZff 4jEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698251504; x=1698856304; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RDacoO2pTIjAlGMMCchKSVm82xwMG/QzGrhVQZzENcM=; b=qAhMqkqxeXaNYzQVF3kCGItj4ZYEUSReSl+copf+5uqeIFvjfbY3+KyuiN/4SfKHF4 nhkcDuUUPiiEu0nTvHyVM08SqWLEoLMmKKTB86xpwby2S3H83N1kXsURj69Or8tmTlWy 1K+tKnmRrhg2a1Hp+B/ra63ynFQQf2UwcNO6STEOxcEJ6aqg1I6Z76HqyU8KzDF5rHmD sLzECdjNvQw5bMR42iryU9Co+ju8a1svdS/UT34QvqMVWcZ3XnAGuPipHzLAGFG2LUiv tUwYyVr631aqihPG6UBqH1qDiJ4CvfjBDJBvbkqLo/xCWb6jICM25ezcju2hGHxgP5mE oxYg== X-Gm-Message-State: AOJu0YxKCwPr2yYf6Anv+LPwGFQRSE0Ry4ICpoRJ7jGpALEmqikeFf3e 0m5SA7HkkQqn2cPZ55o+vJutYw== X-Google-Smtp-Source: AGHT+IEsz15jpg35YgFyxjFFCEuwtR1HHqWORCPmFFTRUY8DD0yYzC9MskCc9i9dy3JNbgnDiP8GEA== X-Received: by 2002:a05:6a21:3e02:b0:15e:1351:f33a with SMTP id bk2-20020a056a213e0200b0015e1351f33amr5626923pzc.47.1698251504033; Wed, 25 Oct 2023 09:31:44 -0700 (PDT) Received: from [192.168.50.117] (c-98-210-197-24.hsd1.ca.comcast.net. [98.210.197.24]) by smtp.gmail.com with ESMTPSA id gu5-20020a056a004e4500b006887be16675sm9579989pfb.205.2023.10.25.09.31.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 09:31:43 -0700 (PDT) Message-ID: Date: Wed, 25 Oct 2023 09:31:42 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] RISC-V: elide sign extend when expanding cmp_and_jump Content-Language: en-US To: Jeff Law , Robin Dapp , gcc-patches@gcc.gnu.org Cc: gnu-toolchain@rivosinc.com References: <20231025050155.627837-1-vineetg@rivosinc.com> <7fe582bc-d259-4d2a-bedf-4e1a334d7fc3@gmail.com> <04f85309-4b40-4797-a424-ff207dd0724d@rivosinc.com> From: Vineet Gupta In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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 10/25/23 09:30, Jeff Law wrote: >>>   - Should some common-code part be more suited to handle that? >>>     We already elide redundant sign-zero extensions for other >>>     reasons.  Maybe we could add subreg promoted handling there? >> >> Not in the context of this specific issue. > Robin's point (IIUC) is that if we put this logic into a zero/sign > extend expander, then it'll get used for *any* attempt to zero/sign > extend that goes through the target expander. > > It doesn't work for your case because we use > gen_rtx_{ZERO,SIGN}_EXTEND directly.   But if those were adjusted to > use the expander, then Robin's idea would be applicable to this case too Understood. Definitely solid idea. -Vineet