public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Li, Pan2" <pan2.li@intel.com>
To: "Robin Dapp" <rdapp.gcc@gmail.com>, 钟居哲 <juzhe.zhong@rivai.ai>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	palmer <palmer@dabbelt.com>, "kito.cheng" <kito.cheng@gmail.com>,
	"Jeff Law" <jeffreyalaw@gmail.com>
Subject: RE: [PATCH] RISC-V: Add vectorized strcmp.
Date: Mon, 11 Dec 2023 11:33:06 +0000	[thread overview]
Message-ID: <MW5PR11MB590816200B8A44D74FFA8654A98FA@MW5PR11MB5908.namprd11.prod.outlook.com> (raw)
In-Reply-To: <fc135fec-4e8f-4014-9100-ac26847f2c5c@gmail.com>

Hi Robin,

I reduced the SZ size from 10 to 1, and the below case with SZ = 2 will fail. The failed location is "foo is 50, foo2 is 12800, i,j is 1, 0".

#define SZ 2

const char *s[SZ]  = {"1",  "12345678901234567889012345678901234567890"};

Executing on host: /home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc -B/home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/  exceptions_enabled4031601.cc  -march=rv64gcv_zvl512b -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m4   -fdiagnostics-plain-output  -Wno-complain-wrong-lang -S   -o exceptions_enabled4031601.s    (timeout = 600)
spawn -ignore SIGHUP /home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc -B/home/pli/gcc/111/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/ exceptions_enabled4031601.cc -march=rv64gcv_zvl512b -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m4 -fdiagnostics-plain-output -Wno-complain-wrong-lang -S -o exceptions_enabled4031601.s
PASS: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c (test for excess errors)
spawn riscv64-unknown-elf-run ./strcmp-run.exe
+ QEMU_CPU=rv64,vlen=512,v=true,vext_spec=v1.0,Zve32f=true,Zve64f=true
+ qemu-riscv64 -r 5.10 -L /home/pli/gcc/111/riscv-gnu-toolchain/__RISC-V_INSTALL___/sysroot ./strcmp-run.exe
qemu-riscv64: warning: CPU property 'Zve32f' is deprecated. Please use 'zve32f' instead
qemu-riscv64: warning: CPU property 'Zve64f' is deprecated. Please use 'zve64f' instead
foo is 50, foo2 is 12800, i,j is 1, 0
FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test

Pan

-----Original Message-----
From: Robin Dapp <rdapp.gcc@gmail.com> 
Sent: Monday, December 11, 2023 4:34 PM
To: Li, Pan2 <pan2.li@intel.com>; 钟居哲 <juzhe.zhong@rivai.ai>; gcc-patches <gcc-patches@gcc.gnu.org>; palmer <palmer@dabbelt.com>; kito.cheng <kito.cheng@gmail.com>; Jeff Law <jeffreyalaw@gmail.com>
Cc: rdapp.gcc@gmail.com
Subject: Re: [PATCH] RISC-V: Add vectorized strcmp.

> FYI. I have the some failures as juzhe mentioned, with the emulator
> qemu version qemu-riscv64 version 8.1.93 (v8.2.0-rc3). The entire log
> may look like below:
> 
> Executing on host: /home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc -B/home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/  /home/box/panli/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c  -march=rv64gcv -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m1 --param=riscv-autovec-preference=fixed-vlmax   -fdiagnostics-plain-output   -ftree-vectorize -O3 --param riscv-autovec-lmul=m1 -O3 -minline-strcmp       -lm  -o ./strcmp-run.exe    (timeout = 600)
> 
> spawn -ignore SIGHUP /home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/xgcc -B/home/box/panli/riscv-gnu-toolchain/build-gcc-newlib-stage2/gcc/ /home/box/panli/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c -march=rv64gcv -mabi=lp64d -mcmodel=medlow --param=riscv-autovec-lmul=m1 --param=riscv-autovec-preference=fixed-vlmax -fdiagnostics-plain-output -ftree-vectorize -O3 --param riscv-autovec-lmul=m1 -O3 -minline-strcmp -lm -o ./strcmp-run.exe^M

Thanks, it must be a bug if you both see it.  But I cannot reproduce
it yet for some reason.  I tried your exact parameters (just didn't
use newlib).  Also, for Juzhe it seemed to fail without
-minline-strcmp for you it fails with it.  Maybe my testcase uses
undefined behavior?  Could you try reducing SZ to 1 for a test?

Regards
 Robin

  reply	other threads:[~2023-12-11 11:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 15:23 Robin Dapp
2023-12-01 22:58 ` 钟居哲
2023-12-08 13:20   ` Robin Dapp
2023-12-08 16:25     ` Robin Dapp
2023-12-09  1:56       ` 钟居哲
2023-12-09 13:51         ` Robin Dapp
2023-12-09 14:03           ` 钟居哲
2023-12-09 14:07             ` Robin Dapp
2023-12-09 14:17               ` 钟居哲
2023-12-11  1:44                 ` Li, Pan2
2023-12-11  8:34                   ` Robin Dapp
2023-12-11 11:33                     ` Li, Pan2 [this message]
2023-12-11 13:14                       ` Robin Dapp
2023-12-11 13:36                         ` Li, Pan2
2023-12-11 13:41                           ` Robin Dapp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW5PR11MB590816200B8A44D74FFA8654A98FA@MW5PR11MB5908.namprd11.prod.outlook.com \
    --to=pan2.li@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=rdapp.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).