ruyisdk / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.
http://llvm.org
Other
9 stars 5 forks source link

use of undeclared identifier '__riscv_vloxei32_v_f32m8' #132

Open nihui opened 4 weeks ago

nihui commented 4 weeks ago

4ca21d5b5ec006ab1bb12f41c22ba0e49314c0d7 origin/rebase-17.0.6

$ ./clang -c test.cpp -o test.o -march=rv64gc_zfh_xtheadvector
test.cpp:23:12: error: use of undeclared identifier '__riscv_vloxei32_v_f32m8'
   23 |     return __riscv_vloxei32_v_f32m8(ptr, bindex, vl);
      |            ^
1 error generated.
#include <riscv_vector.h>

vfloat32m8_t __riscv_vle32_v_f32m8_f32m1(const float* ptr)
{
    const int packn = 4;
    const size_t vl = __riscv_vsetvl_e32m8(packn * 8);

    // NOTE vloxei8_v_f32m8 gets illegal instruction on d1  --- nihui

    // 128bit
    static const uint32_t index_128bit[32] = {
        0, 4, 8, 12,
        0, 4, 8, 12,
        0, 4, 8, 12,
        0, 4, 8, 12,
        0, 4, 8, 12,
        0, 4, 8, 12,
        0, 4, 8, 12,
        0, 4, 8, 12
    };

    vuint32m8_t bindex = __riscv_vle32_v_u32m8(index_128bit, vl);
    return __riscv_vloxei32_v_f32m8(ptr, bindex, vl);
}
nihui commented 4 weeks ago

gcc-15 works fine with ./riscv64-unknown-linux-gnu-g++ -c test.cpp -o test.o -march=rv64gc_zfh_xtheadvector