From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 6A588385841E for ; Mon, 13 May 2024 04:57:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A588385841E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6A588385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715576266; cv=none; b=U1Wmi9pOEQl3wBiTUQaJdBU8l71+fHCktEKYwhua36D7pyjing5GSh5Q1ftdKzlCOv5EHFsBacwTU++ZI+d9wX/hL0Q+kTz3xT/pBZpd158ie9I/klgcpv6Zk9iZLVgIRj3kDMiqT/VpBuB8GKaQ+sebwGb9ViiGXfC9MsYw4eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715576266; c=relaxed/simple; bh=qYlTjvJCi18QKWSQeha+4v5AAcFVBQKxi5S5XaIPc4Y=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=NTmEKhotoEMrWiQpvzzP/QcUxuJSBg4hhO50gVjT+kg1qnxft+VLv1aNsK+3VwLVLr4pF2qqoe5+6ac9K7j7tc24wJx4UTNWaz3HIIWoL/Wbfd03Im4igln5oOEbetcZ8ptOFwc9zAAsmkI4dFY7fE6nbfd29vzoiPIajh9/gMQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3c9995562fcso767767b6e.2 for ; Sun, 12 May 2024 21:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1715576261; x=1716181061; darn=gcc.gnu.org; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=BeJyl6X6HgzydiGy60bmWryKn2TUJkbT6j2S/96rOno=; b=fsBlfkqqKmNzTl18PZ8dREF1ww+QXt4/UXmLqsRG0dpYRU9Sy3fJGQtA82l1jusCPJ kX3yshLJxgqVzZwNqrWHZAHzT+l7m4Ayg+RGbrWpgSjykh3URE/GdVYPeoffdNdPvMWA NAmGsGF3sfg1gZWzDq153xG4fOOmYNMUu87j6AaScP0oLwEKoKhbdeWFz+AbRRQWpdQq Hm55f0yTcreg+NLsnDZCgEsFaqNpL+fIxZ/IAMRditeArIWehyeEh7cVAqNpoiDyix1p R2XoMGPBUlF1l0Vm1yE8EVr0uGqjRW9QL9KIMDgRVGbT1vmR1d+SXyH8sC+J9SquKceM QeOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715576261; x=1716181061; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BeJyl6X6HgzydiGy60bmWryKn2TUJkbT6j2S/96rOno=; b=WHkvnavPQ4UQyiZu19cUlR+gIn+NLF3lPRu/XeHNeXt7RhofBkevO7xtTPGXvvbtXE 778Dc9xeMfJAKgjl5a7m/dvgMAMolRmk77UVnyylvukc6Sf7w8ETw7Pg8IaYKwRCUzEA wHO4gezTy2Rg8rtynfIbpYTdXZrIeA5dI8NpRWliuV8aOe739YbjEy814oEOQ/NiSsd0 PCeyb+7HSd36MPvGBopOXibpSt/brBthbqniaMUl7wqiMQPYxKOzJScx+34q4IltY2Xo piu/UVbPQm8Bg1EUQTWbbc50Yv/dErbt9gVHtFdC3FPBN7J/QUlXFy2FpHDPyheDX/4Q YIGA== X-Gm-Message-State: AOJu0YzxjtUD0TbNnBY4DKCEittbvrcoIs+zf0s8F+qCtxA7vIuhi6/P yOR+XPs8tmWRvgEQ7dtsPuwJfNiKsYIA0gt95TR5SdfXxC6k2148cuynmLQD28SS3DiEf4EKPCi / X-Google-Smtp-Source: AGHT+IE9Xf+3NPM2bMlwALZ3gObJiQfXOuCfH9yEWmYHYpZEaWecnQY8Y/x7nlIVzkJ/TO960HcJtA== X-Received: by 2002:a05:6808:4388:b0:3c9:9378:f812 with SMTP id 5614622812f47-3c9970b9b7cmr8976699b6e.39.1715576261098; Sun, 12 May 2024 21:57:41 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-634103f80b7sm6799899a12.66.2024.05.12.21.57.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 May 2024 21:57:40 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------oJHEgof9x540sJ4n6Ky2PRTh" Message-ID: <313d117c-e18e-440a-ac5b-114722e08274@ventanamicro.com> Date: Sun, 12 May 2024 22:57:39 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Content-Language: en-US To: "gcc-patches@gcc.gnu.org" From: Jeff Law Subject: [to-be-committed] [RISC-V] Improve single inverted bit extraction - v3 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,KAM_SHORT,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: This is a multi-part message in MIME format. --------------oJHEgof9x540sJ4n6Ky2PRTh Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit The only change in v2 vs v3 is testsuite adjustments for the updated sequences and fixing the name of the second pattern. -- So this patch fixes a minor code generation inefficiency that (IIRC) the RAU team discovered a while ago in spec. If we want the inverted value of a single bit we can use bext to extract the bit, then seq to invert the value (if viewed as a 0/1 truth value). The RTL is fairly convoluted, but it's basically a right shift to get the bit into position, bitwise-not then masking off all but the low bit. So it's a 3->2 combine, hidden by the fact that and-not is a define_insn_and_split, so it actually looks like a 2->2 combine. We've run this through Ventana's internal CI (which includes zba_zbb_zbs) and I've run it in my own tester (rv64gc, rv32gcv). I'll wait for the upstream CI to finish with positive results before pushing. Jeff --------------oJHEgof9x540sJ4n6Ky2PRTh Content-Type: text/plain; charset=UTF-8; name="P" Content-Disposition: attachment; filename="P" Content-Transfer-Encoding: base64 Z2NjLwoJKiBjb25maWcvcmlzY3YvYml0bWFuaXAubWQgKGJleHRzZXF6ZGlzaSk6IE5ldyBw YXR0ZXJucy4KCmdjYy90ZXN0c3VpdGUvCgoJKiBnY2MudGFyZ2V0L3Jpc2N2L3picy1iZXh0 LTIuYzogTmV3IHRlc3QuCgkqIGdjYy50YXJnZXQvcmlzY3YvemJzLWJleHQuYzogRml4IG9u ZSBvZiB0aGUgcG9zc2libGUgZXhwZWN0ZXMgc2VxdWVuY2VzLgoJCgpkaWZmIC0tZ2l0IGEv Z2NjL2NvbmZpZy9yaXNjdi9iaXRtYW5pcC5tZCBiL2djYy9jb25maWcvcmlzY3YvYml0bWFu aXAubWQKaW5kZXggZDc2YTcyZDMwZTAuLjcyNDUxMWI2ZGYzIDEwMDY0NAotLS0gYS9nY2Mv Y29uZmlnL3Jpc2N2L2JpdG1hbmlwLm1kCisrKyBiL2djYy9jb25maWcvcmlzY3YvYml0bWFu aXAubWQKQEAgLTcxMSw2ICs3MTEsNDkgQEAgKGRlZmluZV9pbnNuICIqYmV4dDxtb2RlPiIK ICAgImJleHRcdCUwLCUxLCUyIgogICBbKHNldF9hdHRyICJ0eXBlIiAiYml0bWFuaXAiKV0p CiAKKzs7IFRoaXMgaXMgYSBiZXh0IGZvbGxvd2VkIGJ5IGEgc2Vxei4gIE5vcm1hbGx5IHRo aXMgd291bGQgYmUgYSAzLT4yIHNwbGl0Cis7OyBCdX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