On Thu, Mar 21, 2024 at 06:21:48PM +0530, jeevitha wrote:
Hi!

> The following patch has been bootstrapped and regtested on powerpc64le-linux.

Please send v2 patches as their own, new thread.  Replies are for
replies (duh), and for patch series.  If you mix several versions in one
thread things become much, much harder to deal with.

> PTImode assists in generating even/odd register pairs on 128 bits. When the 
> user 
> specifies PTImode as an attribute, it breaks because there is no internal 
> type 
> to handle this mode. To address this, we have created a tree node with dummy 
> type
> to handle PTImode. We are not documenting this dummy type since users are not
> allowed to use this type externally.

Like discussed before, do not say this.  Users are perfectly well
allowed to use whatever type they want.  But we don't *encourage* using
this type, a very different thing.

> 2024-03-21  Jeevitha Palanisamy  <jeevi...@linux.ibm.com>
> 
> gcc/
>       PR target/110411

That is the wrong PR #.  To prevent such things, never copy such lines,
always type them from scratch.  It is a very short line anyway!

>       * config/rs6000/rs6000.h (enum rs6000_builtin_type_index): Add
>       RS6000_BTI_INTPTI.
>       * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Add node
>       for PTImode type.

Please don't break lines early.  Changelog lines are 80 positions wide.

> gcc/testsuite/
>       PR target/106895
>       * gcc.target/powerpc/pr106895.c: New testcase.

> +  /* PTImode to get even/odd register pairs.  */
> +  intPTI_type_internal_node = make_node(INTEGER_TYPE);
> +  TYPE_PRECISION (intPTI_type_internal_node) = GET_MODE_BITSIZE (PTImode);
> +  layout_type (intPTI_type_internal_node);
> +  SET_TYPE_MODE (intPTI_type_internal_node, PTImode);
> +  t = build_qualified_type (intPTI_type_internal_node, TYPE_QUAL_CONST);
> +  lang_hooks.types.register_builtin_type (intPTI_type_internal_node,
> +                                       "__dummypti");

Please use a real name, not something "dummy".  It is a real type after
all!

> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr106895.c
> @@ -0,0 +1,15 @@
> +/* PR target/106895 */
> +/* { dg-require-effective-target int128 } */
> +/* { dg-options "-O2" } */
> +
> +/* Verify the following generates even/odd register pairs.  */
> +
> +typedef __int128 pti __attribute__((mode(PTI)));
> +
> +void
> +set128 (pti val, pti *mem)
> +{
> +    asm("stq %1,%0" : "=m"(*mem) : "r"(val));
> +}
> +
> +/* { dg-final { scan-assembler "stq \[123\]?\[02468\]" } } */

Please use {} quoting, and no backslashes.  Also use \m and \M.

Or something like
  scan-assembler { \mstq .*[02468], }
(you do not have to match the things you don't care about, and you only
need to look at the last digit to see if a number is even).

The patch looks good otherwise, but please fix these things and repost.
In a new thread :-)

Thanks,


Segher

Reply via email to