summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2005-03-17 04:52:10 +0000
committerDavid Schleef <ds@schleef.org>2005-03-17 04:52:10 +0000
commitea9b1f9c47567162855a2fb5e29219170a8b37da (patch)
treee39529897cb5e4d76f2ea14a0611f19e78795826
parent562ffd9d9ba1c6fd730ce9334ffba480eed0fe92 (diff)
downloadliboil-ea9b1f9c47567162855a2fb5e29219170a8b37da.tar.gz
* liboil/Makefile.am: add liboilgcc.h, build build_prototypes_doc
* liboil/liboilfunction.c: fix docs * liboil/build_prototypes_doc.c: build a file appropriate for gtk-doc * liboil/liboilgcc.h: File for gcc magic
-rw-r--r--ChangeLog7
-rw-r--r--liboil/Makefile.am14
-rw-r--r--liboil/build_prototypes_doc.c86
-rw-r--r--liboil/liboilfunction.c2
-rw-r--r--liboil/liboilgcc.h45
5 files changed, 151 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9694aa6..6bcb9bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2005-03-16 David Schleef <ds@schleef.org>
+ * liboil/Makefile.am: add liboilgcc.h, build build_prototypes_doc
+ * liboil/liboilfunction.c: fix docs
+ * liboil/build_prototypes_doc.c: build a file appropriate for gtk-doc
+ * liboil/liboilgcc.h: File for gcc magic
+
+2005-03-16 David Schleef <ds@schleef.org>
+
* doc/tmpl/liboil-unused.sgml: More of the same
* doc/tmpl/liboilcpu.sgml:
* doc/tmpl/liboilfuncs-doc.sgml:
diff --git a/liboil/Makefile.am b/liboil/Makefile.am
index 5c4e3d5..a9c3d9d 100644
--- a/liboil/Makefile.am
+++ b/liboil/Makefile.am
@@ -7,11 +7,13 @@ lib_LTLIBRARIES = liboiltmp1.la liboil-@LIBOIL_MAJORMINOR@.la
noinst_LTLIBRARIES = liboilfunctions.la
-noinst_PROGRAMS = build_prototypes build_marshal
+noinst_PROGRAMS = build_prototypes build_prototypes_doc build_marshal
pkginclude_HEADERS = liboil.h liboilfunction.h liboildebug.h liboilfuncs.h \
liboiltypes.h liboilcpu.h liboilprototype.h liboilparameter.h \
- liboilrandom.h
+ liboilrandom.h liboilgcc.h
+
+nodist_noinst_HEADERS = liboilfuncs-doc.h
CLEANFILES = liboilarray.c
@@ -68,6 +70,11 @@ build_prototypes_SOURCES = build_prototypes.c
build_prototypes_CFLAGS = $(LIBOIL_CFLAGS)
build_prototypes_LDADD = $(LIBOIL_LIBS)
+build_prototypes_doc_DEPENDENCIES = liboil-$(LIBOIL_MAJORMINOR).la
+build_prototypes_doc_SOURCES = build_prototypes_doc.c
+build_prototypes_doc_CFLAGS = $(LIBOIL_CFLAGS)
+build_prototypes_doc_LDADD = $(LIBOIL_LIBS)
+
build_marshal_DEPENDENCIES = liboil-$(LIBOIL_MAJORMINOR).la
build_marshal_SOURCES = build_marshal.c
@@ -104,3 +111,6 @@ liboilfuncs.h:
liboilmarshal.c:
./build_marshal >liboilmarshal.c
+liboilfuncs-doc.h:
+ ./build_prototypes_doc >liboilfuncs-doc.h
+
diff --git a/liboil/build_prototypes_doc.c b/liboil/build_prototypes_doc.c
new file mode 100644
index 0000000..75c389c
--- /dev/null
+++ b/liboil/build_prototypes_doc.c
@@ -0,0 +1,86 @@
+/*
+ * LIBOIL - Library of Optimized Inner Loops
+ * Copyright (c) 2004 David A. Schleef <ds@schleef.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include <stdio.h>
+#include <liboil/liboil.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <liboil/liboilprototype.h>
+
+void print_header (void);
+void print_footer (void);
+
+int main (int argc, char *argv[])
+{
+ OilFunctionClass *klass;
+ OilPrototype *proto;
+ int i;
+ int n;
+ char *string;
+
+ oil_init ();
+
+ print_header ();
+
+ n = oil_class_get_n_classes ();
+ for (i=0;i<n; i++ ){
+ klass = oil_class_get_by_index (i);
+
+ if(klass->prototype) {
+ proto = oil_prototype_from_string (klass->prototype);
+ if (proto) {
+ string = oil_prototype_to_string (proto);
+
+ printf ("void oil_%s (%s);\n", klass->name, string);
+
+ oil_prototype_free (proto);
+ free (string);
+ } else {
+ printf("/* ERROR: could not parse %s(%s) */\n", klass->name, klass->prototype);
+ }
+ }
+ }
+
+ print_footer ();
+
+ return 0;
+}
+
+void print_header (void)
+{
+ printf ("/* This file is automatically generated. Do not edit. */\n");
+ printf ("\n");
+}
+
+void print_footer (void)
+{
+ printf ("\n");
+}
+
diff --git a/liboil/liboilfunction.c b/liboil/liboilfunction.c
index 58cb8cf..9245a97 100644
--- a/liboil/liboilfunction.c
+++ b/liboil/liboilfunction.c
@@ -50,7 +50,7 @@ void _oil_cpu_init (void);
* oil_init:
*
* Initializes liboil. This function must be called before any
- * other liboil function is used. &oil_init may be called multiple
+ * other liboil function is used. @oil_init may be called multiple
* times.
*/
void
diff --git a/liboil/liboilgcc.h b/liboil/liboilgcc.h
new file mode 100644
index 0000000..e81a79d
--- /dev/null
+++ b/liboil/liboilgcc.h
@@ -0,0 +1,45 @@
+/*
+ * LIBOIL - Library of Optimized Inner Loops
+ * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _LIBOIL_GCC_H_
+#define _LIBOIL_GCC_H_
+
+#ifndef __GNUC__
+#error liboilgcc.h should only be included if the compiler is GCC
+#endif
+
+#include <stdint.h>
+
+typedef int8_t vec_s8 __attribute__ ((mode(V8QI)));
+typedef uint8_t vec_u8 __attribute__ ((mode(V8QI)));
+typedef int16_t vec_s16 __attribute__ ((mode(V4HI)));
+typedef uint16_t vec_u16 __attribute__ ((mode(V4HI)));
+typedef int32_t vec_s32 __attribute__ ((mode(V2SI)));
+typedef uint32_t vec_u32 __attribute__ ((mode(V2SI)));
+
+#endif
+