/* Check whether rounding mode argument is a valid immediate. */
if (c.base->has_rounding_mode_operand_p ())
{
- if (!c.any_type_float_p ())
+ /* Some invalid overload intrinsic like below will have zero for
+ c.arg_num (). Thus, make sure arg_num is big enough here.
+ __riscv_vaadd () will make c.arg_num () == 0. */
+ if (!c.any_type_float_p () && c.arg_num () >= 2)
return c.require_immediate (c.arg_num () - 2, VXRM_RNU, VXRM_ROD);
/* TODO: We will support floating-point intrinsic modeling
rounding mode in the future. */
{
gcc_assert (c.any_type_float_p ());
- /* Check whether rounding mode argument is a valid immediate. */
- if (c.base->has_rounding_mode_operand_p ())
+ /* Check whether rounding mode argument is a valid immediate.
+ Some invalid overload intrinsic like below will have zero for
+ c.arg_num (). Thus, make sure arg_num is big enough here.
+ __riscv_vaadd () will make c.arg_num () == 0. */
+ if (c.base->has_rounding_mode_operand_p () && c.arg_num () >= 2)
{
unsigned int frm_num = c.arg_num () - 2;
/* Check whether rounding mode argument is a valid immediate. */
if (c.base->has_rounding_mode_operand_p ())
{
- if (!c.any_type_float_p ())
+ /* Some invalid overload intrinsic like below will have zero for
+ c.arg_num (). Thus, make sure arg_num is big enough here.
+ __riscv_vaadd () will make c.arg_num () == 0. */
+ if (!c.any_type_float_p () && c.arg_num () >= 2)
return c.require_immediate (c.arg_num () - 2, VXRM_RNU, VXRM_ROD);
/* TODO: We will support floating-point intrinsic modeling
rounding mode in the future. */
__riscv_vfredosum (); /* { dg-error {no matching function call to '__riscv_vfredosum' with empty args} } */
__riscv_vfredosum_tu (); /* { dg-error {no matching function call to '__riscv_vfredosum_tu' with empty args} } */
+
+ __riscv_vaadd (); /* { dg-error {no matching function call to '__riscv_vaadd' with empty args} } */
+
+ __riscv_vaaddu (); /* { dg-error {no matching function call to '__riscv_vaaddu' with empty args} } */
+
+ __riscv_vadc (); /* { dg-error {no matching function call to '__riscv_vadc' with empty args} } */
+
+ __riscv_vnmsac (); /* { dg-error {no matching function call to '__riscv_vnmsac' with empty args} } */
+
+ __riscv_vnsrl (); /* { dg-error {no matching function call to '__riscv_vnsrl' with empty args} } */
+
+ __riscv_vfnmadd (); /* { dg-error {no matching function call to '__riscv_vfnmadd' with empty args} } */
+
+ __riscv_vfwsub_vv (); /* { dg-error {no matching function call to '__riscv_vfwsub_vv' with empty args} } */
+
+ __riscv_vfwredosum (); /* { dg-error {no matching function call to '__riscv_vfwredosum' with empty args} } */
}