Skip to content

Commit

Permalink
RISC-V: Add intrinsics testcases for SiFive Xsfvcp extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
yulong18 committed Dec 9, 2024
1 parent c646364 commit 865eb47
Show file tree
Hide file tree
Showing 28 changed files with 9,543 additions and 0 deletions.
189 changes: 189 additions & 0 deletions gcc/testsuite/gcc.target/riscv/rvv/xsfvector/sf_vc_fv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv_xsfvcp -mabi=lp64d -O3" } */
/* { dg-final { check-function-bodies "**" "" } } */

#include "riscv_vector.h"

typedef _Float16 float16_t;
typedef float float32_t;
typedef double float64_t;

/*
** test_sf_vc_fv_se_u16mf4:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u16mf4(const int bit_field26, const int bit_field11_7, vuint16mf4_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u16mf4(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u16mf2:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u16mf2(const int bit_field26, const int bit_field11_7, vuint16mf2_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u16mf2(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u16m1:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u16m1(const int bit_field26, const int bit_field11_7, vuint16m1_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u16m1(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u16m2:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u16m2(const int bit_field26, const int bit_field11_7, vuint16m2_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u16m2(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u16m4:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u16m4(const int bit_field26, const int bit_field11_7, vuint16m4_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u16m4(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u16m8:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u16m8(const int bit_field26, const int bit_field11_7, vuint16m8_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u16m8(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u32mf2:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u32mf2(const int bit_field26, const int bit_field11_7, vuint32mf2_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u32mf2(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u32m1:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u32m1(const int bit_field26, const int bit_field11_7, vuint32m1_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u32m1(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u32m2:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u32m2(const int bit_field26, const int bit_field11_7, vuint32m2_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u32m2(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u32m4:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u32m4(const int bit_field26, const int bit_field11_7, vuint32m4_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u32m4(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u32m8:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u32m8(const int bit_field26, const int bit_field11_7, vuint32m8_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u32m8(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u64m1:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u64m1(const int bit_field26, const int bit_field11_7, vuint64m1_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u64m1(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u64m2:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u64m2(const int bit_field26, const int bit_field11_7, vuint64m2_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u64m2(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u64m4:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u64m4(const int bit_field26, const int bit_field11_7, vuint64m4_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u64m4(bit_field26, bit_field11_7, vs2, fs1, vl);
}

/*
** test_sf_vc_fv_se_u64m8:
** ...
** sf\.vc\.fv\t[0-9]+,[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fv_se_u64m8(const int bit_field26, const int bit_field11_7, vuint64m8_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fv_se_u64m8(bit_field26, bit_field11_7, vs2, fs1, vl);
}
190 changes: 190 additions & 0 deletions gcc/testsuite/gcc.target/riscv/rvv/xsfvector/sf_vc_fvv.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64gcv_xsfvcp -mabi=lp64d -O3" } */
/* { dg-final { check-function-bodies "**" "" } } */

#include "riscv_vector.h"

typedef _Float16 float16_t;
typedef float float32_t;
typedef double float64_t;


/*
** test_sf_vc_fvv_se_u16mf4:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u16mf4(const int bit_field26, vuint16mf4_t vd, vuint16mf4_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u16mf4(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u16mf2:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u16mf2(const int bit_field26, vuint16mf2_t vd, vuint16mf2_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u16mf2(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u16m1:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u16m1(const int bit_field26, vuint16m1_t vd, vuint16m1_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u16m1(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u16m2:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u16m2(const int bit_field26, vuint16m2_t vd, vuint16m2_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u16m2(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u16m4:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u16m4(const int bit_field26, vuint16m4_t vd, vuint16m4_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u16m4(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u16m8:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u16m8(const int bit_field26, vuint16m8_t vd, vuint16m8_t vs2, float16_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u16m8(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u32mf2:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u32mf2(const int bit_field26, vuint32mf2_t vd, vuint32mf2_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u32mf2(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u32m1:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u32m1(const int bit_field26, vuint32m1_t vd, vuint32m1_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u32m1(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u32m2:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u32m2(const int bit_field26, vuint32m2_t vd, vuint32m2_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u32m2(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u32m4:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u32m4(const int bit_field26, vuint32m4_t vd, vuint32m4_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u32m4(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u32m8:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u32m8(const int bit_field26, vuint32m8_t vd, vuint32m8_t vs2, float32_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u32m8(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u64m1:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u64m1(const int bit_field26, vuint64m1_t vd, vuint64m1_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u64m1(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u64m2:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u64m2(const int bit_field26, vuint64m2_t vd, vuint64m2_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u64m2(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u64m4:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u64m4(const int bit_field26, vuint64m4_t vd, vuint64m4_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u64m4(bit_field26, vd, vs2, fs1, vl);
}

/*
** test_sf_vc_fvv_se_u64m8:
** ...
** sf\.vc\.fvv\t[0-9]+,v[0-9]+,v[0-9]+,fa[0-9]+
** ...
*/

void test_sf_vc_fvv_se_u64m8(const int bit_field26, vuint64m8_t vd, vuint64m8_t vs2, float64_t fs1, size_t vl)
{
__riscv_sf_vc_fvv_se_u64m8(bit_field26, vd, vs2, fs1, vl);
}
Loading

0 comments on commit 865eb47

Please sign in to comment.