Skip to content

[RISC-V] attribute target arch=+zvkn doesn't add builtins #121603

Open
@antonblanchard

Description

@antonblanchard

All of these fail when building with -march=rv64gc:

#include <riscv_vector.h>

__attribute__((target("arch=+v,+zvkn")))
vuint32m4_t testcase1(vuint32m4_t pt, vuint32m1_t rk, size_t vl)
{
        return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
}

__attribute__((target("arch=+v,+zvknc")))
vuint32m4_t testcase2(vuint32m4_t pt, vuint32m1_t rk, size_t vl)
{
        return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
}

__attribute__((target("arch=+v,+zvkned")))
vuint32m4_t testcase3(vuint32m4_t pt, vuint32m1_t rk, size_t vl)
{
        return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
}

__attribute__((target("arch=+v,+zvkng")))
vuint32m4_t testcase4(vuint32m4_t pt, vuint32m1_t rk, size_t vl)
{
        return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
}

with:

zvkned.c:6:9: error: call to undeclared function '__riscv_vaesz_vs_u32m1_u32m4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    6 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^
zvkned.c:6:9: error: returning 'int' from a function with incompatible result type 'vuint32m4_t' (aka '__rvv_uint32m4_t')
    6 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zvkned.c:12:9: error: call to undeclared function '__riscv_vaesz_vs_u32m1_u32m4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   12 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^
zvkned.c:12:9: error: returning 'int' from a function with incompatible result type 'vuint32m4_t' (aka '__rvv_uint32m4_t')
   12 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zvkned.c:18:9: error: call to undeclared function '__riscv_vaesz_vs_u32m1_u32m4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   18 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^
zvkned.c:18:9: error: returning 'int' from a function with incompatible result type 'vuint32m4_t' (aka '__rvv_uint32m4_t')
   18 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zvkned.c:24:9: error: call to undeclared function '__riscv_vaesz_vs_u32m1_u32m4'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   24 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^
zvkned.c:24:9: error: returning 'int' from a function with incompatible result type 'vuint32m4_t' (aka '__rvv_uint32m4_t')
   24 |         return __riscv_vaesz_vs_u32m1_u32m4(pt, rk, vl);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 errors generated.

It works with -march=rv64gcv_zvkn

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions