Kewen:
On 8/20/24 12:56 AM, Kewen.Lin wrote:
Hi Carl,
on 2024/8/9 23:57, Carl Love wrote:
Gcc maintainers:
Version 2, based on discussion additional overloaded instances of the
vec_test_lsbb_all_ones and, vec_test_lsbb_all_zeros built-ins has been added.
The additional instances are for arguments of vector signed char and vector
bool char. The patch has been tested on Power 10 LE and BE with no regressions.
Per a report from a user, the existing vec_test_lsbb_all_ones and,
vec_test_lsbb_all_zeros built-ins are not documented in the GCC documentation
file.
The following patch adds missing documentation for the vec_test_lsbb_all_ones
and, vec_test_lsbb_all_zeros built-ins.
Please let me know if the patch is acceptable for mainline. Thanks.
Carl
------------------------------------------------------------
rs6000,extend and document built-ins vec_test_lsbb_all_ones and
vec_test_lsbb_all_zeros
The built-ins currently support unsigned char arguments. Extend the
Nit: /unsigned char/vector unsigned char/
Fixed.
built-ins to also support vector signed char and vector bool char aruments.
Nit: /aruments/arguments/
Fixed
<snip>
ndex 89fe5db7aed..5ca87889831 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -23332,6 +23332,25 @@ signed long long will sign extend the rightmost byte
of each doubleword.
The following additional built-in functions are also available for the
PowerPC family of processors, starting with ISA 3.1 (@option{-mcpu=power10}):
+@smallexample
+@exdent int vec_test_lsbb_all_ones (vector signed char);
+@exdent int vec_test_lsbb_all_ones (vector unsigned char);
+@exdent int vec_test_lsbb_all_ones (vector bool char);
+@end smallexample
+@findex vec_test_lsbb_all_ones
+
+The builtin @code{vec_test_lsbb_all_ones} returns 1 if the least significant
+bit in each byte is equal to 1. It returns a 0 otherwise.
Nit: s/a 0/0/
Fixed
+
+@smallexample
+@exdent int vec_test_lsbb_all_zeros (vector signed char);
+@exdent int vec_test_lsbb_all_zeros (vector unsigned char);
+@exdent int vec_test_lsbb_all_zeros (vector bool char);
+@end smallexample
+@findex vec_test_lsbb_all_zeros
+
+The builtin @code{vec_test_lsbb_all_zeros} returns 1 if the least significant
+bit in each byte is equal to zero. It returns a 0 otherwise.
Nit: s/a 0/0/
Fixed
<snip>
diff --git a/gcc/testsuite/gcc.target/powerpc/lsbb.c
b/gcc/testsuite/gcc.target/powerpc/lsbb.c
index b5c037094a5..650e944e082 100644
--- a/gcc/testsuite/gcc.target/powerpc/lsbb.c
+++ b/gcc/testsuite/gcc.target/powerpc/lsbb.c
@@ -9,16 +9,32 @@
/* { dg-require-effective-target power10_ok } */
Nit: This power10_ok isn't needed, could you also remove it together?
OK, removed.
/* { dg-options "-fno-inline -mdejagnu-cpu=power10 -O2" } */
... and this "-fno-inline".
Removed
-/* { dg-final { scan-assembler-times {\mxvtlsbb\M} 2 } } */
-/* { dg-final { scan-assembler-times {\msetbc\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxvtlsbb\M} 3 } } */
+/* { dg-final { scan-assembler-times {\msetbc\M} 3 } } */
I would expect the times are changed to 6 rather than 3, was this test
case really tested? Or am I missing something?
BR,
Kewen
I retested and yes it fails. Should be 6. Not sure why my original
testing didn't catch that. Perhaps
I looked at the wrong output file???
Changed to
-/* { dg-final { scan-assembler-times {\mxvtlsbb\M} 2 } } */
-/* { dg-final { scan-assembler-times {\msetbc\M} 2 } } */
+/* { dg-final { scan-assembler-times {\mxvtlsbb\M} 6 } } */
+/* { dg-final { scan-assembler-times {\msetbc\M} 6 } } */
and retested. It now passes.
Carl