RISC-V: Add the mini support for SiFive extensions.

This patch add the mini support for xsfvqmaccqoq, xsfvqmaccdod and
 xsfvfnrclipxfqf extensions.

gcc/ChangeLog:

	* common/config/riscv/riscv-common.cc: New.
	* config/riscv/riscv.opt: New.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/predef-sf-3.c: New test.
	* gcc.target/riscv/predef-sf-4.c: New test.
	* gcc.target/riscv/predef-sf-5.c: New test.
This commit is contained in:
yulong 2024-11-17 17:55:30 +08:00 committed by Kito Cheng
parent 065433b4ce
commit 139bd3198a
5 changed files with 54 additions and 0 deletions

View File

@ -430,6 +430,9 @@ static const struct riscv_ext_version riscv_ext_version_table[] =
{"xsfvcp", ISA_SPEC_CLASS_NONE, 1, 0},
{"xsfcease", ISA_SPEC_CLASS_NONE, 1, 0},
{"xsfvqmaccqoq", ISA_SPEC_CLASS_NONE, 1, 0},
{"xsfvqmaccdod", ISA_SPEC_CLASS_NONE, 1, 0},
{"xsfvfnrclipxfqf", ISA_SPEC_CLASS_NONE, 1, 0},
/* Terminate the list. */
{NULL, ISA_SPEC_CLASS_NONE, 0, 0}
@ -1759,6 +1762,9 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] =
RISCV_EXT_FLAG_ENTRY ("xsfvcp", x_riscv_sifive_subext, MASK_XSFVCP),
RISCV_EXT_FLAG_ENTRY ("xsfcease", x_riscv_sifive_subext, MASK_XSFCEASE),
RISCV_EXT_FLAG_ENTRY ("xsfvqmaccqoq", x_riscv_sifive_subext, MASK_XSFVQMACCQOQ),
RISCV_EXT_FLAG_ENTRY ("xsfvqmaccdod", x_riscv_sifive_subext, MASK_XSFVQMACCDOD),
RISCV_EXT_FLAG_ENTRY ("xsfvfnrclipxfqf", x_riscv_sifive_subext, MASK_XSFVFNRCLIPXFQF),
{NULL, NULL, NULL, 0}
};

View File

@ -523,6 +523,12 @@ Mask(XSFVCP) Var(riscv_sifive_subext)
Mask(XSFCEASE) Var(riscv_sifive_subext)
Mask(XSFVQMACCQOQ) Var(riscv_sifive_subext)
Mask(XSFVQMACCDOD) Var(riscv_sifive_subext)
Mask(XSFVFNRCLIPXFQF) Var(riscv_sifive_subext)
TargetVariable
int riscv_fmv_priority = 0

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64g_xsfvqmaccqoq -mabi=lp64" } */
int main () {
#if !defined(__riscv)
#error "__riscv"
#endif
#if !defined(__riscv_xsfvqmaccqoq)
#error "__riscv_xsfvqmaccqoq"
#endif
return 0;
}

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64g_xsfvqmaccdod -mabi=lp64" } */
int main () {
#if !defined(__riscv)
#error "__riscv"
#endif
#if !defined(__riscv_xsfvqmaccdod)
#error "__riscv_xsfvqmaccdod"
#endif
return 0;
}

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-march=rv64g_xsfvfnrclipxfqf -mabi=lp64" } */
int main () {
#if !defined(__riscv)
#error "__riscv"
#endif
#if !defined(__riscv_xsfvfnrclipxfqf)
#error "__riscv_xsfvfnrclipxfqf"
#endif
return 0;
}