shibatch / sleef

SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
https://sleef.org
Boost Software License 1.0
628 stars 126 forks source link

Clean up RVV register composition. #521

Closed sh1boot closed 5 months ago

sh1boot commented 6 months ago

Prefer use of __riscvvcreate*() intrinsics, where appropriate. This does away with piecemeal assembly of a tuple register types and ensures that every component is defined. It also gets rid of uninitialised variable warnings.

__riscv_vcreate intrinsics aren't available in older toolchains but will be available in version 1.0 of the intrinsics interface. In the interim include substitute macros which try to fill the gap as best as possible.

Use a regular pattern of cast-then-insert, and extract-then-cast when dealing with tuple registers with mixed component types.

Remove a few unused macros, etc..

sh1boot commented 6 months ago

This contains a portion of #503, and fits underneath that PR and on top of #520, so that each can be reviewed in isolation.

Diff from #520: https://github.com/rivosinc/sleef/compare/dev/shosie/fix-rvv-masks...dev/shosie/fix-rvv-warnings

blapie commented 5 months ago

It looks like there are some conflicts? Did I mess it up by merging #520 first, or do you need to rebase your PR after each merge?

sh1boot commented 5 months ago

I'm not very clear on the best flow with staging multiple dependent PRs on github. I've rebased this change, and I guess I'll rebase the others once this merges, too.