On 10/11/23 19:37, Hans-Peter Nilsson wrote:
```
foo2:
sext.w a6,a1 <-- this goes away
beq a1,zero,.L4
li a5,0
li a0,0
.L3:
addw a4,a2,a5
addw a5,a3,a5
addw a0,a4,a0
bltu a5,a6,.L3
ret
.L4:
li a0,0
ret
```
...if your patch gets rid of that sign-extension above...
diff --git a/gcc/testsuite/gcc.target/riscv/pr111466.c
b/gcc/testsuite/gcc.target/riscv/pr111466.c
new file mode 100644
index 000000000000..007792466a51
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/pr111466.c
@@ -0,0 +1,15 @@
+/* Simplified varaint of gcc.target/riscv/zba-adduw.c. */
+
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zba_zbs -mabi=lp64" } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } } */
+
+int foo2(int unused, int n, unsigned y, unsigned delta){
+ int s = 0;
+ unsigned int x = 0;
+ for (;x<n;x +=delta)
+ s += x+y;
+ return s;
+}
+
+/* { dg-final { scan-assembler "\msext\M" } } */
...then why test for the presence of a sign-extension
instruction in the test-case?
IOW, shouldn't that be a scan-assember-not?
Yes indeed.
(What am I missing?)
Nothing deep really, just a snafu on my side. I'll fix it in v2.
Thx,
-Vineet
brgds, H-P
PS. sorry I missed the Cauldron this year. Hope to see you all next year!
Looking fwd to.
Thx,
-Vineet