This is an archive of the discontinued LLVM Phabricator instance.

[libc] Support more functions in riscv
ClosedPublic

Authored by mikhail.ramalho on Mar 6 2023, 3:46 PM.

Diff Detail

Event Timeline

mikhail.ramalho created this revision.Mar 6 2023, 3:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 3:46 PM
mikhail.ramalho requested review of this revision.Mar 6 2023, 3:46 PM
mikhail.ramalho edited the summary of this revision. (Show Details)Mar 6 2023, 3:46 PM
mikhail.ramalho edited the summary of this revision. (Show Details)

Out of more than 1600 tests (that run in my x86_64 machine), this patch enables 1057 of them.

mikhail.ramalho edited the summary of this revision. (Show Details)Mar 6 2023, 3:49 PM

Also, sorry for the big patch, the next ones shall be smaller/more directed to individual lib support.

Fixed copy & paste error in FMA.h:

LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_FMA_H should've been LLVM_LIBC_SRC_SUPPORT_FPUTIL_RISCV64_FMA_H.

Hi, thanks for the patch. You have included thread functions but do they build and pass? Their linux implementation is very closely tied to the startup implementation which you have not included in this patch.

Also, can you split this up so that it is easy for me to test? Likewise, send the changes doing cleanups separately.

Also, can you split this up so that it is easy for me to test? Likewise, send the changes doing cleanups separately.

Sure, I'll split it and send the smaller ones tomorrow!

Two keep it easy to test and rollout, lets also first only add non-fullbuild functions. I have patches ready for this but since you have sent it before me, I will wait for you to send them out. For the syscall implementation in riscv64/syscall.h, lets follow the aarch64/syscall.h pattern.

mikhail.ramalho retitled this revision from [libc] Enable riscv support of more functions to [libc] Support more functions in riscv.
mikhail.ramalho edited the summary of this revision. (Show Details)

Removed code implemented by D145452 and D145496

Enable math libs now that we have a working fenv

Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 8:22 AM

Hi,

Can you separate this out into following patches:

  1. Just simple expansion of entrypoints.txt with functions that can now be included without any other changes. Do not include any commented out functions.
  2. FMA patch.
  3. sqrt patch.
  4. Adding riscv fenv_t and singal.h macros. Enable full build also with this patch.

Thanks,
Siva Chandra

split the patch: this only adds the new supported functions now

Hi,

Can you separate this out into following patches:

  1. Just simple expansion of entrypoints.txt with functions that can now be included without any other changes. Do not include any commented out functions.
  2. FMA patch.
  3. sqrt patch.
  4. Adding riscv fenv_t and singal.h macros. Enable full build also with this patch.

Thanks,
Siva Chandra

No problem!

I only left the commented sin, cos and tan, if that's alright.

Added sched include

sivachandra edited the summary of this revision. (Show Details)Mar 8 2023, 9:41 AM
sivachandra accepted this revision.Mar 8 2023, 9:43 AM

Hi,

Can you separate this out into following patches:

  1. Just simple expansion of entrypoints.txt with functions that can now be included without any other changes. Do not include any commented out functions.
  2. FMA patch.
  3. sqrt patch.
  4. Adding riscv fenv_t and singal.h macros. Enable full build also with this patch.

Thanks,
Siva Chandra

No problem!

I only left the commented sin, cos and tan, if that's alright.

I see more functions commented out. Commenting out is fine as long as we include a good reason why it has been commented out.

This revision is now accepted and ready to land.Mar 8 2023, 9:43 AM

Enable snprintf

Feel free to land with the simpler description I have edited to.