riscv-non-isa / rvv-intrinsic-doc

https://jira.riscv.org/browse/RVG-153
BSD 3-Clause "New" or "Revised" License
287 stars 90 forks source link

Define BFloat16 intrinsics #293

Closed eopXD closed 4 months ago

eopXD commented 11 months ago

NOTE: This PR currently is based upon #292

NOTE: These new intrinsics introduced are not part of the to-be-frozen v1.0 intrinsics specification. These new intrinsics will not be cherry-picked to the v1.0.x branch.

This pull request defines intrinsics for vector bfloat16 type manipulations and vector instructions that are introduced by the RISC-V BFloat16 instruction set extensions (zvfbfmin and zvfbfwma) [0].

Intrinsics introduced for vector bfloat16 type manipulation:

New intrinsics are added to expose new instructions introduced:

[0] https://github.com/riscv/riscv-bfloat16

dzaima commented 11 months ago

Shouldn't __riscv_vreinterpret_v_ui16m1_bf16m1 be __riscv_vreinterpret_v_u16m1_bf16m1 (i.e. u16 instead of ui16) as it is in all current vuint16m1_t type abbreviations?

kito-cheng commented 11 months ago

https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#cc-type-sizes-and-alignments

__bf16 has used in psABI, but we may also need to add that to c-api-doc https://github.com/riscv-non-isa/riscv-c-api-doc/blob/master/riscv-c-api.md for more complete documentation for that type.

eopXD commented 11 months ago

Rebase and addressed comments from @dzaima, thank you for pointing this out. @kito-cheng I'll leave it to you to add some descriptions somewhere in the C api document and we'll then cite them here.

4vtomat commented 5 months ago

I'll take over and proceed this patch!