From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id CF56B3858D3C for ; Tue, 1 Nov 2022 21:29:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF56B3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x330.google.com with SMTP id v7so3806639wmn.0 for ; Tue, 01 Nov 2022 14:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=daLMO5dKZqbhFhQhIB16W2cSGVB/1PqmJlLWEHLbPkw=; b=MliJgusWJgQFJ6+AYswVxwWFpkcALzMU7+iZDqm1PJSP9G6tOcPq0SWUxD5N75Vvph PzEIZNVzeyC9q+VvOpXSuzfamzaGdwYnBimS201LBoWe3K45cs4sfF0Qf16+7/h9YUy4 ePmfCIH+pOjThAC9EFmdo1LyGan2UpT3mJcs9rQW7bfR0NUGI5fYl12Gs1NNEO+3Rzpg kEJLp1gJeB22aVBwvw/WIfKyKojRI10zY5gBvv6pjEcHyS3FC4qJevXOw7r56AE3QaOq QBhogBgXDTgv9ii2e+bSAdj8oOKTPZ7DXg/0SZX26+YIKd++H1IQPay4A0fjPbcb+OIz Ptjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=daLMO5dKZqbhFhQhIB16W2cSGVB/1PqmJlLWEHLbPkw=; b=NhS1TqwdL+mK2+0nTT/RbI9EvjJ3fheBgsxKhdGkHznwdy63Vq5/AH54oFuQA8IiAi +n0je/dGXi/coxE1WeDfnHEsi9bfVZqSjRY8zojNehqagQbgpEPYz025Sxl59mqPrmEo EDNgYj4um7Si+1uIVf6qCrx4cKdVn1WD15qrN8qh+PI6eFXvFe06yhSeh8QQaPYR9ZD8 Ch8Cr9VNRfkDyzjphFoFuRz09qIPFy1TFjECh+hiO/WvXLF165LKMytUikNlnVI9wWZK /JsNgDaN86ctnbWLEl1meu9vCgW88pHMKyT5kypujbMPD1hgtokob7UnWi1QLjKvqwAm Nerg== X-Gm-Message-State: ACrzQf2y54xjBOHAaKfKmG+LEjxOVwKDILUZekNiMLTZv5htGrCEp/np 5ca3rh93ETslr1MuwOilPlXLAw== X-Google-Smtp-Source: AMsMyM54gniH9+GVcJqC9r3V/tdznPstUUnFrWFdrQ0HVWhxcrLI6SiMuujaxj/Aq+oQTfrOOM5V2Q== X-Received: by 2002:a05:600c:3d8e:b0:3c6:e58d:354f with SMTP id bi14-20020a05600c3d8e00b003c6e58d354fmr23231828wmb.176.1667338139287; Tue, 01 Nov 2022 14:28:59 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:8d5:d990:e654:e8ff:fe8f:2ce6]) by smtp.gmail.com with ESMTPSA id b15-20020a5d45cf000000b002364c77bc96sm11102591wrs.33.2022.11.01.14.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 14:28:58 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] x86: Replace ne:CCC/ne:CCO with UNSPEC_CC_NE in neg patterns Date: Tue, 01 Nov 2022 22:28:57 +0100 Message-ID: <3131485.5fSG56mABF@fomalhaut> In-Reply-To: <20221101203431.GM25951@gate.crashing.org> References: <20221026185857.234023-1-hjl.tools@gmail.com> <2132915.irdbgypaU6@fomalhaut> <20221101203431.GM25951@gate.crashing.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: > Yes. But it is all the same: neither signed overflow nor unsigned > overflow (of an addition, say) can be described as the result of an > RTL comparison. I disagree, see for example the implementation of the addvdi4_sp3 pattern (for which we indeed use an UNSPEC) and of the uaddvdi4_sp32 pattern (for which we describe the overflow with a COMPARE) in the SPARC back-end. And that's even simpler for an unsigned subtraction, where we do not need a special CC mode. Sure there is a technical difficulty for unsigned negation because of the canonicalization rules, hence the trick used in the SPARC back-end, but unsigned overflow is much easier to deal with than signed overflow. -- Eric Botcazou