Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Risc-V Vector Intrinsic Support #642

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Aug 8, 2023

  1. Introduce Risc-V Vector Intrinsic Support

    The Risc-V ISA has an optional "V" extension for vector support. This patch
    introduces vector accelerated routines for the following methods:
     + local_lpc_compute_autocorrelation
     + local_lpc_compute_residual_from_qlp_coefficients
    
    This patch disables building with Risc-V Vector support. It can be enabled
    using `--enable-riscv-vector-optimizations` in autotools or `-DRISCV_VECTOR=ON`
    using cmake.
    
    Building with vector support is disabled by default because the patch was tested
    only on QEMU for now for correctness.
    
    Limitations:
     + RiscV vector support is limited to very modern compilers (Clang 16 or later)
       for the time being
     + The width of each vector element on Risc-V is configurable by the silicon
       vendor. This patch assumes a reasonable width of at least 128 bits per vector
       register for now.
    
    Future Work:
     + Only local_lpc_compute_residual_from_qlp_coefficients has been optimized for
       now and the implementation was based heavily on the Intel AVX implementation.
       There is likely a more idiomatic Risc-V implementation that is feasible.
    gkalsi committed Aug 8, 2023
    Configuration menu
    Copy the full SHA
    a9617fb View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2023

  1. Introduce Dynamic Detection of RiscV Vector Unit

    This patch dynamically detects whether the RiscV vector unit
    is available and only enables the intrinsic routines if it is.
    
    Tested by launching QEMU with the Vector Extensions enabled
    and disabled and observed that the intrinsic routines were
    only patched in when vector was enabled.
    gkalsi committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    3da085e View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2023

  1. Test for riscv_vector before calling __riscv_vsetvlmax_e8m1

    This was causing a build failure if riscv_vector was not available
    on the system.
    gkalsi committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    3f70de0 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2023

  1. Correctly detect riscv_vector.h using "-march=rv64gcv"

    When detecting "riscv_vector.h" using autotools and cmake,
    invoke the toolchain with -march=rv64gcv.
    gkalsi committed Aug 17, 2023
    Configuration menu
    Copy the full SHA
    b9e0a83 View commit details
    Browse the repository at this point in the history