From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by sourceware.org (Postfix) with ESMTPS id 9C69B3887010 for ; Tue, 7 Apr 2020 21:43:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9C69B3887010 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=twiddle.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rth7680@gmail.com Received: by mail-pg1-x544.google.com with SMTP id m17so2348451pgj.5 for ; Tue, 07 Apr 2020 14:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ON4XB5pqJvSZYP2es+T2VSgK8hoZQe9HF18nq7d+op0=; b=DXvDQL2ELNT967PyLhdywS286Cp+Hx9I5iyqBlFvgDLDK8Uq+MjApdsql4rsEUY1W5 ARNV2Ah2CqxVcjRJs4xDSvwiWVhNyK1EA+2OXTlqoLdyw2dwK15TV+/vvb6nSWE7UaXR 2zOUKzdSLyEFGdidKcup3p2wwmR8gdAKpHNg0uhPg1QEufKIo2ON6fo6OoEp6gIRJl07 Atqq6Tq3Wr6zCMOpWi19tgn3eM6Mh5asLxd5sQwZ+rGyVl3u9IZA/i3bxa+M3yfCQEzf j9eoVF4cGZVTpcfg6QDPzEu5Zp5cAgwYfFTxV1++HDH1Io2KDd/P49jL/FljDdL6pc2a 4jug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=ON4XB5pqJvSZYP2es+T2VSgK8hoZQe9HF18nq7d+op0=; b=gGGTckxx0uDSsOfVP42LT3mTy6EFQ+b12xehVOXz2RvEF6zBkQtxirryW1shdoUHNe PgdsW9pnpzuUep6joZQygdLtgiyWeSeB5jAc53fW12hyNN3xR3b6f343k9RVVRXKiFp3 hvC3Dwyqvn/EEo6C2GDl/+iRQMY94jdZdwPodOmrUnkW4HBka25MfMeDEzdSmBXSrs71 q29DxXk5LRQ33J1cG2JlIYJkLo1jB6lgQbWxSX4JedOsbVmGQ+LItboc+cA8EWAfqIG0 ac0nY/VHc7N8zprSNSOkWQu1DIkn0aJeRbSJXv9LngrszAmiTxmcJxBAmVnM+c96FPbf wMGA== X-Gm-Message-State: AGi0PuaisUxTWeYjV301Lf38vWVdu5Rf1Xa5cGpiDSQzY/VW/3dLwZcK sKc0vbPyv6ar9Tpkv5tRcnQ= X-Google-Smtp-Source: APiQypIgLckFxDJhLOeIL6fKL74FdyqoTgsFzheP74kdOs2SyF0sho7ZemsnMilRzjzUf5fSZd2OnQ== X-Received: by 2002:a63:b905:: with SMTP id z5mr3573388pge.402.1586295819625; Tue, 07 Apr 2020 14:43:39 -0700 (PDT) Received: from [192.168.1.11] (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.googlemail.com with ESMTPSA id mg20sm2581666pjb.12.2020.04.07.14.43.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 14:43:38 -0700 (PDT) Sender: Richard Henderson Subject: Re: [PATCH v2 00/11] aarch64: Implement TImode comparisons To: Segher Boessenkool , "Richard Earnshaw (lists)" , Richard Henderson , gcc-patches@gcc.gnu.org, marcus.shawcroft@arm.com, Wilco.Dijkstra@arm.com, richard.sandiford@arm.com References: <20200402185353.11047-1-richard.henderson@linaro.org> <868411a5-48fa-b025-0451-d23e72fbe37a@arm.com> <333e33ae-4836-1003-042e-80027ab38abd@arm.com> <20200407202745.GY26902@gate.crashing.org> From: Richard Henderson Autocrypt: addr=rth@twiddle.net; prefer-encrypt=mutual; keydata= mQENBFGuLC8BCADcAoWcnW9lTsDMzbO3MBU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4njsQJPF1i9egBXaIloqv7p2hVCKJ Hl5UWIxitQ9QQIl6iU4LCpz8mVYTXwv48IAVpbUf7+ak9V9Kk3jCeQnlxCJBUHjUhoIzinbS JHPHtkkAEQEAAYkBPAQYAQIAJgIbDBYhBJyxjdr46EmtKvwWpK0ScMxN0CebBQJdweVIBQkP 1iAZAAoJEK0ScMxN0CebGHUH/RtouOlWl6To97tQsTJUq/2YwmRpFOsvV0/zCX4fKBGAbeZi VaELSt2+3UEErA+n8HwbQmjJ6IrdhA9GustOpOyCcbLVSMwql/OlAwBtDzCcC8dTU4zcuY2a rGG2A8i5krU85G9r1wowVcWZBsdmW7/dKiNoadLQiig4bHNiSaV4ograas5efyEjqTxiY+yG hzPw5DK2kbp2co8iDF1vW0LWPeLFBinCgItcI9LvgHWaB3rwjOfvNpMn5m64SoQYHB8wbnid erAjOzkBzmqnfS1tAUr8mtESStEwrEmNv0ZoA6S0Wt+c9pyTr+BpG4OFlhj7ZI+Eh7zOrr33 q9OBIdA= Message-ID: Date: Tue, 7 Apr 2020 14:43:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200407202745.GY26902@gate.crashing.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2020 21:43:41 -0000 On 4/7/20 1:27 PM, Segher Boessenkool wrote: > On Mon, Apr 06, 2020 at 12:19:42PM +0100, Richard Sandiford wrote: >> The reason I'm not keen on using special modes for this case is that >> they'd describe one way in which the result can be used rather than >> describing what the instruction actually does. The instruction really >> does set all four flags to useful values. The "problem" is that they're >> not the values associated with a compare between two values, so representing >> them that way will always lose information. > > CC modes describe how the flags are set, not how the flags are used. > You cannot easily describe the V bit setting with a compare (it needs > a mode bigger than the register), is that what you mean? I think that is a good deal of the effort. I wonder if it would be helpful to have (uoverflow_plus x y carry) (soverflow_plus x y carry) etc. (define_insn "uaddsi3_cout" [(set (reg:CC_C CC_REGNUM) (uoverflow_plus:CC_C (match_operand:SI 1 "register_operand") (match_operand:SI 2 "plus_operand") (const_int 0))) (set (match_operand:SI 0 "register_operand") (plus:SI (match_dup 1) (match_dup 2)))] ... ) (define_insn "uaddsi4_cin_cout" [(set (reg:CC_C CC_REGNUM) (uoverflow_plus:CC_C (match_operand:SI 1 "register_operand") (match_operand:SI 2 "reg_or_zero_operand") (match_operand:SI 3 "carry_operand"))) (set (match_operand:SI 0 "register_operand") (plus:SI (plus:SI (match_dup 3) (match_dup 1)) (match_dup 2)))] ... ) (define_insn "usubsi4_cin_cout" [(set (reg:CC_C CC_REGNUM) (uoverflow_plus:CC_C (match_operand:SI 1 "register_operand") (not:SI (match_operand:SI 2 "reg_or_zero_operand")) (match_operand:SI 3 "carry_operand"))) (set (match_operand:SI 0 "register_operand") (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_operand:SI 4 "borrow_operand")))] ... ) This does have the advantage of avoiding the extensions, so that constants can be retained in the original mode. Though of course if we go this way, there will be incentive to add overflow codes for all __builtin_*_overflow_p. r~