* Bug in gcc and gas
@ 2023-08-25 11:43 jacob navia
0 siblings, 0 replies; only message in thread
From: jacob navia @ 2023-08-25 11:43 UTC (permalink / raw)
To: binutils
[-- 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-25 11:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25 11:43 Bug in gcc and gas jacob navia
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).