Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
rvp: fix wrong format in maddr32 and msubr32
Browse files Browse the repository at this point in the history
  • Loading branch information
linsinan1995 committed Apr 22, 2022
1 parent da54bac commit 932a619
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gcc/config/riscv/riscv-builtins-rvp.def
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ DIRECT_BUILTIN_NO_PREFIX (kwmmul_64, kwmmul, RISCV_IXLEN_FTYPE_IXLEN_IXLEN, zpn6
DIRECT_BUILTIN_NO_PREFIX (kwmmul64_round, kwmmul_u, RISCV_IXLEN_FTYPE_IXLEN_IXLEN, zpn64),
DIRECT_BUILTIN_NO_PREFIX (kwmmul_64, v_kwmmul, RISCV_V2SI_FTYPE_V2SI_V2SI, zpn64),
DIRECT_BUILTIN_NO_PREFIX (kwmmul64_round, v_kwmmul_u, RISCV_V2SI_FTYPE_V2SI_V2SI, zpn64),
DIRECT_BUILTIN_NO_PREFIX (maddr32, maddr32, RISCV_SI_FTYPE_SI_SI, zpn),
DIRECT_BUILTIN_NO_PREFIX (msubr32, msubr32, RISCV_SI_FTYPE_SI_SI, zpn),
DIRECT_BUILTIN_NO_PREFIX (maddr32, maddr32, RISCV_SI_FTYPE_SI_SI_SI, zpn),
DIRECT_BUILTIN_NO_PREFIX (msubr32, msubr32, RISCV_SI_FTYPE_SI_SI_SI, zpn),
DIRECT_BUILTIN_NO_PREFIX (pbsadsi, pbsad, RISCV_UIXLEN_FTYPE_UIXLEN_UIXLEN, zpn32),
DIRECT_BUILTIN_NO_PREFIX (pbsadasi, pbsada, RISCV_UIXLEN_FTYPE_UIXLEN_UIXLEN_UIXLEN, zpn32),
DIRECT_BUILTIN_NO_PREFIX (pbsadsi, v_pbsad, RISCV_USI_FTYPE_UV4QI_UV4QI, zpn32),
Expand Down
1 change: 1 addition & 0 deletions gcc/config/riscv/riscv-ftypes.def
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ DEF_RISCV_FTYPE (3, (IXLEN, IXLEN, UIXLEN, UIXLEN))
DEF_RISCV_FTYPE (3, (IXLEN, IXLEN, V2HI, V2HI))
DEF_RISCV_FTYPE (3, (IXLEN, IXLEN, V2SI, V2SI))
DEF_RISCV_FTYPE (3, (SI, IXLEN, V2HI, V2HI))
DEF_RISCV_FTYPE (3, (SI, SI, SI, SI))
DEF_RISCV_FTYPE (3, (SI, SI, SI, V2HI))
DEF_RISCV_FTYPE (3, (SI, SI, USI, USI))
DEF_RISCV_FTYPE (3, (SI, SI, V2HI, V2HI))
Expand Down
4 changes: 2 additions & 2 deletions gcc/config/riscv/rvp_intrinsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ CREATE_RVP_INTRINSIC (int32_t, ksubh, int32_t, int32_t)
CREATE_RVP_INTRINSIC (int32_t, ksubw, int32_t, int32_t)
CREATE_RVP_INTRINSIC (intXLEN_t, kwmmul, intXLEN_t, intXLEN_t)
CREATE_RVP_INTRINSIC (intXLEN_t, kwmmul_u, intXLEN_t, intXLEN_t)
CREATE_RVP_INTRINSIC (int32_t, maddr32, int32_t, int32_t)
CREATE_RVP_INTRINSIC (int32_t, msubr32, int32_t, int32_t)
CREATE_RVP_INTRINSIC (int32_t, maddr32, int32_t, int32_t, int32_t)
CREATE_RVP_INTRINSIC (int32_t, msubr32, int32_t, int32_t, int32_t)
CREATE_RVP_INTRINSIC (uintXLEN_t, pbsad, uintXLEN_t, uintXLEN_t)
CREATE_RVP_INTRINSIC (uintXLEN_t, pbsada, uintXLEN_t, uintXLEN_t, uintXLEN_t)
CREATE_RVP_INTRINSIC (uintXLEN_t, pkbt16, uintXLEN_t, uintXLEN_t)
Expand Down
22 changes: 22 additions & 0 deletions gcc/testsuite/gcc.target/riscv/rvp32_scan/builtin-rvp-mul32.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* This is a test program for maddr32, msubr32 instruction. */
/* { dg-do compile { target riscv32*-*-* } } */
/* { dg-options "-march=rv32gc_zpn -mabi=ilp32d -O0" } */

#include <rvp_intrinsic.h>
#include <stdlib.h>

static __attribute__ ((noinline))
int32_t madd (int32_t ra, int32_t rb, int32_t rc)
{
return __rv_maddr32 (ra, rb, rc);
}

static __attribute__ ((noinline))
int32_t msub (int32_t ra, int32_t rb, int32_t rc)
{
return __rv_msubr32 (ra, rb, rc);
}

/* { dg-final { scan-assembler-times "msubr32" 1 } } */
/* { dg-final { scan-assembler-times "maddr32" 1 } } */
/* { dg-final { scan-assembler-times "builtin_riscv" 0 } } */

0 comments on commit 932a619

Please sign in to comment.