| Message ID | 20260603135155.619826-1-jovan.dmitrovic@htecgroup.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 15F3C4BA2E15 for <patchwork@sourceware.org>; Wed, 3 Jun 2026 13:52:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15F3C4BA2E15 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=htecgroup.com header.i=@htecgroup.com header.a=rsa-sha256 header.s=selector1 header.b=ZHFaej8l X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from MRWPR03CU001.outbound.protection.outlook.com (mail-francesouthazlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c207::3]) by sourceware.org (Postfix) with ESMTPS id BA1884BA540B for <libc-alpha@sourceware.org>; Wed, 3 Jun 2026 13:52:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA1884BA540B Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=htecgroup.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=htecgroup.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BA1884BA540B Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c207::3 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1780494738; cv=pass; b=P4z34l8YU8ALcRVKMzlVSSv3m5FhUwpm2ujZqRjZwCVz4RNuQ+CvYiyH+4bGTvdHsTYwCgoSGHK2lwO5isxJxLoK19QbDD3/gTHjGZPdPMdmu+asXw6OeCmgt7eiFUK89Xe7cXW8mnO7qDLsx8XxT2Ld/1QbpES5dxqa75eJ/U0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1780494738; c=relaxed/simple; bh=I7F3j8fahLOYlusgZHBaa0f7hWYv8G2H9U/HExbt3BM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=a+OGhJLYzYLKYKLicDWUQ8Hjm53KzXfH/++/NE7HI3aOaKxrW4r+NfbdE2xylCjpOahzUz6cfVwmHGGGvFxqJOM6F4qz8KxrN5vJeCxRcj+htzQCLaTLhX92uQSHPomWbW9VWjQGQ6W3o616EFlUZHVPXZe7T4gdLYy2v7IrnuU= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=htecgroup.com header.i=@htecgroup.com header.a=rsa-sha256 header.s=selector1 header.b=ZHFaej8l DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA1884BA540B ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=btzdu6THuI76m+DZHq5SwCtjKG0H4GvBYey5gUuqHE0YxuxprcTHrlW887N/cFO3+jXOK+NBtmyexaEvhBzYgJGWwtIRvdzef8uu4H/e+/1qtU7qCThBAlG7cjK3cQZE/5a88Lta/wcpPL0nkyCkDCcMwamwPb5/dyc9YB3OFMxR+UckAz16iKuC2CVZwlVGLDMRQsxCI8Dfjv7fAFPVxhf6c8dMe7P+JXsDdoDBxspEcUpLhbAzcnY1COuS40ej5KrDMxaRbVDWvswo5tfiKt3CgaIXPIeYtAVKkKjrxrovcbKDfMu3FueKSz5tET51dW/MQ05msSN0Z4c6PmGrPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lcJ129F+ALchADxCJDore4TVd+Z1Vn4p30HtLbhweAs=; b=ly/RohdtzQx4cNDT23J+H1X+6ZUYtMO5ZbciVTeZPF6wniPPC/aKDaRBFF9Nz8+UHKDp9qlWO9O0jNQx/6XdYbWh8rNYX7KehBPHJ2EexaPCRuOE3DBjyTJXAdyomHWhJRlfvIojxVCSAO2YwqMO/DyH+q8LAlrNlonC/2pae/6fIsv4N2z5CvIMcCKbCVz3sJx0JYtEwHcX7vdaR4E3AZubsoge3t2tmctwfJhBOTb6AeAd6u3WX4iZxkb7aTA3xk2IqpyoMY5ctlA6DnLiA/0RnSHgPBrlp/61QKG7bj0GrRLDgUr2gHpRU7GUu2dfznwprHdC0r+I/Ez2iEQkDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=htecgroup.com; dmarc=pass action=none header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lcJ129F+ALchADxCJDore4TVd+Z1Vn4p30HtLbhweAs=; b=ZHFaej8lXumlnrrsGLAT+gnleOY1pxScuiOg3UmNc57X8Wxs+8rnQNYQodvush+/PooHlHKPKGjZOm9bpYzPwUkwKFVKEVytYPu9DQY58rl5ef0+blNZAQiRhC4iFJQ/wCJhE0q/BnBJSXpyG8ObpCmcDaZZuWh0S6Toz9E1Zdk6Vb1b7azV6mMDxJmE8VEEgFuYC9keKAHgxa1ARChCh6INlWz1kR7vDHNlqZCZD92FEI1HJ71ncofaRkkhsyL2hHaL+ylLRvD1NvRXn2A7Qmq91g/lIHTttNuwnax+8+vYmIKV+dXWCdgqPqn+YhBdg0n/6sgvouWP6y4FxBHKhA== Received: from MATPR09MB8627.eurprd09.prod.outlook.com (2603:10a6:250:4d::7) by VI1PR09MB4239.eurprd09.prod.outlook.com (2603:10a6:800:12f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.7; Wed, 3 Jun 2026 13:52:11 +0000 Received: from MATPR09MB8627.eurprd09.prod.outlook.com ([fe80::ec2e:61:1e09:a9fd]) by MATPR09MB8627.eurprd09.prod.outlook.com ([fe80::ec2e:61:1e09:a9fd%3]) with mapi id 15.21.0092.006; Wed, 3 Jun 2026 13:52:11 +0000 From: Jovan Dmitrovic <jovan.dmitrovic@htecgroup.com> To: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org> CC: Djordje Todorovic <Djordje.Todorovic@htecgroup.com>, Jovan Dmitrovic <jovan.dmitrovic@htecgroup.com> Subject: [PATCH] riscv: Add big-endian support to string-fzi.h. Thread-Topic: [PATCH] riscv: Add big-endian support to string-fzi.h. Thread-Index: AQHc82Atshy0qSsb7UyeWpAGQYQWjw== Date: Wed, 3 Jun 2026 13:52:11 +0000 Message-ID: <20260603135155.619826-1-jovan.dmitrovic@htecgroup.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=htecgroup.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MATPR09MB8627:EE_|VI1PR09MB4239:EE_ x-ms-office365-filtering-correlation-id: 20a7cbc0-4d39-4c82-19c8-08dec1774f89 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700021|56012099006|11063799006|6133799003|18002099003; x-microsoft-antispam-message-info: nWbQX5+dVKuBzglesLM4o2wnD97BW4kNCgAsntZQ/e5Q7jdI00RLy/CtkIYGo80PDpn6+rsV3J3IdQXWwiHonMYIUXonoavN+WJ+n0L7sKO/lTaJpnm47PSSl/kn3WanlVCPamxFq/Gs9ZYCGrYv7csxoZ83vRuIh7tgDcFgpfSQNSedC1jDN5o/L94FPkhVvJXDiMwOTINdRtPLjCgwX8/I2OvUZgJ1xUHGboO44pS1MnnPLBZR8Yj21h900Ovc69G/jifoRbNy01OQ3vU390elKFDoYE3Ew6q9/XWGpTbi8/CV2WEkBYXvh2MRWQB4RVkn1e5Zx2poTMp1JzbbaAfMaI0+bguq4y+aPVOwj3UYg05fYVFIy67agz2PdnWsyEVWR5kfC3Fw0tLDx/BWo19zcjE32xVTUqDF2PPB9edFE/jLoiamqOyQfzy9Pt/QwESqs1Fl3s8oiHa03TjM0FlA7twuHpq/Tp8bdEX+Uhtt/VtTwaSOhTQ7oJi7zqjJKz1USklTKrIyDpESWX/avMnAJtV0ye0VdDUZOsl4150JN42ypxpfkBom779B6t7x9W69pOV3f3Ufyv5JFkhuPg2b7qt02t+WN5dTK3F0WxZ9UXdVFgx18o2XpgrxSAocf4waEAjzE8q+R/AB0JgQ3lyz8Um3+nW+jiQOWXdMQ29NXmrQQN44YeNxA6nQx1Tnj4RkwJJZl49sU/Ha8I2wSJoieK3yvkMYKS7vwi1osI9vrW8j6I9qkc+UdcKxWajj x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MATPR09MB8627.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700021)(56012099006)(11063799006)(6133799003)(18002099003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?JtGagwSoaC/2hmmmqRLMPIW?= =?iso-8859-1?q?/zCiX0n0oXn5MNgBBlhX2C+YygX6ClD8WcCuWSlGbKtbaqfaqT1GfM/oxW4Y?= =?iso-8859-1?q?1MMB9K9Ou2BrzdOFH+OFhhh80LVN86vsRmgsQ2CsPtlxNJ4R6kWT4IK9/F/x?= =?iso-8859-1?q?NoBrWblZBdAcCu4fliE9wtWZx+q7tPzPCawbSr4PoxJ9eXOUs5hSvQo0MzOy?= =?iso-8859-1?q?FJtFoVf85s+4i40NRDfS6OKfoBEku7jTSUffy1VjrRUxw1xVPKTtv2A/yG69?= =?iso-8859-1?q?+d3eY2Mojb6fTn4PCKQpRD+I8b6HTA1JN1sJhBDUFICalB6XNk59KAgDolDt?= =?iso-8859-1?q?Hlp2atY+do8d6twFC23q0tPahV+TJU+sUl6wpeMluivmpB+caEPbpuz0Lz7+?= =?iso-8859-1?q?/sFgvIvyy2ZM/LGZaguU1OTYqswWjE689Jem/TFnsvypYOp4lak9aCQBHiMx?= =?iso-8859-1?q?caD1ChXBgRnrB5SHNbd9KdtNmHxQ5ugCmcQdx3ponBx7mhtjiMz8p0QVj0dI?= =?iso-8859-1?q?SBWcQAvwoZQinireSjhwO8STtXhu6Jk/+PbsoR///+D4DvQdkMnxyopS722d?= =?iso-8859-1?q?Xn2tkmnL2wxyT9mLGSheLOG7HjTjW+aAHuBocI46Zu8K6sLXhhh+BZu4XkQn?= =?iso-8859-1?q?jnd+MpYIBmyZF60Enn/HLt8oM6zqrOkUbPhOJkP69Am20yL1QRjkLXoQqIl/?= =?iso-8859-1?q?6T0YVxejQnGnBcXulZpjVRfQDfrzT9tdvthwTgiUQlsPiWZoNjAHC3y0Ftvs?= =?iso-8859-1?q?d8WtB0YQwjUY4Ty7EkR4rPgWyGAHLHHYQoZBCwxdSDwCs8b6eww/yJ+QK+kQ?= =?iso-8859-1?q?b95zLA7xau0WNxpf5QXGosymZSSH1vobM9KIOb9s2NWYleoBVbWElxkHMeCQ?= =?iso-8859-1?q?0WWryK+SkDnjx6W3KRqIgFPrlI48W1Cu2iXVS90srvofWs51i7ItMlv3gYaB?= =?iso-8859-1?q?MrrXIhRklReQRWHe1I5MdejIEkR7goYxnLTi7hOcwOGAFvaNODq+dp5qapDJ?= =?iso-8859-1?q?caK1cvPUu3k06OTNmV7Glvo2MXsyeN/HJjI6QHAjGxI20E9id3wryav2+4ch?= =?iso-8859-1?q?mDKPcQR8Z4cqArvPydrg3MvTlXKKtqASC5bjG/g9XswKMn0I6xqyxL20V0VN?= =?iso-8859-1?q?QtLNx8+9HRXPmaBZIy0381Hd5nRziRb7UUxMrxSYT3KztLzaQcO+KiT0HVRK?= =?iso-8859-1?q?8RTa5odArvNeS5t6Y+/vZ59lmNxPDYGcS42j3aFkOI16bOoZofwh1gzqiBuR?= =?iso-8859-1?q?c6jI/dzNvpLaDLYVt94BrYmzMl/gU7wWepeRTNFJxsUuXAdgatb291ABn0ZE?= =?iso-8859-1?q?kDDhF4Oa+QcKkoHw6vsJppJbaJ9+ZT3uPz+05azqS7pu6WB1IF/ywCzRywo8?= =?iso-8859-1?q?VrrD0WgYWxUCMwvKEyWZs2T2czoUkRPzlmdZAqZ4aHn0gXJFcNq6DE7ef7by?= =?iso-8859-1?q?2SAWhw3EU3HPtzeuPvSjYPJteklGGunN8TE0ShUoo5JM3VNrNhZmZCAorRq3?= =?iso-8859-1?q?dgwbsBgUkxQikBxcPgDXgTUx74n/3MyBz3jXim5det/Rm62qrAqMxc1uXRZv?= =?iso-8859-1?q?ISBNw2NyU+Er34YZ4EoL0rEVEy7lEPJtkfldTC00uCjULHCDW//CqzUjaFaH?= =?iso-8859-1?q?SqAHt0yXxEyHfAQ/LytudVizBh9iH62iw20JBbVj1qaZzuQQfrgO3isoR5tV?= =?iso-8859-1?q?3SzE57Rv0OJ8Lqte+NeTqeU3mWkDhzYI9m1gDG0odpSV99OhMMBv9yVthG5i?= =?iso-8859-1?q?vaICjE6QyESeI6FbrztOsQ/LsHON0WSAaaHUyAoLCZOuLX08VHqL3LxLb2bU?= =?iso-8859-1?q?IsCyoZxM=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: htecgroup.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MATPR09MB8627.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20a7cbc0-4d39-4c82-19c8-08dec1774f89 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2026 13:52:11.2340 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9f85665b-7efd-4776-9dfe-b6bfda2565ee X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3b2A+602lWtX+qmj+H/a2VZbda1Q3A0nsw5PJvu9zIKj0+yj0hClC30RVr3sY0Cb6gqVmzephnEpsE6lXmrKEPerS/nSFGdQdS8UEtnUaw4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR09MB4239 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLOCKED shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
riscv: Add big-endian support to string-fzi.h.
|
|
Checks
| Context | Check | Description |
|---|---|---|
| redhat-pt-bot/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
| linaro-tcwg-bot/tcwg_glibc_build--master-arm | success | Build passed |
| redhat-pt-bot/TryBot-32bit | success | Build for i686 |
| linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 | success | Build passed |
| linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 | success | Test passed |
| linaro-tcwg-bot/tcwg_glibc_check--master-arm | success | Test passed |
Commit Message
Jovan Dmitrovic
June 3, 2026, 1:52 p.m. UTC
Functions index_first and index_last should depend on endianness,
considering we are looking at raw bytes.
ChangeLog:
* sysdeps/riscv/string-fzi.h (index_first): Add big-endian
implementation.
(index_last): Likewise.
---
sysdeps/riscv/string-fzi.h | 68 ++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
Comments
* Jovan Dmitrovic: > Functions index_first and index_last should depend on endianness, > considering we are looking at raw bytes. Does big-endian RISC-V really work? I believe there's missing endianess translation for compat mode for the affinity system calls right now. What's the status of the port in Linux and the GNU toolchain? Thanks, Florian
On 6/3/26 9:52 AM, Jovan Dmitrovic wrote: > Functions index_first and index_last should depend on endianness, > considering we are looking at raw bytes. Is RISC-V BE officially supported by the ecosystem at large? We only support 2 LE variants in glibc's official ABI list: https://sourceware.org/glibc/wiki/ABIList#RISC-V
Hello everyone, thank you for the replies. We should be able to see big-endian be introduced into psABI in the near future: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/470 There are efforts across the board in order to introduce big-endian RISC-V (GCC and qemu already have support for BE). So I've sent this patch in order to get this process underway for glibc as well. There are some things that are definitely missing, but I will be sending patches as I go. Regards, Jovan On 6/8/26 15:33, Carlos O'Donell wrote: > On 6/3/26 9:52 AM, Jovan Dmitrovic wrote: >> Functions index_first and index_last should depend on endianness, >> considering we are looking at raw bytes. > > Is RISC-V BE officially supported by the ecosystem at large? > > We only support 2 LE variants in glibc's official ABI list: > https://sourceware.org/glibc/wiki/ABIList#RISC-V > > -- > Cheers, > Carlos. >
What about Linux support? Last time I checked there is no option for CPU_BIG_ENDIAN on arch/riscv and I recall that Linus was not very enthusiastic about it. Also, the pull request also states that BE support is not yet complete on gcc [1], is that the case? [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/470#issuecomment-4610611607 On 10/06/26 11:32, Jovan Dmitrovic wrote: > Hello everyone, > thank you for the replies. We should be able to see big-endian be > introduced into psABI in the near future: > > https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/470 > > There are efforts across the board in order to introduce > big-endian RISC-V (GCC and qemu already have support for BE). > So I've sent this patch in order to get this process underway > for glibc as well. There are some things that are definitely > missing, but I will be sending patches as I go. > > Regards, > Jovan > > On 6/8/26 15:33, Carlos O'Donell wrote: >> On 6/3/26 9:52 AM, Jovan Dmitrovic wrote: >>> Functions index_first and index_last should depend on endianness, >>> considering we are looking at raw bytes. >> >> Is RISC-V BE officially supported by the ecosystem at large? >> >> We only support 2 LE variants in glibc's official ABI list: >> https://sourceware.org/glibc/wiki/ABIList#RISC-V >> >> -- >> Cheers, >> Carlos. >>
On 6/10/2026 9:56 AM, Adhemerval Zanella Netto wrote: > What about Linux support? Last time I checked there is no option for > CPU_BIG_ENDIAN on arch/riscv and I recall that Linus was not very > enthusiastic about it. > > Also, the pull request also states that BE support is not yet complete > on gcc [1], is that the case? > > [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/470#issuecomment-4610611607 There's a bit of a chicken and the egg problem here. We need fixes in various places before we can test the GCC bits, including QEMU and GLIBC. I don't personally think that BE RISC-V is terribly interesting, but I wouldn't block its progress just because Linus doesn't like it. So if folks are going to step up to make work, maintain it over time, etc then we should enable them to do that. jeff
On 6/11/26 18:18, Jeffrey Law wrote: > On 6/10/2026 9:56 AM, Adhemerval Zanella Netto wrote: >> What about Linux support? Last time I checked there is no option for >> CPU_BIG_ENDIAN on arch/riscv and I recall that Linus was not very >> enthusiastic about it. >> >> Also, the pull request also states that BE support is not yet complete >> on gcc [1], is that the case? >> >> [1] >> https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/470#issuecomment-4610611607 > There's a bit of a chicken and the egg problem here. We need fixes in > various places before we can test the GCC bits, including QEMU and GLIBC. > > I don't personally think that BE RISC-V is terribly interesting, but I > wouldn't block its progress just because Linus doesn't like it. So if > folks are going to step up to make work, maintain it over time, etc then > we should enable them to do that. > > jeff Thanks Jeff for your support, our team is interested in making this work. Once the psABI proposal is finalized, we will post patches for both GCC and LLVM backend, considering we merged the LLVM codegen support for RISC-V last year [1]. Also, QEMU support is finalized [2], we are only waiting for that series to be merged to master. Regards, Jovan [1] https://github.com/llvm/llvm-project/pull/172668 [2] https://lists.nongnu.org/archive/html/qemu-devel/2026-05/msg07505.html
On 11/06/26 13:18, Jeffrey Law wrote: > > > On 6/10/2026 9:56 AM, Adhemerval Zanella Netto wrote: >> What about Linux support? Last time I checked there is no option for >> CPU_BIG_ENDIAN on arch/riscv and I recall that Linus was not very >> enthusiastic about it. >> >> Also, the pull request also states that BE support is not yet complete >> on gcc [1], is that the case? >> >> [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/470#issuecomment-4610611607 > There's a bit of a chicken and the egg problem here. We need fixes in various places before we can test the GCC bits, including QEMU and GLIBC. > > I don't personally think that BE RISC-V is terribly interesting, but I wouldn't block its progress just because Linus doesn't like it. So if folks are going to step up to make work, maintain it over time, etc then we should enable them to do that. Is not really a block, but our current policy is to only enable ABIs that are currently supported or planed by Linux. We used the same criteria to remove ia64, even when people keep of-of-tree patch to keep it alive. Also, some time ago I installed some mipsr6 support, only to found out later that it was not even properly supported by the toolchain (and I am not even sure if/when it will be). I think when Linus has it on linux-next, or similar maintainer tree to inclusion, it would be less contentious to install the initial support.
diff --git a/sysdeps/riscv/string-fzi.h b/sysdeps/riscv/string-fzi.h index 613e5789e4..0eba3c8c6a 100644 --- a/sysdeps/riscv/string-fzi.h +++ b/sysdeps/riscv/string-fzi.h @@ -26,6 +26,73 @@ instead of calling compiler auxiliary functions. */ # include <string-optype.h> +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +static __always_inline unsigned int +index_first (find_t c) +{ + if (sizeof (op_t) == 8) + { + if (c & 0x8000000000000000UL) + return 0; + if (c & 0x80000000000000UL) + return 1; + if (c & 0x800000000000UL) + return 2; + if (c & 0x8000000000UL) + return 3; + if (c & 0x80000000UL) + return 4; + if (c & 0x800000UL) + return 5; + if (c & 0x8000UL) + return 6; + return 7; + } + else + { + if (c & 0x80000000U) + return 0; + if (c & 0x800000U) + return 1; + if (c & 0x8000U) + return 2; + return 3; + } +} + +static __always_inline unsigned int +index_last (find_t c) +{ + if (sizeof (op_t) == 8) + { + if (c & 0x80UL) + return 7; + if (c & 0x8000UL) + return 6; + if (c & 0x800000UL) + return 5; + if (c & 0x80000000UL) + return 4; + if (c & 0x8000000000UL) + return 3; + if (c & 0x800000000000UL) + return 2; + if (c & 0x80000000000000UL) + return 1; + return 0; + } + else + { + if (c & 0x80U) + return 3; + if (c & 0x8000U) + return 2; + if (c & 0x800000U) + return 1; + return 0; + } +} +# else static __always_inline unsigned int index_first (find_t c) { @@ -72,6 +139,7 @@ index_last (find_t c) return 1; return 0; } +# endif /* __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ */ #endif #endif /* STRING_FZI_H */