[6/7] PowerPC tests: Add PC-relative tests.

Message ID 1591041222-24243-7-git-send-email-meissner@linux.ibm.com
State New
Headers show
Series
  • [1/7] PowerPC tests: Add prefixed/pcrel tests.
Related show

Commit Message

Kewen.Lin via Gcc-patches June 1, 2020, 7:53 p.m.
These tests make sure that PC-relative variant is generated for -mcpu=future on
systems that support PC-relative addressing.

2020-06-01  Michael Meissner  <meissner@linux.ibm.com>

	* gcc.target/powerpc/prefix-pcrel-dd.c: New test.
	* gcc.target/powerpc/prefix-pcrel-df.c: New test.
	* gcc.target/powerpc/prefix-pcrel-di.c: New test.
	* gcc.target/powerpc/prefix-pcrel-hi.c: New test.
	* gcc.target/powerpc/prefix-pcrel-kf.c: New test.
	* gcc.target/powerpc/prefix-pcrel-qi.c: New test.
	* gcc.target/powerpc/prefix-pcrel-sd.c: New test.
	* gcc.target/powerpc/prefix-pcrel-sf.c: New test.
	* gcc.target/powerpc/prefix-pcrel-si.c: New test.
	* gcc.target/powerpc/prefix-pcrel-udi.c: New test.
	* gcc.target/powerpc/prefix-pcrel-uhi.c: New test.
	* gcc.target/powerpc/prefix-pcrel-uqi.c: New test.
	* gcc.target/powerpc/prefix-pcrel-usi.c: New test.
	* gcc.target/powerpc/prefix-pcrel-v2df.c: New test.
	* gcc.target/powerpc/prefix-pcrel.h: Include file for new tests.
---
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c | 16 +++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c | 13 ++++++
 .../gcc.target/powerpc/prefix-pcrel-udi.c          | 13 ++++++
 .../gcc.target/powerpc/prefix-pcrel-uhi.c          | 13 ++++++
 .../gcc.target/powerpc/prefix-pcrel-uqi.c          | 13 ++++++
 .../gcc.target/powerpc/prefix-pcrel-usi.c          | 13 ++++++
 .../gcc.target/powerpc/prefix-pcrel-v2df.c         | 13 ++++++
 gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h    | 52 ++++++++++++++++++++++
 15 files changed, 237 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h

-- 
1.8.3.1

Comments

Kewen.Lin via Gcc-patches June 1, 2020, 10:45 p.m. | #1
On Mon, 2020-06-01 at 15:53 -0400, Michael Meissner via Gcc-patches wrote:
> These tests make sure that PC-relative variant is generated for -mcpu=future on

> systems that support PC-relative addressing.

> 

> 2020-06-01  Michael Meissner  <meissner@linux.ibm.com>

> 

> 	* gcc.target/powerpc/prefix-pcrel-dd.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-df.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-di.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-hi.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-kf.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-qi.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-sd.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-sf.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-si.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-udi.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-uhi.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-uqi.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-usi.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel-v2df.c: New test.

> 	* gcc.target/powerpc/prefix-pcrel.h: Include file for new tests.

> ---

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c | 16 +++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c | 13 ++++++

>  .../gcc.target/powerpc/prefix-pcrel-udi.c          | 13 ++++++

>  .../gcc.target/powerpc/prefix-pcrel-uhi.c          | 13 ++++++

>  .../gcc.target/powerpc/prefix-pcrel-uqi.c          | 13 ++++++

>  .../gcc.target/powerpc/prefix-pcrel-usi.c          | 13 ++++++

>  .../gcc.target/powerpc/prefix-pcrel-v2df.c         | 13 ++++++

>  gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h    | 52 ++++++++++++++++++++++

>  15 files changed, 237 insertions(+)

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c

>  create mode 100644 gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h

> 

> diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c

> new file mode 100644

> index 0000000..f100c24

> --- /dev/null

> +++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c

> @@ -0,0 +1,13 @@

> +/* { dg-do compile } */

> +/* { dg-require-effective-target powerpc_pcrel } */

> +/* { dg-options "-O2 -mdejagnu-cpu=future" } */

> +

> +/* Tests for prefixed instructions testing whether pc-relative prefixed

> +   instructions are generated for the _Decimal64 type.  */



Similar/same comment as was made in Apr.    I recommend something like 

"Test whether pc-relative prefixed instructions
are generated for the _Decimal64 type."
Kewen.Lin via Gcc-patches June 3, 2020, 3:43 a.m. | #2
On Mon, Jun 01, 2020 at 05:45:34PM -0500, will schmidt wrote:
> Similar/same comment as was made in Apr.    I recommend something like 

> 

> "Test whether pc-relative prefixed instructions

> are generated for the _Decimal64 type." 


Ok, I missed that comment in April.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.ibm.com, phone: +1 (978) 899-4797

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c
new file mode 100644
index 0000000..f100c24
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-dd.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the _Decimal64 type.  */
+
+#define TYPE _Decimal64
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplfd\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c
new file mode 100644
index 0000000..a9a0711
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-df.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the double type.  */
+
+#define TYPE double
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplfd\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstfd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c
new file mode 100644
index 0000000..850c28b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-di.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the long type.  */
+
+#define TYPE long
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mpld\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c
new file mode 100644
index 0000000..06fa86f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-hi.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the short type.  */
+
+#define TYPE short
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplh[az]\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpsth\M}     2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c
new file mode 100644
index 0000000..aba28ae
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-kf.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the __float128 type.  */
+
+#define TYPE __float128
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplxv\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c
new file mode 100644
index 0000000..ccce0f8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-qi.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the signed char type.  */
+
+#define TYPE signed char
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplbz\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstb\M}  2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c
new file mode 100644
index 0000000..bd15b18
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sd.c
@@ -0,0 +1,16 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the _Decimal32 type.  Note, the _Decimal32
+   type will not generate any prefixed load or stores, because there is no
+   prefixed load/store instruction to load up a vector register as a zero
+   extended 32-bit integer.  So we count the number load addresses that are
+   generated.  */
+
+#define TYPE _Decimal32
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mpla\M}  3 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c
new file mode 100644
index 0000000..de70258
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-sf.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the float type.  */
+
+#define TYPE float
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplfs\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstfs\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c
new file mode 100644
index 0000000..ce95972
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-si.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the int type.  */
+
+#define TYPE int
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplw[az]\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M}     2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c
new file mode 100644
index 0000000..c146e85
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-udi.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for unsigned long type.  */
+
+#define TYPE unsigned long
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mpld\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstd\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c
new file mode 100644
index 0000000..d9a4318
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uhi.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the unsigned short type.  */
+
+#define TYPE unsigned short
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplhz\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpsth\M}  2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c
new file mode 100644
index 0000000..312e68d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-uqi.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the unsigned char type.  */
+
+#define TYPE unsigned char
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplbz\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstb\M}  2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c
new file mode 100644
index 0000000..a84ae80
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-usi.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for unsigned int type.  */
+
+#define TYPE unsigned int
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplwz\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstw\M}  2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c
new file mode 100644
index 0000000..cf549e4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel-v2df.c
@@ -0,0 +1,13 @@ 
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_pcrel } */
+/* { dg-options "-O2 -mdejagnu-cpu=future" } */
+
+/* Tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for the vector double type.  */
+
+#define TYPE vector double
+
+#include "prefix-pcrel.h"
+
+/* { dg-final { scan-assembler-times {\mplxv\M}  2 } } */
+/* { dg-final { scan-assembler-times {\mpstxv\M} 2 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h
new file mode 100644
index 0000000..474bf07
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/prefix-pcrel.h
@@ -0,0 +1,52 @@ 
+/* Common tests for prefixed instructions testing whether pc-relative prefixed
+   instructions are generated for each type.  */
+
+typedef signed char	schar;
+typedef unsigned char	uchar;
+typedef unsigned short	ushort;
+typedef unsigned int	uint;
+typedef unsigned long	ulong;
+typedef long double	ldouble;
+typedef vector double	v2df;
+typedef vector long	v2di;
+typedef vector float	v4sf;
+typedef vector int	v4si;
+
+#ifndef TYPE
+#define TYPE ulong
+#endif
+
+static TYPE a;
+
+/* Make sure a is not optimized away.  */
+TYPE *p = &a;
+
+#if !defined(DO_ADD) && !defined(DO_VALUE) && !defined(DO_SET)
+#define DO_ADD		1
+#define DO_VALUE	1
+#define DO_SET		1
+#endif
+
+#if DO_ADD
+void
+add (TYPE b)
+{
+  a += b;
+}
+#endif
+
+#if DO_VALUE
+TYPE
+value (void)
+{
+  return a;
+}
+#endif
+
+#if DO_SET
+void
+set (TYPE b)
+{
+  a = b;
+}
+#endif