From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 008ED199E80 for ; Wed, 19 Mar 2025 21:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742420277; cv=none; b=iZ2TV3Q0kmBD9U6E+2ijhLQvGg9gW5WygPP2HeRAw1+z5wqKSrzqjwv3ZJ1yXw97IBmuHllVd381xgytiPx6UnEjXRNp/sQQjd2zMIgpsvNbU+Y8nQDdhvbGGScYQkOTpcFqCBd4VIXbVcvcSbKyA0BE05SDlYt3ZfuYWGLdQDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742420277; c=relaxed/simple; bh=igXvRtvCkoJEAtcvR466ksYl5KrIfTTEO33JIxuBk8w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qnY4gO/b/osBKOTxolBGpvyY0f0WVJKv4AIOmJk0ye/ctqvJxSBN8kOXkPCpvUBvHSMxgIwuO7CCFIs5D/wwrADN2LGFIlmypY6iSTKUO5SGkufoa5BelClTSXtpQS1rFeX3G4BMgkJJ4sTzNCZZxE+ntfg2+cWteqFEjNghGDw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=iencinas.com; spf=pass smtp.mailfrom=iencinas.com; dkim=pass (2048-bit key) header.d=iencinas.com header.i=@iencinas.com header.b=C3S+6Vmg; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=iencinas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iencinas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iencinas.com header.i=@iencinas.com header.b="C3S+6Vmg" Message-ID: <4d45df0c-d44e-4bb6-8daa-0dba1b834bc4@iencinas.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iencinas.com; s=key1; t=1742420262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DDJL+avqyQivSc/tZpy/FsXCVGYKqm0FhSqiAlMXSfk=; b=C3S+6VmgvccqvPi6WWbIAzLwx40URVVAjPIg7cGnBwezs6jYObL58WESqdFHc6noSZbSvw T8BeUvDq02cwuDDqht1BshGN2tEqjqjUJk4/j7iUm2/puMeQI18QpatopxEuYwoLwKfQH9 zlWoGkf4sAsp2jUcdW+6W8EdX3MbYggQwNbJCGMQeOsaKKoQqMNeH1TybmawyFP2kQmOxd b5dvD+WZT/iyWKgg2uK5ZxD4R8Rl1UHn5qvG/6d9gC+MupWPQ4MJY7v63dnm9BYH8ezMoY ryBbwnEgygNU1+VkpyLrSQHK7RtWILpr8Y9p1PMAGFfj6ffADLDxOYcI9WBR+g== Date: Wed, 19 Mar 2025 22:37:36 +0100 Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v2 1/2] include/uapi/linux/swab.h: move default implementation for swab macros into asm-generic To: Arnd Bergmann , Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti Cc: Eric Biggers , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linux.dev, Shuah Khan , Zhihang Shao , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Linux-Arch References: <20250319-riscv-swab-v2-0-d53b6d6ab915@iencinas.com> <20250319-riscv-swab-v2-1-d53b6d6ab915@iencinas.com> <2afab9dc-e39c-4399-ac5a-87ade4da5ab0@app.fastmail.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ignacio Encinas Rubio In-Reply-To: <2afab9dc-e39c-4399-ac5a-87ade4da5ab0@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 19/3/25 22:12, Arnd Bergmann wrote: > On Wed, Mar 19, 2025, at 22:09, Ignacio Encinas wrote: >> Move the default byteswap implementation into asm-generic so that it can >> be included from arch code. >> >> This is required by RISC-V in order to have a fallback implementation >> without duplicating it. >> >> Signed-off-by: Ignacio Encinas >> --- >> include/uapi/asm-generic/swab.h | 32 ++++++++++++++++++++++++++++++++ >> include/uapi/linux/swab.h | 33 +-------------------------------- >> 2 files changed, 33 insertions(+), 32 deletions(-) >> > > I think we should just remove these entirely in favor of the > compiler-povided built-ins. Got it. I assumed they existed to explicitly avoid relying on __builtin_bswap as they might not exist. However, I did a quick grep and found that there are some uses in the wild. I couldn't find compiler builtins for ___constant_swahb32 nor ___constant_swahw32, so I guess I'll leave them as they are. Thank you! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78974C35FFA for ; Wed, 19 Mar 2025 21:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m3d2XaG+2aos4nz872jVU0pMT6hqwVW6zhfYC4X1XhM=; b=wRXasyKCkzAo+z /wZTjbsXNcHxddqu7F45LqSTP+ohc45mTxITdfWBWbl5Bz+a2pycwnXSe6VY8RgHciZOvTOjuwNAP R02ZIMdEOb/z+rXNzrzqSoSP6LpHVnL1vo6V19XXKeSJrOGwUxXwg0SuCdJZKP36gh7riOwoeh/yb XYGQKMnDgt0Z3oIn+bDm//5R3/NVr7UOCqxVq8A6P8KwwK9mkQ+sE7NMRyvYXvT9Y4dcAPMvBNJgo ePOczzqYPSJODJjKua9p89wRhAe6nNRxP03bFC+lNRxwtXBrgAkBKnXrc4Sxu7cAfzjHqx7bfb4cF gn1cHgiCyQdgLUhHetqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tv16h-0000000AATg-1wRG; Wed, 19 Mar 2025 21:37:47 +0000 Received: from out-170.mta1.migadu.com ([2001:41d0:203:375::aa]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tv16e-0000000AAT8-2LZb for linux-riscv@lists.infradead.org; Wed, 19 Mar 2025 21:37:46 +0000 Message-ID: <4d45df0c-d44e-4bb6-8daa-0dba1b834bc4@iencinas.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iencinas.com; s=key1; t=1742420262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DDJL+avqyQivSc/tZpy/FsXCVGYKqm0FhSqiAlMXSfk=; b=C3S+6VmgvccqvPi6WWbIAzLwx40URVVAjPIg7cGnBwezs6jYObL58WESqdFHc6noSZbSvw T8BeUvDq02cwuDDqht1BshGN2tEqjqjUJk4/j7iUm2/puMeQI18QpatopxEuYwoLwKfQH9 zlWoGkf4sAsp2jUcdW+6W8EdX3MbYggQwNbJCGMQeOsaKKoQqMNeH1TybmawyFP2kQmOxd b5dvD+WZT/iyWKgg2uK5ZxD4R8Rl1UHn5qvG/6d9gC+MupWPQ4MJY7v63dnm9BYH8ezMoY ryBbwnEgygNU1+VkpyLrSQHK7RtWILpr8Y9p1PMAGFfj6ffADLDxOYcI9WBR+g== Date: Wed, 19 Mar 2025 22:37:36 +0100 MIME-Version: 1.0 Subject: Re: [PATCH v2 1/2] include/uapi/linux/swab.h: move default implementation for swab macros into asm-generic To: Arnd Bergmann , Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti Cc: Eric Biggers , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linux.dev, Shuah Khan , Zhihang Shao , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Linux-Arch References: <20250319-riscv-swab-v2-0-d53b6d6ab915@iencinas.com> <20250319-riscv-swab-v2-1-d53b6d6ab915@iencinas.com> <2afab9dc-e39c-4399-ac5a-87ade4da5ab0@app.fastmail.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ignacio Encinas Rubio In-Reply-To: <2afab9dc-e39c-4399-ac5a-87ade4da5ab0@app.fastmail.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250319_143744_894238_61ABBFE2 X-CRM114-Status: GOOD ( 12.62 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 19/3/25 22:12, Arnd Bergmann wrote: > On Wed, Mar 19, 2025, at 22:09, Ignacio Encinas wrote: >> Move the default byteswap implementation into asm-generic so that it can >> be included from arch code. >> >> This is required by RISC-V in order to have a fallback implementation >> without duplicating it. >> >> Signed-off-by: Ignacio Encinas >> --- >> include/uapi/asm-generic/swab.h | 32 ++++++++++++++++++++++++++++++++ >> include/uapi/linux/swab.h | 33 +-------------------------------- >> 2 files changed, 33 insertions(+), 32 deletions(-) >> > > I think we should just remove these entirely in favor of the > compiler-povided built-ins. Got it. I assumed they existed to explicitly avoid relying on __builtin_bswap as they might not exist. However, I did a quick grep and found that there are some uses in the wild. I couldn't find compiler builtins for ___constant_swahb32 nor ___constant_swahw32, so I guess I'll leave them as they are. Thank you! _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv