From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id E021E3955C8E for ; Wed, 16 Nov 2022 09:17:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E021E3955C8E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-lj1-x22e.google.com with SMTP id u2so21006421ljl.3 for ; Wed, 16 Nov 2022 01:17:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BuTwvC9beOx45QD6IkGY8cSpV7UJti44RTln9xqGeyY=; b=lTSHdF0Ylh9RDoMXnldWUfKzPwu+9pWVXn6aZuhA++ImKIbVOh3w2Q9yUEXwvSa1Th sdqSVtIjwsioQKhjzI65d9nubS+meRn7owvFCQ8DwyNDjHfCd4mj2rH7ujmyxTWkeldU 5GqEJwulgyx47jfH5rn72b092Wtf/tVwfSf7drZi2a6OO0q4lJGeXob1sH29XfxC1G5/ MwzqKrRTmJZb9YwZPBYrpt/qw/t9Sr77KuOULs2Jv0toQh8Dr+sHokJm/LQl8XGhbt/l 9LuU/sG//yZLIjkdzjU955id27cdHtKkf5bdf0wyEPHiM3z+vXGj2MoSj7p9iTsPJuI0 Gs+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BuTwvC9beOx45QD6IkGY8cSpV7UJti44RTln9xqGeyY=; b=rOiblIIJepzFiIIETWD4YBwr0Zfh1oolaPVRWbkzHg1agpPCNWJV5Z/CBYXFYrqmlL MRkrqrUlkIyNWfU8QhwSq3sm7LT1gDDzXVvskWWGb4ED243zvhb7RsKLT9phRf2q1HWL UyEnVuRJayQ0DT+v+hMSH0nK6dSNZDjM/wyvi0+OT4gXdO+21hZ9MHRhDKUugSAg4iw+ Dd1CW88h9Mj8XMWy7UEJ0BrohgYoO20ZNLlrpTI9Fz56aZUbzjzPhY/lD6l3LwLBsTcC cYW9JMnb7pd7759xTbwTxq75Z/Ho2hje/nhjbnpJYFJlAZEqIcj7znwk+xnQ3TUltBBI kU0A== X-Gm-Message-State: ANoB5pm98OhQx7fNFTjwaBjzHsrQ9F6kTVNem1L8hswHoIzQaIYGftrN vUVQ7ZZFN3ErCfJ/UZSCWK0Z9A0LIe+8lbrOkdlQTQ== X-Google-Smtp-Source: AA0mqf7ukDfHzTsVHrWof0/cjie8iDK+g5hSitFz9tc0BAct2lamg523MQUbrv1RODMqCgZ3a9IZO2NqXkjQ66N00AU= X-Received: by 2002:a05:651c:11cb:b0:26e:6fb:4845 with SMTP id z11-20020a05651c11cb00b0026e06fb4845mr7061232ljo.120.1668590274244; Wed, 16 Nov 2022 01:17:54 -0800 (PST) MIME-Version: 1.0 References: <20221110213501.3592470-1-philipp.tomsich@vrull.eu> <1c091d0d-e355-8fd8-8c6b-1bfe77f20291@gmail.com> In-Reply-To: <1c091d0d-e355-8fd8-8c6b-1bfe77f20291@gmail.com> From: Philipp Tomsich Date: Wed, 16 Nov 2022 10:17:42 +0100 Message-ID: Subject: Re: [PATCH] RISC-V: Use binvi to cover more immediates than with xori alone To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Kito Cheng , Christoph Muellner , Vineet Gupta , Jeff Law , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On Wed, 16 Nov 2022 at 04:45, Jeff Law wrote: > > > On 11/10/22 14:35, Philipp Tomsich wrote: > > Sequences of the form "a ^ C" with C being the positive half of a > > signed immediate's range with one extra bit set in addtion are mapped > > to xori and one binvi to avoid using a temporary (and a multi-insn > > sequence to load C into that temporary). > > > > gcc/ChangeLog: > > > > * config/riscv/bitmanip.md (*binvi_extrabit): New pattern. > > > > gcc/testsuite/ChangeLog: > > > > * gcc.target/riscv/zbs-binvi.c: New test. > > Could this have been potentially done by extending the ior pattern with > a code iterator that covered IOR/XOR? > > > Not a big deal, but if it'd work, consider to avoid the pattern duplication. We'll rework to using an iterator and a mapping in v2 for the following cases, folding into a single patch: - X | C => bseti - X & ~C => bclri - X ^ C => binvi Thanks. Philipp.