diff mbox series

, V8, #1 of 6, Tessuite: Add PADDI tests

Message ID 20191115001254.GA19187@ibm-toto.the-meissners.org
State New
Headers show
Series , V8, #1 of 6, Tessuite: Add PADDI tests | expand

Commit Message

Michael Meissner Nov. 15, 2019, 12:12 a.m. UTC
This patch adds 3 tests that tests whether PLI (PADDI) is generated to load up
DImode constants, load up SImode constants, and adding 34-bit constants.

Once the appropriate patches to generate this code have been checked in (V7,
#1-3), can I check these new tests into the FSF trunk?

2019-11-14   Michael Meissner  <meissner@linux.ibm.com>

	* gcc.target/powerpc/paddi-1.c: New test to test using PLI to
	load up a large DImode constant.
	* gcc.target/powerpc/paddi-2.c: New test to test using PLI to
	load up a large SImode constant.
	* gcc.target/powerpc/paddi-3.c: New test to test using PADDI to
	add a large DImode constant.

Comments

Segher Boessenkool Dec. 2, 2019, 6:52 p.m. UTC | #1
On Thu, Nov 14, 2019 at 07:12:54PM -0500, Michael Meissner wrote:
> This patch adds 3 tests that tests whether PLI (PADDI) is generated to load up
> DImode constants, load up SImode constants, and adding 34-bit constants.

> 	* gcc.target/powerpc/paddi-1.c: New test to test using PLI to
> 	load up a large DImode constant.
> 	* gcc.target/powerpc/paddi-2.c: New test to test using PLI to
> 	load up a large SImode constant.
> 	* gcc.target/powerpc/paddi-3.c: New test to test using PADDI to
> 	add a large DImode constant.

	* gcc.target/powerpc/paddi-1.c: New test.
	* gcc.target/powerpc/paddi-2.c: New test.
	* gcc.target/powerpc/paddi-3.c: New test.

Changelogs say *what*, not *why*.  If you want to say what is tested,
say that in the testcases itself (you should, in fact; and more precise
than this please).

> --- /tmp/s2UNQW_paddi-1.c	2019-11-13 17:39:21.274807246 -0500
> +++ gcc/testsuite/gcc.target/powerpc/paddi-1.c	2019-11-13 17:39:21.067805382 -0500
> @@ -0,0 +1,12 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target powerpc_prefixed_addr_ok } */
> +/* { dg-options "-O2 -mdejagnu-cpu=future" } */
> +
> +/* Test that PADDI is generated to add a large constant.  */
> +unsigned long
> +add (unsigned long a)
> +{
> +  return a + 0x12345678UL;
> +}
> +
> +/* { dg-final { scan-assembler {\mpaddi\M} } } */

This will always succeed (it matches the ".file" line).


Segher
diff mbox series

Patch

--- /tmp/s2UNQW_paddi-1.c	2019-11-13 17:39:21.274807246 -0500
+++ gcc/testsuite/gcc.target/powerpc/paddi-1.c	2019-11-13 17:39:21.067805382 -0500
@@ -0,0 +1,12 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Test that PADDI is generated to add a large constant.  */
+unsigned long
+add (unsigned long a)
+{
+  return a + 0x12345678UL;
+}
+
+/* { dg-final { scan-assembler {\mpaddi\M} } } */
--- /tmp/T53ePo_paddi-2.c	2019-11-13 17:39:21.283807328 -0500
+++ gcc/testsuite/gcc.target/powerpc/paddi-2.c	2019-11-13 17:39:21.069805400 -0500
@@ -0,0 +1,12 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Test that PLI (PADDI) is generated to load a large constant.  */
+unsigned long
+large (void)
+{
+  return 0x12345678UL;
+}
+
+/* { dg-final { scan-assembler {\mpli\M} } } */
--- /tmp/gyt7OQ_paddi-3.c	2019-11-13 17:39:21.291807400 -0500
+++ gcc/testsuite/gcc.target/powerpc/paddi-3.c	2019-11-13 17:39:21.071805418 -0500
@@ -0,0 +1,12 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_prefixed_addr_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Test that PLI (PADDI) is generated to load a large constant for SImode.  */
+void
+large_si (unsigned int *p)
+{
+  *p = 0x12345U;
+}
+
+/* { dg-final { scan-assembler {\mpli\M} } } */