[v2] RISC-V: Test memcpy inlined on riscv_v

Message ID 20231004225527.930610-1-patrick@rivosinc.com
State Accepted
Headers
Series [v2] RISC-V: Test memcpy inlined on riscv_v |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Patrick O'Neill Oct. 4, 2023, 10:55 p.m. UTC
  Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
perform a memcpy. We no longer expect memcpy for riscv_v targets.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr90263.c: Skip riscv_v targets.
	* gcc.target/riscv/rvv/base/pr90263.c: New test.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
Co-authored-by: Joern Rennecke <joern.rennecke@embecosm.com>
---
Changes from v1:
[PATCH] RISC-V: xfail gcc.dg/pr90263.c for riscv_v
- Skip test rather than xfailing for riscv_v.
- Add testcase to ensure memcpy is not emitted on riscv_v.
---
 gcc/testsuite/gcc.dg/pr90263.c                    | 1 +
 gcc/testsuite/gcc.target/riscv/rvv/base/pr90263.c | 7 +++++++
 2 files changed, 8 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/base/pr90263.c

--
2.34.1
  

Comments

Jeff Law Oct. 5, 2023, 10:14 p.m. UTC | #1
On 10/4/23 16:55, Patrick O'Neill wrote:
> Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
> perform a memcpy. We no longer expect memcpy for riscv_v targets.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/pr90263.c: Skip riscv_v targets.
> 	* gcc.target/riscv/rvv/base/pr90263.c: New test.
OK
jeff
  
Patrick O'Neill Oct. 5, 2023, 10:25 p.m. UTC | #2
On 10/5/23 15:14, Jeff Law wrote:
>
>
> On 10/4/23 16:55, Patrick O'Neill wrote:
>> Since r14-4358-g9464e72bcc9 riscv_v targets use vector instructions to
>> perform a memcpy. We no longer expect memcpy for riscv_v targets.
>>
>> gcc/testsuite/ChangeLog:
>>
>>     * gcc.dg/pr90263.c: Skip riscv_v targets.
>>     * gcc.target/riscv/rvv/base/pr90263.c: New test.
> OK
> jeff
Committed.
Patrick
  

Patch

diff --git a/gcc/testsuite/gcc.dg/pr90263.c b/gcc/testsuite/gcc.dg/pr90263.c
index 3222a5331c1..831e098783b 100644
--- a/gcc/testsuite/gcc.dg/pr90263.c
+++ b/gcc/testsuite/gcc.dg/pr90263.c
@@ -2,6 +2,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2" } */
 /* { dg-require-effective-target glibc } */
+/* { dg-skip-if "riscv_v uses an inline memcpy routine" { riscv_v } }*/

 int *f (int *p, int *q, long n)
 {
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/pr90263.c b/gcc/testsuite/gcc.target/riscv/rvv/base/pr90263.c
new file mode 100644
index 00000000000..7308428e2c3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/pr90263.c
@@ -0,0 +1,7 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target glibc } */
+
+#include "../../../../gcc.dg/pr90263.c"
+
+/* { dg-final { scan-assembler-not "memcpy" { target { riscv_v } } } } */