public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: jacob navia <jacob@jacob.remcomp.fr>
To: binutils@sourceware.org
Subject: Bug in gcc and gas
Date: Fri, 25 Aug 2023 13:43:30 +0200	[thread overview]
Message-ID: <2F223F84-886F-489D-921C-BF9A6F6A7AA5@jacob.remcomp.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

Hi
Neither gcc nor gas recognize the Zbb and Zba instructions under linux.
You have to force gcc with:, "march=rv64gc_zbb »

This is an undocumented option.

The processor is an Sifive U74 and in the documentation of that processor those 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 riscv64 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		: 
uarch		: sifive,u74-mc

…


In the « Isa » 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 special function that returns the value of this register? Would it be possible or that would need a device driver if there isn’t any system call that would do that?

Jacob

                 reply	other threads:[~2023-08-25 11:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2F223F84-886F-489D-921C-BF9A6F6A7AA5@jacob.remcomp.fr \
    --to=jacob@jacob.remcomp.fr \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).