diff options
-rw-r--r-- | configure.ac | 51 | ||||
-rw-r--r-- | examples/Makefile.am | 6 | ||||
-rw-r--r-- | orc/Makefile.am | 49 | ||||
-rw-r--r-- | orc/orc.c | 12 | ||||
-rw-r--r-- | testsuite/Makefile.am | 2 |
5 files changed, 102 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 2c5ca6a..f9523be 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,7 @@ AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_TAGS([]) AC_PROG_LIBTOOL AM_PROG_AS +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([orc/orc.h]) @@ -108,6 +109,56 @@ case "${host_os}" in ;; esac +AC_ARG_ENABLE(backend, + AC_HELP_STRING([--enable-backend=[sse,mmx,neon,arm,all]], [include backend (default=all)]), + [], [enable_backend=all]) +case "${enable_backend}" in + sse) + ENABLE_BACKEND_SSE=yes + AC_DEFINE(ENABLE_BACKEND_SSE, 1, [Enable SSE backend]) + ;; + mmx) + ENABLE_BACKEND_MMX=yes + AC_DEFINE(ENABLE_BACKEND_MMX, 1, [Enable MMX backend]) + ;; + altivec) + ENABLE_BACKEND_ALTIVEC=yes + AC_DEFINE(ENABLE_BACKEND_ALTIVEC, 1, [Enable Altivec backend]) + ;; + neon) + ENABLE_BACKEND_NEON=yes + AC_DEFINE(ENABLE_BACKEND_NEON, 1, [Enable NEON backend]) + ;; + arm) + ENABLE_BACKEND_ARM=yes + AC_DEFINE(ENABLE_BACKEND_ARM, 1, [Enable Arm backend]) + ;; + c64x) + ENABLE_BACKEND_C64X=yes + AC_DEFINE(ENABLE_BACKEND_C64X, 1, [Enable c64x backend]) + ;; + all|auto) + ENABLE_BACKEND_SSE=yes + AC_DEFINE(ENABLE_BACKEND_SSE, 1, [Enable SSE backend]) + ENABLE_BACKEND_MMX=yes + AC_DEFINE(ENABLE_BACKEND_MMX, 1, [Enable MMX backend]) + ENABLE_BACKEND_ALTIVEC=yes + AC_DEFINE(ENABLE_BACKEND_ALTIVEC, 1, [Enable Altivec backend]) + ENABLE_BACKEND_NEON=yes + AC_DEFINE(ENABLE_BACKEND_NEON, 1, [Enable NEON backend]) + ENABLE_BACKEND_ARM=yes + AC_DEFINE(ENABLE_BACKEND_ARM, 1, [Enable Arm backend]) + ENABLE_BACKEND_C64X=yes + AC_DEFINE(ENABLE_BACKEND_C64X, 1, [Enable c64x backend]) + ;; +esac +AM_CONDITIONAL(ENABLE_BACKEND_SSE, test "x$ENABLE_BACKEND_SSE" = "xyes") +AM_CONDITIONAL(ENABLE_BACKEND_MMX, test "x$ENABLE_BACKEND_MMX" = "xyes") +AM_CONDITIONAL(ENABLE_BACKEND_ALTIVEC, test "x$ENABLE_BACKEND_ALTIVEC" = "xyes") +AM_CONDITIONAL(ENABLE_BACKEND_NEON, test "x$ENABLE_BACKEND_NEON" = "xyes") +AM_CONDITIONAL(ENABLE_BACKEND_ARM, test "x$ENABLE_BACKEND_ARM" = "xyes") +AM_CONDITIONAL(ENABLE_BACKEND_C64X, test "x$ENABLE_BACKEND_C64X" = "xyes") + AC_DEFINE(ORC_EXPORTS, 1, [Defined for compiling internal code]) diff --git a/examples/Makefile.am b/examples/Makefile.am index 672ae36..921c980 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,5 +1,9 @@ -orcbin_PROGRAMS = example1 mt19937ar volscale +orcbin_PROGRAMS = example1 mt19937ar + +if ENABLE_BACKEND_MMX +orcbin_PROGRAMS += volscale +endif AM_LDFLAGS = $(ORC_LIBS) AM_CFLAGS = $(ORC_CFLAGS) diff --git a/orc/Makefile.am b/orc/Makefile.am index 3d6fa42..45b2dd6 100644 --- a/orc/Makefile.am +++ b/orc/Makefile.am @@ -18,28 +18,42 @@ liborc_@ORC_MAJORMINOR@_la_SOURCES = \ orccodemem.c \ orcprogram.c \ orccompiler.c \ - orcprogram-arm.c \ orcprogram-c.c \ - orcprogram-c64x-c.c \ - orcprogram-altivec.c \ - orcprogram-mmx.c \ - orcprogram-sse.c \ orcprogram.h \ orcopcodes.c \ orcparse.c \ orconce.c \ - orcrules-altivec.c \ - orcrules-mmx.c \ - orcrules-sse.c \ - orcrules-arm.c \ - orcprogram-neon.c \ - orcrules-neon.c \ - orcdebug.c \ - orcpowerpc.c \ - orcsse.c \ - orcmmx.c \ - orcx86.c \ - orcarm.c + orcdebug.c + +if ENABLE_BACKEND_SSE +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcsse.c orcrules-sse.c orcprogram-sse.c +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcx86.c +endif +if ENABLE_BACKEND_MMX +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcmmx.c orcrules-mmx.c orcprogram-mmx.c +if ENABLE_BACKEND_SSE +else +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcx86.c +endif +endif +if ENABLE_BACKEND_ALTIVEC +liborc_@ORC_MAJORMINOR@_la_SOURCES += \ + orcrules-altivec.c orcprogram-altivec.c orcpowerpc.c +endif +if ENABLE_BACKEND_NEON +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcprogram-neon.c orcrules-neon.c +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcarm.c +endif +if ENABLE_BACKEND_ARM +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcprogram-arm.c orcrules-arm.c +if ENABLE_BACKEND_NEON +else +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcarm.c +endif +endif +if ENABLE_BACKEND_C64X +liborc_@ORC_MAJORMINOR@_la_SOURCES += orcprogram-c64x-c.c +endif if HAVE_I386 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-x86.c @@ -65,6 +79,7 @@ pkginclude_HEADERS = \ orconce.h \ orcsse.h \ orcmmx.h \ + orcneon.h \ orcx86.h \ orcpowerpc.h \ orcarm.h @@ -38,11 +38,23 @@ orc_init (void) _orc_once_init(); orc_opcode_init(); orc_c_init(); +#ifdef ENABLE_BACKEND_C64X orc_c64x_c_init(); +#endif +#ifdef ENABLE_BACKEND_MMX orc_mmx_init(); +#endif +#ifdef ENABLE_BACKEND_SSE orc_sse_init(); +#endif +#ifdef ENABLE_BACKEND_ALTIVEC orc_powerpc_init(); +#endif +#ifdef ENABLE_BACKEND_ARM orc_arm_init(); +#endif +#ifdef ENABLE_BACKEND_NEON orc_neon_init(); +#endif } diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 8eac198..50727c3 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -27,12 +27,14 @@ EXTRA_DIST = test.orc CLEANFILES = temp-orc-test-* +if ENABLE_BACKEND_NEON TESTS += compile_opcodes_sys_neon \ compile_opcodes_float_neon \ compile_parse_neon noinst_PROGRAMS += compile_opcodes_sys_neon \ compile_opcodes_float_neon \ compile_parse_neon +endif AM_CFLAGS = $(ORC_CFLAGS) -I/usr/local/include/liboil-0.3/ LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la -loil-0.3 |