RISC-V: Add __RISCV_ prefix to VXRM and FRM enum
According to doc: https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/222/files https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/226 Add __RISCV_ prefix to VXRM and FRM enum. gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (DEF_RVV_VXRM_ENUM): Add __RISCV_ prefix. (DEF_RVV_FRM_ENUM): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/frm-1.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-1.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-10.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-11.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-12.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-6.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-7.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-8.c: Ditto. * gcc.target/riscv/rvv/base/vxrm-9.c: Ditto.
This commit is contained in:
parent
91430b73a0
commit
d5ea84cdd9
10 changed files with 31 additions and 31 deletions
|
@ -4026,11 +4026,11 @@ register_vxrm ()
|
|||
{
|
||||
auto_vec<string_int_pair, 4> values;
|
||||
#define DEF_RVV_VXRM_ENUM(NAME, VALUE) \
|
||||
values.quick_push (string_int_pair ("VXRM_" #NAME, VALUE));
|
||||
values.quick_push (string_int_pair ("__RISCV_VXRM_" #NAME, VALUE));
|
||||
#include "riscv-vector-builtins.def"
|
||||
#undef DEF_RVV_VXRM_ENUM
|
||||
|
||||
lang_hooks.types.simulate_enum_decl (input_location, "RVV_VXRM", &values);
|
||||
lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_VXRM", &values);
|
||||
}
|
||||
|
||||
/* Register the frm enum. */
|
||||
|
@ -4039,11 +4039,11 @@ register_frm ()
|
|||
{
|
||||
auto_vec<string_int_pair, 5> values;
|
||||
#define DEF_RVV_FRM_ENUM(NAME, VALUE) \
|
||||
values.quick_push (string_int_pair ("FRM_" #NAME, VALUE));
|
||||
values.quick_push (string_int_pair ("__RISCV_FRM_" #NAME, VALUE));
|
||||
#include "riscv-vector-builtins.def"
|
||||
#undef DEF_RVV_FRM_ENUM
|
||||
|
||||
lang_hooks.types.simulate_enum_decl (input_location, "RVV_FRM", &values);
|
||||
lang_hooks.types.simulate_enum_decl (input_location, "__RISCV_FRM", &values);
|
||||
}
|
||||
|
||||
/* Implement #pragma riscv intrinsic vector. */
|
||||
|
|
|
@ -5,27 +5,27 @@
|
|||
|
||||
size_t f0 ()
|
||||
{
|
||||
return FRM_RNE;
|
||||
return __RISCV_FRM_RNE;
|
||||
}
|
||||
|
||||
size_t f1 ()
|
||||
{
|
||||
return FRM_RTZ;
|
||||
return __RISCV_FRM_RTZ;
|
||||
}
|
||||
|
||||
size_t f2 ()
|
||||
{
|
||||
return FRM_RDN;
|
||||
return __RISCV_FRM_RDN;
|
||||
}
|
||||
|
||||
size_t f3 ()
|
||||
{
|
||||
return FRM_RUP;
|
||||
return __RISCV_FRM_RUP;
|
||||
}
|
||||
|
||||
size_t f4 ()
|
||||
{
|
||||
return FRM_RMM;
|
||||
return __RISCV_FRM_RMM;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*0} 1} } */
|
||||
|
|
|
@ -5,22 +5,22 @@
|
|||
|
||||
size_t f0 ()
|
||||
{
|
||||
return VXRM_RNU;
|
||||
return __RISCV_VXRM_RNU;
|
||||
}
|
||||
|
||||
size_t f1 ()
|
||||
{
|
||||
return VXRM_RNE;
|
||||
return __RISCV_VXRM_RNE;
|
||||
}
|
||||
|
||||
size_t f2 ()
|
||||
{
|
||||
return VXRM_RDN;
|
||||
return __RISCV_VXRM_RDN;
|
||||
}
|
||||
|
||||
size_t f3 ()
|
||||
{
|
||||
return VXRM_ROD;
|
||||
return __RISCV_VXRM_ROD;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-times {li\s+[a-x0-9]+,\s*0} 1} } */
|
||||
|
|
|
@ -8,16 +8,16 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i, v3, 4);
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i + 1000, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i + 1000, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RNE, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RNE, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RNE, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RNE, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i + 1000, v3, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
fn ();
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i, v3, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,9 +8,9 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
asm volatile ("csrwi\tvxrm,1");
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i, v3, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
{
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100, v3, 4);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
{
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RNE, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RNE, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100, v3, 4);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i, v3, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ void f (void * in, void *out, int32_t x, int n, int m)
|
|||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i, v3, 4);
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
vint32m1_t v = __riscv_vle32_v_i32m1 (in + i + 1000, 4);
|
||||
vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in + 100 + i + 1000, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, VXRM_RDN, 4);
|
||||
vint32m1_t v3 = __riscv_vaadd_vx_i32m1 (v2, 0, __RISCV_VXRM_RDN, 4);
|
||||
v3 = __riscv_vaadd_vx_i32m1 (v3, 3, __RISCV_VXRM_RDN, 4);
|
||||
__riscv_vse32_v_i32m1 (out + 100 + i + 1000, v3, 4);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue