RVV
This commit is contained in:
parent
f0becd1582
commit
35091b2c53
5 changed files with 322 additions and 12 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
A C++23 math library for the Crafter engine, distributed as a set of C++ modules. Provides generic vector and matrix types alongside SIMD-specialized fixed-size vectors for `float` and `_Float16`, plus a small set of ray intersection routines.
|
||||
|
||||
The library is hardware-aware: it picks the widest SIMD path the target supports (SSE / AVX / AVX-512 on x86_64, SIMD128 on WebAssembly) and falls back to scalar code elsewhere.
|
||||
The library is hardware-aware: it picks the widest SIMD path the target supports (SSE / AVX / AVX-512 on x86_64, RVV on RISC-V, SIMD128 on WebAssembly) and falls back to scalar code elsewhere.
|
||||
|
||||
## Modules
|
||||
|
||||
|
|
@ -49,12 +49,16 @@ This project uses [Crafter.Build](https://forgejo.catcrafts.net/Catcrafts/Crafte
|
|||
- `Vector-sapphirerapids` — AVX-512 with FP16 (`-march=sapphirerapids`)
|
||||
- `Vector-x86-64-v4` — AVX-512 baseline
|
||||
- `Vector-x86-64-v3` — AVX2 baseline
|
||||
- `Vector-rv64gcv_zvl512b` — RVV with VLEN≥512 (uses the 64-byte tier)
|
||||
- `Vector-rv64gcv_zvl256b` — RVV with VLEN≥256 (32-byte tier)
|
||||
- `Vector-rv64gcv` — RVA23 baseline ZVL128B (16-byte tier)
|
||||
|
||||
Build and run tests via your usual Crafter.Build entry point; `build/` and `bin/` are git-ignored.
|
||||
|
||||
## Target support
|
||||
|
||||
- **x86_64**: SSE / AVX / AVX-512F selected per target; AVX512-FP16 is required for native `VectorF16` (otherwise it aliases `VectorF32`). F16C is used for fp16 ↔ fp32 conversion when available.
|
||||
- **RISC-V**: RVV 1.0 (the `V` extension, ratified Nov 2021, mandatory in the RVA23 profile). Storage is a 16/32/64-byte GNU vector picked at compile time from the guaranteed VLEN (`__riscv_v_fixed_vlen` from Clang's `-mrvv-vector-bits=`, else `__riscv_v_min_vlen` from the march's `Zvl*` suffix, else the ZVL128B baseline). `VectorF16` aliases `VectorF32` until a `Zvfh` path lands.
|
||||
- **WebAssembly**: `wasm_simd128.h` 128-bit path; SIMD width is capped at 16 bytes.
|
||||
- **Other targets**: scalar fallback via `std::array<T, N>`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue