From: YunQiang Su Date: Tue, 28 May 2024 15:44:49 +0000 (+0800) Subject: MIPS/testsuite: Fix bseli.b fail in msa-builtins.c X-Git-Tag: basepoints/gcc-16~8643 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a92e5e56a7f2b19928b8cb7634f59d9c7b2b582;p=thirdparty%2Fgcc.git MIPS/testsuite: Fix bseli.b fail in msa-builtins.c commit 05daf617ea22e1d818295ed2d037456937e23530 Author: Jeff Law Date: Sat May 25 12:39:05 2024 -0600 [committed] [v2] More logical op simplifications in simplify-rtx.cc does some simplifications, and then `bseli.b $w1,$w0,255` is found that it is same with `or.v $w1,$w0,$w1`. So there will be no bseli.b instruction generated. Let's use 254 instead of 255 to test the generation of `bseli.b`. gcc/testsuite * gcc.target/mips/msa-builtins.c: Use 254 instead of 255 for bseli.b, as `bseli.b $w0,$w1,255` is same as `or.v $w0,$w0,$w1`. --- diff --git a/gcc/testsuite/gcc.target/mips/msa-builtins.c b/gcc/testsuite/gcc.target/mips/msa-builtins.c index a679f065f34..6a146b3e6ae 100644 --- a/gcc/testsuite/gcc.target/mips/msa-builtins.c +++ b/gcc/testsuite/gcc.target/mips/msa-builtins.c @@ -705,7 +705,7 @@ #define BNEG(T) NOMIPS16 T FN (bneg, T ## _DF) (T i, T j) { return BUILTIN (bneg, T ## _DF) (i, j); } #define BNEGI(T) NOMIPS16 T FN (bnegi, T ## _DF) (T i) { return BUILTIN (bnegi, T ## _DF) (i, 0); } #define BSEL(T) NOMIPS16 T FN (bsel, v) (T i, T j, T k) { return BUILTIN (bsel, v) (i, j, k); } -#define BSELI(T) NOMIPS16 T FN (bseli, T ## _DF) (T i, T j) { return BUILTIN (bseli, T ## _DF) (i, j, U8MAX); } +#define BSELI(T) NOMIPS16 T FN (bseli, T ## _DF) (T i, T j) { return BUILTIN (bseli, T ## _DF) (i, j, U8MAX-1); } #define BSET(T) NOMIPS16 T FN (bset, T ## _DF) (T i, T j) { return BUILTIN (bset, T ## _DF) (i, j); } #define BSETI(T) NOMIPS16 T FN (bseti, T ## _DF) (T i) { return BUILTIN (bseti, T ## _DF) (i, 0); } #define NLOC(T) NOMIPS16 T FN (nloc, T ## _DF) (T i) { return BUILTIN (nloc, T ## _DF) (i); }