Hi Matthias: Sure, backported to gcc 10 branch, let's wait 10.3 :)
On Mon, Mar 1, 2021 at 4:17 PM Matthias Klose <d...@ubuntu.com> wrote: > > On 7/8/20 9:59 PM, Jim Wilson wrote: > > On Tue, Jul 7, 2020 at 2:52 AM Kito Cheng <kito.ch...@sifive.com> wrote: > >> gcc/ChangeLog: > >> * gcc/config/riscv/riscv.md (): New. > >> (TP_REGNUM): Ditto. > >> * doc/extend.texi (Target Builtins): Add RISC-V built-in section. > >> Document __builtin_thread_pointer. > >> gcc/testsuite/ChangeLog: > >> * gcc.target/riscv/read-thread-pointer.c: New. > > > > It looks OK to me in general. > > > > You added builtin_thread_pointer but not builtin_set_thread_pointer. > > Maybe we should implement both as long as we are implementing one? If > > clang only implements one, maybe it should implement the other also? > > This doesn't have to be part of this patch. This could be a separate > > issue. > > > > The builtin_thread_pointer docs looks out-of-date. It is documented > > for alpha and SH, but it is implemented in gcc/builtins.c not in the > > backends. A scan of md files show that quite a few targets support it > > but don't document it. I think it should be documented in the generic > > builtins section not in the target dependent builtins sections with > > some language that says not all targets support it. This doesn't have > > to be part of this patch. This could be a separate issue. > > > > We have two existing undocumented builtins. __builtin_riscv_fsflags > > and __builtin_riscv_frflags for setting or reading the FP flags. I > > don't know if anyone uses them though. newlib and glbic both use > > extended asms for these operations. This doesn't have to be part of > > this patch. This could be a separate issue. > > > > There is a document https://github.com/riscv/riscv-c-api-doc for > > coordinating gcc and llvm work that has an empty list of builtin > > functions. I'm not sure if this document is still useful. If this is > > a RISC-V specific builtin then it should be listed here, but I don't > > think it should be considered a RISC-V specific builtin. There is an > > unresolved pull request for the frflags and fsflags builtins. I guess > > I forgot about that. > > > > Jim > > LLVM 12 now uses __builtin_thread_pointer, and fails to build with GCC 10 (but > builds with GCC 11). Could you consider backporting this one to GCC 10? > > Thanks, Matthias