On 10/3/24 2:24 PM, Segher Boessenkool wrote: > On Thu, Mar 21, 2024 at 06:21:48PM +0530, jeevitha wrote: >> 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.
I think a simple s/allowed/encouraged/ should suffice. >> + 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! Segher, how about __internal_pti or __pti_internal instead? >> --- /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). I think a better idea is to change this to a { dg-do assemble } test case, since the assembler will verify that the register number is even and will also verify the offset is valid too. Then the dg-final can be just: /* { dg-final { scan-assembler {\mstq\M} } } */ Peter