From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-19.smtpout.orange.fr [80.12.242.19]) by sourceware.org (Postfix) with ESMTPS id BA73B3858C62 for ; Fri, 25 Aug 2023 11:43:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA73B3858C62 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jacob.remcomp.fr Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jacob.remcomp.fr Received: from smtpclient.apple ([90.22.252.13]) by smtp.orange.fr with ESMTPS id ZVE4qDxkKOQiUZVE5qN1ha; Fri, 25 Aug 2023 13:43:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1692963821; bh=zG58/37V2k2epLP9zQ78PzjqvzsP3GZvvc+YGGsRpdA=; h=From:Subject:Date:To; b=e2dG4+tuZLNuAlJTK1/PAMe2USMdb44Y33MVzUv+DM8rRabYi0Jw9vblaR5qAde4u OvdcqE++4es37u3wJa4FnyWL/0RNQW8m31NdmtadYEOh8lBAUcUKL0BH1NtiSjRxJf 3dRFWF7VWpVO2A0EqV7srkYDp/pGb/jYusMrPUN1qoOUaUxxwFCL06rr0w1kY4nonX 5953d3ebb4Y51tuy3t14Th7SJLIWShWhI+utkn2DNsFDTS09Tqw3teOt6j+1Fr4ewA FwazDAaSEluJk6OXVwnACD3WbeJjBhUSgm0n5m99PbPMY5pc5xv+KiFXF/Y6wp6BOR DRNO4Mf2HrA4Q== X-ME-Helo: smtpclient.apple X-ME-Date: Fri, 25 Aug 2023 13:43:41 +0200 X-ME-IP: 90.22.252.13 From: jacob navia Content-Type: multipart/alternative; boundary="Apple-Mail=_D447821C-3666-4F26-8D26-4386EA4A9090" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Bug in gcc and gas Message-Id: <2F223F84-886F-489D-921C-BF9A6F6A7AA5@jacob.remcomp.fr> Date: Fri, 25 Aug 2023 13:43:30 +0200 To: binutils@sourceware.org X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,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: --Apple-Mail=_D447821C-3666-4F26-8D26-4386EA4A9090 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Neither gcc nor gas recognize the Zbb and Zba instructions under linux. You have to force gcc with:, "march=3Drv64gc_zbb =C2=BB This is an undocumented option. The processor is an Sifive U74 and in the documentation of that processor t= hose instructions are present. star64:~/tiny-asm$ uname -a Linux star64 5.15.115 #1 SMP Sat Jun 10 09:56:27 UTC 2023 riscv64 riscv64 r= iscv64 GNU/Linux All versions of gcc up to 13 have this bug. Maybe the problem is not with gcc but with linux itself: star64:~/tiny-asm$ cat /proc/cpuinfo processor : 0 hart : 1 isa : rv64imafdc mmu : sv39 isa-ext :=20 uarch : sifive,u74-mc =E2=80=A6 In the =C2=AB Isa =C2=BB entry, those extensions are absent. This is a general problem with riscv. How can a user program know which CPU= extensions are installed in the processor? There is a dedicated register that would be possible to query the register M-mode instruction set architecture register (misa) But this is possible only in M mode. Should the libc in riscv develop a spe= cial function that returns the value of this register? Would it be possible= or that would need a device driver if there isn=E2=80=99t any system call = that would do that? Jacob= --Apple-Mail=_D447821C-3666-4F26-8D26-4386EA4A9090--