From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id B28263858D28 for ; Thu, 26 Jan 2023 00:26:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B28263858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1030.google.com with SMTP id nn18-20020a17090b38d200b0022bfb584987so319244pjb.2 for ; Wed, 25 Jan 2023 16:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=ECKwR0goYSJDOTo++k6sIb/zbdRkX07Unt+Xs3m+vrU=; b=MHJ2JlppktHEMJk5fUUeDQtOB9pcBxTjnbXwf43Cpe8rX+BRNQq5g6yAQMtjFeL87r dXRDCdH7GscjKKjQyLGxafeZb4J9b1AUfIn9x4una6S2J4+Ci0nKVh7PfKt4E7H+OTRi NK+aXwgLT1T3kAa7qGGzPmsX26Hz+i9fDND+OTJw6TH84/CXu97ur8gMXB8HBn37HYj9 ZvwQ/1fWHoCwqvJZPkB74nYT8lMqczDFQrF21W9ur6UMMvO9jAS8NVreMLB52gm3vBhm vE5SE8WgwEXPR6D5eHYZpcfAOfzJqJmYZaU5NeQcrkLFx+6e7QWeRzxHY3mHBQE+/YId WgRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ECKwR0goYSJDOTo++k6sIb/zbdRkX07Unt+Xs3m+vrU=; b=2e4PbGCAavA7pQrJdudYmYKGXXCQj9A5XOmKTie+MSA+0KR0GB7ZriyLF19mtRG1aP BoQbwXBEFNzBOaDROIYdeAnzhshtsrlRrCi8KX82nAird1Qhfap8jQ2xE27+OJLpgpJl WxP7Q+eHv5SE9/bQGc46KX1JaVvmBsxbFoxyYKxnrKIXFvXNUpvSnfJ01Y4O2k+Jj5Pf 6lm1dutJHXnAcsXJAFy1IrQu0/vxrJCU0Kk0rAyOLH8WXO+yGsJVaRDzZ3yzW9AfW6lk wGXTqMpbuQqyCOxIxqME50dVlZWs8Lau0t7kpjuxoSLZHMBh58vYYtRIgU14CS9jrkxx jx0g== X-Gm-Message-State: AO0yUKVPLWPHTi72R8goeP7Mw5LK7zD6EoqD66lZ/BULIE6QPkXYzNrd oioo3TRI5ML1lim5VhAiM5w= X-Google-Smtp-Source: AK7set+AsuE8Vqm61p4bAvAUbiPGSxULzlOb/DEBYFDW02WsU+RyeuMfk+4IFIaQi9BMrkGQwL1nbQ== X-Received: by 2002:a17:903:1249:b0:196:3bfa:4dce with SMTP id u9-20020a170903124900b001963bfa4dcemr1081561plh.34.1674692809369; Wed, 25 Jan 2023 16:26:49 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id u10-20020a170902bf4a00b00185402cfedesm4214520pls.246.2023.01.25.16.26.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Jan 2023 16:26:48 -0800 (PST) Message-ID: <7dfcdb8b-f8ba-f0ae-b71f-f6fef1acac13@gmail.com> Date: Wed, 25 Jan 2023 17:26:47 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [RFC PATCH v1] RISC-V: Support Zicond extension Content-Language: en-US To: Philipp Tomsich , binutils@sourceware.org Cc: Kito Cheng , Nelson Chu , Christoph Muellner References: <20230121002935.1139281-1-philipp.tomsich@vrull.eu> From: Jeff Law In-Reply-To: <20230121002935.1139281-1-philipp.tomsich@vrull.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,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 1/20/23 17:29, Philipp Tomsich wrote: > *** Zicond is not FROZEN at this time. Do not merge until FROZEN. *** > > This implements the Zicond (conditional integer operations) extension, > as of version 1.0-draft-20230120. > > The Zicond extension acts as a building block for branchless sequences > including conditional-arithmetic, conditional-logic and > conditional-select/move. > The following instructions constitute Zicond: > - czero.eqz rd, rs1, rs2 => rd = (rs2 == 0) ? 0 : rs1 > - czero.nez rd, rs1, rs2 => rd = (rs2 != 0) ? 0 : rs1 > > See > https://github.com/riscv/riscv-zicond/releases/download/v1.0-draft-20230120/riscv-zicond_1.0-draft-20230120.pdf > for the proposed specification and usage details. > > bfd/ChangeLog: > > * elfxx-riscv.c (riscv_multi_subset_supports): Recognize > INSN_CLASS_XVENTANACONDOPS. > (riscv_multi_subset_supports_ext): Recognize > INSN_CLASS_XVENTANACONDOPS, > > gas/ChangeLog: > > * testsuite/gas/riscv/zicond.d: New test. > * testsuite/gas/riscv/zicond.s: New test. > > include/ChangeLog: > > * opcode/riscv-opc.h (MATCH_CZERO_EQZ): Define. > (MASK_CZERO_EQZ): Define. > (MATCH_CZERO_NEZ): Define, > (MASK_CZERO_NEZ): Define. > (DECLARE_INSN): Add czero.eqz and czero.nez. > * opcode/riscv.h (enum riscv_insn_class): Add > INSN_CLASS_ZICOND > > opcodes/ChangeLog: > > * riscv-opc.c: Add czero.eqz and czero.nez. Given this extension is derived from the Ventana condops extension, I may be somewhat biased. The mnemonics and encoding is obviously different, but the behavior is the same (perhaps differing in timing characteristics, but I think that's outside of what we care about here). I assume nobody cares about gdbsim, so nothing to do there. With that assumption this is fine to go forward once the spec freezes. jeff