RISC-V: Fix failed testcase when use -cmodel=medany

Message ID 20231017095738.1081807-1-lehua.ding@rivai.ai
State Unresolved
Headers
Series RISC-V: Fix failed testcase when use -cmodel=medany |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Lehua Ding Oct. 17, 2023, 9:57 a.m. UTC
  This little path fix a failed testcase when use -cmodel=medany.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/base/cpymem-1.c: Split check.

---
 gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--
2.36.3
  

Comments

juzhe.zhong@rivai.ai Oct. 17, 2023, 9:58 a.m. UTC | #1
OK



juzhe.zhong@rivai.ai
 
From: Lehua Ding
Date: 2023-10-17 17:57
To: gcc-patches
CC: juzhe.zhong; kito.cheng; rdapp.gcc; palmer; jeffreyalaw; lehua.ding
Subject: [PATCH] RISC-V: Fix failed testcase when use -cmodel=medany
This little path fix a failed testcase when use -cmodel=medany.
 
gcc/testsuite/ChangeLog:
 
* gcc.target/riscv/rvv/base/cpymem-1.c: Split check.
 
---
gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
 
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
index 9bb4904e8e9..549d6648104 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
@@ -50,7 +50,7 @@ void f2 (__INT32_TYPE__* a, __INT32_TYPE__* b, int l)
    Use extern here so that we get a known alignment, lest
    DATA_ALIGNMENT force us to make the scan pattern accomodate
    code for different alignments depending on word size.
-** f3:
+** f3: { target { any-opts "-mcmodel=medlow" } }
**        lui\s+[ta][0-7],%hi\(a_a\)
**        lui\s+[ta][0-7],%hi\(a_b\)
**        addi\s+a4,[ta][0-7],%lo\(a_b\)
@@ -61,6 +61,16 @@ void f2 (__INT32_TYPE__* a, __INT32_TYPE__* b, int l)
**        ret
*/
 
+/*
+** f3: { target { any-opts "-mcmodel=medany" } }
+**        lla\s+[ta][0-7],a_b
+**        vsetivli\s+zero,16,e32,m4,ta,ma
+**        vle32.v\s+v\d+,0\([ta][0-7]\)
+**        lla\s+[ta][0-7],a_a
+**        vse32\.v\s+v\d+,0\([ta][0-7]\)
+**        ret
+*/
+
extern struct { __INT32_TYPE__ a[16]; } a_a, a_b;
 
void f3 ()
--
2.36.3
  
Lehua Ding Oct. 17, 2023, 10:01 a.m. UTC | #2
Committed, thanks Juzhe.

On 2023/10/17 17:58, juzhe.zhong@rivai.ai wrote:
> OK
> 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Lehua Ding <mailto:lehua.ding@rivai.ai>
>     *Date:* 2023-10-17 17:57
>     *To:* gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* juzhe.zhong <mailto:juzhe.zhong@rivai.ai>; kito.cheng
>     <mailto:kito.cheng@gmail.com>; rdapp.gcc
>     <mailto:rdapp.gcc@gmail.com>; palmer <mailto:palmer@rivosinc.com>;
>     jeffreyalaw <mailto:jeffreyalaw@gmail.com>; lehua.ding
>     <mailto:lehua.ding@rivai.ai>
>     *Subject:* [PATCH] RISC-V: Fix failed testcase when use -cmodel=medany
>     This little path fix a failed testcase when use -cmodel=medany.
>     gcc/testsuite/ChangeLog:
>     * gcc.target/riscv/rvv/base/cpymem-1.c: Split check.
>     ---
>     gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c | 12 +++++++++++-
>     1 file changed, 11 insertions(+), 1 deletion(-)
>     diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
>     b/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
>     index 9bb4904e8e9..549d6648104 100644
>     --- a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
>     +++ b/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
>     @@ -50,7 +50,7 @@ void f2 (__INT32_TYPE__* a, __INT32_TYPE__* b, int l)
>          Use extern here so that we get a known alignment, lest
>          DATA_ALIGNMENT force us to make the scan pattern accomodate
>          code for different alignments depending on word size.
>     -** f3:
>     +** f3: { target { any-opts "-mcmodel=medlow" } }
>     **        lui\s+[ta][0-7],%hi\(a_a\)
>     **        lui\s+[ta][0-7],%hi\(a_b\)
>     **        addi\s+a4,[ta][0-7],%lo\(a_b\)
>     @@ -61,6 +61,16 @@ void f2 (__INT32_TYPE__* a, __INT32_TYPE__* b, int l)
>     **        ret
>     */
>     +/*
>     +** f3: { target { any-opts "-mcmodel=medany" } }
>     +**        lla\s+[ta][0-7],a_b
>     +**        vsetivli\s+zero,16,e32,m4,ta,ma
>     +**        vle32.v\s+v\d+,0\([ta][0-7]\)
>     +**        lla\s+[ta][0-7],a_a
>     +**        vse32\.v\s+v\d+,0\([ta][0-7]\)
>     +**        ret
>     +*/
>     +
>     extern struct { __INT32_TYPE__ a[16]; } a_a, a_b;
>     void f3 ()
>     --
>     2.36.3
>
  

Patch

diff --git a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c b/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
index 9bb4904e8e9..549d6648104 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/base/cpymem-1.c
@@ -50,7 +50,7 @@  void f2 (__INT32_TYPE__* a, __INT32_TYPE__* b, int l)
    Use extern here so that we get a known alignment, lest
    DATA_ALIGNMENT force us to make the scan pattern accomodate
    code for different alignments depending on word size.
-** f3:
+** f3: { target { any-opts "-mcmodel=medlow" } }
 **        lui\s+[ta][0-7],%hi\(a_a\)
 **        lui\s+[ta][0-7],%hi\(a_b\)
 **        addi\s+a4,[ta][0-7],%lo\(a_b\)
@@ -61,6 +61,16 @@  void f2 (__INT32_TYPE__* a, __INT32_TYPE__* b, int l)
 **        ret
 */

+/*
+** f3: { target { any-opts "-mcmodel=medany" } }
+**        lla\s+[ta][0-7],a_b
+**        vsetivli\s+zero,16,e32,m4,ta,ma
+**        vle32.v\s+v\d+,0\([ta][0-7]\)
+**        lla\s+[ta][0-7],a_a
+**        vse32\.v\s+v\d+,0\([ta][0-7]\)
+**        ret
+*/
+
 extern struct { __INT32_TYPE__ a[16]; } a_a, a_b;

 void f3 ()