orc-0.4.18/0000775000175000017500000000000012206165374007400 500000000000000orc-0.4.18/depcomp0000755000175000017500000005064312206165330010673 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: orc-0.4.18/orc-uninstalled.pc.in0000664000175000017500000000050712126351204013344 00000000000000prefix= exec_prefix= libdir=${pcfiledir}/orc/ includedir=${pcfiledir}/ Name: orc-@ORC_MAJORMINOR@ uninstalled Description: Library of Optimized Inner Loops Runtime Compiler Version: @VERSION@ Libs: @abs_top_builddir@/orc/liborc-@ORC_MAJORMINOR@.la @LIBM@ @LIBRT@ Cflags: -I${includedir} orcc=${pcfiledir}/tools/orcc@EXEEXT@ orc-0.4.18/COPYING0000644000175000017500000000606411551076052010353 00000000000000 The majority of the source code and the collective work is subject to the following license: Copyright 2002 - 2009 David A. Schleef 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. The source code implementing the Mersenne Twister algorithm is subject to the following license: Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, 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. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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. orc-0.4.18/m4/0000775000175000017500000000000012206165373007717 500000000000000orc-0.4.18/m4/ltversion.m40000644000175000017500000000126212206165324012121 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) orc-0.4.18/m4/libtool.m40000644000175000017500000106043412206165324011547 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS orc-0.4.18/m4/as-nano.m40000644000175000017500000000117111022604644011425 00000000000000dnl as-version.m4 0.1.0 dnl autostars m4 macro for versioning (modified) dnl Thomas Vander Stichele dnl David Schleef dnl $Id: as-nano.m4,v 1.2 2007-03-16 23:30:02 ds Exp $ dnl AS_VERSION(ACTION-IF-NO-NANO, [ACTION-IF-NANO]) AC_DEFUN([AS_NANO], [ AC_MSG_CHECKING(nano version) NANO=$(echo AC_PACKAGE_VERSION | sed ['s/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.*//']) AC_SUBST(NANO) if test x"$NANO" = x || test "x$NANO" = "x0" ; then AC_MSG_RESULT([0 (release)]) NANO=0 ifelse([$1], , :, [$1]) else AC_MSG_RESULT($NANO) ifelse([$2], , :, [$2]) fi ]) orc-0.4.18/m4/gtk-doc.m40000644000175000017500000000417511551076053011434 00000000000000dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) orc-0.4.18/m4/ltoptions.m40000644000175000017500000003007312206165324012131 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) orc-0.4.18/m4/as-host-defines.m40000664000175000017500000000273612111024531013063 00000000000000dnl as-host-defines.m4 0.1.0 dnl autostars m4 macro for generating defines for various host architectures dnl David Schleef dnl $Id: as-host-defines.m4,v 1.3 2007-08-22 20:55:24 uid2631 Exp $ dnl AS_HOST_DEFINES() AC_DEFUN([AS_HOST_DEFINES], [ case "x${host_cpu}" in xi?86 | k?) HAVE_I386=yes AC_DEFINE(HAVE_I386, 1, [Defined if host is i386]) ;; xx86_64|xamd64) HAVE_AMD64=yes AC_DEFINE(HAVE_AMD64, 1, [Defined if host is amd64]) ;; xpowerpc|xppc|xpowerpc64|xppc64) HAVE_POWERPC=yes AC_DEFINE(HAVE_POWERPC, 1, [Defined if host is powerpc]) ;; xarm*) HAVE_ARM=yes AC_DEFINE(HAVE_ARM, 1, [Defined if host is arm]) ;; xmipsel*) HAVE_MIPSEL=yes AC_DEFINE(HAVE_MIPSEL, 1, [Defined if host is mipsel]) esac AM_CONDITIONAL(HAVE_I386, test "x$HAVE_I386" = "xyes") AM_CONDITIONAL(HAVE_AMD64, test "x$HAVE_AMD64" = "xyes") AM_CONDITIONAL(HAVE_POWERPC, test "x$HAVE_POWERPC" = "xyes") AM_CONDITIONAL(HAVE_ARM, test "x$HAVE_ARM" = "xyes") AM_CONDITIONAL(HAVE_MIPSEL, test "x$HAVE_MIPSEL" = "xyes") case "${host_os}" in mingw*) HAVE_OS_WIN32=yes AC_DEFINE(HAVE_OS_WIN32, 1, [Defined if host OS is MS Windows]) ;; linux*) HAVE_OS_LINUX=yes AC_DEFINE(HAVE_OS_LINUX, 1, [Defined if host OS is linux]) ;; esac AM_CONDITIONAL(HAVE_OS_WIN32, test "$HAVE_OS_WIN32" = "yes") AM_CONDITIONAL(HAVE_OS_LINUX, test "$HAVE_OS_LINUX" = "yes") ]) orc-0.4.18/m4/as-compiler-flag.m40000644000175000017500000000135411022604644013216 00000000000000dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2004-08-20 22:25:22 ds Exp $ dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS. dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags, dnl and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([AS_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) orc-0.4.18/m4/lt~obsolete.m40000644000175000017500000001375612206165325012462 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) orc-0.4.18/m4/ac_libtool_tags.m40000644000175000017500000000317711022604644013226 00000000000000 # backported from libtool 1.6 by Paolo Bonzini # When AC_LIBTOOL_TAGS is used, I redefine _LT_AC_TAGCONFIG # to be more similar to the libtool 1.6 implementation, which # uses an m4 loop and m4 case instead of a shell loop. This # way the CXX/GCJ/F77/RC tests are not always expanded. # AC_LIBTOOL_TAGS # --------------- # tags to enable AC_DEFUN([AC_LIBTOOL_TAGS], [m4_define([_LT_TAGS],[$1]) m4_define([_LT_AC_TAGCONFIG], [ if test -f "$ltmain"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi AC_FOREACH([_LT_TAG], _LT_TAGS, [m4_case(_LT_TAG, [CXX], [ if test -n "$CXX" && test "X$CXX" != "Xno"; then AC_LIBTOOL_LANG_CXX_CONFIG available_tags="$available_tags _LT_TAG" fi], [F77], [ if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG available_tags="$available_tags _LT_TAG" fi], [GCJ], [ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG available_tags="$available_tags _LT_TAG" fi], [RC], [ if test -n "$RC" && test "X$RC" != "Xno"; then AC_LIBTOOL_LANG_RC_CONFIG available_tags="$available_tags _LT_TAG" fi], [m4_errprintn(m4_location[: error: invalid tag name: ]"_LT_TAG") m4_exit(1)]) ]) fi ])dnl _LT_AC_TAG_CONFIG ]) orc-0.4.18/m4/ltsugar.m40000644000175000017500000001042412206165324011555 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) orc-0.4.18/m4/pkg.m40000644000175000017500000001122311154067733010661 00000000000000# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) if test $pkg_failed = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met. Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables to avoid the need to call pkg-config. See the pkg-config man page for more details.])], [$4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES orc-0.4.18/Makefile.in0000664000175000017500000007037412206165330011370 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/orc-uninstalled.pc.in $(srcdir)/orc.pc.in \ $(top_srcdir)/configure COPYING TODO compile config.guess \ config.sub depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = orc-uninstalled.pc orc.pc CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(aclocaldir)" \ "$(DESTDIR)$(pkgconfigdir)" DATA = $(aclocal_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = -I m4 AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign SUBDIRS = orc orc-test tools examples doc testsuite EXTRA_DIST = COPYING autogen.sh gtk-doc.make orc.m4 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc pkgconfig_DATA = orc-$(ORC_MAJORMINOR).pc BUILT_SOURCES = orc-$(ORC_MAJORMINOR)-uninstalled.pc CLEANFILES = orc-$(ORC_MAJORMINOR).pc orc-$(ORC_MAJORMINOR)-uninstalled.pc aclocaldir = $(datadir)/aclocal aclocal_DATA = orc.m4 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 orc-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/orc-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ orc.pc: $(top_builddir)/config.status $(srcdir)/orc.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-aclocalDATA: $(aclocal_DATA) @$(NORMAL_INSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(aclocaldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(aclocaldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(aclocaldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(aclocaldir)" || exit $$?; \ done uninstall-aclocalDATA: @$(NORMAL_UNINSTALL) @list='$(aclocal_DATA)'; test -n "$(aclocaldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(aclocaldir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(aclocaldir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-aclocalDATA install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-aclocalDATA uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-aclocalDATA install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-aclocalDATA \ uninstall-am uninstall-pkgconfigDATA orc-$(ORC_MAJORMINOR).pc: orc.pc cp orc.pc orc-$(ORC_MAJORMINOR).pc orc-$(ORC_MAJORMINOR)-uninstalled.pc: orc-uninstalled.pc cp orc-uninstalled.pc orc-$(ORC_MAJORMINOR)-uninstalled.pc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/config.h.in0000664000175000017500000001005112206165327011336 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Enable Altivec backend */ #undef ENABLE_BACKEND_ALTIVEC /* Enable c64x backend */ #undef ENABLE_BACKEND_C64X /* Enable MIPS backend */ #undef ENABLE_BACKEND_MIPS /* Enable MMX backend */ #undef ENABLE_BACKEND_MMX /* Enable NEON backend */ #undef ENABLE_BACKEND_NEON /* Enable SSE backend */ #undef ENABLE_BACKEND_SSE /* Defined if host is amd64 */ #undef HAVE_AMD64 /* Defined if host is arm */ #undef HAVE_ARM /* Defined if we have clock_gettime() */ #undef HAVE_CLOCK_GETTIME /* Use malloc to allocate code for execution */ #undef HAVE_CODEMEM_MALLOC /* Use mmap to allocate code for execution */ #undef HAVE_CODEMEM_MMAP /* Use VirtualAlloc to allocate code for execution */ #undef HAVE_CODEMEM_VIRTUALALLOC /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Defined if host is i386 */ #undef HAVE_I386 /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Defined if host is mipsel */ #undef HAVE_MIPSEL /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Defined if we have a monotonic clock */ #undef HAVE_MONOTONIC_CLOCK /* Defined if host OS is linux */ #undef HAVE_OS_LINUX /* Defined if host OS is MS Windows */ #undef HAVE_OS_WIN32 /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Defined if host is powerpc */ #undef HAVE_POWERPC /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the `sigsetjmp' function. */ #undef HAVE_SIGSETJMP /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Use pthread thread code */ #undef HAVE_THREAD_PTHREAD /* Use Windows thread code */ #undef HAVE_THREAD_WIN32 /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VALGRIND_VALGRIND_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Defined for compiling internal code */ #undef ORC_EXPORTS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif orc-0.4.18/configure.ac0000664000175000017500000001317212206165123011602 00000000000000AC_PREREQ([2.58]) AC_INIT(orc,0.4.18) dnl don't forget to update libversion AS_NANO(ORC_GIT=no,ORC_GIT=yes) AC_CANONICAL_HOST([]) AM_INIT_AUTOMAKE(1.6) ORC_MAJORMINOR=0.4 AC_SUBST(ORC_MAJORMINOR) AC_CONFIG_HEADER(config.h) dnl CURRENT, REVISION, AGE dnl - library source changed -> increment REVISION dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 dnl - interfaces added -> increment AGE dnl - interfaces removed -> AGE = 0 ORC_LIBVERSION="18:0:18" AC_SUBST(ORC_LIBVERSION) AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_TAGS([]) AC_PROG_LIBTOOL AM_PROG_CC_C_O AM_PROG_AS AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([orc/orc.h]) ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS" AC_SUBST(ACLOCAL_AMFLAGS) AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = "xyes") AC_CHECK_FUNCS([posix_memalign]) ################################################## # Check for gtk-doc. ################################################## if test "x$cross_compiling" = "xyes" ; then enable_gtk_doc=no fi GTK_DOC_CHECK([1.0]) AS_HOST_DEFINES() AC_C_BIGENDIAN AC_FUNC_MMAP() AC_CHECK_HEADERS([inttypes.h]) AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_HEADERS([unistd.h]) AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_FUNCS([sigaction]) AC_CHECK_FUNCS([sigsetjmp]) AC_CHECK_LIBM AC_SUBST(LIBM) AC_CHECK_LIB(rt, clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Defined if we have clock_gettime()]) LIBRT=-lrt ) AC_SUBST(LIBRT) AC_CACHE_CHECK(for monotonic clocks, orc_cv_monotonic_clock,AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { #if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)) #error No monotonic clock #endif return 0; } ]])],orc_cv_monotonic_clock=yes,orc_cv_monotonic_clock=no)) if test "$orc_cv_monotonic_clock" = "yes"; then AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Defined if we have a monotonic clock]) fi AC_CHECK_HEADERS([valgrind/valgrind.h]) AS_COMPILER_FLAG(-Wall, ORC_CFLAGS="$ORC_CFLAGS -Wall") if test "x$ORC_GIT" = "xyes" then AS_COMPILER_FLAG(-Werror, ERROR_CFLAGS="-Werror") fi case "${host_os}" in nobody_is_using_this_currently) AC_DEFINE(HAVE_CODEMEM_MALLOC, 1, [Use malloc to allocate code for execution]) ;; mingw*|pw32*|cygwin*) AC_DEFINE(HAVE_CODEMEM_VIRTUALALLOC, 1, [Use VirtualAlloc to allocate code for execution]) ;; linux*|darwin*|solaris*|netbsd*|freebsd*|openbsd*|kfreebsd*|dragonfly*|gnu*) AC_DEFINE(HAVE_CODEMEM_MMAP, 1, [Use mmap to allocate code for execution]) ;; *) AC_ERROR([no code allocation backend]) ;; esac case "${host_os}" in mingw*|pw32*|cygwin*) AC_DEFINE(HAVE_THREAD_WIN32, 1, [Use Windows thread code]) ;; *android*) AC_DEFINE(HAVE_THREAD_PTHREAD, 1, [Use pthread thread code]) PTHREAD_CFLAGS= PTHREAD_LIBS= ;; *) AC_DEFINE(HAVE_THREAD_PTHREAD, 1, [Use pthread thread code]) PTHREAD_CFLAGS= PTHREAD_LIBS=-lpthread ;; esac AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) AC_ARG_ENABLE(backend, AC_HELP_STRING([--enable-backend],[sse,mmx,neon,mips,all (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 backend is disabled until it has decent coverage # 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]) ;; mips) ENABLE_BACKEND_MIPS=yes AC_DEFINE(ENABLE_BACKEND_MIPS, 1, [Enable MIPS 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]) ENABLE_BACKEND_MIPS=yes AC_DEFINE(ENABLE_BACKEND_MIPS, 1, [Enable MIPS 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") AM_CONDITIONAL(ENABLE_BACKEND_MIPS, test "x$ENABLE_BACKEND_MIPS" = "xyes") AC_DEFINE(ORC_EXPORTS, 1, [Defined for compiling internal code]) ORC_CFLAGS="$ORC_CFLAGS \$(ERROR_CFLAGS) -I\$(top_srcdir)" AC_SUBST(ERROR_CFLAGS) AC_SUBST(ORC_CFLAGS) ORC_LIBS="\$(top_builddir)/orc/liborc-$ORC_MAJORMINOR.la $LIBM $LIBRT" AC_SUBST(ORC_LIBS) #CFLAGS=`echo $CFLAGS | sed s/O2/O0/` pkgconfigdir="\$(libdir)/pkgconfig" AC_SUBST(pkgconfigdir) AC_CONFIG_FILES([ Makefile doc/Makefile doc/version.entities orc/Makefile orc-test/Makefile testsuite/Makefile testsuite/orcc/Makefile testsuite/benchmorc/Makefile examples/Makefile tools/Makefile orc-uninstalled.pc orc.pc ]) AC_OUTPUT orc-0.4.18/orc/0000775000175000017500000000000012206165373010162 500000000000000orc-0.4.18/orc/orccode.c0000664000175000017500000000106512071634360011663 00000000000000 #include "config.h" #include #include #include #include #include OrcCode * orc_code_new (void) { OrcCode *code; code = malloc(sizeof(OrcCode)); memset (code, 0, sizeof(OrcCode)); return code; } void orc_code_free (OrcCode *code) { if (code->insns) { free (code->insns); code->insns = NULL; } if (code->vars) { free (code->vars); code->vars = NULL; } if (code->chunk) { orc_code_chunk_free (code->chunk); code->chunk = NULL; } free (code); } orc-0.4.18/orc/orconce.h0000644000175000017500000000045511626334410011700 00000000000000 #ifndef _ORC_ONCE_H_ #define _ORC_ONCE_H_ #include ORC_BEGIN_DECLS typedef struct _OrcMutex OrcMutex; typedef struct _OrcOnce OrcOnce; struct _OrcOnce { int inited; void *value; }; void orc_once_mutex_lock (void); void orc_once_mutex_unlock (void); ORC_END_DECLS #endif orc-0.4.18/orc/orcutils.c0000664000175000017500000000756512071634360012124 00000000000000/* * ORC - Library of Optimized Inner Loops * Copyright (c) 2003,2004 David A. Schleef * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include /** * SECTION:orcutils * @title: Utility functions * @short_description: Orc utility functions */ char * _strndup (const char *s, int n) { char *r; r = malloc (n+1); memcpy(r,s,n); r[n]=0; return r; } char ** strsplit (const char *s, char delimiter) { char **list = NULL; const char *tok; int n = 0; while (*s == ' ') s++; list = malloc (1 * sizeof(char *)); while (*s) { tok = s; while (*s && *s != delimiter) s++; list[n] = _strndup (tok, s - tok); while (*s && *s == delimiter) s++; list = realloc (list, (n + 2) * sizeof(char *)); n++; } list[n] = NULL; return list; } char * get_tag_value (char *s, const char *tag) { char *flags; char *end; char *colon; flags = strstr(s,tag); if (flags == NULL) return NULL; end = strchr(flags, '\n'); if (end == NULL) return NULL; colon = strchr (flags, ':'); if (colon == NULL) return NULL; colon++; if(colon >= end) return NULL; return _strndup (colon, end-colon); } orc_int64 _strtoll (const char *nptr, char **endptr, int base) { int neg = 0; orc_int64 val = 0; /* Skip all spaces */ while (isspace (*nptr)) nptr++; if (!*nptr) return val; /* Get sign */ if (*nptr == '-') { neg = 1; nptr++; } else if (*nptr == '+') { nptr++; } if (!*nptr) return val; /* Try to detect the base if none was given */ if (base == 0) { if (*nptr == '0' && (*(nptr + 1) == 'x' || *(nptr + 1) == 'X')) { base = 16; nptr += 2; } else if (*nptr == '0') { base = 8; nptr++; } else { base = 10; } } else if (base == 16) { if (*nptr == '0' && (*(nptr + 1) == 'x' || *(nptr + 1) == 'X')) nptr += 2; } else if (base == 8) { if (*nptr == '0') nptr++; } while (*nptr) { int c = *nptr; if (c >= '0' && c <= '9') c = c - '0'; else if (c >= 'a' && c <= 'z') c = 10 + c - 'a'; else if (c >= 'A' && c <= 'Z') c = 10 + c - 'A'; else break; if (c >= base) break; if ((orc_uint64) val > ORC_UINT64_C(0xffffffffffffffff) / base || (orc_uint64) (val * base) > ORC_UINT64_C(0xffffffffffffffff) - c) { val = ORC_UINT64_C(0xffffffffffffffff); break; } val = val * base + c; nptr++; } if (endptr) *endptr = (char *) nptr; return (neg) ? - val : val; } orc-0.4.18/orc/orcneon.h0000644000175000017500000000332611563547254011727 00000000000000 #ifndef _ORC_NEON_H_ #define _ORC_NEON_H_ #include #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API const char *orc_neon_reg_name (int reg); const char *orc_neon_reg_name_quad (int reg); void orc_neon_loadb (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_loadw (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_loadl (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_loadq (OrcCompiler *compiler, int dest, int src1, int update, int is_aligned); void orc_neon_load_vec_aligned (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_load_vec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_load_halfvec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update); void orc_neon_neg (OrcCompiler *compiler, int dest); void orc_neon_storeb (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned); void orc_neon_storew (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned); void orc_neon_storel (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned); void orc_neon_storeq (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned); void orc_neon_emit_loadib (OrcCompiler *p, int reg, int value); void orc_neon_emit_loadiw (OrcCompiler *p, int reg, int value); void orc_neon_emit_loadil (OrcCompiler *p, int reg, int value); void orc_neon_emit_loadpb (OrcCompiler *p, int reg, int param); void orc_neon_emit_loadpw (OrcCompiler *p, int reg, int param); void orc_neon_emit_loadpl (OrcCompiler *p, int reg, int param); void orc_neon_preload (OrcCompiler *compiler, OrcVariable *var, int write, int offset); #endif ORC_END_DECLS #endif orc-0.4.18/orc/generate-emulation.c0000664000175000017500000002215412177015514014035 00000000000000 #include "config.h" #include #include #include #include #include #include void output_code_emulate (OrcProgram *p, FILE *output); int verbose = 0; int error = 0; int compat; char *target = "sse"; #define ORC_VERSION(a,b,c,d) ((a)*1000000 + (b)*10000 + (c)*100 + (d)) #define REQUIRE(a,b,c,d) do { \ if (ORC_VERSION((a),(b),(c),(d)) > compat) { \ fprintf(stderr, "Feature used that is incompatible with --compat\n"); \ exit (1); \ } \ } while (0) void help (void) { printf("Usage:\n"); printf(" generate-emulation [OPTION...]\n"); printf("\n"); printf("Help Options:\n"); printf(" -h, --help Show help options\n"); printf("\n"); printf("Application Options:\n"); printf(" -o, --output FILE Write output to FILE\n"); printf(" --header Write header instead of .c file\n"); printf("\n"); exit (0); } int main (int argc, char *argv[]) { char *output_file = NULL; char *input_file = NULL; char *include_file = NULL; FILE *output; int i; OrcOpcodeSet *opcode_set; int output_header = FALSE; orc_init (); for(i=1;in_opcodes;i++){ OrcStaticOpcode *opcode = opcode_set->opcodes + i; fprintf(output, "void emulate_%s (OrcOpcodeExecutor *ex, int i, int n);\n", opcode->name); } fprintf(output, "\n"); fprintf(output, "#endif\n"); fprintf(output, "\n"); } else { fprintf(output, "#ifdef HAVE_CONFIG_H\n"); fprintf(output, "#include \"config.h\"\n"); fprintf(output, "#endif\n"); fprintf(output, "#include \n"); fprintf(output, "#include \n"); if (include_file) { fprintf(output, "#include <%s>\n", include_file); } fprintf(output, "\n"); fprintf(output, "%s", orc_target_get_asm_preamble ("c")); fprintf(output, "\n"); for(i=0;in_opcodes;i++){ char s[40]; OrcProgram *program; OrcStaticOpcode *opcode = opcode_set->opcodes + i; int args[4] = { -1, -1, -1, -1 }; int n_args = 0; program = orc_program_new (); sprintf(s, "emulate_%s", opcode->name); orc_program_set_name (program, s); if (opcode->dest_size[0] != 0) { if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (program, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (program, opcode->dest_size[0], "d1"); } } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (program, opcode->dest_size[1], "d2"); } if (opcode->src_size[0] != 0) { if (opcode->src_size[1] == 0 && opcode->flags & ORC_STATIC_OPCODE_SCALAR) { args[n_args++] = orc_program_add_parameter (program, opcode->src_size[0], "s1"); } else { args[n_args++] = orc_program_add_source (program, opcode->src_size[0], "s1"); } } if (opcode->src_size[1] != 0) { if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { args[n_args++] = orc_program_add_parameter (program, opcode->src_size[1], "s2"); } else { args[n_args++] = orc_program_add_source (program, opcode->src_size[1], "s2"); } } if (opcode->src_size[2] != 0) { if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { args[n_args++] = orc_program_add_parameter (program, opcode->src_size[2], "s3"); } else { args[n_args++] = orc_program_add_source (program, opcode->src_size[2], "s3"); } } orc_program_append_2 (program, opcode->name, 0, args[0], args[1], args[2], args[3]); output_code_emulate (program, output); } } fclose (output); if (error) exit(1); return 0; } const char *varnames[] = { "d1", "d2", "d3", "d4", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "a1", "a2", "a3", "d4", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "t14", "t15", "t16" }; const char *enumnames[] = { "ORC_VAR_D1", "ORC_VAR_D2", "ORC_VAR_D3", "ORC_VAR_D4", "ORC_VAR_S1", "ORC_VAR_S2", "ORC_VAR_S3", "ORC_VAR_S4", "ORC_VAR_S5", "ORC_VAR_S6", "ORC_VAR_S7", "ORC_VAR_S8", "ORC_VAR_A1", "ORC_VAR_A2", "ORC_VAR_A3", "ORC_VAR_A4", "ORC_VAR_C1", "ORC_VAR_C2", "ORC_VAR_C3", "ORC_VAR_C4", "ORC_VAR_C5", "ORC_VAR_C6", "ORC_VAR_C7", "ORC_VAR_C8", "ORC_VAR_P1", "ORC_VAR_P2", "ORC_VAR_P3", "ORC_VAR_P4", "ORC_VAR_P5", "ORC_VAR_P6", "ORC_VAR_P7", "ORC_VAR_P8", "ORC_VAR_T1", "ORC_VAR_T2", "ORC_VAR_T3", "ORC_VAR_T4", "ORC_VAR_T5", "ORC_VAR_T6", "ORC_VAR_T7", "ORC_VAR_T8", "ORC_VAR_T9", "ORC_VAR_T10", "ORC_VAR_T11", "ORC_VAR_T12", "ORC_VAR_T13", "ORC_VAR_T14", "ORC_VAR_T15", "ORC_VAR_T16" }; #if 0 void output_prototype (OrcProgram *p, FILE *output) { OrcVariable *var; int i; int need_comma; fprintf(output, "%s (", p->name); need_comma = FALSE; for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->type_name) { fprintf(output, "%s * %s", var->type_name, varnames[ORC_VAR_D1 + i]); } else { fprintf(output, "orc_uint%d * %s", var->size*8, varnames[ORC_VAR_D1 + i]); } if (p->is_2d) { fprintf(output, ", int %s_stride", varnames[ORC_VAR_D1 + i]); } need_comma = TRUE; } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->type_name) { fprintf(output, "%s * %s", var->type_name, varnames[ORC_VAR_A1 + i]); } else { fprintf(output, "orc_uint%d * %s", var->size*8, varnames[ORC_VAR_A1 + i]); } need_comma = TRUE; } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->type_name) { fprintf(output, "const %s * %s", var->type_name, varnames[ORC_VAR_S1 + i]); } else { fprintf(output, "const orc_uint%d * %s", var->size*8, varnames[ORC_VAR_S1 + i]); } if (p->is_2d) { fprintf(output, ", int %s_stride", varnames[ORC_VAR_S1 + i]); } need_comma = TRUE; } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->is_float_param) { REQUIRE(0,4,5,1); } fprintf(output, "%s %s", var->is_float_param ? "float" : "int", varnames[ORC_VAR_P1 + i]); need_comma = TRUE; } } if (p->constant_n == 0) { if (need_comma) fprintf(output, ", "); fprintf(output, "int n"); need_comma = TRUE; } if (p->is_2d && p->constant_m == 0) { if (need_comma) fprintf(output, ", "); fprintf(output, "int m"); } fprintf(output, ")"); } void output_code_header (OrcProgram *p, FILE *output) { fprintf(output, "void "); output_prototype (p, output); fprintf(output, ";\n"); } #endif void output_code_emulate (OrcProgram *p, FILE *output) { fprintf(output, "void\n"); if (p->constant_n) { fprintf(output, "%s (OrcOpcodeExecutor *ex, int offset)\n", p->name); } else { fprintf(output, "%s (OrcOpcodeExecutor *ex, int offset, int n)\n", p->name); } fprintf(output, "{\n"); { OrcCompileResult result; result = orc_program_compile_full (p, orc_target_get_by_name("c"), ORC_TARGET_C_BARE | ORC_TARGET_C_OPCODE); if (ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { fprintf(output, "%s\n", orc_program_get_asm_code (p)); } else { printf("Failed to compile %s\n", p->name); error = TRUE; } } fprintf(output, "}\n"); fprintf(output, "\n"); } orc-0.4.18/orc/orcprogram-mips.c0000664000175000017500000006463012111024531013361 00000000000000/* Copyright 2002 - 2009 David A. Schleef Copyright 2012 MIPS Technologies, Inc. Author: Guillaume Emont 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 #include #include #include #include "config.h" unsigned int orc_compiler_orc_mips_get_default_flags (void); void orc_compiler_orc_mips_init (OrcCompiler *compiler); void orc_compiler_orc_mips_assemble (OrcCompiler *compiler); const char * orc_compiler_orc_mips_get_asm_preamble (void); void orc_mips_flush_cache (OrcCode *code); /* in orcrules-mips.c */ void orc_compiler_orc_mips_register_rules (OrcTarget *target); static OrcTarget orc_mips_target = { "mips", #ifdef HAVE_MIPSEL TRUE, #else FALSE, #endif ORC_GP_REG_BASE, orc_compiler_orc_mips_get_default_flags, orc_compiler_orc_mips_init, orc_compiler_orc_mips_assemble, { { 0 } }, 0, orc_compiler_orc_mips_get_asm_preamble, NULL, NULL, orc_mips_flush_cache, }; enum { LABEL_REGION0_LOOP = 1, LABEL_REGION1, LABEL_REGION1_LOOP, LABEL_REGION2, LABEL_REGION2_LOOP, /* 5 */ LABEL_REGION2_LOOP_END, LABEL_OUTER_LOOP, LABEL_END }; #define LAST_LABEL LABEL_END void orc_mips_init (void) { orc_target_register (&orc_mips_target); orc_compiler_orc_mips_register_rules (&orc_mips_target); } unsigned int orc_compiler_orc_mips_get_default_flags (void) { unsigned int flags = 0; if (_orc_compiler_flag_debug) { flags |= ORC_TARGET_MIPS_FRAME_POINTER; } return flags; } void orc_compiler_orc_mips_init (OrcCompiler *compiler) { int i; if (compiler->target_flags & ORC_TARGET_MIPS_FRAME_POINTER) compiler->use_frame_pointer = TRUE; for (i=ORC_GP_REG_BASE; ivalid_regs[i] = 1; compiler->valid_regs[ORC_MIPS_ZERO] = 0; /* always 0 */ compiler->valid_regs[ORC_MIPS_AT] = 0; /* we shouldn't touch that (assembler temporary) */ compiler->exec_reg = ORC_MIPS_A0; compiler->valid_regs[ORC_MIPS_A0] = 0; /* first (and in our case only) function argument */ compiler->valid_regs[ORC_MIPS_T0] = 0; /* $t0, $t1 and $t2 are used as loop */ compiler->valid_regs[ORC_MIPS_T1] = 0; /* counters */ compiler->valid_regs[ORC_MIPS_T2] = 0; compiler->valid_regs[ORC_MIPS_T3] = 0; compiler->valid_regs[ORC_MIPS_T4] = 0; compiler->valid_regs[ORC_MIPS_T5] = 0; compiler->valid_regs[ORC_MIPS_K0] = 0; /* for kernel/interupts */ compiler->valid_regs[ORC_MIPS_K1] = 0; /* for kernel/interupts */ compiler->valid_regs[ORC_MIPS_GP] = 0; /* global pointer */ compiler->valid_regs[ORC_MIPS_SP] = 0; /* stack pointer */ compiler->valid_regs[ORC_MIPS_FP] = 0; /* frame pointer */ compiler->valid_regs[ORC_MIPS_RA] = 0; /* return address */ for (i=0;ialloc_regs[i] = 0; compiler->used_regs[i] = 0; compiler->save_regs[i] = 0; } compiler->save_regs[ORC_MIPS_V0] = 1; compiler->save_regs[ORC_MIPS_V1] = 1; for (i=ORC_MIPS_S0; i<= ORC_MIPS_S7; i++) compiler->save_regs[i] = 1; switch (compiler->max_var_size) { case 1: compiler->loop_shift = 2; break; case 2: compiler->loop_shift = 1; break; case 4: compiler->loop_shift = 0; break; default: ORC_ERROR("unhandled variable size %d", compiler->max_var_size); } /* Empirical evidence in a colorspace conversion benchmark shows that 3 is * the best unroll shift. */ compiler->unroll_shift = 3; compiler->unroll_index = 0; for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; if ((strcmp (opcode->name, "loadupib") == 0) || (strcmp (opcode->name, "loadupdb") == 0)) { compiler->vars[insn->src_args[0]].need_offset_reg = TRUE; } } } const char * orc_compiler_orc_mips_get_asm_preamble (void) { return "\n" "/* begin Orc MIPS target preamble */\n" ".abicalls\n" /* not exactly sure what this is, but linker complains without it */ ".set noreorder\n" "/* end Orc MIPS target preamble */\n\n"; } int orc_mips_emit_prologue (OrcCompiler *compiler) { int i, stack_size; unsigned int stack_increment; if (compiler->use_frame_pointer) { stack_size = 12; /* we stack at least fp and a0 and start at stack_increment 4 */ stack_increment = 4; } else { stack_size = 0; stack_increment = 0; } orc_compiler_append_code(compiler,".globl %s\n", compiler->program->name); orc_compiler_append_code(compiler,"%s:\n", compiler->program->name); /* push registers we need to save */ for(i=0; i<32; i++) if (compiler->used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) stack_size += 4; if (stack_size) { orc_mips_emit_addiu (compiler, ORC_MIPS_SP, ORC_MIPS_SP, -stack_size); if (compiler->use_frame_pointer) { orc_mips_emit_sw (compiler, ORC_MIPS_FP, ORC_MIPS_SP, stack_increment); stack_increment += 4; orc_mips_emit_move (compiler, ORC_MIPS_FP, ORC_MIPS_SP); orc_mips_emit_sw (compiler, ORC_MIPS_A0, ORC_MIPS_SP, stack_increment); stack_increment += 4; } for(i=0; i<32; i++){ if (compiler->used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) { orc_mips_emit_sw (compiler, ORC_GP_REG_BASE+i, ORC_MIPS_SP, stack_increment); stack_increment +=4; } } } return stack_size; } void orc_mips_emit_epilogue (OrcCompiler *compiler, int stack_size) { int i; /* pop saved registers */ if (stack_size) { unsigned int stack_increment = 0; if (compiler->use_frame_pointer) stack_increment = 8; for(i=0; i<32; i++){ if (compiler->used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) { orc_mips_emit_lw (compiler, ORC_GP_REG_BASE+i, ORC_MIPS_SP, stack_increment); stack_increment +=4; } } if (compiler->use_frame_pointer) orc_mips_emit_lw (compiler, ORC_MIPS_FP, ORC_MIPS_SP, 4); orc_mips_emit_addiu (compiler, ORC_MIPS_SP, ORC_MIPS_SP, stack_size); } orc_mips_emit_jr (compiler, ORC_MIPS_RA); orc_mips_emit_nop (compiler); if (compiler->target_flags & ORC_TARGET_CLEAN_COMPILE) { /* we emit some padding nops at the end to align to 16 bytes because that's * what gnu as does (not sure why) and we want to generate the same code * for testing purposes */ orc_mips_emit_align (compiler, 4); } } void orc_mips_load_constants_inner (OrcCompiler *compiler) { int i; for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_CONST: case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_mips_emit_lw (compiler, var->ptr_register, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_ARRAYS(i)); break; default: break; } if (var->ptr_offset) orc_mips_emit_move (compiler, var->ptr_offset, ORC_MIPS_ZERO); } for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; OrcRule *rule; if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", i, insn->opcode->name); compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { rule->emit (compiler, rule->emit_user, insn); } else { ORC_COMPILER_ERROR(compiler,"No rule for: %s", opcode->name); } } } #define CACHE_LINE_SIZE 32 void orc_mips_emit_var_pref (OrcCompiler *compiler, int iter_offset, int total_shift) { int i, j; int offset = 0; /* prefetch stuff into cache */ for (i=0; ivars + i; if (var->name == NULL) continue; if (var->update_type == 0) { offset = 0; } else if (var->update_type == 1) { offset = (var->size << total_shift) >> 1; } else { offset = var->size << total_shift; } if (var->vartype == ORC_VAR_TYPE_SRC) { for (j = iter_offset*offset; j < (iter_offset+1)*offset; j+=CACHE_LINE_SIZE) orc_mips_emit_pref (compiler, 4 /* load-streamed */, var->ptr_register, j); } else if (var->vartype == ORC_VAR_TYPE_DEST) { for (j = iter_offset*offset; j < (iter_offset+1)*offset; j+=CACHE_LINE_SIZE) orc_mips_emit_pref (compiler, 5 /* store-streamed */, var->ptr_register, j); } } } static int uses_register (OrcCompiler *compiler, OrcInstruction *insn, OrcMipsRegister reg) { int i; for (i=0; ivars + insn->dest_args[i]; if (var->alloc == reg || var->ptr_register == reg) return TRUE; } for (i=0; ivars + insn->src_args[i]; if (var->alloc == reg || var->ptr_register == reg) return TRUE; } return FALSE; } static void do_swap (int *tab, int i, int j) { int tmp = tab[i]; tab[i] = tab[j]; tab[j] = tmp; } /* Assumes that the instruction at indexes[i] is a load instruction */ static int can_raise (OrcCompiler *compiler, int *indexes, int i) { OrcMipsRegister reg; OrcInstruction *insn, *previous_insn; if (i==0) return FALSE; insn = compiler->insns + indexes[i]; previous_insn = compiler->insns + indexes[i-1]; /* Register where the load operation will put the data */ reg = compiler->vars[insn->dest_args[0]].alloc; return ! uses_register (compiler, previous_insn, reg); } /* Recursive. */ static void try_raise (OrcCompiler *compiler, int *indexes, int i) { if (can_raise (compiler, indexes, i)) { do_swap (indexes, i-1, i); try_raise (compiler, indexes, i-1); } } /* Do a kind of bubble sort, though it might not exactly be a sort. It only moves load instructions up until they reach an operation above which they cannot go. FIXME: also push store instructions down. */ static void optimise_order (OrcCompiler *compiler, int *indexes) { int i; for (i=0; in_insns; i++) { OrcInstruction *insn = compiler->insns + indexes[i]; if (insn->opcode->flags & ORC_STATIC_OPCODE_LOAD) try_raise (compiler, indexes, i); } } static int * get_optimised_instruction_order (OrcCompiler *compiler) { int *instruction_idx = NULL; int i; if (compiler->n_insns == 0) return NULL; instruction_idx = malloc (compiler->n_insns * sizeof(int)); for (i=0; in_insns; i++) instruction_idx[i] = i; optimise_order (compiler, instruction_idx); return instruction_idx; } void orc_mips_emit_loop (OrcCompiler *compiler, int unroll) { int i, j; int iteration_per_loop = 1; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; int total_shift = compiler->loop_shift; int *insn_idx; ORC_DEBUG ("loop_shift=%d", compiler->loop_shift); if (unroll) total_shift += compiler->unroll_shift; if (unroll) iteration_per_loop = 1 << compiler->unroll_shift; insn_idx = get_optimised_instruction_order (compiler); if (insn_idx == NULL) { ORC_ERROR ("Could not get optimised instruction order, not emitting loop"); return; } for (j=0; junroll_index = j; for (i=0; in_insns; i++) { insn = compiler->insns + insn_idx[i]; opcode = insn->opcode; if (insn->flags & ORC_INSN_FLAG_INVARIANT) continue; orc_compiler_append_code(compiler,"/* %d: %s */\n", i, insn->opcode->name); compiler->min_temp_reg = ORC_MIPS_T3; rule = insn->rule; if (rule && rule->emit) { compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_append_code (compiler, "No rule for %s\n", opcode->name); } } } compiler->unroll_index = 0; for (j=0; jvars + j; if (var->name == NULL) continue; if (var->vartype == ORC_VAR_TYPE_SRC || var->vartype == ORC_VAR_TYPE_DEST) { int offset; if (var->update_type == 0) { offset = 0; } else if (var->update_type == 1) { offset = (var->size << total_shift) >> 1; } else { offset = var->size << total_shift; } if (offset !=0 && var->ptr_register) { orc_mips_emit_addiu (compiler, var->ptr_register, var->ptr_register, offset); } } } } static int get_align_var (OrcCompiler *compiler) { if (compiler->vars[ORC_VAR_D1].size) return ORC_VAR_D1; if (compiler->vars[ORC_VAR_S1].size) return ORC_VAR_S1; ORC_PROGRAM_ERROR(compiler, "could not find alignment variable"); return -1; } static int get_shift (int size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; default: ORC_ERROR("bad size %d", size); } return -1; } /* alignment is a bit field. Each bit (from least significant) corresponds to a * dest or source variable in the order * ORC_VAR_D1-ORC_VAR_D4,ORC_VAR_S1-ORC_VAR_S8 */ void orc_mips_set_alignment (OrcCompiler *compiler, orc_uint16 alignment) { int i; for (i=ORC_VAR_D1; i<=ORC_VAR_S8; i++) { compiler->vars[i].is_aligned = !!(alignment & (1<vars[i].is_aligned) alignment |= 1<loop_shift; compiler->loop_shift = loop_shift; saved_alignment = orc_mips_get_alignment (compiler); orc_mips_set_alignment (compiler, alignment); orc_mips_emit_loop (compiler, unroll); orc_mips_set_alignment (compiler, saved_alignment); compiler->loop_shift = saved_loop_shift; orc_mips_emit_addi (compiler, counter, counter, -1); orc_mips_emit_bnez (compiler, counter, loop_label); orc_mips_emit_nop (compiler); } /* FIXME: this stuff should be cached */ int orc_mips_get_loop_label (OrcCompiler *compiler, int alignments) { int i, j=0, bitfield=0; for (i=ORC_VAR_D1; i<=ORC_VAR_S8; i++) { OrcVariable *var = &(compiler->vars[i]); if (var->name == NULL || var->ptr_register == 0 || var->is_aligned) { if (alignments & (1 << i)) return -1; else continue; } if (alignments & (1 << i)) { bitfield |= 1 << j; } j++; } if (bitfield) return LAST_LABEL + bitfield; return -1; } /* overwrites $t0 and $t1 */ void orc_mips_add_strides (OrcCompiler *compiler, int var_size_shift) { int i; orc_mips_emit_lw (compiler, ORC_MIPS_T1, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_N); orc_mips_emit_sll (compiler, ORC_MIPS_T1, ORC_MIPS_T1, var_size_shift); /* $t1 now contains the number of bytes that we treated (and that the var * pointer registers advanced) */ for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: /* get the stride (it's in bytes) */ orc_mips_emit_lw (compiler, ORC_MIPS_T0, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(i)); /* $t0 = stride - bytes advanced we add that to the pointer so that it points to the beginning of the next stride */ orc_mips_emit_sub (compiler, ORC_MIPS_T0, ORC_MIPS_T0, ORC_MIPS_T1); orc_mips_emit_addu (compiler, compiler->vars[i].ptr_register, compiler->vars[i].ptr_register, ORC_MIPS_T0); break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: ORC_COMPILER_ERROR(compiler,"bad vartype"); break; } } } void orc_compiler_orc_mips_assemble (OrcCompiler *compiler) { int stack_size; int align_shift = 2; /* this wouldn't work on mips64 */ int align_var = get_align_var (compiler); int var_size_shift; int i; var_size_shift = get_shift (compiler->vars[align_var].size); stack_size = orc_mips_emit_prologue (compiler); /* FIXME: load constants and params */ #if 0 for (i=0; ivars[i].name == NULL) ORC_PROGRAM_ERROR (compiler, "unimplemented"); } #endif orc_mips_load_constants_inner (compiler); if (compiler->program->is_2d) { /* ex->params[ORC_VAR_A1] contains "m", the number of lines we want to treat */ orc_mips_emit_lw (compiler, ORC_MIPS_T0, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(ORC_VAR_A1)); orc_mips_emit_beqz (compiler, ORC_MIPS_T0, LABEL_END); orc_mips_emit_label (compiler, LABEL_OUTER_LOOP); } orc_mips_emit_lw (compiler, ORC_MIPS_T2, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_N); orc_mips_emit_blez (compiler, ORC_MIPS_T2, LABEL_END); /* Note: in all these counter calculations ($t0, $t1 and $t2), we assume that * variables of k bytes are k-bytes aligned. */ /* $t0 = number of iterations in region0 (before alignment) */ /* = number of bytes to get to alignment / var_size = ((alignment - data_address) % alignment) / var_size = (((1 << align_shift) - data_address) % (1 << align_shift)) / var_size = (((1 << align_shift) - data_address) & ((1 << align_shfit) - 1)) >> var_size_shift */ orc_mips_emit_addiu (compiler, ORC_MIPS_T0, ORC_MIPS_ZERO, 1 << align_shift); orc_mips_emit_sub (compiler, ORC_MIPS_T0, ORC_MIPS_T0, compiler->vars[align_var].ptr_register); orc_mips_emit_andi (compiler, ORC_MIPS_T0, ORC_MIPS_T0, (1 << align_shift) - 1); if (var_size_shift > 0) orc_mips_emit_srl (compiler, ORC_MIPS_T0, ORC_MIPS_T0, var_size_shift); /* $t1 = number of iterations in region1 (aligned) = (n - $t0) / (loop_size * unroll) = (n - $t0) >> (loop_shift + unroll_shift) */ orc_mips_emit_sub (compiler, ORC_MIPS_T2, ORC_MIPS_T2, ORC_MIPS_T0); /* handle the case where n < $t0. In that case, we want to handle n elements in region0, and no element in the two other regions. bgez $t2, usual_case move $t1, $0 move $t2, $0 lw $t0, OFFSET_N($a0) beqz $0, LABEL_REGION0_LOOP usual_case: */ orc_mips_emit_conditional_branch_with_offset (compiler, ORC_MIPS_BGEZ, ORC_MIPS_T2, ORC_MIPS_ZERO, 24); orc_mips_emit_nop (compiler); orc_mips_emit_move (compiler, ORC_MIPS_T1, ORC_MIPS_ZERO); orc_mips_emit_move (compiler, ORC_MIPS_T2, ORC_MIPS_ZERO); orc_mips_emit_lw (compiler, ORC_MIPS_T0, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_N); orc_mips_emit_beqz (compiler, ORC_MIPS_ZERO, LABEL_REGION0_LOOP); orc_mips_emit_nop (compiler); if (compiler->loop_shift + compiler->unroll_shift > 0) orc_mips_emit_srl (compiler, ORC_MIPS_T1, ORC_MIPS_T2, compiler->loop_shift + compiler->unroll_shift); else orc_mips_emit_move (compiler, ORC_MIPS_T1, ORC_MIPS_T2); /* if ($t0 == 0) goto REGION1 */ orc_mips_emit_beqz (compiler, ORC_MIPS_T0, LABEL_REGION1); /* $t2 = number of iterations in region2 (after aligned region) = (n - $t0) % loop_size = (previous $t2) % loop_size = $t2 & ((1 << loop_shift + unroll_shift) - 1) */ /* note that this instruction is in the branch delay slot */ if (compiler->loop_shift + compiler->unroll_shift > 0) orc_mips_emit_andi (compiler, ORC_MIPS_T2, ORC_MIPS_T2, (1 << (compiler->loop_shift + compiler->unroll_shift)) - 1); else /* loop_shift==0: $t2 should be 0 because we can handle all our data in region 1*/ orc_mips_emit_move (compiler, ORC_MIPS_T2, ORC_MIPS_ZERO); /* FIXME: when loop_shift == 0, we only need to emit region1 */ orc_mips_emit_full_loop (compiler, ORC_MIPS_T0, 0, LABEL_REGION0_LOOP, 0, FALSE); orc_mips_emit_label (compiler, LABEL_REGION1); orc_mips_emit_beqz (compiler, ORC_MIPS_T1, LABEL_REGION2); /* branch delay slot is occupied either by the next andi in the loop below or * by the nop after that loop */ /* from here on until LABEL_REGION2, align_var is known to be aligned (that's * the reason why we went through region 0) */ compiler->vars[align_var].is_aligned = TRUE; /* We need a register that contains 1 so that we easily get 2^i */ orc_mips_emit_ori (compiler, ORC_MIPS_T3, ORC_MIPS_ZERO, 1); /* That's where we will store the bitfield of aligned vars (apart from * align_var) */ orc_mips_emit_ori (compiler, ORC_MIPS_T5, ORC_MIPS_ZERO, 0); for (i=ORC_VAR_D1; i<=ORC_VAR_S8; i++) { OrcVariable *var = &(compiler->vars[i]); if (var->name == NULL || var->ptr_register == 0 || var->is_aligned) continue; orc_mips_emit_andi (compiler, ORC_MIPS_T0, var->ptr_register, (1 << align_shift) - 1); orc_mips_emit_conditional_branch_with_offset (compiler, ORC_MIPS_BNE, ORC_MIPS_T0, ORC_MIPS_ZERO, 8 /* skipping the next two instructions */); orc_mips_emit_sll (compiler, ORC_MIPS_T4, ORC_MIPS_T3, i); orc_mips_emit_or (compiler, ORC_MIPS_T5, ORC_MIPS_T5, ORC_MIPS_T4); } orc_mips_emit_beqz (compiler, ORC_MIPS_T5, LABEL_REGION1_LOOP); /* Loop on all the alignment combinations we can handle and compare them to * the actual alignment we have, then branch to the best loop for it*/ /* Note: this assumes that ORC_VAR_D1 == 0 */ for (i=1; i < (1 << (ORC_VAR_S8 +1)); i++) { int label = orc_mips_get_loop_label (compiler, i); if (label == -1) continue; if (label >= ORC_N_LABELS) { /* this check works because _get_loop_label() */ break; /* is strictly monotonic and increasing */ } /* This next line works to load i because ORC_VAR_S8 < 16 */ orc_mips_emit_ori (compiler, ORC_MIPS_T0, ORC_MIPS_ZERO, i); orc_mips_emit_beq (compiler, ORC_MIPS_T5, ORC_MIPS_T0, label); } orc_mips_emit_nop (compiler); /* If we reach here, it means we haven't branched to any specific loop, so we * branch to the fallback one */ orc_mips_emit_beqz (compiler, ORC_MIPS_ZERO, LABEL_REGION1_LOOP); orc_mips_emit_nop (compiler); /* Loop on all alignment combinations we can handle (limited by number of * labels available) and emit the loop for it */ for (i=0; i < (1 << (ORC_VAR_S8 +1)); i++) { int label = orc_mips_get_loop_label (compiler, i); if (label == -1) continue; if (label >= ORC_N_LABELS) /* this check works because _get_loop_label() */ break; /* is strictly monotonic and increasing */ orc_mips_emit_full_loop (compiler, ORC_MIPS_T1, compiler->loop_shift, label, i | (1 << align_var), TRUE); /* Jump the other loop versions and go to REGION2 */ orc_mips_emit_beqz (compiler, ORC_MIPS_ZERO, LABEL_REGION2); orc_mips_emit_nop (compiler); } /* Fallback loop that works for any alignment combination */ orc_mips_emit_full_loop (compiler, ORC_MIPS_T1, compiler->loop_shift, LABEL_REGION1_LOOP, 1 << align_var, TRUE); compiler->vars[align_var].is_aligned = FALSE; orc_mips_emit_label (compiler, LABEL_REGION2); orc_mips_emit_beqz (compiler, ORC_MIPS_T2, LABEL_REGION2_LOOP_END); orc_mips_emit_nop (compiler); orc_mips_emit_full_loop (compiler, ORC_MIPS_T2, 0, LABEL_REGION2_LOOP, 0, FALSE); orc_mips_emit_label (compiler, LABEL_REGION2_LOOP_END); if (compiler->program->is_2d) { /* ex->params[ORC_VAR_A1] contains "m", the number of lines we want to treat */ orc_mips_emit_lw (compiler, ORC_MIPS_T2, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(ORC_VAR_A1)); orc_mips_add_strides (compiler, var_size_shift); orc_mips_emit_addi (compiler, ORC_MIPS_T2, ORC_MIPS_T2, -1); orc_mips_emit_sw (compiler, ORC_MIPS_T2, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(ORC_VAR_A1)); orc_mips_emit_bnez (compiler, ORC_MIPS_T2, LABEL_OUTER_LOOP); orc_mips_emit_nop (compiler); } orc_mips_emit_label (compiler, LABEL_END); orc_mips_do_fixups (compiler); orc_mips_emit_epilogue (compiler, stack_size); } void orc_mips_flush_cache (OrcCode *code) { #ifdef HAVE_MIPSEL __clear_cache (code->code, code->code + code->code_size); #endif } orc-0.4.18/orc/orcutils.h0000664000175000017500000001476212111024531012112 00000000000000/* * ORC - Library of Optimized Inner Loops * Copyright (c) 2007 David A. Schleef * 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 _ORC_UTILS_H_ #define _ORC_UTILS_H_ /* Orc objects */ //typedef struct _OrcVariable OrcVariable; //typedef struct _OrcOpcodeSet OrcOpcodeSet; //typedef struct _OrcStaticOpcode OrcStaticOpcode; typedef struct _OrcInstruction OrcInstruction; typedef struct _OrcProgram OrcProgram; typedef struct _OrcCompiler OrcCompiler; typedef struct _OrcConstant OrcConstant; //typedef struct _OrcFixup OrcFixup; typedef struct _OrcTarget OrcTarget; typedef struct _OrcCode OrcCode; //typedef struct _OrcCodeChunk OrcCodeChunk; typedef enum { ORC_COMPILE_RESULT_OK = 0, ORC_COMPILE_RESULT_UNKNOWN_COMPILE = 0x100, ORC_COMPILE_RESULT_MISSING_RULE = 0x101, ORC_COMPILE_RESULT_UNKNOWN_PARSE = 0x200, ORC_COMPILE_RESULT_PARSE = 0x201, ORC_COMPILE_RESULT_VARIABLE = 0x202 } OrcCompileResult; #ifndef _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_ #if defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; typedef intptr_t orc_intptr; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #ifdef _WIN64 typedef unsigned __int64 orc_intptr; #else typedef unsigned long orc_intptr; #endif #define ORC_UINT64_C(x) (x##Ui64) #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #ifdef _WIN64 typedef unsigned __int64 orc_intptr; #else typedef unsigned long orc_intptr; #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif typedef unsigned int orc_bool; #define ORC_PTR_TO_INT(x) ((int)(orc_intptr)(x)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_STRUCT_OFFSET(struct_type, member) \ (ORC_PTR_TO_INT((unsigned char *) &((struct_type*) 0)->member)) #ifdef ORC_ENABLE_UNSTABLE_API #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #ifndef MIN #define MIN(a,b) ((a)<(b) ? (a) : (b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b) ? (a) : (b)) #endif #ifndef ORC_CLAMP #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #endif #define ORC_READ_UINT32_LE(ptr) \ ((orc_uint32)( \ ((orc_uint8 *)(ptr))[0] | \ (((orc_uint8 *)(ptr))[1]<<8) | \ (((orc_uint8 *)(ptr))[2]<<16) | \ (((orc_uint8 *)(ptr))[3]<<24))) #define ORC_WRITE_UINT32_LE(ptr,val) \ do { \ ((orc_uint8 *)ptr)[0] = ((val)>>0)&0xff; \ ((orc_uint8 *)ptr)[1] = ((val)>>8)&0xff; \ ((orc_uint8 *)ptr)[2] = ((val)>>16)&0xff; \ ((orc_uint8 *)ptr)[3] = ((val)>>24)&0xff; \ } while(0) #endif #if defined(__GNUC__) && defined(__GNUC_MINOR__) #define ORC_GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else #define ORC_GNUC_PREREQ(maj, min) 0 #endif #ifndef ORC_INTERNAL #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) #define ORC_INTERNAL __attribute__((visibility("hidden"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #define ORC_INTERNAL __hidden #elif defined (__GNUC__) && ORC_GNUC_PREREQ(3,3) && defined(__ELF__) #define ORC_INTERNAL __attribute__((visibility("hidden"))) #else #define ORC_INTERNAL #endif #endif #if ORC_GNUC_PREREQ(3,3) /* guess */ #define ORC_GNU_PRINTF(a,b) __attribute__((__format__ (__printf__, a, b))) #else #define ORC_GNU_PRINTF(a,b) #endif #if ORC_GNUC_PREREQ(2,4) #define ORC_GNUC_UNUSED __attribute__((__unused__)) #else #define ORC_GNUC_UNUSED #endif #ifdef __cplusplus #define ORC_BEGIN_DECLS extern "C" { #define ORC_END_DECLS } #else #define ORC_BEGIN_DECLS #define ORC_END_DECLS #endif #ifdef _MSC_VER #ifdef ORC_EXPORTS #define ORC_EXPORT __declspec(dllexport) extern #else #define ORC_EXPORT __declspec(dllimport) extern #endif #else /* not _MSC_VER */ #define ORC_EXPORT extern #endif ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API int get_file_int (const char *file, int *value); char * get_file (const char *file); char * get_cpuinfo_line (char *cpuinfo, const char *tag); char * _strndup (const char *s, int n); char ** strsplit (const char *s, char delimiter); char * get_tag_value (char *s, const char *tag); orc_int64 _strtoll (const char *nptr, char **endptr, int base); void orc_global_mutex_lock (void); void orc_global_mutex_unlock (void); #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcarm.c0000664000175000017500000004750712177015514011544 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #ifdef HAVE_ARM #if defined(__APPLE__) #include #endif #endif /** * SECTION:orcarm * @title: ARM * @short_description: code generation for ARM */ const char * orc_arm_cond_name (OrcArmCond cond) { static const char *cond_names[] = { "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le", "", "" }; if (cond < 0 || cond >= 16) { return "ERROR"; } return cond_names[cond&0xf]; } const char * orc_arm_reg_name (int reg) { #if 0 static const char *gp_regs[] = { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "ip", "sp", "lr", "pc" }; #else static const char *gp_regs[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "ip", "sp", "lr", "pc" }; //"r12", "r13", "r14", "r15" }; #endif if (reg < ORC_GP_REG_BASE || reg >= ORC_GP_REG_BASE+16) { return "ERROR"; } return gp_regs[reg&0xf]; } void orc_arm_emit (OrcCompiler *compiler, orc_uint32 insn) { ORC_WRITE_UINT32_LE (compiler->codeptr, insn); compiler->codeptr+=4; } void orc_arm_emit_bx_lr (OrcCompiler *compiler) { ORC_ASM_CODE(compiler," bx lr\n"); orc_arm_emit (compiler, 0xe12fff1e); } void orc_arm_emit_push (OrcCompiler *compiler, int regs) { int i; int x = 0; ORC_ASM_CODE(compiler," push {"); for(i=0;i<16;i++){ if (regs & (1<labels[label] = compiler->codeptr; } void orc_arm_add_fixup (OrcCompiler *compiler, int label, int type) { ORC_ASSERT (compiler->n_fixups < ORC_N_FIXUPS); compiler->fixups[compiler->n_fixups].ptr = compiler->codeptr; compiler->fixups[compiler->n_fixups].label = label; compiler->fixups[compiler->n_fixups].type = type; compiler->n_fixups++; } void orc_arm_do_fixups (OrcCompiler *compiler) { int i; for(i=0;in_fixups;i++){ unsigned char *label = compiler->labels[compiler->fixups[i].label]; unsigned char *ptr = compiler->fixups[i].ptr; orc_uint32 code; int diff; if (compiler->fixups[i].type == 0) { code = ORC_READ_UINT32_LE (ptr); diff = code; diff = (diff << 8) >> 8; diff += ((label - ptr) >> 2); if (diff != (diff << 8)>>8) { ORC_COMPILER_ERROR(compiler, "fixup out of range"); } ORC_WRITE_UINT32_LE(ptr, (code&0xff000000) | (diff&0x00ffffff)); } else { code = ORC_READ_UINT32_LE (ptr); diff = code; /* We store the offset in the code as signed, but the CPU considers * it unsigned */ diff = (diff << 24) >> 24; diff += ((label - ptr) >> 2); if (diff != (diff & 0xff)) { ORC_COMPILER_ERROR(compiler, "fixup out of range (%d > 255)", diff); } ORC_WRITE_UINT32_LE(ptr, (code&0xffffff00) | (diff&0x000000ff)); } } } void orc_arm_emit_align (OrcCompiler *compiler, int align_shift) { int diff; diff = (compiler->code - compiler->codeptr)&((1<>= 2; shift2++; } if (x > 0xff) { ORC_PROGRAM_ERROR(compiler, "bad immediate value"); } } code = 0xe3a00000; code |= (dest&0xf) << 12; code |= (((16-shift2)&0xf) << 8); code |= (x&0xff); ORC_ASM_CODE(compiler," mov %s, #0x%08x\n", orc_arm_reg_name (dest), imm); orc_arm_emit (compiler, code); } void orc_arm_emit_add_imm (OrcCompiler *compiler, int dest, int src1, int imm) { orc_uint32 code; int shift2; unsigned int x; if ((imm & 0xff) == imm) { shift2 = 0; x = imm; } else { shift2 = 0; x = imm & 0xffffffff; while ((x & 3) == 0) { x >>= 2; shift2++; } if (x > 0xff) { ORC_PROGRAM_ERROR(compiler, "bad immediate value"); } } code = 0xe2800000; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= (((16-shift2)&0xf) << 8); code |= (x&0xff); ORC_ASM_CODE(compiler," add %s, %s, #0x%08x\n", orc_arm_reg_name (dest), orc_arm_reg_name(src1), imm); orc_arm_emit (compiler, code); } void orc_arm_emit_and_imm (OrcCompiler *compiler, int dest, int src1, int value) { orc_uint32 code; code = 0xe2000000; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= (value) << 0; ORC_ASM_CODE(compiler," and %s, %s, #%d\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), value); orc_arm_emit (compiler, code); } void orc_arm_emit_cmp (OrcCompiler *compiler, int src1, int src2) { orc_uint32 code; code = 0xe1500000; code |= (src1&0xf) << 16; code |= (src2&0xf) << 0; ORC_ASM_CODE(compiler," cmp %s, %s\n", orc_arm_reg_name (src1), orc_arm_reg_name (src2)); orc_arm_emit (compiler, code); } void orc_arm_emit_asr_imm (OrcCompiler *compiler, int dest, int src1, int value) { orc_uint32 code; if (value == 0) { ORC_ERROR("bad immediate value"); } code = 0xe1a00040; code |= (src1&0xf) << 0; code |= (dest&0xf) << 12; code |= (value) << 7; ORC_ASM_CODE(compiler," asr %s, %s, #%d\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), value); orc_arm_emit (compiler, code); } void orc_arm_emit_lsl_imm (OrcCompiler *compiler, int dest, int src1, int value) { orc_uint32 code; if (value == 0) { ORC_ERROR("bad immediate value"); } code = 0xe1a00000; code |= (src1&0xf) << 0; code |= (dest&0xf) << 12; code |= (value) << 7; ORC_ASM_CODE(compiler," lsl %s, %s, #%d\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), value); orc_arm_emit (compiler, code); } void orc_arm_emit_load_reg (OrcCompiler *compiler, int dest, int src1, int offset) { orc_uint32 code; code = 0xe5900000; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= offset&0xfff; ORC_ASM_CODE(compiler," ldr %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), offset); orc_arm_emit (compiler, code); } void orc_arm_emit_store_reg (OrcCompiler *compiler, int src1, int dest, int offset) { orc_uint32 code; code = 0xe5800000; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= offset&0xfff; ORC_ASM_CODE(compiler," str %s, [%s, #%d]\n", orc_arm_reg_name (src1), orc_arm_reg_name (dest), offset); orc_arm_emit (compiler, code); } void orc_arm_emit_mov (OrcCompiler *compiler, int dest, int src) { if (dest == src) return; orc_arm_emit_mov_r(compiler, ORC_ARM_COND_AL, 0, dest, src); } void orc_arm_emit_sub (OrcCompiler *compiler, int dest, int src1, int src2) { orc_arm_emit_sub_r (compiler, ORC_ARM_COND_AL, 0, dest, src1, src2); } void orc_arm_emit_sub_imm (OrcCompiler *compiler, int dest, int src1, int value, int record) { orc_arm_emit_sub_i (compiler, ORC_ARM_COND_AL, record, dest, src1, value); } void orc_arm_emit_add (OrcCompiler *compiler, int dest, int src1, int src2) { orc_arm_emit_add_r (compiler, ORC_ARM_COND_AL, 0, dest, src1, src2); } void orc_arm_emit_cmp_imm (OrcCompiler *compiler, int src1, int value) { orc_arm_emit_cmp_i (compiler, ORC_ARM_COND_AL, src1, value); } /* shifter operands */ /* 1 * 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+ * |rotimm | immed_8 | * +-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_so_i(rot,imm) ((((rot)&15)<<8)|((imm)&255)) /* 1 * 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+ * | Si | St|0| Rm | * +-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_so_rsi(Si,St,Rm) ((((Si)&31)<<7)|(((St)&3)<<5)|((Rm)&15)) #define arm_so_rrx(Rm) arm_so_rsi(0,ORC_ARM_ROR,Rm) #define arm_so_r(Rm) ((Rm)&15) /* 1 * 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+ * | Rs |0| St|1| Rm | * +-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_so_rsr(Rs,St,Rm) (0x010|(((Rs)&15)<<8)|(((St)&3)<<5)|((Rm)&15)) /* data processing instructions */ /* 3 2 2 2 2 2 2 2 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | cond |0 0|I| opcode|S| Rn | Rd | shifter_operand | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_code_dp(cond,I,opcode,S,Rn,Rd,So) ((((cond)&15)<<28) | (((I)&1)<<25) | \ (((opcode)&15)<<21) | (((S)&1)<<20) | \ (((Rn)&15)<<16) | (((Rd)&15)<<12) | \ ((So)&0xfff)) /* * type 0: {}{s} {}, , #imm (imm = (val>>(shift*2))|(val<<(32-(shift*2)))) * type 1: {}{s} {}, , * type 2: {}{s} {}, , , [LSL|LSR|ASR] #imm * type 3: {}{s} {}, , , [LSL|LSR|ASR] * type 4: {}{s} {,} , , RRX */ void orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP opcode, int S, int Rd, int Rn, int Rm, int shift, orc_uint32 val) { orc_uint32 code; int I = 0; int shifter_op; char shifter[64]; orc_uint32 imm; static const char *shift_names[] = { "LSL", "LSR", "ASR", "ROR" }; /* opcodes with Rd */ static const int op_Rd[] = { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1 }; /* opcodes using Rn */ static const int op_Rn[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 }; static const char *dp_insn_names[] = { "and", "eor", "sub", "rsb", "add", "adc", "sbc", "rsc", "tst", "teq", "cmp", "cmn", "orr", "mov", "bic", "mvn" }; switch (type) { case 0: /* #imm */ imm = (orc_uint32) val; /* if imm <= 0xff we're done. It's recommanded that we choose the * smallest shifter value. Impossible values will overflow the shifter. */ while (imm > 0xff && shift < 16) { imm = (imm << 2) | (imm >> 30); shift++; } if (shift > 15) { ORC_COMPILER_ERROR(p,"invalid ARM immediate %08x", val); return; } shifter_op = arm_so_i (shift, imm); sprintf (shifter, "#0x%08x", val); I = 1; break; case 1: /* */ shifter_op = arm_so_r (Rm); sprintf (shifter, "%s", orc_arm_reg_name (Rm)); break; case 2: /* , [LSL|LSR|ASR] #imm */ shifter_op = arm_so_rsi (val,shift,Rm); sprintf (shifter, "%s, %s #%d", orc_arm_reg_name (Rm), shift_names[shift], val); break; case 3: /* , [LSL|LSR|ASR] */ shifter_op = arm_so_rsr (val,shift,Rm); sprintf (shifter, "%s, %s %s", orc_arm_reg_name (Rm), shift_names[shift], orc_arm_reg_name (val)); break; case 4: /* , RRX */ shifter_op = arm_so_rrx (Rm); sprintf (shifter, "%s, RRX", orc_arm_reg_name (Rm)); break; default: ORC_COMPILER_ERROR(p,"unknown data processing type %d", type); return; } if (op_Rd[opcode]) { if (op_Rn[opcode]) { /* opcode using Rn */ code = arm_code_dp (cond, I, opcode, S, Rn, Rd, shifter_op); ORC_ASM_CODE(p," %s%s%s %s, %s, %s\n", dp_insn_names[opcode], orc_arm_cond_name(cond), (S ? "s" : ""), orc_arm_reg_name (Rd), orc_arm_reg_name (Rn), shifter); } else { /* opcode using Rd and val (mov, mvn) */ code = arm_code_dp (cond, I, opcode, S, Rn, Rd, shifter_op); ORC_ASM_CODE(p," %s%s%s %s, %s\n", dp_insn_names[opcode], orc_arm_cond_name(cond), (S ? "s" : ""), orc_arm_reg_name (Rd), shifter); } } else { /* opcode does not change Rd, change status register (cmp, tst, ..) */ code = arm_code_dp (cond, I, opcode, 1, Rn, 0, shifter_op); ORC_ASM_CODE(p," %s%s %s, %s\n", dp_insn_names[opcode], orc_arm_cond_name(cond), orc_arm_reg_name (Rn), shifter); } orc_arm_emit (p, code); } /* parallel instructions */ /* 3 2 2 2 2 2 2 2 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | cond | mode | Rn | Rd |0 0 0 0| op | Rm | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_code_par(cond,mode,Rn,Rd,op,Rm) (((cond)<<28)|((mode)<<20)|(((Rn)&0xf)<<16)|(((Rd)&0xf)<<12)|((op)<<4)|((Rm)&0xf)|0xf00) void orc_arm_emit_par (OrcCompiler *p, int op, int mode, OrcArmCond cond, int Rd, int Rn, int Rm) { orc_uint32 code; static const int par_op[] = { 1, 3, 5, 7, 9, 15, 11, 5, 5 }; static const char *par_op_names[] = { "add16", "addsubx", "subaddx", "sub16", "add8", "sub8", "sel", "add", "sub" }; static const int par_mode[] = { 0x61, 0x62, 0x63, 0x65, 0x66, 0x67, 0x68, 0x10, 0x12, 0x14, 0x16 }; static const char *par_mode_names[] = { "s", "q", "sh", "u", "uq", "uh", "", "q", "q", "qd", "qd" }; code = arm_code_par (cond, par_mode[mode], Rn, Rd, par_op[op], Rm); if (op == 7) { int tmp; /* gas does something screwy here */ code &= ~0xf00; tmp = Rn; Rn = Rm; Rm = tmp; } ORC_ASM_CODE(p," %s%s%s %s, %s, %s\n", par_mode_names[mode], par_op_names[op], orc_arm_cond_name(cond), orc_arm_reg_name (Rd), orc_arm_reg_name (Rn), orc_arm_reg_name (Rm)); orc_arm_emit (p, code); } /* extend instructions */ /* 3 2 2 2 2 2 2 2 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | cond |0 1 1 0 0 0 0 0| Rn | Rd |rot|0 0|0 1 1 1| Rm | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_code_xt(op,cond,Rn,Rd,r8,Rm) (op|((cond)<<28)|(((Rn)&0xf)<<16)|(((Rd)&0xf)<<12)|((((r8)&0xf)&0x18)<<7)|((Rm)&0xf)) void orc_arm_emit_xt (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int Rn, int Rm, int r8) { orc_uint32 code; char shifter[64]; static const orc_uint32 xt_opcodes[] = { 0x06800070, 0x06a00070, 0x06b00070, 0x06c00070, 0x06e00070, 0x06f00070 }; static const char *xt_insn_names[] = { "sxtb16", "sxtb", "sxth", "uxtb16", "uxtb", "uxth", "sxtab16", "sxtab", "sxtah", "uxtab16", "uxtab", "uxtah", }; if (r8 & 0x18) sprintf (shifter, ", ROR #%d", r8 & 0x18); else shifter[0] = '\0'; code = arm_code_xt (xt_opcodes[op], cond, Rn, Rd, r8, Rm); if (Rn < 15) { /* with Rn */ ORC_ASM_CODE(p," %s%s %s, %s, %s%s\n", xt_insn_names[op], orc_arm_cond_name(cond), orc_arm_reg_name (Rd), orc_arm_reg_name (Rn), orc_arm_reg_name (Rm), shifter); } else { ORC_ASM_CODE(p," %s%s %s, %s%s\n", xt_insn_names[op], orc_arm_cond_name(cond), orc_arm_reg_name (Rd), orc_arm_reg_name (Rm), shifter); } orc_arm_emit (p, code); } #define arm_code_pkh(op,cond,Rn,Rd,sh,Rm) (op|((cond)<<28)|(((Rn)&0xf)<<16)|(((Rd)&0xf)<<12)|((sh)<<7)|((Rm)&0xf)) void orc_arm_emit_pkh (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int Rn, int Rm, int sh) { orc_uint32 code; char shifter[64]; static const orc_uint32 pkh_opcodes[] = { 0x06800010, 0x06800050 }; static const char *pkh_insn_names[] = { "pkhbt", "pkhtb" }; if (sh > 0) { sprintf (shifter, ", %s #%d", (op == 0 ? "LSL" : "ASR"), sh); } else { shifter[0] = '\0'; } code = arm_code_pkh (pkh_opcodes[op], cond, Rn, Rd, sh, Rm); ORC_ASM_CODE(p," %s%s %s, %s, %s%s\n", pkh_insn_names[op], orc_arm_cond_name(cond), orc_arm_reg_name (Rd), orc_arm_reg_name (Rn), orc_arm_reg_name (Rm), shifter); orc_arm_emit (p, code); } /* extend instructions */ /* 3 2 2 2 2 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | cond |0 1 1 0|x x x| sat | Rd | sh |a|0 1| Rm | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ #define arm_code_sat(op,cond,sat,Rd,sh,a,Rm) (op|(((cond)&15)<<28)|(((sat)&31)<<16)|\ (((Rd)&15)<<12)|(((sh)&31)<<7)|(((a)&1)<<6)|\ ((Rm)&15)) void orc_arm_emit_sat (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int sat, int Rm, int sh, int asr) { orc_uint32 code; char shifter[64]; static const orc_uint32 sat_opcodes[] = { 0x06a00010, 0x06e00010, 0, 0 }; static const char *sat_insn_names[] = { "ssat", "usat", "ssat16", "usat16" }; static const int par_mode[] = { 0, 0, 0x6a, 0x6e }; static const int par_op[] = { 0, 0, 3, 3 }; if (sh > 0) { sprintf (shifter, ", %s #%d", (asr&1 ? "ASR" : "LSL"), sh); } else { shifter[0] = '\0'; } if (op < 2) { code = arm_code_sat (sat_opcodes[op], cond, sat, Rd, sh, asr, Rm); } else { if (op == 3) { code = arm_code_par (cond, par_mode[op], sat, Rd, par_op[op], Rm); } else { code = arm_code_par (cond, par_mode[op], sat - 1, Rd, par_op[op], Rm); } } ORC_ASM_CODE(p," %s%s %s, #%d, %s%s\n", sat_insn_names[op], orc_arm_cond_name(cond), orc_arm_reg_name (Rd), sat, orc_arm_reg_name (Rm), shifter); orc_arm_emit (p, code); } #define arm_code_rv(op,cond,Rd,Rm) (op|(((cond)&15)<<28)|(((Rd)&15)<<12)|((Rm)&15)) void orc_arm_emit_rv (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int Rm) { orc_uint32 code; static const orc_uint32 rv_opcodes[] = { 0x06bf0f30, 0x06bf0fb0 }; static const char *rv_insn_names[] = { "rev", "rev16" }; code = arm_code_rv (rv_opcodes[op], cond, Rd, Rm); ORC_ASM_CODE(p," %s%s %s, %s\n", rv_insn_names[op], orc_arm_cond_name(cond), orc_arm_reg_name (Rd), orc_arm_reg_name (Rm)); orc_arm_emit (p, code); } void orc_arm_flush_cache (OrcCode *code) { #ifdef HAVE_ARM #ifdef __APPLE__ sys_icache_invalidate(code->code, code->code_size); #else __clear_cache (code->code, code->code + code->code_size); #endif #endif } void orc_arm_emit_data (OrcCompiler *compiler, orc_uint32 data) { if (compiler->target_flags & ORC_TARGET_CLEAN_COMPILE) { orc_arm_emit_nop (compiler); } else { ORC_ASM_CODE(compiler," .word 0x%08x\n", data); orc_arm_emit (compiler, data); } } void orc_arm_loadw (OrcCompiler *compiler, int dest, int src1, int offset) { orc_uint32 code; code = 0xe1d000b0; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; ORC_ASM_CODE(compiler," ldrh %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), offset); orc_arm_emit (compiler, code); } orc-0.4.18/orc/orcvariable.h0000664000175000017500000000231512117155734012546 00000000000000 #ifndef _ORC_VARIABLE_H_ #define _ORC_VARIABLE_H_ #include #include #include #include #include #include #include #include ORC_BEGIN_DECLS #define ORC_VAR_FLAG_VOLATILE_WORKAROUND (1<<0) typedef struct _OrcVariable OrcVariable; typedef enum { ORC_VAR_TYPE_TEMP, ORC_VAR_TYPE_SRC, ORC_VAR_TYPE_DEST, ORC_VAR_TYPE_CONST, ORC_VAR_TYPE_PARAM, ORC_VAR_TYPE_ACCUMULATOR } OrcVarType; enum { ORC_PARAM_TYPE_INT = 0, ORC_PARAM_TYPE_FLOAT, ORC_PARAM_TYPE_INT64, ORC_PARAM_TYPE_DOUBLE }; /** * OrcVariable: * * The OrcVariable structure has no public members */ struct _OrcVariable { /*< private >*/ char *name; char *type_name; int size; OrcVarType vartype; int used; int first_use; int last_use; int replaced; int replacement; int alloc; int is_chained; int is_aligned; int alignment; int is_uncached; orc_union64 value; int ptr_register; int ptr_offset; int mask_alloc; int aligned_data; int param_type; int load_dest; int update_type; int need_offset_reg; unsigned int flags; }; ORC_END_DECLS #endif orc-0.4.18/orc/orc-stdint.h0000644000175000017500000000005611563547254012347 00000000000000/* This file is intentionally nearly empty */ orc-0.4.18/orc/orcrule.h0000664000175000017500000000161112111024531011706 00000000000000 #ifndef _ORC_RULE_H_ #define _ORC_RULE_H_ #include #include #include ORC_BEGIN_DECLS typedef struct _OrcRule OrcRule; typedef struct _OrcRuleSet OrcRuleSet; typedef void (*OrcRuleEmitFunc)(OrcCompiler *p, void *user, OrcInstruction *insn); /** * OrcRule: * * The OrcRule structure has no public members */ struct _OrcRule { /*< private >*/ OrcRuleEmitFunc emit; void *emit_user; }; /** * OrcRuleSet: * * The OrcRuleSet structure has no public members */ struct _OrcRuleSet { /*< private >*/ int opcode_major; int required_target_flags; OrcRule *rules; int n_rules; }; OrcRuleSet * orc_rule_set_new (OrcOpcodeSet *opcode_set, OrcTarget *target, unsigned int required_flags); void orc_rule_register (OrcRuleSet *rule_set, const char *opcode_name, OrcRuleEmitFunc emit, void *emit_user); ORC_END_DECLS #endif orc-0.4.18/orc/orcarm.h0000644000175000017500000005060611563547254011552 00000000000000 #ifndef _ORC_ARM_H_ #define _ORC_ARM_H_ #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API typedef enum { ORC_ARM_A1 = ORC_GP_REG_BASE+0, ORC_ARM_A2, ORC_ARM_A3, ORC_ARM_A4, ORC_ARM_V1, ORC_ARM_V2, ORC_ARM_V3, ORC_ARM_V4, ORC_ARM_V5, ORC_ARM_V6, ORC_ARM_V7, ORC_ARM_V8, ORC_ARM_IP, ORC_ARM_SP, ORC_ARM_LR, ORC_ARM_PC } OrcArmRegister; typedef enum { ORC_ARM_DP_AND = 0, ORC_ARM_DP_EOR, ORC_ARM_DP_SUB, ORC_ARM_DP_RSB, ORC_ARM_DP_ADD, ORC_ARM_DP_ADC, ORC_ARM_DP_SBC, ORC_ARM_DP_RSC, ORC_ARM_DP_TST, ORC_ARM_DP_TEQ, ORC_ARM_DP_CMP, ORC_ARM_DP_CMN, ORC_ARM_DP_ORR, ORC_ARM_DP_MOV, ORC_ARM_DP_BIC, ORC_ARM_DP_MVN } OrcArmDP; typedef enum { ORC_ARM_COND_EQ = 0, ORC_ARM_COND_NE, ORC_ARM_COND_CS, ORC_ARM_COND_CC, ORC_ARM_COND_MI, ORC_ARM_COND_PL, ORC_ARM_COND_VS, ORC_ARM_COND_VC, ORC_ARM_COND_HI, ORC_ARM_COND_LS, ORC_ARM_COND_GE, ORC_ARM_COND_LT, ORC_ARM_COND_GT, ORC_ARM_COND_LE, ORC_ARM_COND_AL, } OrcArmCond; typedef enum { ORC_ARM_LSL, ORC_ARM_LSR, ORC_ARM_ASR, ORC_ARM_ROR } OrcArmShift; unsigned long orc_arm_get_cpu_flags (void); void orc_arm_emit (OrcCompiler *compiler, orc_uint32 insn); void orc_arm_emit_bx_lr (OrcCompiler *compiler); const char * orc_arm_reg_name (int reg); const char * orc_arm_cond_name (OrcArmCond cond); void orc_arm_emit_load_imm (OrcCompiler *compiler, int dest, int imm); void orc_arm_emit_add (OrcCompiler *compiler, int dest, int src1, int src2); void orc_arm_emit_sub (OrcCompiler *compiler, int dest, int src1, int src2); void orc_arm_emit_add_imm (OrcCompiler *compiler, int dest, int src1, int value); void orc_arm_emit_and_imm (OrcCompiler *compiler, int dest, int src1, int value); void orc_arm_emit_sub_imm (OrcCompiler *compiler, int dest, int src1, int value, int record); void orc_arm_emit_asr_imm (OrcCompiler *compiler, int dest, int src1, int value); void orc_arm_emit_lsl_imm (OrcCompiler *compiler, int dest, int src1, int value); void orc_arm_emit_cmp_imm (OrcCompiler *compiler, int src1, int value); void orc_arm_emit_cmp (OrcCompiler *compiler, int src1, int src2); void orc_arm_emit_mov (OrcCompiler *compiler, int dest, int src); void orc_arm_emit_align (OrcCompiler *compiler, int align_shift); void orc_arm_emit_label (OrcCompiler *compiler, int label); void orc_arm_emit_push (OrcCompiler *compiler, int regs); void orc_arm_emit_pop (OrcCompiler *compiler, int regs); void orc_arm_emit_branch (OrcCompiler *compiler, int cond, int label); void orc_arm_emit_data (OrcCompiler *compiler, orc_uint32 data); void orc_arm_loadb (OrcCompiler *compiler, int dest, int src1, int offset); void orc_arm_storeb (OrcCompiler *compiler, int dest, int offset, int src1); void orc_arm_loadw (OrcCompiler *compiler, int dest, int src1, int offset); void orc_arm_storew (OrcCompiler *compiler, int dest, int offset, int src1); void orc_arm_loadl (OrcCompiler *compiler, int dest, int src1, int offset); void orc_arm_storel (OrcCompiler *compiler, int dest, int offset, int src1); void orc_arm_emit_load_reg (OrcCompiler *compiler, int dest, int src1, int offset); void orc_arm_emit_store_reg (OrcCompiler *compiler, int src, int dest, int offset); void orc_arm_add_fixup (OrcCompiler *compiler, int label, int type); void orc_arm_do_fixups (OrcCompiler *compiler); void orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP opcode, int S, int Rd, int Rn, int Rm, int shift, orc_uint32 val); void orc_arm_emit_par (OrcCompiler *p, int op, int mode, OrcArmCond cond, int Rd, int Rn, int Rm); void orc_arm_emit_xt (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int Rn, int Rm, int r8); void orc_arm_emit_pkh (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int Rn, int Rm, int sh); void orc_arm_emit_sat (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int sat, int Rm, int sh, int asr); void orc_arm_emit_rv (OrcCompiler *p, int op, OrcArmCond cond, int Rd, int Rm); void orc_arm_emit_nop (OrcCompiler *compiler); void orc_arm_flush_cache (OrcCode *code); /* ALL cpus */ /* data procesing instructions */ /* {}{s} {}, , #imm */ #define orc_arm_emit_and_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_AND,S,Rd,Rn,0,0,imm) #define orc_arm_emit_eor_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_EOR,S,Rd,Rn,0,0,imm) #define orc_arm_emit_sub_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_SUB,S,Rd,Rn,0,0,imm) #define orc_arm_emit_rsb_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_RSB,S,Rd,Rn,0,0,imm) #define orc_arm_emit_add_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_ADD,S,Rd,Rn,0,0,imm) #define orc_arm_emit_adc_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_ADC,S,Rd,Rn,0,0,imm) #define orc_arm_emit_sbc_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_SBC,S,Rd,Rn,0,0,imm) #define orc_arm_emit_rsc_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_RSC,S,Rd,Rn,0,0,imm) #define orc_arm_emit_tst_i(p,cond,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_TST,1, 0,Rn,0,0,imm) #define orc_arm_emit_teq_i(p,cond,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_TEQ,1, 0,Rn,0,0,imm) #define orc_arm_emit_cmp_i(p,cond,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_CMP,1, 0,Rn,0,0,imm) #define orc_arm_emit_cmn_i(p,cond,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_CMN,1, 0,Rn,0,0,imm) #define orc_arm_emit_orr_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_ORR,S,Rd,Rn,0,0,imm) #define orc_arm_emit_mov_i(p,cond,S,Rd,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_MOV,S,Rd, 0,0,0,imm) #define orc_arm_emit_bic_i(p,cond,S,Rd,Rn,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_BIC,S,Rd,Rn,0,0,imm) #define orc_arm_emit_mvn_i(p,cond,S,Rd,imm) orc_arm_emit_dp(p,0,cond,ORC_ARM_DP_MVN,S,Rd, 0,0,0,imm) /* {}{s} {}, , */ #define orc_arm_emit_and_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_AND,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_eor_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_EOR,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_sub_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_SUB,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_rsb_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_RSB,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_add_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_ADD,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_adc_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_ADC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_sbc_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_SBC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_rsc_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_RSC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_tst_r(p,cond,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_TST,1, 0,Rn,Rm,0,0) #define orc_arm_emit_teq_r(p,cond,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_TEQ,1, 0,Rn,Rm,0,0) #define orc_arm_emit_cmp_r(p,cond,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_CMP,1, 0,Rn,Rm,0,0) #define orc_arm_emit_cmn_r(p,cond,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_CMN,1, 0,Rn,Rm,0,0) #define orc_arm_emit_orr_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_ORR,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_mov_r(p,cond,S,Rd,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_MOV,S,Rd, 0,Rm,0,0) #define orc_arm_emit_bic_r(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_BIC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_mvn_r(p,cond,S,Rd,Rm) orc_arm_emit_dp(p,1,cond,ORC_ARM_DP_MVN,S,Rd, 0,Rm,0,0) /* {}{s} {}, , , [LSL|LSR|ASR] #imm */ #define orc_arm_emit_and_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_AND,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_eor_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_EOR,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_sub_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_SUB,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_rsb_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_RSB,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_add_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_ADD,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_adc_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_ADC,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_sbc_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_SBC,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_rsc_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_RSC,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_tst_rsi(p,cond,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_TST,1, 0,Rn,Rm,sh,im) #define orc_arm_emit_teq_rsi(p,cond,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_TEQ,1, 0,Rn,Rm,sh,im) #define orc_arm_emit_cmp_rsi(p,cond,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_CMP,1, 0,Rn,Rm,sh,im) #define orc_arm_emit_cmn_rsi(p,cond,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_CMN,1, 0,Rn,Rm,sh,im) #define orc_arm_emit_orr_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_ORR,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_mov_rsi(p,cond,S,Rd,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_MOV,S,Rd, 0,Rm,sh,im) #define orc_arm_emit_bic_rsi(p,cond,S,Rd,Rn,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_BIC,S,Rd,Rn,Rm,sh,im) #define orc_arm_emit_mvn_rsi(p,cond,S,Rd,Rm,sh,im) orc_arm_emit_dp(p,2,cond,ORC_ARM_DP_MVN,S,Rd, 0,Rm,sh,im) /* {}{s} {}, , , [LSL|LSR|ASR] */ #define orc_arm_emit_and_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_AND,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_eor_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_EOR,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_sub_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_SUB,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_rsb_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_RSB,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_add_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_ADD,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_adc_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_ADC,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_sbc_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_SBC,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_rsc_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_RSC,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_tst_rsr(p,cond,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_TST,1, 0,Rn,Rm,sh,Rs) #define orc_arm_emit_teq_rsr(p,cond,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_TEQ,1, 0,Rn,Rm,sh,Rs) #define orc_arm_emit_cmp_rsr(p,cond,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_CMP,1, 0,Rn,Rm,sh,Rs) #define orc_arm_emit_cmn_rsr(p,cond,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_CMN,1, 0,Rn,Rm,sh,Rs) #define orc_arm_emit_orr_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_ORR,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_mov_rsr(p,cond,S,Rd,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_MOV,S,Rd, 0,Rm,sh,Rs) #define orc_arm_emit_bic_rsr(p,cond,S,Rd,Rn,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_BIC,S,Rd,Rn,Rm,sh,Rs) #define orc_arm_emit_mvn_rsr(p,cond,S,Rd,Rm,sh,Rs) orc_arm_emit_dp(p,3,cond,ORC_ARM_DP_MVN,S,Rd, 0,Rm,sh,Rs) /* {}{s} {,} , , RRX */ #define orc_arm_emit_and_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_AND,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_eor_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_EOR,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_sub_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_SUB,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_rsb_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_RSB,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_add_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_ADD,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_adc_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_ADC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_sbc_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_SBC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_rsc_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_RSC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_tst_rrx(p,cond,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_TST,1, 0,Rn,Rm,0,0) #define orc_arm_emit_teq_rrx(p,cond,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_TEQ,1, 0,Rn,Rm,0,0) #define orc_arm_emit_cmp_rrx(p,cond,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_CMP,1, 0,Rn,Rm,0,0) #define orc_arm_emit_cmn_rrx(p,cond,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_CMN,1, 0,Rn,Rm,0,0) #define orc_arm_emit_orr_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_ORR,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_mov_rrx(p,cond,S,Rd,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_MOV,S,Rd, 0,Rm,0,0) #define orc_arm_emit_bic_rrx(p,cond,S,Rd,Rn,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_BIC,S,Rd,Rn,Rm,0,0) #define orc_arm_emit_mvn_rrx(p,cond,S,Rd,Rm) orc_arm_emit_dp(p,4,cond,ORC_ARM_DP_MVN,S,Rd, 0,Rm,0,0) /* parallel instructions */ #define orc_arm_emit_sadd16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,0,0,cond,Rd,Rn,Rm) #define orc_arm_emit_qadd16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,0,1,cond,Rd,Rn,Rm) #define orc_arm_emit_shadd16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,0,2,cond,Rd,Rn,Rm) #define orc_arm_emit_uadd16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,0,3,cond,Rd,Rn,Rm) #define orc_arm_emit_uqadd16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,0,4,cond,Rd,Rn,Rm) #define orc_arm_emit_uhadd16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,0,5,cond,Rd,Rn,Rm) #define orc_arm_emit_saddsubx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,1,0,cond,Rd,Rn,Rm) #define orc_arm_emit_qaddsubx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,1,1,cond,Rd,Rn,Rm) #define orc_arm_emit_shaddsubx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,1,2,cond,Rd,Rn,Rm) #define orc_arm_emit_uaddsubx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,1,3,cond,Rd,Rn,Rm) #define orc_arm_emit_uqaddsubx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,1,4,cond,Rd,Rn,Rm) #define orc_arm_emit_uhaddsubx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,1,5,cond,Rd,Rn,Rm) #define orc_arm_emit_ssubaddx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,2,0,cond,Rd,Rn,Rm) #define orc_arm_emit_qsubaddx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,2,1,cond,Rd,Rn,Rm) #define orc_arm_emit_shsubaddx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,2,2,cond,Rd,Rn,Rm) #define orc_arm_emit_usubaddx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,2,3,cond,Rd,Rn,Rm) #define orc_arm_emit_uqsubaddx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,2,4,cond,Rd,Rn,Rm) #define orc_arm_emit_uhsubaddx(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,2,5,cond,Rd,Rn,Rm) #define orc_arm_emit_ssub16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,3,0,cond,Rd,Rn,Rm) #define orc_arm_emit_qsub16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,3,1,cond,Rd,Rn,Rm) #define orc_arm_emit_shsub16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,3,2,cond,Rd,Rn,Rm) #define orc_arm_emit_usub16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,3,3,cond,Rd,Rn,Rm) #define orc_arm_emit_uqsub16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,3,4,cond,Rd,Rn,Rm) #define orc_arm_emit_uhsub16(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,3,5,cond,Rd,Rn,Rm) #define orc_arm_emit_sadd8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,4,0,cond,Rd,Rn,Rm) #define orc_arm_emit_qadd8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,4,1,cond,Rd,Rn,Rm) #define orc_arm_emit_shadd8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,4,2,cond,Rd,Rn,Rm) #define orc_arm_emit_uadd8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,4,3,cond,Rd,Rn,Rm) #define orc_arm_emit_uqadd8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,4,4,cond,Rd,Rn,Rm) #define orc_arm_emit_uhadd8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,4,5,cond,Rd,Rn,Rm) #define orc_arm_emit_ssub8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,5,0,cond,Rd,Rn,Rm) #define orc_arm_emit_qsub8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,5,1,cond,Rd,Rn,Rm) #define orc_arm_emit_shsub8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,5,2,cond,Rd,Rn,Rm) #define orc_arm_emit_usub8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,5,3,cond,Rd,Rn,Rm) #define orc_arm_emit_uqsub8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,5,4,cond,Rd,Rn,Rm) #define orc_arm_emit_uhsub8(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,5,5,cond,Rd,Rn,Rm) /* selection */ #define orc_arm_emit_sel(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,6,6,cond,Rd,Rn,Rm) /* saturating add */ #define orc_arm_emit_qadd(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,7,7, cond,Rd,Rn,Rm) #define orc_arm_emit_qsub(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,8,8, cond,Rd,Rn,Rm) #define orc_arm_emit_qdadd(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,7,9, cond,Rd,Rn,Rm) #define orc_arm_emit_qdsub(p,cond,Rd,Rn,Rm) orc_arm_emit_par(p,8,10,cond,Rd,Rn,Rm) /* extend instructions */ /* with ROR #r8, r8 should be a multiple of 8 */ #define orc_arm_emit_sxtb16_r8(p,cond,Rd,Rm,r8) orc_arm_emit_xt(p,0, cond,Rd,15,Rm,r8) #define orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,r8) orc_arm_emit_xt(p,1, cond,Rd,15,Rm,r8) #define orc_arm_emit_sxth_r8(p,cond,Rd,Rm,r8) orc_arm_emit_xt(p,2, cond,Rd,15,Rm,r8) #define orc_arm_emit_uxtb16_r8(p,cond,Rd,Rm,r8) orc_arm_emit_xt(p,3, cond,Rd,15,Rm,r8) #define orc_arm_emit_uxtb_r8(p,cond,Rd,Rm,r8) orc_arm_emit_xt(p,4, cond,Rd,15,Rm,r8) #define orc_arm_emit_uxth_r8(p,cond,Rd,Rm,r8) orc_arm_emit_xt(p,5, cond,Rd,15,Rm,r8) #define orc_arm_emit_sxtab16_r8(p,cond,Rd,Rn,Rm,r8) orc_arm_emit_xt(p,6, cond,Rd,Rn,Rm,r8) #define orc_arm_emit_sxtab_r8(p,cond,Rd,Rn,Rm,r8) orc_arm_emit_xt(p,7, cond,Rd,Rn,Rm,r8) #define orc_arm_emit_sxtah_r8(p,cond,Rd,Rn,Rm,r8) orc_arm_emit_xt(p,8, cond,Rd,Rn,Rm,r8) #define orc_arm_emit_uxtab16_r8(p,cond,Rd,Rn,Rm,r8) orc_arm_emit_xt(p,9, cond,Rd,Rn,Rm,r8) #define orc_arm_emit_uxtab_r8(p,cond,Rd,Rn,Rm,r8) orc_arm_emit_xt(p,10,cond,Rd,Rn,Rm,r8) #define orc_arm_emit_uxtah_r8(p,cond,Rd,Rn,Rm,r8) orc_arm_emit_xt(p,11,cond,Rd,Rn,Rm,r8) /* with out rotate */ #define orc_arm_emit_sxtb16(p,cond,Rd,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_sxtb(p,cond,Rd,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_sxth(p,cond,Rd,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_uxtb16(p,cond,Rd,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_uxtb(p,cond,Rd,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_uxth(p,cond,Rd,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_sxtab16(p,cond,Rd,Rn,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_sxtab(p,cond,Rd,Rn,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_sxtah(p,cond,Rd,Rn,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_uxtab16(p,cond,Rd,Rn,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_uxtab(p,cond,Rd,Rn,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) #define orc_arm_emit_uxtah(p,cond,Rd,Rn,Rm) orc_arm_emit_sxtb_r8(p,cond,Rd,Rm,0) /* misc instructions */ /* packing */ #define orc_arm_emit_pkhbt(p,cond,Rd,Rn,Rm) orc_arm_emit_pkh(p,0,cond,Rd,Rn,Rm,0) #define orc_arm_emit_pkhtb(p,cond,Rd,Rn,Rm) orc_arm_emit_pkh(p,1,cond,Rd,Rn,Rm,0) /* with [LSL|ASR] #imm */ #define orc_arm_emit_pkhbt_s(p,cond,Rd,Rn,Rm,lsl) orc_arm_emit_pkh(p,0,cond,Rd,Rn,Rm,lsl) #define orc_arm_emit_pkhtb_s(p,cond,Rd,Rn,Rm,asr) orc_arm_emit_pkh(p,1,cond,Rd,Rn,Rm,asr) /* saturation */ #define orc_arm_emit_ssat(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,0,cond,Rd,sat,Rm,0, 0) #define orc_arm_emit_usat(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,1,cond,Rd,sat,Rm,0, 0) #define orc_arm_emit_ssat_lsl(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,0,cond,Rd,sat,Rm,sh,0) #define orc_arm_emit_usat_lsl(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,1,cond,Rd,sat,Rm,sh,0) #define orc_arm_emit_ssat_asr(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,0,cond,Rd,sat,Rm,sh,1) #define orc_arm_emit_usat_asr(p,cond,Rd,sat,Rm,sh) orc_arm_emit_sat(p,1,cond,Rd,sat,Rm,sh,1) #define orc_arm_emit_ssat16(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,2,cond,Rd,sat,Rm,0, 0) #define orc_arm_emit_usat16(p,cond,Rd,sat,Rm) orc_arm_emit_sat(p,3,cond,Rd,sat,Rm,0, 0) /* reversing */ #define orc_arm_emit_rev(p,cond,Rd,Rm) orc_arm_emit_rv (p,0,cond,Rd,Rm) #define orc_arm_emit_rev16(p,cond,Rd,Rm) orc_arm_emit_rv (p,1,cond,Rd,Rm) #endif ORC_END_DECLS #endif orc-0.4.18/orc/orconce.c0000664000175000017500000000355412071634360011702 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #if defined(HAVE_THREAD_PTHREAD) #include static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t global_mutex = PTHREAD_MUTEX_INITIALIZER; void orc_once_mutex_lock (void) { pthread_mutex_lock (&once_mutex); } void orc_once_mutex_unlock (void) { pthread_mutex_unlock (&once_mutex); } void orc_global_mutex_lock (void) { pthread_mutex_lock (&global_mutex); } void orc_global_mutex_unlock (void) { pthread_mutex_unlock (&global_mutex); } #elif defined(HAVE_THREAD_WIN32) #include static CRITICAL_SECTION once_mutex; static CRITICAL_SECTION global_mutex; void orc_once_mutex_lock (void) { EnterCriticalSection (&once_mutex); } void orc_once_mutex_unlock (void) { LeaveCriticalSection (&once_mutex); } void orc_global_mutex_lock (void) { EnterCriticalSection (&global_mutex); } void orc_global_mutex_unlock (void) { LeaveCriticalSection (&global_mutex); } #ifdef _MSC_VER #pragma section(".CRT$XCU",read) static void __cdecl orc_once_cs_init (void) { InitializeCriticalSection (&once_mutex); InitializeCriticalSection (&global_mutex); } __declspec(allocate(".CRT$XCU")) void (__cdecl * orc_once_cs_init_constructor)(void) = orc_once_cs_init; #elif defined(__GNUC__) static void orc_once_cs_init (void) __attribute__((constructor)); static void orc_once_cs_init (void) { InitializeCriticalSection (&once_mutex); InitializeCriticalSection (&global_mutex); } #else #error Expecting GCC or MSVC on Windows #endif #if 0 BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { if (dwReason == DLL_PROCESS_ATTACH) { InitializeCriticalSection (&once_mutex); } return TRUE; } #endif #else void orc_once_mutex_lock (void) { } void orc_once_mutex_unlock (void) { } #endif orc-0.4.18/orc/Makefile.in0000664000175000017500000024061212206165327012153 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_BACKEND_SSE_TRUE@am__append_1 = orcsse.c orcrules-sse.c \ @ENABLE_BACKEND_SSE_TRUE@ orcprogram-sse.c orcx86.c \ @ENABLE_BACKEND_SSE_TRUE@ orcx86insn.c @ENABLE_BACKEND_MMX_TRUE@am__append_2 = orcmmx.c orcrules-mmx.c orcprogram-mmx.c @ENABLE_BACKEND_MMX_TRUE@@ENABLE_BACKEND_SSE_FALSE@am__append_3 = orcx86.c @ENABLE_BACKEND_ALTIVEC_TRUE@am__append_4 = \ @ENABLE_BACKEND_ALTIVEC_TRUE@ orcrules-altivec.c orcprogram-altivec.c orcpowerpc.c @ENABLE_BACKEND_NEON_TRUE@am__append_5 = orcprogram-neon.c \ @ENABLE_BACKEND_NEON_TRUE@ orcrules-neon.c orcarm.c @ENABLE_BACKEND_ARM_TRUE@am__append_6 = orcprogram-arm.c orcrules-arm.c @ENABLE_BACKEND_ARM_TRUE@@ENABLE_BACKEND_NEON_FALSE@am__append_7 = orcarm.c @ENABLE_BACKEND_C64X_TRUE@am__append_8 = orcprogram-c64x-c.c @ENABLE_BACKEND_MIPS_TRUE@am__append_9 = orcmips.c orcprogram-mips.c orcrules-mips.c @HAVE_I386_TRUE@am__append_10 = orccpu-x86.c @HAVE_AMD64_TRUE@am__append_11 = orccpu-x86.c @HAVE_POWERPC_TRUE@am__append_12 = orccpu-powerpc.c @HAVE_ARM_TRUE@am__append_13 = orccpu-arm.c noinst_PROGRAMS = generate-emulation$(EXEEXT) \ generate-bytecode$(EXEEXT) subdir = orc DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = liborc_@ORC_MAJORMINOR@_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__liborc_@ORC_MAJORMINOR@_la_SOURCES_DIST = orc.c orcbytecode.c \ orcemulateopcodes.c orcexecutor.c orcfunctions.c orcutils.c \ orcrule.c orccodemem.c orcprogram.c orccompiler.c \ orcprogram-c.c orcprogram.h orcopcodes.c orcparse.c orconce.c \ orcdebug.c orccode.c orcsse.c orcrules-sse.c orcprogram-sse.c \ orcx86.c orcx86insn.c orcmmx.c orcrules-mmx.c orcprogram-mmx.c \ orcrules-altivec.c orcprogram-altivec.c orcpowerpc.c \ orcprogram-neon.c orcrules-neon.c orcarm.c orcprogram-arm.c \ orcrules-arm.c orcprogram-c64x-c.c orcmips.c orcprogram-mips.c \ orcrules-mips.c orccpu-x86.c orccpu-powerpc.c orccpu-arm.c @ENABLE_BACKEND_SSE_TRUE@am__objects_1 = \ @ENABLE_BACKEND_SSE_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcsse.lo \ @ENABLE_BACKEND_SSE_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcrules-sse.lo \ @ENABLE_BACKEND_SSE_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.lo \ @ENABLE_BACKEND_SSE_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcx86.lo \ @ENABLE_BACKEND_SSE_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcx86insn.lo @ENABLE_BACKEND_MMX_TRUE@am__objects_2 = \ @ENABLE_BACKEND_MMX_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcmmx.lo \ @ENABLE_BACKEND_MMX_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.lo \ @ENABLE_BACKEND_MMX_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.lo @ENABLE_BACKEND_MMX_TRUE@@ENABLE_BACKEND_SSE_FALSE@am__objects_3 = liborc_@ORC_MAJORMINOR@_la-orcx86.lo @ENABLE_BACKEND_ALTIVEC_TRUE@am__objects_4 = liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.lo \ @ENABLE_BACKEND_ALTIVEC_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.lo \ @ENABLE_BACKEND_ALTIVEC_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcpowerpc.lo @ENABLE_BACKEND_NEON_TRUE@am__objects_5 = liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.lo \ @ENABLE_BACKEND_NEON_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcrules-neon.lo \ @ENABLE_BACKEND_NEON_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcarm.lo @ENABLE_BACKEND_ARM_TRUE@am__objects_6 = liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.lo \ @ENABLE_BACKEND_ARM_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcrules-arm.lo @ENABLE_BACKEND_ARM_TRUE@@ENABLE_BACKEND_NEON_FALSE@am__objects_7 = liborc_@ORC_MAJORMINOR@_la-orcarm.lo @ENABLE_BACKEND_C64X_TRUE@am__objects_8 = liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.lo @ENABLE_BACKEND_MIPS_TRUE@am__objects_9 = liborc_@ORC_MAJORMINOR@_la-orcmips.lo \ @ENABLE_BACKEND_MIPS_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.lo \ @ENABLE_BACKEND_MIPS_TRUE@ liborc_@ORC_MAJORMINOR@_la-orcrules-mips.lo @HAVE_I386_TRUE@am__objects_10 = \ @HAVE_I386_TRUE@ liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo @HAVE_AMD64_TRUE@am__objects_11 = \ @HAVE_AMD64_TRUE@ liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo @HAVE_POWERPC_TRUE@am__objects_12 = liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.lo @HAVE_ARM_TRUE@am__objects_13 = \ @HAVE_ARM_TRUE@ liborc_@ORC_MAJORMINOR@_la-orccpu-arm.lo am_liborc_@ORC_MAJORMINOR@_la_OBJECTS = \ liborc_@ORC_MAJORMINOR@_la-orc.lo \ liborc_@ORC_MAJORMINOR@_la-orcbytecode.lo \ liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.lo \ liborc_@ORC_MAJORMINOR@_la-orcexecutor.lo \ liborc_@ORC_MAJORMINOR@_la-orcfunctions.lo \ liborc_@ORC_MAJORMINOR@_la-orcutils.lo \ liborc_@ORC_MAJORMINOR@_la-orcrule.lo \ liborc_@ORC_MAJORMINOR@_la-orccodemem.lo \ liborc_@ORC_MAJORMINOR@_la-orcprogram.lo \ liborc_@ORC_MAJORMINOR@_la-orccompiler.lo \ liborc_@ORC_MAJORMINOR@_la-orcprogram-c.lo \ liborc_@ORC_MAJORMINOR@_la-orcopcodes.lo \ liborc_@ORC_MAJORMINOR@_la-orcparse.lo \ liborc_@ORC_MAJORMINOR@_la-orconce.lo \ liborc_@ORC_MAJORMINOR@_la-orcdebug.lo \ liborc_@ORC_MAJORMINOR@_la-orccode.lo $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_8) $(am__objects_9) $(am__objects_10) \ $(am__objects_11) $(am__objects_12) $(am__objects_13) liborc_@ORC_MAJORMINOR@_la_OBJECTS = \ $(am_liborc_@ORC_MAJORMINOR@_la_OBJECTS) liborc_@ORC_MAJORMINOR@_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) \ $(liborc_@ORC_MAJORMINOR@_la_LDFLAGS) $(LDFLAGS) -o $@ PROGRAMS = $(noinst_PROGRAMS) generate_bytecode_SOURCES = generate-bytecode.c generate_bytecode_OBJECTS = \ generate_bytecode-generate-bytecode.$(OBJEXT) generate_bytecode_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(generate_bytecode_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ generate_emulation_SOURCES = generate-emulation.c generate_emulation_OBJECTS = \ generate_emulation-generate-emulation.$(OBJEXT) generate_emulation_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(generate_emulation_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(liborc_@ORC_MAJORMINOR@_la_SOURCES) generate-bytecode.c \ generate-emulation.c DIST_SOURCES = $(am__liborc_@ORC_MAJORMINOR@_la_SOURCES_DIST) \ generate-bytecode.c generate-emulation.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgincludedir = $(includedir)/orc-@ORC_MAJORMINOR@/orc ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = liborc-@ORC_MAJORMINOR@.la liborc_@ORC_MAJORMINOR@_la_LIBADD = $(LIBM) $(LIBRT) $(PTHREAD_LIBS) liborc_@ORC_MAJORMINOR@_la_LDFLAGS = \ -version-info $(ORC_LIBVERSION) \ -no-undefined -export-symbols-regex 'orc_' liborc_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) \ -DORC_ENABLE_UNSTABLE_API liborc_@ORC_MAJORMINOR@_la_SOURCES = orc.c orcbytecode.c \ orcemulateopcodes.c orcexecutor.c orcfunctions.c orcutils.c \ orcrule.c orccodemem.c orcprogram.c orccompiler.c \ orcprogram-c.c orcprogram.h orcopcodes.c orcparse.c orconce.c \ orcdebug.c orccode.c $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) \ $(am__append_6) $(am__append_7) $(am__append_8) \ $(am__append_9) $(am__append_10) $(am__append_11) \ $(am__append_12) $(am__append_13) pkginclude_HEADERS = \ orc-stdint.h \ orc.h \ orcarm.h \ orcbytecode.h \ orcbytecodes.h \ orccode.h \ orccompiler.h \ orcconstant.h \ orccpu.h \ orccpuinsn.h \ orcdebug.h \ orcemulateopcodes.h \ orcexecutor.h \ orcfunctions.h \ orcinstruction.h \ orcinternal.h \ orclimits.h \ orcmmx.h \ orcneon.h \ orconce.h \ orcopcode.h \ orcparse.h \ orcpowerpc.h \ orcprogram.h \ orcrule.h \ orcsse.h \ orctarget.h \ orcutils.h \ orcvariable.h \ orcx86.h \ orcx86insn.h \ orcmips.h noinst_HEADERS = \ opcodes.h generate_emulation_LDADD = $(ORC_LIBS) generate_emulation_CFLAGS = $(ORC_CFLAGS) generate_emulation_DEPENDENCIES = liborc-0.4.la generate_bytecode_LDADD = $(ORC_LIBS) generate_bytecode_CFLAGS = $(ORC_CFLAGS) generate_bytecode_DEPENDENCIES = liborc-0.4.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu orc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu orc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done liborc-@ORC_MAJORMINOR@.la: $(liborc_@ORC_MAJORMINOR@_la_OBJECTS) $(liborc_@ORC_MAJORMINOR@_la_DEPENDENCIES) $(EXTRA_liborc_@ORC_MAJORMINOR@_la_DEPENDENCIES) $(liborc_@ORC_MAJORMINOR@_la_LINK) -rpath $(libdir) $(liborc_@ORC_MAJORMINOR@_la_OBJECTS) $(liborc_@ORC_MAJORMINOR@_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list generate-bytecode$(EXEEXT): $(generate_bytecode_OBJECTS) $(generate_bytecode_DEPENDENCIES) $(EXTRA_generate_bytecode_DEPENDENCIES) @rm -f generate-bytecode$(EXEEXT) $(generate_bytecode_LINK) $(generate_bytecode_OBJECTS) $(generate_bytecode_LDADD) $(LIBS) generate-emulation$(EXEEXT): $(generate_emulation_OBJECTS) $(generate_emulation_DEPENDENCIES) $(EXTRA_generate_emulation_DEPENDENCIES) @rm -f generate-emulation$(EXEEXT) $(generate_emulation_LINK) $(generate_emulation_OBJECTS) $(generate_emulation_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_bytecode-generate-bytecode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_emulation-generate-emulation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcarm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcbytecode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccodemem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccompiler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-arm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-x86.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcdebug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcexecutor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcfunctions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmips.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmmx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orconce.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcopcodes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcpowerpc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-arm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mips.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-neon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-sse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcsse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86insn.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< liborc_@ORC_MAJORMINOR@_la-orc.lo: orc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orc.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orc.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orc.lo `test -f 'orc.c' || echo '$(srcdir)/'`orc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orc.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orc.c' object='liborc_@ORC_MAJORMINOR@_la-orc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orc.lo `test -f 'orc.c' || echo '$(srcdir)/'`orc.c liborc_@ORC_MAJORMINOR@_la-orcbytecode.lo: orcbytecode.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcbytecode.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcbytecode.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcbytecode.lo `test -f 'orcbytecode.c' || echo '$(srcdir)/'`orcbytecode.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcbytecode.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcbytecode.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcbytecode.c' object='liborc_@ORC_MAJORMINOR@_la-orcbytecode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcbytecode.lo `test -f 'orcbytecode.c' || echo '$(srcdir)/'`orcbytecode.c liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.lo: orcemulateopcodes.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.lo `test -f 'orcemulateopcodes.c' || echo '$(srcdir)/'`orcemulateopcodes.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcemulateopcodes.c' object='liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcemulateopcodes.lo `test -f 'orcemulateopcodes.c' || echo '$(srcdir)/'`orcemulateopcodes.c liborc_@ORC_MAJORMINOR@_la-orcexecutor.lo: orcexecutor.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcexecutor.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcexecutor.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcexecutor.lo `test -f 'orcexecutor.c' || echo '$(srcdir)/'`orcexecutor.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcexecutor.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcexecutor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcexecutor.c' object='liborc_@ORC_MAJORMINOR@_la-orcexecutor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcexecutor.lo `test -f 'orcexecutor.c' || echo '$(srcdir)/'`orcexecutor.c liborc_@ORC_MAJORMINOR@_la-orcfunctions.lo: orcfunctions.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcfunctions.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcfunctions.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcfunctions.lo `test -f 'orcfunctions.c' || echo '$(srcdir)/'`orcfunctions.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcfunctions.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcfunctions.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcfunctions.c' object='liborc_@ORC_MAJORMINOR@_la-orcfunctions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcfunctions.lo `test -f 'orcfunctions.c' || echo '$(srcdir)/'`orcfunctions.c liborc_@ORC_MAJORMINOR@_la-orcutils.lo: orcutils.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcutils.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcutils.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcutils.lo `test -f 'orcutils.c' || echo '$(srcdir)/'`orcutils.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcutils.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcutils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcutils.c' object='liborc_@ORC_MAJORMINOR@_la-orcutils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcutils.lo `test -f 'orcutils.c' || echo '$(srcdir)/'`orcutils.c liborc_@ORC_MAJORMINOR@_la-orcrule.lo: orcrule.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrule.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrule.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrule.lo `test -f 'orcrule.c' || echo '$(srcdir)/'`orcrule.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrule.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrule.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrule.c' object='liborc_@ORC_MAJORMINOR@_la-orcrule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrule.lo `test -f 'orcrule.c' || echo '$(srcdir)/'`orcrule.c liborc_@ORC_MAJORMINOR@_la-orccodemem.lo: orccodemem.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orccodemem.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccodemem.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orccodemem.lo `test -f 'orccodemem.c' || echo '$(srcdir)/'`orccodemem.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccodemem.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccodemem.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orccodemem.c' object='liborc_@ORC_MAJORMINOR@_la-orccodemem.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orccodemem.lo `test -f 'orccodemem.c' || echo '$(srcdir)/'`orccodemem.c liborc_@ORC_MAJORMINOR@_la-orcprogram.lo: orcprogram.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram.lo `test -f 'orcprogram.c' || echo '$(srcdir)/'`orcprogram.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram.lo `test -f 'orcprogram.c' || echo '$(srcdir)/'`orcprogram.c liborc_@ORC_MAJORMINOR@_la-orccompiler.lo: orccompiler.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orccompiler.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccompiler.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orccompiler.lo `test -f 'orccompiler.c' || echo '$(srcdir)/'`orccompiler.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccompiler.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccompiler.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orccompiler.c' object='liborc_@ORC_MAJORMINOR@_la-orccompiler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orccompiler.lo `test -f 'orccompiler.c' || echo '$(srcdir)/'`orccompiler.c liborc_@ORC_MAJORMINOR@_la-orcprogram-c.lo: orcprogram-c.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-c.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-c.lo `test -f 'orcprogram-c.c' || echo '$(srcdir)/'`orcprogram-c.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-c.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-c.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-c.lo `test -f 'orcprogram-c.c' || echo '$(srcdir)/'`orcprogram-c.c liborc_@ORC_MAJORMINOR@_la-orcopcodes.lo: orcopcodes.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcopcodes.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcopcodes.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcopcodes.lo `test -f 'orcopcodes.c' || echo '$(srcdir)/'`orcopcodes.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcopcodes.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcopcodes.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcopcodes.c' object='liborc_@ORC_MAJORMINOR@_la-orcopcodes.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcopcodes.lo `test -f 'orcopcodes.c' || echo '$(srcdir)/'`orcopcodes.c liborc_@ORC_MAJORMINOR@_la-orcparse.lo: orcparse.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcparse.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcparse.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcparse.lo `test -f 'orcparse.c' || echo '$(srcdir)/'`orcparse.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcparse.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcparse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcparse.c' object='liborc_@ORC_MAJORMINOR@_la-orcparse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcparse.lo `test -f 'orcparse.c' || echo '$(srcdir)/'`orcparse.c liborc_@ORC_MAJORMINOR@_la-orconce.lo: orconce.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orconce.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orconce.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orconce.lo `test -f 'orconce.c' || echo '$(srcdir)/'`orconce.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orconce.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orconce.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orconce.c' object='liborc_@ORC_MAJORMINOR@_la-orconce.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orconce.lo `test -f 'orconce.c' || echo '$(srcdir)/'`orconce.c liborc_@ORC_MAJORMINOR@_la-orcdebug.lo: orcdebug.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcdebug.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcdebug.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcdebug.lo `test -f 'orcdebug.c' || echo '$(srcdir)/'`orcdebug.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcdebug.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcdebug.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcdebug.c' object='liborc_@ORC_MAJORMINOR@_la-orcdebug.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcdebug.lo `test -f 'orcdebug.c' || echo '$(srcdir)/'`orcdebug.c liborc_@ORC_MAJORMINOR@_la-orccode.lo: orccode.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orccode.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccode.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orccode.lo `test -f 'orccode.c' || echo '$(srcdir)/'`orccode.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccode.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccode.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orccode.c' object='liborc_@ORC_MAJORMINOR@_la-orccode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orccode.lo `test -f 'orccode.c' || echo '$(srcdir)/'`orccode.c liborc_@ORC_MAJORMINOR@_la-orcsse.lo: orcsse.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcsse.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcsse.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcsse.lo `test -f 'orcsse.c' || echo '$(srcdir)/'`orcsse.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcsse.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcsse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcsse.c' object='liborc_@ORC_MAJORMINOR@_la-orcsse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcsse.lo `test -f 'orcsse.c' || echo '$(srcdir)/'`orcsse.c liborc_@ORC_MAJORMINOR@_la-orcrules-sse.lo: orcrules-sse.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrules-sse.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-sse.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-sse.lo `test -f 'orcrules-sse.c' || echo '$(srcdir)/'`orcrules-sse.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-sse.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-sse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrules-sse.c' object='liborc_@ORC_MAJORMINOR@_la-orcrules-sse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-sse.lo `test -f 'orcrules-sse.c' || echo '$(srcdir)/'`orcrules-sse.c liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.lo: orcprogram-sse.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.lo `test -f 'orcprogram-sse.c' || echo '$(srcdir)/'`orcprogram-sse.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-sse.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-sse.lo `test -f 'orcprogram-sse.c' || echo '$(srcdir)/'`orcprogram-sse.c liborc_@ORC_MAJORMINOR@_la-orcx86.lo: orcx86.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcx86.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcx86.lo `test -f 'orcx86.c' || echo '$(srcdir)/'`orcx86.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcx86.c' object='liborc_@ORC_MAJORMINOR@_la-orcx86.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcx86.lo `test -f 'orcx86.c' || echo '$(srcdir)/'`orcx86.c liborc_@ORC_MAJORMINOR@_la-orcx86insn.lo: orcx86insn.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcx86insn.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86insn.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcx86insn.lo `test -f 'orcx86insn.c' || echo '$(srcdir)/'`orcx86insn.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86insn.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcx86insn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcx86insn.c' object='liborc_@ORC_MAJORMINOR@_la-orcx86insn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcx86insn.lo `test -f 'orcx86insn.c' || echo '$(srcdir)/'`orcx86insn.c liborc_@ORC_MAJORMINOR@_la-orcmmx.lo: orcmmx.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcmmx.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmmx.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcmmx.lo `test -f 'orcmmx.c' || echo '$(srcdir)/'`orcmmx.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmmx.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmmx.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcmmx.c' object='liborc_@ORC_MAJORMINOR@_la-orcmmx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcmmx.lo `test -f 'orcmmx.c' || echo '$(srcdir)/'`orcmmx.c liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.lo: orcrules-mmx.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.lo `test -f 'orcrules-mmx.c' || echo '$(srcdir)/'`orcrules-mmx.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrules-mmx.c' object='liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-mmx.lo `test -f 'orcrules-mmx.c' || echo '$(srcdir)/'`orcrules-mmx.c liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.lo: orcprogram-mmx.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.lo `test -f 'orcprogram-mmx.c' || echo '$(srcdir)/'`orcprogram-mmx.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-mmx.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-mmx.lo `test -f 'orcprogram-mmx.c' || echo '$(srcdir)/'`orcprogram-mmx.c liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.lo: orcrules-altivec.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.lo `test -f 'orcrules-altivec.c' || echo '$(srcdir)/'`orcrules-altivec.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrules-altivec.c' object='liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-altivec.lo `test -f 'orcrules-altivec.c' || echo '$(srcdir)/'`orcrules-altivec.c liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.lo: orcprogram-altivec.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.lo `test -f 'orcprogram-altivec.c' || echo '$(srcdir)/'`orcprogram-altivec.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-altivec.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-altivec.lo `test -f 'orcprogram-altivec.c' || echo '$(srcdir)/'`orcprogram-altivec.c liborc_@ORC_MAJORMINOR@_la-orcpowerpc.lo: orcpowerpc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcpowerpc.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcpowerpc.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcpowerpc.lo `test -f 'orcpowerpc.c' || echo '$(srcdir)/'`orcpowerpc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcpowerpc.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcpowerpc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcpowerpc.c' object='liborc_@ORC_MAJORMINOR@_la-orcpowerpc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcpowerpc.lo `test -f 'orcpowerpc.c' || echo '$(srcdir)/'`orcpowerpc.c liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.lo: orcprogram-neon.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.lo `test -f 'orcprogram-neon.c' || echo '$(srcdir)/'`orcprogram-neon.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-neon.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-neon.lo `test -f 'orcprogram-neon.c' || echo '$(srcdir)/'`orcprogram-neon.c liborc_@ORC_MAJORMINOR@_la-orcrules-neon.lo: orcrules-neon.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrules-neon.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-neon.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-neon.lo `test -f 'orcrules-neon.c' || echo '$(srcdir)/'`orcrules-neon.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-neon.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-neon.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrules-neon.c' object='liborc_@ORC_MAJORMINOR@_la-orcrules-neon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-neon.lo `test -f 'orcrules-neon.c' || echo '$(srcdir)/'`orcrules-neon.c liborc_@ORC_MAJORMINOR@_la-orcarm.lo: orcarm.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcarm.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcarm.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcarm.lo `test -f 'orcarm.c' || echo '$(srcdir)/'`orcarm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcarm.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcarm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcarm.c' object='liborc_@ORC_MAJORMINOR@_la-orcarm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcarm.lo `test -f 'orcarm.c' || echo '$(srcdir)/'`orcarm.c liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.lo: orcprogram-arm.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.lo `test -f 'orcprogram-arm.c' || echo '$(srcdir)/'`orcprogram-arm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-arm.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-arm.lo `test -f 'orcprogram-arm.c' || echo '$(srcdir)/'`orcprogram-arm.c liborc_@ORC_MAJORMINOR@_la-orcrules-arm.lo: orcrules-arm.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrules-arm.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-arm.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-arm.lo `test -f 'orcrules-arm.c' || echo '$(srcdir)/'`orcrules-arm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-arm.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-arm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrules-arm.c' object='liborc_@ORC_MAJORMINOR@_la-orcrules-arm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-arm.lo `test -f 'orcrules-arm.c' || echo '$(srcdir)/'`orcrules-arm.c liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.lo: orcprogram-c64x-c.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.lo `test -f 'orcprogram-c64x-c.c' || echo '$(srcdir)/'`orcprogram-c64x-c.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-c64x-c.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-c64x-c.lo `test -f 'orcprogram-c64x-c.c' || echo '$(srcdir)/'`orcprogram-c64x-c.c liborc_@ORC_MAJORMINOR@_la-orcmips.lo: orcmips.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcmips.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmips.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcmips.lo `test -f 'orcmips.c' || echo '$(srcdir)/'`orcmips.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmips.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcmips.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcmips.c' object='liborc_@ORC_MAJORMINOR@_la-orcmips.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcmips.lo `test -f 'orcmips.c' || echo '$(srcdir)/'`orcmips.c liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.lo: orcprogram-mips.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.lo `test -f 'orcprogram-mips.c' || echo '$(srcdir)/'`orcprogram-mips.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprogram-mips.c' object='liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcprogram-mips.lo `test -f 'orcprogram-mips.c' || echo '$(srcdir)/'`orcprogram-mips.c liborc_@ORC_MAJORMINOR@_la-orcrules-mips.lo: orcrules-mips.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orcrules-mips.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mips.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-mips.lo `test -f 'orcrules-mips.c' || echo '$(srcdir)/'`orcrules-mips.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mips.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orcrules-mips.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrules-mips.c' object='liborc_@ORC_MAJORMINOR@_la-orcrules-mips.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orcrules-mips.lo `test -f 'orcrules-mips.c' || echo '$(srcdir)/'`orcrules-mips.c liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo: orccpu-x86.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-x86.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo `test -f 'orccpu-x86.c' || echo '$(srcdir)/'`orccpu-x86.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-x86.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-x86.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orccpu-x86.c' object='liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orccpu-x86.lo `test -f 'orccpu-x86.c' || echo '$(srcdir)/'`orccpu-x86.c liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.lo: orccpu-powerpc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.lo `test -f 'orccpu-powerpc.c' || echo '$(srcdir)/'`orccpu-powerpc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orccpu-powerpc.c' object='liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orccpu-powerpc.lo `test -f 'orccpu-powerpc.c' || echo '$(srcdir)/'`orccpu-powerpc.c liborc_@ORC_MAJORMINOR@_la-orccpu-arm.lo: orccpu-arm.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_@ORC_MAJORMINOR@_la-orccpu-arm.lo -MD -MP -MF $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-arm.Tpo -c -o liborc_@ORC_MAJORMINOR@_la-orccpu-arm.lo `test -f 'orccpu-arm.c' || echo '$(srcdir)/'`orccpu-arm.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-arm.Tpo $(DEPDIR)/liborc_@ORC_MAJORMINOR@_la-orccpu-arm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orccpu-arm.c' object='liborc_@ORC_MAJORMINOR@_la-orccpu-arm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_@ORC_MAJORMINOR@_la-orccpu-arm.lo `test -f 'orccpu-arm.c' || echo '$(srcdir)/'`orccpu-arm.c generate_bytecode-generate-bytecode.o: generate-bytecode.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_bytecode_CFLAGS) $(CFLAGS) -MT generate_bytecode-generate-bytecode.o -MD -MP -MF $(DEPDIR)/generate_bytecode-generate-bytecode.Tpo -c -o generate_bytecode-generate-bytecode.o `test -f 'generate-bytecode.c' || echo '$(srcdir)/'`generate-bytecode.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/generate_bytecode-generate-bytecode.Tpo $(DEPDIR)/generate_bytecode-generate-bytecode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-bytecode.c' object='generate_bytecode-generate-bytecode.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_bytecode_CFLAGS) $(CFLAGS) -c -o generate_bytecode-generate-bytecode.o `test -f 'generate-bytecode.c' || echo '$(srcdir)/'`generate-bytecode.c generate_bytecode-generate-bytecode.obj: generate-bytecode.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_bytecode_CFLAGS) $(CFLAGS) -MT generate_bytecode-generate-bytecode.obj -MD -MP -MF $(DEPDIR)/generate_bytecode-generate-bytecode.Tpo -c -o generate_bytecode-generate-bytecode.obj `if test -f 'generate-bytecode.c'; then $(CYGPATH_W) 'generate-bytecode.c'; else $(CYGPATH_W) '$(srcdir)/generate-bytecode.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/generate_bytecode-generate-bytecode.Tpo $(DEPDIR)/generate_bytecode-generate-bytecode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-bytecode.c' object='generate_bytecode-generate-bytecode.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_bytecode_CFLAGS) $(CFLAGS) -c -o generate_bytecode-generate-bytecode.obj `if test -f 'generate-bytecode.c'; then $(CYGPATH_W) 'generate-bytecode.c'; else $(CYGPATH_W) '$(srcdir)/generate-bytecode.c'; fi` generate_emulation-generate-emulation.o: generate-emulation.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_emulation_CFLAGS) $(CFLAGS) -MT generate_emulation-generate-emulation.o -MD -MP -MF $(DEPDIR)/generate_emulation-generate-emulation.Tpo -c -o generate_emulation-generate-emulation.o `test -f 'generate-emulation.c' || echo '$(srcdir)/'`generate-emulation.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/generate_emulation-generate-emulation.Tpo $(DEPDIR)/generate_emulation-generate-emulation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-emulation.c' object='generate_emulation-generate-emulation.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_emulation_CFLAGS) $(CFLAGS) -c -o generate_emulation-generate-emulation.o `test -f 'generate-emulation.c' || echo '$(srcdir)/'`generate-emulation.c generate_emulation-generate-emulation.obj: generate-emulation.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_emulation_CFLAGS) $(CFLAGS) -MT generate_emulation-generate-emulation.obj -MD -MP -MF $(DEPDIR)/generate_emulation-generate-emulation.Tpo -c -o generate_emulation-generate-emulation.obj `if test -f 'generate-emulation.c'; then $(CYGPATH_W) 'generate-emulation.c'; else $(CYGPATH_W) '$(srcdir)/generate-emulation.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/generate_emulation-generate-emulation.Tpo $(DEPDIR)/generate_emulation-generate-emulation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='generate-emulation.c' object='generate_emulation-generate-emulation.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(generate_emulation_CFLAGS) $(CFLAGS) -c -o generate_emulation-generate-emulation.obj `if test -f 'generate-emulation.c'; then $(CYGPATH_W) 'generate-emulation.c'; else $(CYGPATH_W) '$(srcdir)/generate-emulation.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-pkgincludeHEADERS update: generate-emulation generate-bytecode $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o orcfunctions.c orcfunctions.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o orcfunctions.h orcfunctions.orc ./generate-emulation$(EXEEXT) -o orcemulateopcodes.c ./generate-emulation$(EXEEXT) --header -o orcemulateopcodes.h ./generate-bytecode$(EXEEXT) --header -o orcbytecode.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/orc/orcopcode.h0000664000175000017500000000260412111024531012213 00000000000000 #ifndef _ORC_OPCODE_H_ #define _ORC_OPCODE_H_ #include #include ORC_BEGIN_DECLS typedef struct _OrcOpcodeSet OrcOpcodeSet; typedef struct _OrcStaticOpcode OrcStaticOpcode; /** * OrcOpcodeSet: * * The OrcOpcodeSet structure has no public members */ struct _OrcOpcodeSet { /*< private >*/ int opcode_major; char prefix[8]; int n_opcodes; OrcStaticOpcode *opcodes; }; #define ORC_STATIC_OPCODE_ACCUMULATOR (1<<0) #define ORC_STATIC_OPCODE_FLOAT_SRC (1<<1) #define ORC_STATIC_OPCODE_FLOAT_DEST (1<<2) #define ORC_STATIC_OPCODE_FLOAT (ORC_STATIC_OPCODE_FLOAT_SRC|ORC_STATIC_OPCODE_FLOAT_DEST) #define ORC_STATIC_OPCODE_SCALAR (1<<3) #define ORC_STATIC_OPCODE_LOAD (1<<4) #define ORC_STATIC_OPCODE_STORE (1<<5) #define ORC_STATIC_OPCODE_INVARIANT (1<<6) #define ORC_STATIC_OPCODE_ITERATOR (1<<7) struct _OrcStaticOpcode { char name[16]; unsigned int flags; int dest_size[ORC_STATIC_OPCODE_N_DEST]; int src_size[ORC_STATIC_OPCODE_N_SRC]; OrcOpcodeEmulateNFunc emulateN; }; OrcStaticOpcode * orc_opcode_find_by_name (const char *name); void orc_opcode_init (void); OrcOpcodeSet *orc_opcode_set_get (const char *name); OrcOpcodeSet *orc_opcode_set_get_nth (int opcode_major); int orc_opcode_set_find_by_name (OrcOpcodeSet *opcode_set, const char *name); int orc_opcode_register_static (OrcStaticOpcode *sopcode, char *prefix); ORC_END_DECLS #endif orc-0.4.18/orc/orcrules-mips.c0000664000175000017500000006267212126351204013056 00000000000000/* Copyright 2002 - 2009 David A. Schleef Copyright 2012 MIPS Technologies, Inc. Author: Guillaume Emont 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 #include #include #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 void mips_rule_load (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = compiler->vars[insn->src_args[0]].ptr_register; int dest = compiler->vars[insn->dest_args[0]].alloc; /* such that 2^total_shift is the amount to load at a time */ int total_shift = compiler->insn_shift + ORC_PTR_TO_INT (user); int is_aligned = compiler->vars[insn->src_args[0]].is_aligned; int offset; if (compiler->vars[insn->src_args[0]].vartype == ORC_VAR_TYPE_CONST) { ORC_PROGRAM_ERROR (compiler, "not implemented"); return; } ORC_DEBUG ("insn_shift=%d", compiler->insn_shift); offset = compiler->unroll_index << total_shift; switch (total_shift) { case 0: orc_mips_emit_lbu (compiler, dest, src, offset); break; case 1: if (is_aligned) { orc_mips_emit_lh (compiler, dest, src, offset); } else { orc_mips_emit_lbu (compiler, ORC_MIPS_T3, src, offset); orc_mips_emit_lbu (compiler, dest, src, offset+1); orc_mips_emit_append (compiler, dest, ORC_MIPS_T3, 8); } break; case 2: if (is_aligned) { orc_mips_emit_lw (compiler, dest, src, offset); } else { /* note: the code below is little endian specific */ orc_mips_emit_lwr (compiler, dest, src, offset); orc_mips_emit_lwl (compiler, dest, src, offset+3); } break; default: ORC_PROGRAM_ERROR(compiler, "Don't know how to handle that shift"); } compiler->vars[insn->src_args[0]].update_type = 2; } void mips_rule_store (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = compiler->vars[insn->src_args[0]].alloc; int dest = compiler->vars[insn->dest_args[0]].ptr_register; int total_shift = compiler->insn_shift + ORC_PTR_TO_INT (user); int is_aligned = compiler->vars[insn->dest_args[0]].is_aligned; int offset; ORC_DEBUG ("insn_shift=%d", compiler->insn_shift); offset = compiler->unroll_index << total_shift; switch (total_shift) { case 0: orc_mips_emit_sb (compiler, src, dest, offset); break; case 1: if (is_aligned) { orc_mips_emit_sh (compiler, src, dest, offset); } else { /* Note: the code below is little endian specific */ orc_mips_emit_sb (compiler, src, dest, offset); orc_mips_emit_srl (compiler, ORC_MIPS_T3, src, 8); orc_mips_emit_sb (compiler, ORC_MIPS_T3, dest, offset+1); } break; case 2: if (is_aligned) { orc_mips_emit_sw (compiler, src, dest, offset); } else { orc_mips_emit_swr (compiler, src, dest, offset); orc_mips_emit_swl (compiler, src, dest, offset+3); } break; default: ORC_PROGRAM_ERROR(compiler, "Don't know how to handle that shift"); } compiler->vars[insn->dest_args[0]].update_type = 2; } void mips_rule_addl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_addu (compiler, dest, src1, src2); } void mips_rule_addw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_addu_ph (compiler, dest, src1, src2); } void mips_rule_addb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_addu_qb (compiler, dest, src1, src2); } void mips_rule_subb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_subu_qb (compiler, dest, src1, src2); } void mips_rule_copyl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_move (compiler, dest, src); } void mips_rule_copyw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_move (compiler, dest, src); } void mips_rule_copyb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); if (dest != src) orc_mips_emit_move (compiler, dest, src); } void mips_rule_mulswl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); OrcMipsRegister tmp0 = ORC_MIPS_T3; OrcMipsRegister tmp1 = ORC_MIPS_T4; orc_mips_emit_seh (compiler, tmp0, src1); orc_mips_emit_seh (compiler, tmp1, src2); orc_mips_emit_mul (compiler, dest, tmp0, tmp1); } void mips_rule_mullw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_mul_ph (compiler, dest, src1, src2); } void mips_rule_shrs (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); OrcVariable *src2 = compiler->vars + insn->src_args[1]; int dest = ORC_DEST_ARG (compiler, insn, 0); if (src2->vartype == ORC_VAR_TYPE_CONST) { orc_mips_emit_sra (compiler, dest, src1, src2->value.i); } else { ORC_COMPILER_ERROR(compiler, "rule only implemented for constants"); } } void mips_rule_convssslw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); OrcMipsRegister tmp0 = ORC_MIPS_T3; OrcMipsRegister tmp1 = ORC_MIPS_T4; if (dest != src) orc_mips_emit_move (compiler, dest, src); orc_mips_emit_ori (compiler, tmp0, ORC_MIPS_ZERO, ORC_SW_MAX); orc_mips_emit_slt (compiler, tmp1, tmp0, src); orc_mips_emit_movn (compiler, dest, tmp0, tmp1); orc_mips_emit_lui (compiler, tmp0, (ORC_SW_MIN >> 16) & 0xffff); orc_mips_emit_ori (compiler, tmp0, tmp0, ORC_SW_MIN & 0xffff); /* this still works if src == dest since in that case, its value is either * the original src or ORC_SW_MAX, which works as well here */ orc_mips_emit_slt (compiler, tmp1, src, tmp0); orc_mips_emit_movn (compiler, dest, tmp0, tmp1); } void mips_rule_convssswb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); OrcMipsRegister tmp = ORC_MIPS_T3; orc_mips_emit_repl_ph (compiler, tmp, ORC_SB_MAX); orc_mips_emit_cmp_lt_ph (compiler, tmp, src); orc_mips_emit_pick_ph (compiler, dest, tmp, src); orc_mips_emit_repl_ph (compiler, tmp, ORC_SB_MIN); orc_mips_emit_cmp_lt_ph (compiler, dest, tmp); orc_mips_emit_pick_ph (compiler, dest, tmp, dest); if (compiler->insn_shift > 0) orc_mips_emit_precr_qb_ph (compiler, dest, ORC_MIPS_ZERO, dest); } void mips_rule_convsuswb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); OrcMipsRegister tmp = ORC_MIPS_T3; orc_mips_emit_repl_ph (compiler, tmp, ORC_UB_MAX); orc_mips_emit_cmp_lt_ph (compiler, tmp, src); orc_mips_emit_pick_ph (compiler, dest, tmp, src); orc_mips_emit_cmp_lt_ph (compiler, dest, ORC_MIPS_ZERO); orc_mips_emit_pick_ph (compiler, dest, ORC_MIPS_ZERO, dest); if (compiler->insn_shift > 0) orc_mips_emit_precr_qb_ph (compiler, dest, ORC_MIPS_ZERO, dest); } void mips_rule_convsbw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); /* left shift 8 bits, then right shift signed 8 bits, so that the sign bit * gets replicated in the upper 8 bits */ if (compiler->insn_shift > 0) { orc_mips_emit_preceu_ph_qbr (compiler, dest, src); orc_mips_emit_shll_ph (compiler, dest, dest, 8); orc_mips_emit_shra_ph (compiler, dest, dest, 8); } else { orc_mips_emit_shll_ph (compiler, dest, src, 8); orc_mips_emit_shra_ph (compiler, dest, dest, 8); } } void mips_rule_mergewl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); if (src1 == src2) { orc_mips_emit_replv_ph (compiler, dest, src1); } else if (dest == src1) { orc_mips_emit_sll (compiler, dest, dest, 16); orc_mips_emit_prepend (compiler, dest, src2, 16); } else { if (dest != src2) orc_mips_emit_move (compiler, dest, src2); orc_mips_emit_append (compiler, dest, src1, 16); } } void mips_rule_mergebw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); OrcMipsRegister tmp0 = ORC_MIPS_T3; OrcMipsRegister tmp1 = ORC_MIPS_T4; if (compiler->insn_shift > 0) { orc_mips_emit_preceu_ph_qbr (compiler, tmp0, src1); orc_mips_emit_preceu_ph_qbr (compiler, tmp1, src2); orc_mips_emit_shll_ph (compiler, tmp1, tmp1, 8); orc_mips_emit_or (compiler, dest, tmp0, tmp1); } else { orc_mips_emit_shll_ph (compiler, tmp0, src2, 8); orc_mips_emit_or (compiler, dest, tmp0, src1); } } void mips_rule_addssw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_addq_s_ph (compiler, dest, src1, src2); } void mips_rule_subssw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_subq_s_ph (compiler, dest, src1, src2); } void mips_rule_shrsw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); OrcVariable *src2 = compiler->vars + insn->src_args[1]; int dest = ORC_DEST_ARG (compiler, insn, 0); if (src2->vartype == ORC_VAR_TYPE_CONST) { orc_mips_emit_shra_ph (compiler, dest, src1, src2->value.i); } else { ORC_COMPILER_ERROR(compiler, "rule only implemented for constants"); } } void mips_rule_shruw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); OrcVariable *src2 = compiler->vars + insn->src_args[1]; int dest = ORC_DEST_ARG (compiler, insn, 0); if (src2->vartype == ORC_VAR_TYPE_CONST) { orc_mips_emit_shrl_ph (compiler, dest, src1, src2->value.i); } else { ORC_COMPILER_ERROR(compiler, "rule only implemented for constants"); } } void mips_rule_loadupib (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; OrcMipsRegister tmp0 = ORC_MIPS_T3; OrcMipsRegister tmp1 = ORC_MIPS_T4; OrcMipsRegister tmp2 = ORC_MIPS_T5; int offset; if (src->vartype != ORC_VAR_TYPE_SRC) { ORC_PROGRAM_ERROR (compiler, "not implemented"); return; } switch (compiler->insn_shift) { case 0: orc_mips_emit_andi (compiler, tmp0, src->ptr_offset, 1); /* We only do the first lb if offset is even */ orc_mips_emit_conditional_branch_with_offset (compiler, ORC_MIPS_BEQ, tmp0, ORC_MIPS_ZERO, 16); orc_mips_emit_lb (compiler, dest->alloc, src->ptr_register, 0); orc_mips_emit_lb (compiler, tmp0, src->ptr_register, 1); orc_mips_emit_adduh_r_qb (compiler, dest->alloc, dest->alloc, tmp0); /* In the case where there is no insn_shift, src->ptr_register needs to be * incremented only when ptr_offset is odd, _emit_loop() doesn't update it * in that case, and therefore we do it here */ orc_mips_emit_addiu (compiler, src->ptr_register, src->ptr_register, 1); orc_mips_emit_addiu (compiler, src->ptr_offset, src->ptr_offset, 1); break; case 2: /* lb tmp0, 0(src) # a lb tmp1, 1(src) # b lb dest, 2(src) # c andi tmp2, ptr_offset, 1 # i&1 replv.qb tmp0, tmp0 # aaaa replv.qb tmp1, tmp1 # bbbb replv.qb dest, dest # cccc packrl.ph tmp0, tmp1, tmp0 # bbaa move tmp1, tmp0 # bbaa prepend tmp1, dest, 8 # cbba packrl.ph dest, dest, tmp1 # ccbb # if tmp2 # tmp0 <- dest movn tmp0, dest, tmp2 # if tmp2 ccbb else bbaa adduh_r.qb dest, tmp0, tmp1 # (b,c)b(a,b)a | c(b,c)b(a,b) */ offset = compiler->unroll_index << (compiler->insn_shift - 1); orc_mips_emit_lb (compiler, tmp0, src->ptr_register, offset); orc_mips_emit_lb (compiler, tmp1, src->ptr_register, offset + 1); orc_mips_emit_lb (compiler, dest->alloc, src->ptr_register, offset + 2); orc_mips_emit_andi (compiler, tmp2, src->ptr_offset, 1); orc_mips_emit_replv_qb (compiler, tmp0, tmp0); orc_mips_emit_replv_qb (compiler, tmp1, tmp1); orc_mips_emit_replv_qb (compiler, dest->alloc, dest->alloc); orc_mips_emit_packrl_ph (compiler, tmp0, tmp1, tmp0); orc_mips_emit_move (compiler, tmp1, tmp0); orc_mips_emit_prepend (compiler, tmp1, dest->alloc, 8); orc_mips_emit_packrl_ph (compiler, dest->alloc, dest->alloc, tmp1); orc_mips_emit_movn (compiler, tmp0, dest->alloc, tmp2); orc_mips_emit_adduh_r_qb (compiler, dest->alloc, tmp0, tmp1); /* FIXME: should we remove that as we only use ptr_offset for parity? */ orc_mips_emit_addiu (compiler, src->ptr_offset, src->ptr_offset, 4); break; default: ORC_PROGRAM_ERROR (compiler, "unimplemented"); } src->update_type = 1; } #if 0 void mips_rule_loadupdb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; OrcMipsRegister tmp = ORC_MIPS_T3; int offset; if (src->vartype != ORC_VAR_TYPE_SRC) { ORC_PROGRAM_ERROR (compiler, "not implemented"); return; } switch (compiler->insn_shift) { case 0: orc_mips_emit_andi (compiler, tmp, src->ptr_offset, 1); orc_mips_emit_conditional_branch_with_offset (compiler, ORC_MIPS_BEQ, tmp, ORC_MIPS_ZERO, 8); /* this is always done: in branch delay slot*/ orc_mips_emit_lb (compiler, dest->alloc, src->ptr_register, 0); /* In the case where there is no insn_shift, src->ptr_register needs to be * incremented only when ptr_offset is odd, _emit_loop() doesn't update it * in that case, and therefore we do it here */ orc_mips_emit_addiu (compiler, src->ptr_register, src->ptr_register, 1); orc_mips_emit_append (compiler, dest->alloc, dest->alloc, 8); orc_mips_emit_addiu (compiler, src->ptr_offset, src->ptr_offset, 1); break; case 2: offset = compiler->unroll_index << (compiler->insn_shift - 1); orc_mips_emit_lb (compiler, tmp, src->ptr_register, offset + 0); orc_mips_emit_lb (compiler, dest->alloc, src->ptr_register, offset + 1); orc_mips_emit_replv_qb (compiler, tmp, tmp); orc_mips_emit_replv_qb (compiler, dest->alloc, dest->alloc); orc_mips_emit_packrl_ph (compiler, dest->alloc, dest->alloc, tmp); /* FIXME: should we remove that as we only use ptr_offset for parity? */ orc_mips_emit_addiu (compiler, src->ptr_offset, src->ptr_offset, 4); break; default: ORC_PROGRAM_ERROR (compiler, "unimplemented"); } src->update_type = 1; } #endif void mips_rule_loadp (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int size = ORC_PTR_TO_INT (user); if (src->vartype == ORC_VAR_TYPE_CONST) { if (size == 1 || size == 2) { orc_mips_emit_ori (compiler, dest->alloc, ORC_MIPS_ZERO, src->value.i); if (size == 1) orc_mips_emit_replv_qb (compiler, dest->alloc, dest->alloc); else if (size == 2) orc_mips_emit_replv_ph (compiler, dest->alloc, dest->alloc); } else if (size == 4) { orc_int16 high_bits; high_bits = ((src->value.i >> 16) & 0xffff); if (high_bits) { orc_mips_emit_lui (compiler, dest->alloc, high_bits); orc_mips_emit_ori (compiler, dest->alloc, dest->alloc, src->value.i & 0xffff); } else { orc_mips_emit_ori (compiler, dest->alloc, ORC_MIPS_ZERO, src->value.i & 0xffff); } } else { ORC_PROGRAM_ERROR(compiler,"unimplemented"); } } else { if (size == 1) { orc_mips_emit_lb (compiler, dest->alloc, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(insn->src_args[0])); orc_mips_emit_replv_qb (compiler, dest->alloc, dest->alloc); } else if (size == 2) { orc_mips_emit_lh (compiler, dest->alloc, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(insn->src_args[0])); orc_mips_emit_replv_ph (compiler, dest->alloc, dest->alloc); } else if (size == 4) { orc_mips_emit_lw (compiler, dest->alloc, compiler->exec_reg, ORC_MIPS_EXECUTOR_OFFSET_PARAMS(insn->src_args[0])); } else { ORC_PROGRAM_ERROR(compiler,"unimplemented"); } } } void mips_rule_swapl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_wsbh (compiler, dest, src); orc_mips_emit_packrl_ph (compiler, dest, dest, dest); } void mips_rule_swapw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_wsbh (compiler, dest, src); } void mips_rule_avgub (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_adduh_r_qb (compiler, dest, src1, src2); } void mips_rule_convubw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); if (compiler->insn_shift == 1) orc_mips_emit_preceu_ph_qbr (compiler, dest, src); } void mips_rule_subw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (compiler, insn, 0); int src2 = ORC_SRC_ARG (compiler, insn, 1); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_subq_ph (compiler, dest, src1, src2); } void mips_rule_convwb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); if (compiler->insn_shift >0) orc_mips_emit_precr_qb_ph (compiler, dest, ORC_MIPS_ZERO, src); } void mips_rule_select1wb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_precrq_qb_ph (compiler, dest, ORC_MIPS_ZERO, src); } void mips_rule_select0lw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { /* no op */ } void mips_rule_select1lw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); orc_mips_emit_srl (compiler, dest, src, 16); } void mips_rule_splatbw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); OrcMipsRegister tmp = ORC_MIPS_T3; orc_mips_emit_preceu_ph_qbr (compiler, tmp, src); orc_mips_emit_shll_ph (compiler, dest, tmp, 8); orc_mips_emit_or (compiler, dest, dest, tmp); } void mips_rule_splitlw (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest1 = ORC_DEST_ARG (compiler, insn, 0); int dest2 = ORC_DEST_ARG (compiler, insn, 1); orc_mips_emit_srl (compiler, dest1, src, 16); orc_mips_emit_andi (compiler, dest2, src, 0xffff); } void mips_rule_splitwb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest1 = ORC_DEST_ARG (compiler, insn, 0); int dest2 = ORC_DEST_ARG (compiler, insn, 1); orc_mips_emit_precrq_qb_ph (compiler, dest1, ORC_MIPS_ZERO, src); orc_mips_emit_precr_qb_ph (compiler, dest2, ORC_MIPS_ZERO, src); } void orc_compiler_orc_mips_register_rules (OrcTarget *target) { OrcRuleSet *rule_set; rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, 0); orc_rule_register (rule_set, "loadl", mips_rule_load, (void *) 2); orc_rule_register (rule_set, "loadw", mips_rule_load, (void *) 1); orc_rule_register (rule_set, "loadb", mips_rule_load, (void *) 0); orc_rule_register (rule_set, "loadpl", mips_rule_loadp, (void *) 4); orc_rule_register (rule_set, "loadpw", mips_rule_loadp, (void *) 2); orc_rule_register (rule_set, "loadpb", mips_rule_loadp, (void *) 1); orc_rule_register (rule_set, "storel", mips_rule_store, (void *)2); orc_rule_register (rule_set, "storew", mips_rule_store, (void *)1); orc_rule_register (rule_set, "storeb", mips_rule_store, (void *)0); orc_rule_register (rule_set, "addl", mips_rule_addl, NULL); orc_rule_register (rule_set, "addw", mips_rule_addw, NULL); orc_rule_register (rule_set, "addb", mips_rule_addb, NULL); orc_rule_register (rule_set, "subb", mips_rule_subb, NULL); orc_rule_register (rule_set, "copyl", mips_rule_copyl, NULL); orc_rule_register (rule_set, "copyw", mips_rule_copyw, NULL); orc_rule_register (rule_set, "copyb", mips_rule_copyb, NULL); orc_rule_register (rule_set, "mulswl", mips_rule_mulswl, NULL); orc_rule_register (rule_set, "mullw", mips_rule_mullw, NULL); orc_rule_register (rule_set, "shrsl", mips_rule_shrs, NULL); orc_rule_register (rule_set, "convssslw", mips_rule_convssslw, NULL); orc_rule_register (rule_set, "convssswb", mips_rule_convssswb, NULL); orc_rule_register (rule_set, "convsuswb", mips_rule_convsuswb, NULL); orc_rule_register (rule_set, "convsbw", mips_rule_convsbw, NULL); orc_rule_register (rule_set, "convubw", mips_rule_convubw, NULL); orc_rule_register (rule_set, "convwb", mips_rule_convwb, NULL); orc_rule_register (rule_set, "select0wb", mips_rule_convwb, NULL); orc_rule_register (rule_set, "select1wb", mips_rule_select1wb, NULL); orc_rule_register (rule_set, "select0lw", mips_rule_select0lw, NULL); orc_rule_register (rule_set, "select1lw", mips_rule_select1lw, NULL); orc_rule_register (rule_set, "mergewl", mips_rule_mergewl, NULL); orc_rule_register (rule_set, "mergebw", mips_rule_mergebw, NULL); orc_rule_register (rule_set, "splatbw", mips_rule_splatbw, NULL); orc_rule_register (rule_set, "splitlw", mips_rule_splitlw, NULL); orc_rule_register (rule_set, "splitwb", mips_rule_splitwb, NULL); orc_rule_register (rule_set, "addssw", mips_rule_addssw, NULL); orc_rule_register (rule_set, "subssw", mips_rule_subssw, NULL); orc_rule_register (rule_set, "loadupib", mips_rule_loadupib, NULL); /* orc_rule_register (rule_set, "loadupdb", mips_rule_loadupdb, NULL); */ orc_rule_register (rule_set, "shrsw", mips_rule_shrsw, NULL); orc_rule_register (rule_set, "shruw", mips_rule_shruw, NULL); orc_rule_register (rule_set, "swapl", mips_rule_swapl, NULL); orc_rule_register (rule_set, "swapw", mips_rule_swapw, NULL); orc_rule_register (rule_set, "avgub", mips_rule_avgub, NULL); orc_rule_register (rule_set, "subw", mips_rule_subw, NULL); } orc-0.4.18/orc/orcprogram.c0000664000175000017500000006074712111024531012420 00000000000000 #include "config.h" #include #include #include #include #include #include /** * SECTION:orcprogram * @title: OrcProgram * @short_description: Creating and manipulating Orc programs */ /** * orc_program_new: * * Create a new OrcProgram. The program should be freed using * @orc_program_free(). * * Returns: a pointer to an OrcProgram structure */ OrcProgram * orc_program_new (void) { OrcProgram *p; orc_init (); p = malloc(sizeof(OrcProgram)); memset (p, 0, sizeof(OrcProgram)); p->name = malloc (40); sprintf(p->name, "func_%p", p); return p; } /** * orc_program_new_dss: * @size1: size of destination array members * @size2: size of first source array members * @size3: size of second source array members * * Create a new OrcProgram, with a destination named "d1" and * two sources named "s1" and "s2". * * Returns: a pointer to an OrcProgram structure */ OrcProgram * orc_program_new_dss (int size1, int size2, int size3) { OrcProgram *p; p = orc_program_new (); orc_program_add_destination (p, size1, "d1"); orc_program_add_source (p, size2, "s1"); orc_program_add_source (p, size3, "s2"); return p; } /** * orc_program_new_ds: * @size1: size of destination array members * @size2: size of source array members * * Create a new OrcProgram, with a destination named "d1" and * one source named "s1". * * Returns: a pointer to an OrcProgram structure */ OrcProgram * orc_program_new_ds (int size1, int size2) { OrcProgram *p; p = orc_program_new (); orc_program_add_destination (p, size1, "d1"); orc_program_add_source (p, size2, "s1"); return p; } /** * orc_program_new_ass: * @size1: size of destination array members * @size2: size of first source array members * @size3: size of second source array members * * Create a new OrcProgram, with an accumulator named "a1" and * two source named "s1" and "s2". * * Returns: a pointer to an OrcProgram structure */ OrcProgram * orc_program_new_ass (int size1, int size2, int size3) { OrcProgram *p; p = orc_program_new (); orc_program_add_accumulator (p, size1, "a1"); orc_program_add_source (p, size2, "s1"); orc_program_add_source (p, size3, "s2"); return p; } /** * orc_program_new_as: * @size1: size of destination array members * @size2: size of source array members * * Create a new OrcProgram, with an accumulator named "a1" and * one source named "s1". * * Returns: a pointer to an OrcProgram structure */ OrcProgram * orc_program_new_as (int size1, int size2) { OrcProgram *p; p = orc_program_new (); orc_program_add_accumulator (p, size1, "a1"); orc_program_add_source (p, size2, "s1"); return p; } OrcProgram * orc_program_new_from_static_bytecode (const orc_uint8 *bytecode) { OrcProgram *p; p = orc_program_new (); orc_bytecode_parse_function (p, bytecode); return p; } /** * orc_program_free: * @program: a pointer to an OrcProgram structure * * Frees an OrcProgram. */ void orc_program_free (OrcProgram *program) { int i; for(i=0;ivars[i].name) { free (program->vars[i].name); program->vars[i].name = NULL; } } if (program->asm_code) { free (program->asm_code); program->asm_code = NULL; } if (program->name) { free (program->name); program->name = NULL; } if (program->error_msg) { free (program->error_msg); program->error_msg = NULL; } free (program); } /** * orc_program_set_name: * @program: a pointer to an OrcProgram structure * @name: string to set the name to * * Sets the name of the program. The string is copied. */ void orc_program_set_name (OrcProgram *program, const char *name) { if (program->name) { free (program->name); } program->name = strdup (name); } /** * orc_program_set_line: * @program: a pointer to an OrcProgram structure * @name: define where we are in the source * * Sets the current line of the program. */ void orc_program_set_line (OrcProgram *program, unsigned int line) { program->current_line = line; } /** * orc_program_set_2d: * @program: a pointer to an OrcProgram structure * * Sets a flag on the program indicating that arrays are two * dimensional. This causes the compiler to generate code for * an OrcExec2D executor. */ void orc_program_set_2d (OrcProgram *program) { program->is_2d = TRUE; } void orc_program_set_constant_n (OrcProgram *program, int n) { program->constant_n = n; } void orc_program_set_n_multiple (OrcProgram *program, int n) { program->n_multiple = n; } void orc_program_set_n_minimum (OrcProgram *program, int n) { program->n_minimum = n; } void orc_program_set_n_maximum (OrcProgram *program, int n) { program->n_maximum = n; } void orc_program_set_constant_m (OrcProgram *program, int m) { program->constant_m = m; } /** * orc_program_set_backup_function: * @program: a pointer to an OrcProgram structure * @func: a function that performs the operations in the program * * Normally, if a program cannot be compiled for a particular CPU, * Orc will emulate the function, which is typically very slow. This * function allows the developer to provide a function that is called * instead of resorting to emulation. */ void orc_program_set_backup_function (OrcProgram *program, OrcExecutorFunc func) { program->backup_func = func; if (program->code_exec == NULL) { program->code_exec = func; } } /** * orc_program_get_name: * @program: a pointer to an OrcProgram structure * * Gets the name of the program. The string is valid until the name * is changed or the program is freed. * * Returns: a character string */ const char * orc_program_get_name (OrcProgram *program) { return program->name; } /** * orc_program_add_temporary: * @program: a pointer to an OrcProgram structure * @size: size of data values * @name: name of variable * * Creates a new variable holding temporary values. * * Returns: the index of the new variable */ int orc_program_add_temporary (OrcProgram *program, int size, const char *name) { int i = ORC_VAR_T1 + program->n_temp_vars; program->vars[i].vartype = ORC_VAR_TYPE_TEMP; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_temp_vars++; return i; } /** * orc_program_dup_temporary: * @program: a pointer to an OrcProgram structure * @var: variable to duplicate * @j: index * * Internal function. * * Returns: the index of the new variable */ int orc_program_dup_temporary (OrcProgram *program, int var, int j) { int i = ORC_VAR_T1 + program->n_temp_vars; program->vars[i].vartype = ORC_VAR_TYPE_TEMP; program->vars[i].size = program->vars[var].size; program->vars[i].name = malloc (strlen(program->vars[var].name) + 10); sprintf(program->vars[i].name, "%s.dup%d", program->vars[var].name, j); program->n_temp_vars++; return i; } /** * orc_program_add_source_full: * @program: a pointer to an OrcProgram structure * @size: size of data values * @name: name of variable * @type_name: name of type, or NULL * @alignment: alignment in bytes, or 0 * * Creates a new variable representing a source array. * * Returns: the index of the new variable */ int orc_program_add_source_full (OrcProgram *program, int size, const char *name, const char *type_name, int alignment) { int i = ORC_VAR_S1 + program->n_src_vars; program->vars[i].vartype = ORC_VAR_TYPE_SRC; program->vars[i].size = size; if (alignment == 0) alignment = size; program->vars[i].alignment = alignment; program->vars[i].name = strdup(name); if (type_name) { program->vars[i].type_name = strdup(type_name); } program->n_src_vars++; return i; } /** * orc_program_add_source: * @program: a pointer to an OrcProgram structure * @size: size of data values * @name: name of variable * * Creates a new variable representing a source array. * * Returns: the index of the new variable */ int orc_program_add_source (OrcProgram *program, int size, const char *name) { return orc_program_add_source_full (program, size, name, NULL, 0); } /** * orc_program_add_destination_full: * @program: a pointer to an OrcProgram structure * @size: size of data values * @name: name of variable * * Creates a new variable representing a destination array. * * Returns: the index of the new variable */ int orc_program_add_destination_full (OrcProgram *program, int size, const char *name, const char *type_name, int alignment) { int i = ORC_VAR_D1 + program->n_dest_vars; program->vars[i].vartype = ORC_VAR_TYPE_DEST; program->vars[i].size = size; if (alignment == 0) alignment = size; program->vars[i].alignment = alignment; program->vars[i].name = strdup(name); if (type_name) { program->vars[i].type_name = strdup(type_name); } program->n_dest_vars++; return i; } /** * orc_program_add_destination: * @program: a pointer to an OrcProgram structure * @size: size of data values * @name: name of variable * * Creates a new variable representing a destination array. * * Returns: the index of the new variable */ int orc_program_add_destination (OrcProgram *program, int size, const char *name) { return orc_program_add_destination_full (program, size, name, NULL, 0); } /** * orc_program_add_constant: * @program: a pointer to an OrcProgram structure * @size: size of data value * @value: the value * @name: name of variable * * Creates a new variable representing a constant value. * * Returns: the index of the new variable */ int orc_program_add_constant (OrcProgram *program, int size, int value, const char *name) { int i; i = ORC_VAR_C1 + program->n_const_vars; program->vars[i].vartype = ORC_VAR_TYPE_CONST; program->vars[i].size = size; program->vars[i].value.i = value; program->vars[i].name = strdup(name); program->n_const_vars++; return i; } int orc_program_add_constant_int64 (OrcProgram *program, int size, orc_int64 value, const char *name) { int i; i = ORC_VAR_C1 + program->n_const_vars; program->vars[i].vartype = ORC_VAR_TYPE_CONST; program->vars[i].size = size; program->vars[i].value.i = value; program->vars[i].name = strdup(name); program->n_const_vars++; return i; } int orc_program_add_constant_float (OrcProgram *program, int size, float value, const char *name) { orc_union32 u; u.f = value; return orc_program_add_constant (program, size, u.i, name); } int orc_program_add_constant_double (OrcProgram *program, int size, double value, const char *name) { orc_union64 u; u.f = value; return orc_program_add_constant_int64 (program, size, u.i, name); } int orc_program_add_constant_str (OrcProgram *program, int size, const char *value, const char *name) { int i; char *end; orc_int64 val_i; double val_d; int j; i = ORC_VAR_C1 + program->n_const_vars; val_i = _strtoll (value, &end, 0); if (end[0] == 0) { program->vars[i].value.i = val_i; if (size == 0) size = 4; } else if ((end[0] == 'l' || end[0] == 'L') && end[1] == 0) { program->vars[i].value.i = val_i; if (size == 0) size = 8; } else { val_d = strtod (value, &end); if (end[0] == 0) { orc_union32 u; u.f = val_d; program->vars[i].value.i = u.i; if (size == 0) size = 4; } else if ((end[0] == 'l' || end[0] == 'L') && end[1] == 0) { program->vars[i].value.f = val_d; if (size == 0) size = 8; } else { return -1; } } for(j=0;jn_const_vars;j++){ if (program->vars[ORC_VAR_C1 + j].value.i == program->vars[i].value.i) { return ORC_VAR_C1 + j; } } program->vars[i].vartype = ORC_VAR_TYPE_CONST; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_const_vars++; return i; } /** * orc_program_add_parameter: * @program: a pointer to an OrcProgram structure * @size: size of data value * @name: name of variable * * Creates a new variable representing a scalar parameter. * * Returns: the index of the new variable */ int orc_program_add_parameter (OrcProgram *program, int size, const char *name) { int i = ORC_VAR_P1 + program->n_param_vars; program->vars[i].vartype = ORC_VAR_TYPE_PARAM; program->vars[i].param_type = ORC_PARAM_TYPE_INT; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_param_vars++; return i; } /** * orc_program_add_parameter_float: * @program: a pointer to an OrcProgram structure * @size: size of data value * @name: name of variable * * Creates a new variable representing a scalar parameter. * * Returns: the index of the new variable */ int orc_program_add_parameter_float (OrcProgram *program, int size, const char *name) { int i = ORC_VAR_P1 + program->n_param_vars; program->vars[i].vartype = ORC_VAR_TYPE_PARAM; program->vars[i].param_type = ORC_PARAM_TYPE_FLOAT; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_param_vars++; return i; } int orc_program_add_parameter_double (OrcProgram *program, int size, const char *name) { int i = ORC_VAR_P1 + program->n_param_vars; program->vars[i].vartype = ORC_VAR_TYPE_PARAM; program->vars[i].param_type = ORC_PARAM_TYPE_DOUBLE; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_param_vars++; return i; } int orc_program_add_parameter_int64 (OrcProgram *program, int size, const char *name) { int i = ORC_VAR_P1 + program->n_param_vars; program->vars[i].vartype = ORC_VAR_TYPE_PARAM; program->vars[i].param_type = ORC_PARAM_TYPE_INT64; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_param_vars++; return i; } /** * orc_program_add_accumulator: * @program: a pointer to an OrcProgram structure * @size: size of data value * @name: name of variable * * Creates a new variable representing an accumulator. * * Returns: the index of the new variable */ int orc_program_add_accumulator (OrcProgram *program, int size, const char *name) { int i = ORC_VAR_A1 + program->n_accum_vars; program->vars[i].vartype = ORC_VAR_TYPE_ACCUMULATOR; program->vars[i].size = size; program->vars[i].name = strdup(name); program->n_accum_vars++; return i; } void orc_program_set_type_name (OrcProgram *program, int var, const char *type_name) { program->vars[var].type_name = strdup(type_name); } void orc_program_set_var_alignment (OrcProgram *program, int var, int alignment) { program->vars[var].alignment = alignment; if (alignment >= 16) { program->vars[var].is_aligned = TRUE; } } void orc_program_set_sampling_type (OrcProgram *program, int var, int sampling_type) { /* This doesn't do anything yet */ } /** * orc_program_append_ds: * @program: a pointer to an OrcProgram structure * @name: name of instruction * @arg0: index of first variable * @arg1: index of second variable * * Appends an instruction to the program, with arguments @arg0 and * @arg1. The instruction must take 2 operands. */ void orc_program_append_ds (OrcProgram *program, const char *name, int arg0, int arg1) { OrcInstruction *insn; insn = program->insns + program->n_insns; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s", name); } insn->dest_args[0] = arg0; insn->src_args[0] = arg1; program->n_insns++; } /** * orc_program_append_ds: * @program: a pointer to an OrcProgram structure * @name: name of instruction * @arg0: index of first variable * @arg1: index of second variable * @arg2: index of second variable * * Appends an instruction to the program, with arguments @arg0, * @arg1, and @arg2. The instruction must take 3 operands. */ void orc_program_append (OrcProgram *program, const char *name, int arg0, int arg1, int arg2) { OrcInstruction *insn; insn = program->insns + program->n_insns; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s", name); } insn->dest_args[0] = arg0; insn->src_args[0] = arg1; insn->src_args[1] = arg2; program->n_insns++; } /** * orc_program_append_ds_2: * @program: a pointer to an OrcProgram structure * @name: name of instruction * @arg0: index of first variable * @arg1: index of second variable * @arg2: index of third variable * @arg3: index of fourth variable * * Appends an instruction to the program, with arguments @arg0, * @arg1, @arg2, and @arg3. */ void orc_program_append_2 (OrcProgram *program, const char *name, unsigned int flags, int arg0, int arg1, int arg2, int arg3) { OrcInstruction *insn; int args[4]; int i; insn = program->insns + program->n_insns; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s", name); } insn->flags = flags; args[0] = arg0; args[1] = arg1; args[2] = arg2; args[3] = arg3; insn->flags = flags; i = 0; insn->dest_args[0] = args[i++]; if (insn->opcode) { if (insn->opcode->dest_size[1] != 0) { insn->dest_args[1] = args[i++]; } if (insn->opcode->src_size[0] != 0) { insn->src_args[0] = args[i++]; } if (insn->opcode->src_size[1] != 0) { insn->src_args[1] = args[i++]; } if (insn->opcode->src_size[2] != 0) { insn->src_args[2] = args[i++]; } } program->n_insns++; } /** * orc_program_find_var_by_name: * @program: a pointer to an OrcProgram structure * @name: name of instruction * * Finds the variable with the name @name. If no variable with the * given name exists in the program, -1 is returned. * * Returns: the index of the variable */ int orc_program_find_var_by_name (OrcProgram *program, const char *name) { int i; if (name == NULL) return -1; for(i=0;ivars[i].name && strcmp (program->vars[i].name, name) == 0) { return i; } } return -1; } /** * orc_program_append_str: * @program: a pointer to an OrcProgram structure * @name: name of instruction * @arg0: name of first variable * @arg1: name of second variable * @arg2: name of third variable * * Appends an instruction to the program, with arguments @arg0, * @arg1, and @arg2. The instruction must take 3 operands. */ void orc_program_append_str (OrcProgram *program, const char *name, const char *arg1, const char *arg2, const char *arg3) { OrcInstruction *insn; insn = program->insns + program->n_insns; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s", name); } insn->dest_args[0] = orc_program_find_var_by_name (program, arg1); if (insn->opcode->dest_size[1] != 0) { insn->dest_args[1] = orc_program_find_var_by_name (program, arg2); insn->src_args[0] = orc_program_find_var_by_name (program, arg3); } else { insn->src_args[0] = orc_program_find_var_by_name (program, arg2); insn->src_args[1] = orc_program_find_var_by_name (program, arg3); } program->n_insns++; } /** * orc_program_append_str_2: * @program: a pointer to an OrcProgram structure * @name: name of instruction * @flags: flags * @arg0: name of first variable * @arg1: name of second variable * @arg2: name of third variable * @arg3: name of fourth variable * * Appends an instruction to the program, with arguments @arg0, * @arg1, @arg2, and @arg3. */ void orc_program_append_str_2 (OrcProgram *program, const char *name, unsigned int flags, const char *arg1, const char *arg2, const char *arg3, const char *arg4) { OrcInstruction *insn; int args[4]; int i; insn = program->insns + program->n_insns; insn->line = program->current_line; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s at line %d", name, insn->line); } args[0] = orc_program_find_var_by_name (program, arg1); args[1] = orc_program_find_var_by_name (program, arg2); args[2] = orc_program_find_var_by_name (program, arg3); args[3] = orc_program_find_var_by_name (program, arg4); insn->flags = flags; i = 0; insn->dest_args[0] = args[i++]; if (insn->opcode) { if (insn->opcode->dest_size[1] != 0) { insn->dest_args[1] = args[i++]; } if (insn->opcode->src_size[0] != 0) { insn->src_args[0] = args[i++]; } if (insn->opcode->src_size[1] != 0) { insn->src_args[1] = args[i++]; } if (insn->opcode->src_size[2] != 0) { insn->src_args[2] = args[i++]; } } program->n_insns++; } /** * orc_program_append_ds_str: * @program: a pointer to an OrcProgram structure * @name: name of instruction * @arg0: name of first variable * @arg1: name of second variable * * Appends an instruction to the program, with arguments @arg0 and * @arg2. The instruction must take 2 operands. */ void orc_program_append_ds_str (OrcProgram *program, const char *name, const char *arg1, const char *arg2) { OrcInstruction *insn; insn = program->insns + program->n_insns; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s", name); } insn->dest_args[0] = orc_program_find_var_by_name (program, arg1); insn->src_args[0] = orc_program_find_var_by_name (program, arg2); program->n_insns++; } void orc_program_append_dds_str (OrcProgram *program, const char *name, const char *arg1, const char *arg2, const char *arg3) { OrcInstruction *insn; insn = program->insns + program->n_insns; insn->opcode = orc_opcode_find_by_name (name); if (!insn->opcode) { ORC_ERROR ("unknown opcode: %s", name); } insn->dest_args[0] = orc_program_find_var_by_name (program, arg1); insn->dest_args[1] = orc_program_find_var_by_name (program, arg2); insn->src_args[0] = orc_program_find_var_by_name (program, arg3); program->n_insns++; } /** * orc_program_get_asm_code: * @program: a pointer to an OrcProgram structure * * Returns a character string containing the assembly code created * by compiling the program. This string is valid until the program * is compiled again or the program is freed. * * Returns: a character string */ const char * orc_program_get_asm_code (OrcProgram *program) { return program->asm_code; } /** * orc_program_get_error: * @program: a pointer to an OrcProgram structure * * Returns a character string containing the error message from * compilation. This string is valid until the program * is compiled again or the program is freed. * * Returns: a character string */ const char * orc_program_get_error (OrcProgram *program) { if (program->error_msg) return program->error_msg; return ""; } /** * orc_program_get_max_array_size: * @program: a pointer to an OrcProgram structure * * Returns the size of the largest array used in the program. * * Returns: the number of bytes */ int orc_program_get_max_array_size (OrcProgram *program) { int i; int max; max = 0; for(i=0;ivars[i].size) { if (program->vars[i].vartype == ORC_VAR_TYPE_SRC || program->vars[i].vartype == ORC_VAR_TYPE_DEST) { max = MAX(max, program->vars[i].size); } } } return max; } /** * orc_program_get_max_accumulator_size: * @program: a pointer to an OrcProgram structure * * Returns the size of the largest array used in the program. * * Returns: the number of bytes */ int orc_program_get_max_accumulator_size (OrcProgram *program) { int i; int max; max = 0; for(i=0;ivars[i].size) { if (program->vars[i].vartype == ORC_VAR_TYPE_ACCUMULATOR) { max = MAX(max, program->vars[i].size); } } } return max; } int _orc_data_cache_size_level1; int _orc_data_cache_size_level2; int _orc_data_cache_size_level3; int _orc_cpu_family; int _orc_cpu_model; int _orc_cpu_stepping; const char *_orc_cpu_name = "unknown"; void orc_get_data_cache_sizes (int *level1, int *level2, int *level3) { if (level1) { *level1 = _orc_data_cache_size_level1; } if (level2) { *level2 = _orc_data_cache_size_level2; } if (level3) { *level3 = _orc_data_cache_size_level3; } } void orc_get_cpu_family_model_stepping (int *family, int *model, int *stepping) { if (family) { *family = _orc_cpu_family; } if (model) { *model = _orc_cpu_model; } if (stepping) { *stepping = _orc_cpu_stepping; } } const char * orc_get_cpu_name (void) { return _orc_cpu_name; } void orc_program_reset (OrcProgram *program) { if (program->orccode) { orc_code_free (program->orccode); program->orccode = NULL; } if (program->asm_code) { free(program->asm_code); program->asm_code = NULL; } } OrcCode * orc_program_take_code (OrcProgram *program) { OrcCode *code = program->orccode; program->orccode = NULL; return code; } orc-0.4.18/orc/orcpowerpc.h0000664000175000017500000001712012111024531012420 00000000000000 #ifndef _ORC_POWERPC_H_ #define _ORC_POWERPC_H_ #include ORC_BEGIN_DECLS typedef enum { ORC_TARGET_POWERPC_64BIT = (1<<0) } OrcTargetPowerPCFlags; #ifdef ORC_ENABLE_UNSTABLE_API enum { POWERPC_R0 = ORC_GP_REG_BASE, POWERPC_R1, POWERPC_R2, POWERPC_R3, POWERPC_R4, POWERPC_R5, POWERPC_R6, POWERPC_R7, POWERPC_R8, POWERPC_R9, POWERPC_R10, POWERPC_R11, POWERPC_R12, POWERPC_R13, POWERPC_R14, POWERPC_R15, POWERPC_R16, POWERPC_R17, POWERPC_R18, POWERPC_R19, POWERPC_R20, POWERPC_R21, POWERPC_R22, POWERPC_R23, POWERPC_R24, POWERPC_R25, POWERPC_R26, POWERPC_R27, POWERPC_R28, POWERPC_R29, POWERPC_R30, POWERPC_R31, POWERPC_V0 = ORC_VEC_REG_BASE, POWERPC_V1, POWERPC_V2, POWERPC_V3, POWERPC_V4, POWERPC_V5, POWERPC_V6, POWERPC_V7, POWERPC_V8, POWERPC_V9, POWERPC_V10, POWERPC_V11, POWERPC_V12, POWERPC_V13, POWERPC_V14, POWERPC_V15, POWERPC_V16, POWERPC_V17, POWERPC_V18, POWERPC_V19, POWERPC_V20, POWERPC_V21, POWERPC_V22, POWERPC_V23, POWERPC_V24, POWERPC_V25, POWERPC_V26, POWERPC_V27, POWERPC_V28, POWERPC_V29, POWERPC_V30, POWERPC_V31 }; const char * powerpc_get_regname(int i); int powerpc_regnum (int i); void powerpc_emit(OrcCompiler *compiler, unsigned int insn); void powerpc_emit_add (OrcCompiler *compiler, int regd, int rega, int regb); void powerpc_emit_addi_rec (OrcCompiler *compiler, int regd, int rega, int imm); void powerpc_emit_addi (OrcCompiler *compiler, int regd, int rega, int imm); void powerpc_emit_lwz (OrcCompiler *compiler, int regd, int rega, int imm); void powerpc_emit_stw (OrcCompiler *compiler, int regs, int rega, int offset); void powerpc_emit_stwu (OrcCompiler *compiler, int regs, int rega, int offset); void powerpc_emit_ld (OrcCompiler *compiler, int regd, int rega, int imm); void powerpc_emit_std (OrcCompiler *compiler, int regs, int rega, int offset); void powerpc_emit_stdu (OrcCompiler *compiler, int regs, int rega, int offset); void powerpc_emit_ret (OrcCompiler *compiler); void powerpc_emit_b (OrcCompiler *compiler, int label); void powerpc_emit_beq (OrcCompiler *compiler, int label); void powerpc_emit_bne (OrcCompiler *compiler, int label); void powerpc_emit_label (OrcCompiler *compiler, int label); void powerpc_add_fixup (OrcCompiler *compiler, int type, unsigned char *ptr, int label); void powerpc_do_fixups (OrcCompiler *compiler); void orc_powerpc_flush_cache (OrcCode *code); void powerpc_emit_srawi (OrcCompiler *compiler, int regd, int rega, int shift, int record); void powerpc_emit_655510 (OrcCompiler *compiler, int major, int d, int a, int b, int minor); void powerpc_emit_D (OrcCompiler *compiler, const char *name, unsigned int insn, int regd, int rega, int imm); void powerpc_emit_X (OrcCompiler *compiler, unsigned int insn, int d, int a, int b); void powerpc_emit_VA (OrcCompiler *compiler, const char *name, unsigned int insn, int d, int a, int b, int c); void powerpc_emit_VA_acb (OrcCompiler *compiler, const char *name, unsigned int insn, int d, int a, int b, int c); void powerpc_emit_VX (OrcCompiler *compiler, unsigned int insn, int d, int a, int b); void powerpc_emit_VX_b (OrcCompiler *p, const char *name, unsigned int insn, int a); void powerpc_emit_VX_db (OrcCompiler *p, const char *name, unsigned int insn, int d, int b); void powerpc_emit_VX_dbi (OrcCompiler *p, const char *name, unsigned int insn, int d, int b, int imm); void powerpc_emit_VXR (OrcCompiler *compiler, const char *name, unsigned int insn, int d, int a, int b, int record); void powerpc_emit_VX_2 (OrcCompiler *p, const char *name, unsigned int insn, int d, int a, int b); void powerpc_emit_VX_3 (OrcCompiler *p, const char *name, unsigned int insn, int d, int a, int b, int c); void powerpc_emit_VX_3_reg (OrcCompiler *p, const char *name, unsigned int insn, int d, int a, int b, int c); void powerpc_emit_VX_4 (OrcCompiler *p, const char *name, unsigned int insn, int d, int a); int powerpc_get_constant (OrcCompiler *p, int type, int value); int powerpc_get_constant_full (OrcCompiler *p, int value0, int value1, int value2, int value3); void powerpc_load_long_constant (OrcCompiler *p, int reg, orc_uint32 a, orc_uint32 b, orc_uint32 c, orc_uint32 d); /* instructions */ #define powerpc_emit_vand(p,a,b,c) powerpc_emit_VX_2 (p, "vand", 0x10000404, a, b, c) #define powerpc_emit_vandc(p,a,b,c) powerpc_emit_VX_2 (p, "vandc", 0x10000444, a, b, c) #define powerpc_emit_vor(p,a,b,c) powerpc_emit_VX_2 (p, "vor", 0x10000484, a, b, c) #define powerpc_emit_vxor(p,a,b,c) powerpc_emit_VX_2 (p, "vxor", 0x100004c4, a, b, c) #define powerpc_emit_vmulesb(p,a,b,c) powerpc_emit_VX_2 (p, "vmulesb", 0x10000308, a, b, c) #define powerpc_emit_vmuleub(p,a,b,c) powerpc_emit_VX_2 (p, "vmuleub", 0x10000208, a, b, c) #define powerpc_emit_vmulesh(p,a,b,c) powerpc_emit_VX_2 (p, "vmulesh", 0x10000348, a, b, c) #define powerpc_emit_vmuleuh(p,a,b,c) powerpc_emit_VX_2 (p, "vmuleuh", 0x10000248, a, b, c) #define powerpc_emit_vmrghb(p,a,b,c) powerpc_emit_VX_2 (p, "vmrghb", 0x1000000c, a, b, c) #define powerpc_emit_vmrghh(p,a,b,c) powerpc_emit_VX_2 (p, "vmrghh", 0x1000004c, a, b, c) #define powerpc_emit_vpkshss(p,a,b,c) powerpc_emit_VX_2 (p, "vpkshss", 0x1000018e, a, b, c) #define powerpc_emit_vpkshus(p,a,b,c) powerpc_emit_VX_2 (p, "vpkshus", 0x1000010e, a, b, c) #define powerpc_emit_vpkswss(p,a,b,c) powerpc_emit_VX_2 (p, "vpkswss", 0x100001ce, a, b, c) #define powerpc_emit_vpkswus(p,a,b,c) powerpc_emit_VX_2 (p, "vpkswus", 0x1000014e, a, b, c) #define powerpc_emit_vpkuhus(p,a,b,c) powerpc_emit_VX_2 (p, "vpkuhus", 0x1000008e, a, b, c) #define powerpc_emit_vpkuhum(p,a,b,c) powerpc_emit_VX_2 (p, "vpkuhum", 0x1000000e, a, b, c) #define powerpc_emit_vpkuwus(p,a,b,c) powerpc_emit_VX_2 (p, "vpkuwus", 0x100000ce, a, b, c) #define powerpc_emit_vpkuwum(p,a,b,c) powerpc_emit_VX_2 (p, "vpkuwum", 0x1000004e, a, b, c) #define powerpc_emit_vadduhm(p,a,b,c) powerpc_emit_VX_2 (p, "vadduhm", 0x10000040, a, b, c) #define powerpc_emit_vadduwm(p,a,b,c) powerpc_emit_VX_2 (p, "vadduwm", 0x10000080, a, b, c) #define powerpc_emit_vsububm(p,a,b,c) powerpc_emit_VX_2 (p, "vsububm", 0x10000400, a, b, c) #define powerpc_emit_vsum4ubs(p,a,b,c) powerpc_emit_VX_2 (p, "vsum4ubs", 0x10000608, a, b, c) #define powerpc_emit_vmaxub(p,a,b,c) powerpc_emit_VX_2 (p, "vmaxub", 0x10000002, a, b, c) #define powerpc_emit_vmaxsb(p,a,b,c) powerpc_emit_VX_2 (p, "vmaxsb", 0x10000102, a, b, c) #define powerpc_emit_vmaxsh(p,a,b,c) powerpc_emit_VX_2 (p, "vmaxsh", 0x10000142, a, b, c) #define powerpc_emit_vmaxsw(p,a,b,c) powerpc_emit_VX_2 (p, "vmaxsw", 0x10000182, a, b, c) #define powerpc_emit_vminub(p,a,b,c) powerpc_emit_VX_2 (p, "vminub", 0x10000202, a, b, c) #define powerpc_emit_vminsb(p,a,b,c) powerpc_emit_VX_2 (p, "vminsb", 0x10000302, a, b, c) #define powerpc_emit_vminsh(p,a,b,c) powerpc_emit_VX_2 (p, "vminsh", 0x10000342, a, b, c) #define powerpc_emit_vminsw(p,a,b,c) powerpc_emit_VX_2 (p, "vminsw", 0x10000382, a, b, c) #define powerpc_emit_vsldoi(p,a,b,c,d) powerpc_emit_VX_3 (p, "vsldoi", 0x1000002c | (d<<6), a, b, c, d) #define powerpc_emit_vmladduhm(p,a,b,c,d) powerpc_emit_VA (p, "vmladduhm", 0x10000022, a, b, c, d) #define powerpc_emit_vupkhsb(p,a,b) powerpc_emit_VX_4 (p, "vupkhsb", 0x1000020e, a, b) #define powerpc_emit_vupkhsh(p,a,b) powerpc_emit_VX_4 (p, "vupkhsh", 0x1000024e, a, b) #define powerpc_emit_vperm(p,a,b,c,d) powerpc_emit_VA (p, "vperm", 0x1000002b, a, b, c, d) #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcemulateopcodes.h0000644000175000017500000002641511643723636014004 00000000000000 /* autogenerated by generate-emulation */ #ifndef _ORC_EMULATE_OPCODES_H_ #define _ORC_EMULATE_OPCODES_H_ void emulate_absb (OrcOpcodeExecutor *ex, int i, int n); void emulate_addb (OrcOpcodeExecutor *ex, int i, int n); void emulate_addssb (OrcOpcodeExecutor *ex, int i, int n); void emulate_addusb (OrcOpcodeExecutor *ex, int i, int n); void emulate_andb (OrcOpcodeExecutor *ex, int i, int n); void emulate_andnb (OrcOpcodeExecutor *ex, int i, int n); void emulate_avgsb (OrcOpcodeExecutor *ex, int i, int n); void emulate_avgub (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpeqb (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpgtsb (OrcOpcodeExecutor *ex, int i, int n); void emulate_copyb (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadb (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadoffb (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadupdb (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadupib (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadpb (OrcOpcodeExecutor *ex, int i, int n); void emulate_ldresnearb (OrcOpcodeExecutor *ex, int i, int n); void emulate_ldresnearl (OrcOpcodeExecutor *ex, int i, int n); void emulate_ldreslinb (OrcOpcodeExecutor *ex, int i, int n); void emulate_ldreslinl (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxsb (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxub (OrcOpcodeExecutor *ex, int i, int n); void emulate_minsb (OrcOpcodeExecutor *ex, int i, int n); void emulate_minub (OrcOpcodeExecutor *ex, int i, int n); void emulate_mullb (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulhsb (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulhub (OrcOpcodeExecutor *ex, int i, int n); void emulate_orb (OrcOpcodeExecutor *ex, int i, int n); void emulate_shlb (OrcOpcodeExecutor *ex, int i, int n); void emulate_shrsb (OrcOpcodeExecutor *ex, int i, int n); void emulate_shrub (OrcOpcodeExecutor *ex, int i, int n); void emulate_signb (OrcOpcodeExecutor *ex, int i, int n); void emulate_storeb (OrcOpcodeExecutor *ex, int i, int n); void emulate_subb (OrcOpcodeExecutor *ex, int i, int n); void emulate_subssb (OrcOpcodeExecutor *ex, int i, int n); void emulate_subusb (OrcOpcodeExecutor *ex, int i, int n); void emulate_xorb (OrcOpcodeExecutor *ex, int i, int n); void emulate_absw (OrcOpcodeExecutor *ex, int i, int n); void emulate_addw (OrcOpcodeExecutor *ex, int i, int n); void emulate_addssw (OrcOpcodeExecutor *ex, int i, int n); void emulate_addusw (OrcOpcodeExecutor *ex, int i, int n); void emulate_andw (OrcOpcodeExecutor *ex, int i, int n); void emulate_andnw (OrcOpcodeExecutor *ex, int i, int n); void emulate_avgsw (OrcOpcodeExecutor *ex, int i, int n); void emulate_avguw (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpeqw (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpgtsw (OrcOpcodeExecutor *ex, int i, int n); void emulate_copyw (OrcOpcodeExecutor *ex, int i, int n); void emulate_div255w (OrcOpcodeExecutor *ex, int i, int n); void emulate_divluw (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadw (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadoffw (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadpw (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxsw (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxuw (OrcOpcodeExecutor *ex, int i, int n); void emulate_minsw (OrcOpcodeExecutor *ex, int i, int n); void emulate_minuw (OrcOpcodeExecutor *ex, int i, int n); void emulate_mullw (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulhsw (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulhuw (OrcOpcodeExecutor *ex, int i, int n); void emulate_orw (OrcOpcodeExecutor *ex, int i, int n); void emulate_shlw (OrcOpcodeExecutor *ex, int i, int n); void emulate_shrsw (OrcOpcodeExecutor *ex, int i, int n); void emulate_shruw (OrcOpcodeExecutor *ex, int i, int n); void emulate_signw (OrcOpcodeExecutor *ex, int i, int n); void emulate_storew (OrcOpcodeExecutor *ex, int i, int n); void emulate_subw (OrcOpcodeExecutor *ex, int i, int n); void emulate_subssw (OrcOpcodeExecutor *ex, int i, int n); void emulate_subusw (OrcOpcodeExecutor *ex, int i, int n); void emulate_xorw (OrcOpcodeExecutor *ex, int i, int n); void emulate_absl (OrcOpcodeExecutor *ex, int i, int n); void emulate_addl (OrcOpcodeExecutor *ex, int i, int n); void emulate_addssl (OrcOpcodeExecutor *ex, int i, int n); void emulate_addusl (OrcOpcodeExecutor *ex, int i, int n); void emulate_andl (OrcOpcodeExecutor *ex, int i, int n); void emulate_andnl (OrcOpcodeExecutor *ex, int i, int n); void emulate_avgsl (OrcOpcodeExecutor *ex, int i, int n); void emulate_avgul (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpeql (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpgtsl (OrcOpcodeExecutor *ex, int i, int n); void emulate_copyl (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadl (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadoffl (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadpl (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxsl (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxul (OrcOpcodeExecutor *ex, int i, int n); void emulate_minsl (OrcOpcodeExecutor *ex, int i, int n); void emulate_minul (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulll (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulhsl (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulhul (OrcOpcodeExecutor *ex, int i, int n); void emulate_orl (OrcOpcodeExecutor *ex, int i, int n); void emulate_shll (OrcOpcodeExecutor *ex, int i, int n); void emulate_shrsl (OrcOpcodeExecutor *ex, int i, int n); void emulate_shrul (OrcOpcodeExecutor *ex, int i, int n); void emulate_signl (OrcOpcodeExecutor *ex, int i, int n); void emulate_storel (OrcOpcodeExecutor *ex, int i, int n); void emulate_subl (OrcOpcodeExecutor *ex, int i, int n); void emulate_subssl (OrcOpcodeExecutor *ex, int i, int n); void emulate_subusl (OrcOpcodeExecutor *ex, int i, int n); void emulate_xorl (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadq (OrcOpcodeExecutor *ex, int i, int n); void emulate_loadpq (OrcOpcodeExecutor *ex, int i, int n); void emulate_storeq (OrcOpcodeExecutor *ex, int i, int n); void emulate_splatw3q (OrcOpcodeExecutor *ex, int i, int n); void emulate_copyq (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpeqq (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpgtsq (OrcOpcodeExecutor *ex, int i, int n); void emulate_andq (OrcOpcodeExecutor *ex, int i, int n); void emulate_andnq (OrcOpcodeExecutor *ex, int i, int n); void emulate_orq (OrcOpcodeExecutor *ex, int i, int n); void emulate_xorq (OrcOpcodeExecutor *ex, int i, int n); void emulate_addq (OrcOpcodeExecutor *ex, int i, int n); void emulate_subq (OrcOpcodeExecutor *ex, int i, int n); void emulate_shlq (OrcOpcodeExecutor *ex, int i, int n); void emulate_shrsq (OrcOpcodeExecutor *ex, int i, int n); void emulate_shruq (OrcOpcodeExecutor *ex, int i, int n); void emulate_convsbw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convubw (OrcOpcodeExecutor *ex, int i, int n); void emulate_splatbw (OrcOpcodeExecutor *ex, int i, int n); void emulate_splatbl (OrcOpcodeExecutor *ex, int i, int n); void emulate_convswl (OrcOpcodeExecutor *ex, int i, int n); void emulate_convuwl (OrcOpcodeExecutor *ex, int i, int n); void emulate_convslq (OrcOpcodeExecutor *ex, int i, int n); void emulate_convulq (OrcOpcodeExecutor *ex, int i, int n); void emulate_convwb (OrcOpcodeExecutor *ex, int i, int n); void emulate_convhwb (OrcOpcodeExecutor *ex, int i, int n); void emulate_convssswb (OrcOpcodeExecutor *ex, int i, int n); void emulate_convsuswb (OrcOpcodeExecutor *ex, int i, int n); void emulate_convusswb (OrcOpcodeExecutor *ex, int i, int n); void emulate_convuuswb (OrcOpcodeExecutor *ex, int i, int n); void emulate_convlw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convhlw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convssslw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convsuslw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convusslw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convuuslw (OrcOpcodeExecutor *ex, int i, int n); void emulate_convql (OrcOpcodeExecutor *ex, int i, int n); void emulate_convsssql (OrcOpcodeExecutor *ex, int i, int n); void emulate_convsusql (OrcOpcodeExecutor *ex, int i, int n); void emulate_convussql (OrcOpcodeExecutor *ex, int i, int n); void emulate_convuusql (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulsbw (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulubw (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulswl (OrcOpcodeExecutor *ex, int i, int n); void emulate_muluwl (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulslq (OrcOpcodeExecutor *ex, int i, int n); void emulate_mululq (OrcOpcodeExecutor *ex, int i, int n); void emulate_accw (OrcOpcodeExecutor *ex, int i, int n); void emulate_accl (OrcOpcodeExecutor *ex, int i, int n); void emulate_accsadubl (OrcOpcodeExecutor *ex, int i, int n); void emulate_swapw (OrcOpcodeExecutor *ex, int i, int n); void emulate_swapl (OrcOpcodeExecutor *ex, int i, int n); void emulate_swapwl (OrcOpcodeExecutor *ex, int i, int n); void emulate_swapq (OrcOpcodeExecutor *ex, int i, int n); void emulate_swaplq (OrcOpcodeExecutor *ex, int i, int n); void emulate_select0wb (OrcOpcodeExecutor *ex, int i, int n); void emulate_select1wb (OrcOpcodeExecutor *ex, int i, int n); void emulate_select0lw (OrcOpcodeExecutor *ex, int i, int n); void emulate_select1lw (OrcOpcodeExecutor *ex, int i, int n); void emulate_select0ql (OrcOpcodeExecutor *ex, int i, int n); void emulate_select1ql (OrcOpcodeExecutor *ex, int i, int n); void emulate_mergelq (OrcOpcodeExecutor *ex, int i, int n); void emulate_mergewl (OrcOpcodeExecutor *ex, int i, int n); void emulate_mergebw (OrcOpcodeExecutor *ex, int i, int n); void emulate_splitql (OrcOpcodeExecutor *ex, int i, int n); void emulate_splitlw (OrcOpcodeExecutor *ex, int i, int n); void emulate_splitwb (OrcOpcodeExecutor *ex, int i, int n); void emulate_addf (OrcOpcodeExecutor *ex, int i, int n); void emulate_subf (OrcOpcodeExecutor *ex, int i, int n); void emulate_mulf (OrcOpcodeExecutor *ex, int i, int n); void emulate_divf (OrcOpcodeExecutor *ex, int i, int n); void emulate_sqrtf (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxf (OrcOpcodeExecutor *ex, int i, int n); void emulate_minf (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpeqf (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpltf (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmplef (OrcOpcodeExecutor *ex, int i, int n); void emulate_convfl (OrcOpcodeExecutor *ex, int i, int n); void emulate_convlf (OrcOpcodeExecutor *ex, int i, int n); void emulate_addd (OrcOpcodeExecutor *ex, int i, int n); void emulate_subd (OrcOpcodeExecutor *ex, int i, int n); void emulate_muld (OrcOpcodeExecutor *ex, int i, int n); void emulate_divd (OrcOpcodeExecutor *ex, int i, int n); void emulate_sqrtd (OrcOpcodeExecutor *ex, int i, int n); void emulate_maxd (OrcOpcodeExecutor *ex, int i, int n); void emulate_mind (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpeqd (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpltd (OrcOpcodeExecutor *ex, int i, int n); void emulate_cmpled (OrcOpcodeExecutor *ex, int i, int n); void emulate_convdl (OrcOpcodeExecutor *ex, int i, int n); void emulate_convld (OrcOpcodeExecutor *ex, int i, int n); void emulate_convfd (OrcOpcodeExecutor *ex, int i, int n); void emulate_convdf (OrcOpcodeExecutor *ex, int i, int n); #endif orc-0.4.18/orc/orcprogram-neon.c0000664000175000017500000006525512071634360013370 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include #define SIZE 65536 void orc_neon_emit_loop (OrcCompiler *compiler, int unroll_index); void orc_compiler_neon_register_rules (OrcTarget *target); unsigned int orc_compiler_neon_get_default_flags (void); void orc_compiler_neon_init (OrcCompiler *compiler); void orc_compiler_neon_assemble (OrcCompiler *compiler); void orc_compiler_rewrite_vars (OrcCompiler *compiler); void orc_compiler_dump (OrcCompiler *compiler); void orc_neon_save_accumulators (OrcCompiler *compiler); void neon_add_strides (OrcCompiler *compiler); void orc_neon_emit_prologue (OrcCompiler *compiler) { unsigned int regs = 0; int i; orc_compiler_append_code(compiler,".global %s\n", compiler->program->name); orc_compiler_append_code(compiler,"%s:\n", compiler->program->name); for(i=0;i<16;i++){ if (compiler->used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) { regs |= (1<used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) { regs |= (1<valid_regs[i] = 1; } for(i=ORC_VEC_REG_BASE+0;ivalid_regs[i] = 1; } //compiler->valid_regs[ORC_ARM_SB] = 0; compiler->valid_regs[ORC_ARM_IP] = 0; compiler->valid_regs[ORC_ARM_SP] = 0; compiler->valid_regs[ORC_ARM_LR] = 0; compiler->valid_regs[ORC_ARM_PC] = 0; for(i=4;i<12;i++) { compiler->save_regs[ORC_GP_REG_BASE+i] = 1; } for(i=0;ialloc_regs[i] = 0; compiler->used_regs[i] = 0; } compiler->exec_reg = ORC_ARM_A1; compiler->valid_regs[compiler->exec_reg] = 0; compiler->gp_tmpreg = ORC_ARM_A2; compiler->valid_regs[compiler->gp_tmpreg] = 0; compiler->tmpreg = ORC_VEC_REG_BASE + 0; compiler->valid_regs[compiler->tmpreg] = 0; compiler->tmpreg2 = ORC_VEC_REG_BASE + 2; compiler->valid_regs[compiler->tmpreg2] = 0; loop_shift = 0; switch (compiler->max_var_size) { case 1: compiler->loop_shift = 4; break; case 2: compiler->loop_shift = 3; break; case 4: compiler->loop_shift = 2; break; case 8: compiler->loop_shift = 1; break; default: ORC_ERROR("unhandled max var size %d", compiler->max_var_size); break; } switch (orc_program_get_max_array_size (compiler->program)) { case 0: case 1: loop_shift = 4; break; case 2: loop_shift = 3; break; case 4: loop_shift = 2; break; case 8: loop_shift = 1; break; default: ORC_ERROR("unhandled max array size %d", orc_program_get_max_array_size (compiler->program)); break; } if (loop_shift < compiler->loop_shift) { compiler->loop_shift = loop_shift; } switch (orc_program_get_max_accumulator_size (compiler->program)) { case 0: loop_shift = 4; break; case 1: loop_shift = 3; break; case 2: loop_shift = 2; break; case 4: loop_shift = 1; break; case 8: loop_shift = 0; break; default: ORC_ERROR("unhandled max accumulator size %d", orc_program_get_max_accumulator_size (compiler->program)); break; } if (loop_shift < compiler->loop_shift) { compiler->loop_shift = loop_shift; } /* Unrolling isn't helpful until neon gets an instruction * scheduler. This decreases the raw amount of code generated * while still keeping the feature active. */ if (compiler->n_insns < 5) { compiler->unroll_shift = 0; } if (0) { compiler->need_mask_regs = TRUE; } } void orc_neon_load_constants_outer (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: break; case ORC_VAR_TYPE_ACCUMULATOR: orc_neon_emit_loadil (compiler, compiler->vars[i].alloc, 0); break; case ORC_VAR_TYPE_TEMP: break; default: ORC_PROGRAM_ERROR(compiler,"bad vartype"); break; } } for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; OrcRule *rule; if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", i, insn->opcode->name); compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { rule->emit (compiler, rule->emit_user, insn); } else { ORC_COMPILER_ERROR(compiler,"No rule for: %s", opcode->name); } } } void orc_neon_load_constants_inner (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_arm_emit_load_reg (compiler, compiler->vars[i].ptr_register, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: ORC_PROGRAM_ERROR(compiler,"bad vartype"); break; } } } #if 0 void orc_neon_emit_load_src (OrcCompiler *compiler, OrcVariable *var, int unroll_index) { int ptr_reg; int update; if (var->ptr_register == 0) { int i; i = var - compiler->vars; //arm_emit_mov_memoffset_reg (compiler, arm_ptr_size, // (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), // p->exec_reg, X86_ECX); ptr_reg = ORC_ARM_PC; } else { ptr_reg = var->ptr_register; } if (var->vartype == ORC_VAR_TYPE_DEST) { update = FALSE; } else { update = TRUE; } switch (var->size) { case 1: orc_neon_loadb (compiler, var, update); break; case 2: orc_neon_loadw (compiler, var, update); break; case 4: orc_neon_loadl (compiler, var, update); break; case 8: orc_neon_loadq (compiler, var->alloc, ptr_reg, update, var->is_aligned); break; default: ORC_ERROR("bad size"); } if (unroll_index == 0) { switch (compiler->size_region) { case 0: case 1: orc_neon_preload (compiler, var, FALSE, 208); break; case 2: case 3: orc_neon_preload (compiler, var, FALSE, 208); break; } } } void orc_neon_emit_store_dest (OrcCompiler *compiler, OrcVariable *var) { int ptr_reg; if (var->ptr_register == 0) { //arm_emit_mov_memoffset_reg (compiler, arm_ptr_size, // var->ptr_offset, p->exec_reg, X86_ECX); ptr_reg = ORC_ARM_PC; } else { ptr_reg = var->ptr_register; } switch (var->size) { case 1: orc_neon_storeb (compiler, ptr_reg, TRUE, var->alloc, var->is_aligned); break; case 2: orc_neon_storew (compiler, ptr_reg, TRUE, var->alloc, var->is_aligned); break; case 4: orc_neon_storel (compiler, ptr_reg, TRUE, var->alloc, var->is_aligned); break; case 8: orc_neon_storeq (compiler, ptr_reg, TRUE, var->alloc, var->is_aligned); break; default: ORC_ERROR("bad size"); } switch (compiler->size_region) { case 0: break; case 1: /* assume hot cache, see below */ break; case 2: /* This is only useful for cold cache and for memset-like operations, which isn't the usual case, thus it's disabled. */ #if 0 orc_neon_preload (compiler, var, FALSE, 208); #endif break; case 3: /* none */ break; } } #endif static int get_shift (int size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: ORC_ERROR("bad size %d", size); } return -1; } static int get_align_var (OrcCompiler *compiler) { if (compiler->vars[ORC_VAR_D1].size) return ORC_VAR_D1; if (compiler->vars[ORC_VAR_S1].size) return ORC_VAR_S1; ORC_PROGRAM_ERROR(compiler, "could not find alignment variable"); return -1; } enum { LABEL_ONE_REGION = 1, LABEL_ONE_REGION_AFTER, LABEL_REGION0_LOOP, LABEL_REGION0_SKIP, LABEL_REGION1_LOOP, LABEL_REGION1_SKIP, LABEL_REGION2_LOOP_SMALL, LABEL_REGION2_LOOP_MEDIUM, LABEL_REGION2_LOOP_LARGE, LABEL_REGION2_SMALL, LABEL_REGION2_MEDIUM, LABEL_REGION2_SKIP, LABEL_REGION3_LOOP, LABEL_REGION3_SKIP, LABEL_OUTER_LOOP, LABEL_OUTER_LOOP_SKIP, LABEL_L1L2_AFTER, }; void orc_compiler_neon_assemble (OrcCompiler *compiler) { int align_var; int align_shift; int var_size_shift; int i; align_var = get_align_var (compiler); if (compiler->error) return; var_size_shift = get_shift (compiler->vars[align_var].size); align_shift = 4; compiler->vars[align_var].is_aligned = FALSE; orc_neon_emit_prologue (compiler); orc_neon_load_constants_outer (compiler); if (compiler->program->is_2d) { if (compiler->program->constant_m > 0) { orc_arm_emit_load_imm (compiler, ORC_ARM_A3, compiler->program->constant_m); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2])); } else { orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A1])); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2])); } orc_arm_emit_label (compiler, LABEL_OUTER_LOOP); } #define ORC_NEON_ALIGNED_DEST_CUTOFF 64 if (compiler->loop_shift > 0 && compiler->n_insns < 5) { orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,n)); orc_arm_emit_cmp_imm (compiler, ORC_ARM_A3, ORC_NEON_ALIGNED_DEST_CUTOFF); orc_arm_emit_branch (compiler, ORC_ARM_COND_GT, LABEL_REGION0_SKIP); orc_arm_emit_asr_imm (compiler, ORC_ARM_A2, ORC_ARM_A3, compiler->loop_shift); orc_arm_emit_store_reg (compiler, ORC_ARM_A2, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2)); orc_arm_emit_and_imm (compiler, ORC_ARM_A3, ORC_ARM_A3, (1<loop_shift)-1); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3)); orc_neon_load_constants_inner (compiler); orc_arm_emit_load_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2)); orc_arm_emit_cmp_imm (compiler, ORC_ARM_IP, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, LABEL_REGION2_SKIP); compiler->size_region = 0; orc_arm_emit_label (compiler, LABEL_REGION0_LOOP); orc_arm_emit_sub_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, 1, TRUE); orc_neon_emit_loop (compiler, -1); orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_REGION0_LOOP); orc_arm_emit_branch (compiler, ORC_ARM_COND_AL, LABEL_REGION2_SKIP); orc_arm_emit_label (compiler, LABEL_REGION0_SKIP); } if (compiler->loop_shift > 0) { orc_arm_emit_load_imm (compiler, ORC_ARM_IP, 1<exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,arrays[align_var])); orc_arm_emit_sub (compiler, ORC_ARM_IP, ORC_ARM_IP, ORC_ARM_A2); orc_arm_emit_and_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, (1< 0) { orc_arm_emit_asr_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, var_size_shift); } orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,n)); orc_arm_emit_cmp (compiler, ORC_ARM_A3, ORC_ARM_IP); orc_arm_emit_branch (compiler, ORC_ARM_COND_LE, LABEL_ONE_REGION); orc_arm_emit_store_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1)); orc_arm_emit_sub (compiler, ORC_ARM_A2, ORC_ARM_A3, ORC_ARM_IP); orc_arm_emit_asr_imm (compiler, ORC_ARM_A3, ORC_ARM_A2, compiler->loop_shift + compiler->unroll_shift); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2)); orc_arm_emit_and_imm (compiler, ORC_ARM_A3, ORC_ARM_A2, (1<<(compiler->loop_shift + compiler->unroll_shift))-1); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3)); orc_arm_emit_branch (compiler, ORC_ARM_COND_AL, LABEL_ONE_REGION_AFTER); orc_arm_emit_label (compiler, LABEL_ONE_REGION); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1)); orc_arm_emit_load_imm (compiler, ORC_ARM_A3, 0); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2)); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3)); orc_arm_emit_label (compiler, LABEL_ONE_REGION_AFTER); } orc_neon_load_constants_inner (compiler); if (compiler->loop_shift > 0) { int save_loop_shift = compiler->loop_shift; compiler->loop_shift = 0; orc_arm_emit_load_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1)); orc_arm_emit_cmp_imm (compiler, ORC_ARM_IP, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, LABEL_REGION1_SKIP); orc_arm_emit_label (compiler, LABEL_REGION1_LOOP); orc_arm_emit_sub_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, 1, TRUE); orc_neon_emit_loop (compiler, -1); orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_REGION1_LOOP); orc_arm_emit_label (compiler, LABEL_REGION1_SKIP); compiler->loop_shift = save_loop_shift; compiler->vars[align_var].is_aligned = TRUE; } if (compiler->loop_shift > 0) { orc_arm_emit_load_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2)); } else { orc_arm_emit_load_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,n)); } orc_arm_emit_cmp_imm (compiler, ORC_ARM_IP, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, LABEL_REGION2_SKIP); orc_arm_emit_asr_imm (compiler, compiler->gp_tmpreg, ORC_ARM_IP, 17 + var_size_shift - compiler->loop_shift - compiler->unroll_shift); orc_arm_emit_cmp_imm (compiler, compiler->gp_tmpreg, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, LABEL_REGION2_MEDIUM); /* N is larger than L2 cache size */ compiler->size_region = 3; orc_arm_emit_label (compiler, LABEL_REGION2_LOOP_LARGE); orc_arm_emit_sub_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, 1, TRUE); for(i=0;i<(1<unroll_shift);i++){ orc_neon_emit_loop (compiler, i); } orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_REGION2_LOOP_LARGE); orc_arm_emit_branch (compiler, ORC_ARM_COND_AL, LABEL_REGION2_SKIP); orc_arm_emit_label (compiler, LABEL_REGION2_MEDIUM); orc_arm_emit_asr_imm (compiler, compiler->gp_tmpreg, ORC_ARM_IP, 13 + var_size_shift - compiler->loop_shift - compiler->unroll_shift); orc_arm_emit_cmp_imm (compiler, compiler->gp_tmpreg, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, LABEL_REGION2_SMALL); /* N is smaller than L2 cache size */ compiler->size_region = 2; orc_arm_emit_label (compiler, LABEL_REGION2_LOOP_MEDIUM); orc_arm_emit_sub_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, 1, TRUE); for(i=0;i<(1<unroll_shift);i++){ orc_neon_emit_loop (compiler, i); } orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_REGION2_LOOP_MEDIUM); orc_arm_emit_branch (compiler, ORC_ARM_COND_AL, LABEL_REGION2_SKIP); orc_arm_emit_label (compiler, LABEL_REGION2_SMALL); /* N is smaller than L2 cache size */ compiler->size_region = 1; orc_arm_emit_label (compiler, LABEL_REGION2_LOOP_SMALL); orc_arm_emit_sub_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, 1, TRUE); for(i=0;i<(1<unroll_shift);i++){ orc_neon_emit_loop (compiler, i); } orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_REGION2_LOOP_SMALL); orc_arm_emit_label (compiler, LABEL_REGION2_SKIP); if (compiler->loop_shift > 0) { int save_loop_shift = compiler->loop_shift; compiler->loop_shift = 0; compiler->vars[align_var].is_aligned = FALSE; orc_arm_emit_load_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3)); orc_arm_emit_cmp_imm (compiler, ORC_ARM_IP, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, LABEL_REGION3_SKIP); orc_arm_emit_label (compiler, LABEL_REGION3_LOOP); orc_arm_emit_sub_imm (compiler, ORC_ARM_IP, ORC_ARM_IP, 1, TRUE); orc_neon_emit_loop (compiler, -1); orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_REGION3_LOOP); orc_arm_emit_label (compiler, LABEL_REGION3_SKIP); compiler->loop_shift = save_loop_shift; } if (compiler->program->is_2d) { neon_add_strides (compiler); orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A2])); orc_arm_emit_sub_imm (compiler, ORC_ARM_A3, ORC_ARM_A3, 1, TRUE); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2])); orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, LABEL_OUTER_LOOP); } orc_neon_save_accumulators (compiler); orc_neon_emit_epilogue (compiler); orc_arm_emit_align (compiler, 4); orc_arm_emit_label (compiler, 20); orc_arm_emit_data (compiler, 0x07060706); orc_arm_emit_data (compiler, 0x07060706); orc_arm_emit_data (compiler, 0x0f0e0f0e); orc_arm_emit_data (compiler, 0x0f0e0f0e); orc_arm_do_fixups (compiler); } void orc_neon_emit_loop (OrcCompiler *compiler, int unroll_index) { int j; int k; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; orc_compiler_append_code(compiler,"# LOOP shift %d\n", compiler->loop_shift); for(j=0;jn_insns;j++){ compiler->insn_index = j; insn = compiler->insns + j; opcode = insn->opcode; if (insn->flags & ORC_INSN_FLAG_INVARIANT) continue; orc_compiler_append_code(compiler,"# %d: %s", j, insn->opcode->name); /* set up args */ #if 0 for(k=0;kn_src + opcode->n_dest;k++){ args[k] = compiler->vars + insn->args[k]; orc_compiler_append_code(compiler," %d", args[k]->alloc); if (args[k]->is_chained) { orc_compiler_append_code(compiler," (chained)"); } } #endif orc_compiler_append_code(compiler,"\n"); for(k=0;ksrc_size[k] == 0) continue; switch (compiler->vars[insn->src_args[k]].vartype) { case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: //orc_neon_emit_load_src (compiler, &compiler->vars[insn->src_args[k]], unroll_index); break; case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_TEMP: break; default: break; } } compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { #if 0 if (compiler->vars[insn->dest_args[0]].alloc != compiler->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov (compiler, compiler->vars[insn->dest_args[0]].alloc, compiler->vars[insn->src_args[0]].alloc); } #endif rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_append_code(compiler,"No rule for: %s\n", opcode->name); } for(k=0;kdest_size[k] == 0) continue; switch (compiler->vars[insn->dest_args[k]].vartype) { case ORC_VAR_TYPE_DEST: //orc_neon_emit_store_dest (compiler, &compiler->vars[insn->dest_args[k]]); break; case ORC_VAR_TYPE_TEMP: break; default: break; } } } for(k=0;kvars[k].name == NULL) continue; if (compiler->vars[k].vartype == ORC_VAR_TYPE_SRC || compiler->vars[k].vartype == ORC_VAR_TYPE_DEST) { if (compiler->vars[k].ptr_register) { orc_arm_emit_add_imm (compiler, compiler->vars[k].ptr_register, compiler->vars[k].ptr_register, compiler->vars[k].size << compiler->loop_shift); } else { //arm_emit_add_imm_memoffset (compiler, arm_ptr_size, // compiler->vars[k].size << compiler->loop_shift, // (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]), // p->exec_reg); } } } } #define NEON_BINARY(code,a,b,c) \ ((code) | \ (((a)&0xf)<<12) | \ ((((a)>>4)&0x1)<<22) | \ (((b)&0xf)<<16) | \ ((((b)>>4)&0x1)<<7) | \ (((c)&0xf)<<0) | \ ((((c)>>4)&0x1)<<5)) void orc_neon_save_accumulators (OrcCompiler *compiler) { int i; int src; unsigned int code; for(i=0;ivars + i; if (compiler->vars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_ACCUMULATOR: src = compiler->vars[i].alloc; orc_arm_emit_load_imm (compiler, compiler->gp_tmpreg, ORC_STRUCT_OFFSET(OrcExecutor, accumulators[i-ORC_VAR_A1])); orc_arm_emit_add (compiler, compiler->gp_tmpreg, compiler->gp_tmpreg, compiler->exec_reg); switch (var->size) { case 2: if (compiler->loop_shift > 0) { ORC_ASM_CODE(compiler," vpaddl.u16 %s, %s\n", orc_neon_reg_name (src), orc_neon_reg_name (src)); code = 0xf3b40280; code |= (src&0xf) << 12; code |= ((src>>4)&0x1) << 22; code |= (src&0xf) << 0; orc_arm_emit (compiler, code); ORC_ASM_CODE(compiler," vpaddl.u32 %s, %s\n", orc_neon_reg_name (src), orc_neon_reg_name (src)); code = 0xf3b80280; code |= (src&0xf) << 12; code |= ((src>>4)&0x1) << 22; code |= (src&0xf) << 0; orc_arm_emit (compiler, code); } ORC_ASM_CODE(compiler," vst1.16 %s[%d], [%s]\n", orc_neon_reg_name (src), 0, orc_arm_reg_name (compiler->gp_tmpreg)); code = 0xf480040f; code |= (compiler->gp_tmpreg&0xf) << 16; code |= (src&0xf) << 12; code |= ((src>>4)&0x1) << 22; orc_arm_emit (compiler, code); break; case 4: if (compiler->loop_shift > 0) { ORC_ASM_CODE(compiler," vpadd.u32 %s, %s, %s\n", orc_neon_reg_name (src), orc_neon_reg_name (src), orc_neon_reg_name (src)); code = NEON_BINARY(0xf2200b10, src, src, src); orc_arm_emit (compiler, code); } ORC_ASM_CODE(compiler," vst1.32 %s[%d], [%s]\n", orc_neon_reg_name (src), 0, orc_arm_reg_name (compiler->gp_tmpreg)); code = 0xf480080f; code |= (compiler->gp_tmpreg&0xf) << 16; code |= (src&0xf) << 12; code |= ((src>>4)&0x1) << 22; orc_arm_emit (compiler, code); break; default: ORC_ERROR("bad size"); } break; default: break; } } } void neon_add_strides (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); orc_arm_emit_load_reg (compiler, ORC_ARM_A2, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i])); orc_arm_emit_add (compiler, ORC_ARM_A3, ORC_ARM_A3, ORC_ARM_A2); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: ORC_COMPILER_ERROR(compiler,"bad vartype"); break; } } } orc-0.4.18/orc/orcsse.h0000664000175000017500000000226312111024531011535 00000000000000 #ifndef _ORC_SSE_H_ #define _ORC_SSE_H_ #include #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API typedef enum { X86_XMM0 = ORC_VEC_REG_BASE + 16, X86_XMM1, X86_XMM2, X86_XMM3, X86_XMM4, X86_XMM5, X86_XMM6, X86_XMM7, X86_XMM8, X86_XMM9, X86_XMM10, X86_XMM11, X86_XMM12, X86_XMM13, X86_XMM14, X86_XMM15 }OrcSSERegister; #define ORC_SSE_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0)) const char * orc_x86_get_regname_sse(int i); void orc_x86_emit_mov_memoffset_sse (OrcCompiler *compiler, int size, int offset, int reg1, int reg2, int is_aligned); void orc_x86_emit_mov_memindex_sse (OrcCompiler *compiler, int size, int offset, int reg1, int regindex, int shift, int reg2, int is_aligned); void orc_x86_emit_mov_sse_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2, int aligned, int uncached); void orc_sse_set_mxcsr (OrcCompiler *compiler); void orc_sse_restore_mxcsr (OrcCompiler *compiler); void orc_sse_load_constant (OrcCompiler *compiler, int reg, int size, orc_uint64 value); #endif unsigned int orc_sse_get_cpu_flags (void); ORC_END_DECLS #endif orc-0.4.18/orc/orcfunctions.h0000644000175000017500000000371411643723635012777 00000000000000 /* autogenerated from orcfunctions.orc */ #ifndef _ORCFUNCTIONS_H_ #define _ORCFUNCTIONS_H_ #ifdef __cplusplus extern "C" { #endif #ifndef _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif void orc_memcpy (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n); void orc_memset (void * ORC_RESTRICT d1, int p1, int n); #ifdef __cplusplus } #endif #endif orc-0.4.18/orc/orcbytecodes.h0000664000175000017500000001053012111024531012720 00000000000000 /* autogenerated by generate-bytecode */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include typedef enum { ORC_BC_END, ORC_BC_BEGIN_FUNCTION, ORC_BC_END_FUNCTION, ORC_BC_SET_CONSTANT_N, ORC_BC_SET_N_MULTIPLE, ORC_BC_SET_N_MINIMUM, ORC_BC_SET_N_MAXIMUM, ORC_BC_SET_2D, ORC_BC_SET_CONSTANT_M, ORC_BC_SET_NAME, ORC_BC_SET_BACKUP_FUNCTION, ORC_BC_ADD_DESTINATION, ORC_BC_ADD_SOURCE, ORC_BC_ADD_ACCUMULATOR, ORC_BC_ADD_CONSTANT, ORC_BC_ADD_CONSTANT_INT64, ORC_BC_ADD_PARAMETER, ORC_BC_ADD_PARAMETER_FLOAT, ORC_BC_ADD_PARAMETER_INT64, ORC_BC_ADD_PARAMETER_DOUBLE, ORC_BC_ADD_TEMPORARY, ORC_BC_INSTRUCTION_FLAGS, ORC_BC_RESERVED_22, ORC_BC_RESERVED_23, ORC_BC_RESERVED_24, ORC_BC_RESERVED_25, ORC_BC_RESERVED_26, ORC_BC_RESERVED_27, ORC_BC_RESERVED_28, ORC_BC_RESERVED_29, ORC_BC_RESERVED_30, ORC_BC_RESERVED_31, ORC_BC_absb, ORC_BC_addb, ORC_BC_addssb, ORC_BC_addusb, ORC_BC_andb, ORC_BC_andnb, ORC_BC_avgsb, ORC_BC_avgub, /* 40 */ ORC_BC_cmpeqb, ORC_BC_cmpgtsb, ORC_BC_copyb, ORC_BC_loadb, ORC_BC_loadoffb, ORC_BC_loadupdb, ORC_BC_loadupib, ORC_BC_loadpb, ORC_BC_ldresnearb, ORC_BC_ldresnearl, /* 50 */ ORC_BC_ldreslinb, ORC_BC_ldreslinl, ORC_BC_maxsb, ORC_BC_maxub, ORC_BC_minsb, ORC_BC_minub, ORC_BC_mullb, ORC_BC_mulhsb, ORC_BC_mulhub, ORC_BC_orb, /* 60 */ ORC_BC_shlb, ORC_BC_shrsb, ORC_BC_shrub, ORC_BC_signb, ORC_BC_storeb, ORC_BC_subb, ORC_BC_subssb, ORC_BC_subusb, ORC_BC_xorb, ORC_BC_absw, /* 70 */ ORC_BC_addw, ORC_BC_addssw, ORC_BC_addusw, ORC_BC_andw, ORC_BC_andnw, ORC_BC_avgsw, ORC_BC_avguw, ORC_BC_cmpeqw, ORC_BC_cmpgtsw, ORC_BC_copyw, /* 80 */ ORC_BC_div255w, ORC_BC_divluw, ORC_BC_loadw, ORC_BC_loadoffw, ORC_BC_loadpw, ORC_BC_maxsw, ORC_BC_maxuw, ORC_BC_minsw, ORC_BC_minuw, ORC_BC_mullw, /* 90 */ ORC_BC_mulhsw, ORC_BC_mulhuw, ORC_BC_orw, ORC_BC_shlw, ORC_BC_shrsw, ORC_BC_shruw, ORC_BC_signw, ORC_BC_storew, ORC_BC_subw, ORC_BC_subssw, /* 100 */ ORC_BC_subusw, ORC_BC_xorw, ORC_BC_absl, ORC_BC_addl, ORC_BC_addssl, ORC_BC_addusl, ORC_BC_andl, ORC_BC_andnl, ORC_BC_avgsl, ORC_BC_avgul, /* 110 */ ORC_BC_cmpeql, ORC_BC_cmpgtsl, ORC_BC_copyl, ORC_BC_loadl, ORC_BC_loadoffl, ORC_BC_loadpl, ORC_BC_maxsl, ORC_BC_maxul, ORC_BC_minsl, ORC_BC_minul, /* 120 */ ORC_BC_mulll, ORC_BC_mulhsl, ORC_BC_mulhul, ORC_BC_orl, ORC_BC_shll, ORC_BC_shrsl, ORC_BC_shrul, ORC_BC_signl, ORC_BC_storel, ORC_BC_subl, /* 130 */ ORC_BC_subssl, ORC_BC_subusl, ORC_BC_xorl, ORC_BC_loadq, ORC_BC_loadpq, ORC_BC_storeq, ORC_BC_splatw3q, ORC_BC_copyq, ORC_BC_cmpeqq, ORC_BC_cmpgtsq, /* 140 */ ORC_BC_andq, ORC_BC_andnq, ORC_BC_orq, ORC_BC_xorq, ORC_BC_addq, ORC_BC_subq, ORC_BC_shlq, ORC_BC_shrsq, ORC_BC_shruq, ORC_BC_convsbw, /* 150 */ ORC_BC_convubw, ORC_BC_splatbw, ORC_BC_splatbl, ORC_BC_convswl, ORC_BC_convuwl, ORC_BC_convslq, ORC_BC_convulq, ORC_BC_convwb, ORC_BC_convhwb, ORC_BC_convssswb, /* 160 */ ORC_BC_convsuswb, ORC_BC_convusswb, ORC_BC_convuuswb, ORC_BC_convlw, ORC_BC_convhlw, ORC_BC_convssslw, ORC_BC_convsuslw, ORC_BC_convusslw, ORC_BC_convuuslw, ORC_BC_convql, /* 170 */ ORC_BC_convsssql, ORC_BC_convsusql, ORC_BC_convussql, ORC_BC_convuusql, ORC_BC_mulsbw, ORC_BC_mulubw, ORC_BC_mulswl, ORC_BC_muluwl, ORC_BC_mulslq, ORC_BC_mululq, /* 180 */ ORC_BC_accw, ORC_BC_accl, ORC_BC_accsadubl, ORC_BC_swapw, ORC_BC_swapl, ORC_BC_swapwl, ORC_BC_swapq, ORC_BC_swaplq, ORC_BC_select0wb, ORC_BC_select1wb, /* 190 */ ORC_BC_select0lw, ORC_BC_select1lw, ORC_BC_select0ql, ORC_BC_select1ql, ORC_BC_mergelq, ORC_BC_mergewl, ORC_BC_mergebw, ORC_BC_splitql, ORC_BC_splitlw, ORC_BC_splitwb, /* 200 */ ORC_BC_addf, ORC_BC_subf, ORC_BC_mulf, ORC_BC_divf, ORC_BC_sqrtf, ORC_BC_maxf, ORC_BC_minf, ORC_BC_cmpeqf, ORC_BC_cmpltf, ORC_BC_cmplef, /* 210 */ ORC_BC_convfl, ORC_BC_convlf, ORC_BC_addd, ORC_BC_subd, ORC_BC_muld, ORC_BC_divd, ORC_BC_sqrtd, ORC_BC_maxd, ORC_BC_mind, ORC_BC_cmpeqd, /* 220 */ ORC_BC_cmpltd, ORC_BC_cmpled, ORC_BC_convdl, ORC_BC_convld, ORC_BC_convfd, ORC_BC_convdf, /* 226 */ ORC_BC_LAST } OrcBytecodes; orc-0.4.18/orc/opcodes.h0000644000175000017500000001315111563547254011715 00000000000000UNARY_SB(absb, "ORC_ABS(%s)") BINARY_SB(addb, "%s + %s") BINARY_SB(addssb, "ORC_CLAMP_SB(%s + %s)") BINARY_UB(addusb, "ORC_CLAMP_UB((orc_uint8)%s + (orc_uint8)%s)") BINARY_SB(andb, "%s & %s") BINARY_SB(andnb, "(~%s) & %s") BINARY_SB(avgsb, "(%s + %s + 1)>>1") BINARY_UB(avgub, "((orc_uint8)%s + (orc_uint8)%s + 1)>>1") BINARY_SB(cmpeqb, "(%s == %s) ? (~0) : 0") BINARY_SB(cmpgtsb, "(%s > %s) ? (~0) : 0") UNARY_SB(copyb, "%s") BINARY_SB(maxsb, "ORC_MAX(%s, %s)") BINARY_UB(maxub, "ORC_MAX((orc_uint8)%s, (orc_uint8)%s)") BINARY_SB(minsb, "ORC_MIN(%s, %s)") BINARY_UB(minub, "ORC_MIN((orc_uint8)%s, (orc_uint8)%s)") BINARY_SB(mullb, "(%s * %s) & 0xff") BINARY_SB(mulhsb, "(%s * %s) >> 8") BINARY_UB(mulhub, "((orc_uint32)(orc_uint8)%s * (orc_uint32)(orc_uint8)%s) >> 8") BINARY_SB(orb, "%s | %s") BINARY_SB(shlb, "%s << %s") BINARY_SB(shrsb, "%s >> %s") BINARY_UB(shrub, "((orc_uint8)%s) >> %s") UNARY_SB(signb, "ORC_CLAMP(%s,-1,1)") BINARY_SB(subb, "%s - %s") BINARY_SB(subssb, "ORC_CLAMP_SB(%s - %s)") BINARY_UB(subusb, "ORC_CLAMP_UB((orc_uint8)%s - (orc_uint8)%s)") BINARY_SB(xorb, "%s ^ %s") UNARY_SW(absw, "ORC_ABS(%s)") BINARY_SW(addw, "%s + %s") BINARY_SW(addssw, "ORC_CLAMP_SW(%s + %s)") BINARY_UW(addusw, "ORC_CLAMP_UW((orc_uint16)%s + (orc_uint16)%s)") BINARY_SW(andw, "%s & %s") BINARY_SW(andnw, "(~%s) & %s") BINARY_SW(avgsw, "(%s + %s + 1)>>1") BINARY_UW(avguw, "((orc_uint16)%s + (orc_uint16)%s + 1)>>1") BINARY_SW(cmpeqw, "(%s == %s) ? (~0) : 0") BINARY_SW(cmpgtsw, "(%s > %s) ? (~0) : 0") UNARY_SW(copyw, "%s") BINARY_SW(maxsw, "ORC_MAX(%s, %s)") BINARY_UW(maxuw, "ORC_MAX((orc_uint16)%s, (orc_uint16)%s)") BINARY_SW(minsw, "ORC_MIN(%s, %s)") BINARY_UW(minuw, "ORC_MIN((orc_uint16)%s, (orc_uint16)%s)") BINARY_SW(mullw, "(%s * %s) & 0xffff") BINARY_SW(mulhsw, "(%s * %s) >> 16") BINARY_UW(mulhuw, "((orc_uint32)((orc_uint16)%s) * (orc_uint32)((orc_uint16)%s)) >> 16") BINARY_SW(orw, "%s | %s") BINARY_SW(shlw, "%s << %s") BINARY_SW(shrsw, "%s >> %s") BINARY_UW(shruw, "((orc_uint16)%s) >> %s") UNARY_SW(signw, "ORC_CLAMP(%s,-1,1)") BINARY_SW(subw, "%s - %s") BINARY_SW(subssw, "ORC_CLAMP_SW(%s - %s)") BINARY_UW(subusw, "ORC_CLAMP_UW((orc_uint16)%s - (orc_uint16)%s)") BINARY_SW(xorw, "%s ^ %s") UNARY_SL(absl, "ORC_ABS(%s)") BINARY_SL(addl, "%s + %s") BINARY_SL(addssl, "ORC_CLAMP_SL((orc_int64)%s + (orc_int64)%s)") BINARY_UL(addusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s + (orc_int64)(orc_uint32)%s)") BINARY_SL(andl, "%s & %s") BINARY_SL(andnl, "(~%s) & %s") BINARY_SL(avgsl, "((orc_int64)%s + (orc_int64)%s + 1)>>1") BINARY_UL(avgul, "((orc_uint64)(orc_uint32)%s + (orc_uint64)(orc_uint32)%s + 1)>>1") BINARY_SL(cmpeql, "(%s == %s) ? (~0) : 0") BINARY_SL(cmpgtsl, "(%s > %s) ? (~0) : 0") UNARY_SL(copyl, "%s") BINARY_SL(maxsl, "ORC_MAX(%s, %s)") BINARY_UL(maxul, "ORC_MAX((orc_uint32)%s, (orc_uint32)%s)") BINARY_SL(minsl, "ORC_MIN(%s, %s)") BINARY_UL(minul, "ORC_MIN((orc_uint32)%s, (orc_uint32)%s)") BINARY_SL(mulll, "(%s * %s) & 0xffffffff") BINARY_SL(mulhsl, "((orc_int64)%s * (orc_int64)%s) >> 32") BINARY_UL(mulhul, "((orc_uint64)(orc_uint32)%s * (orc_uint64)(orc_uint32)%s) >> 32") BINARY_SL(orl, "%s | %s") BINARY_SL(shll, "%s << %s") BINARY_SL(shrsl, "%s >> %s") BINARY_UL(shrul, "((orc_uint32)%s) >> %s") UNARY_SL(signl, "ORC_CLAMP(%s,-1,1)") BINARY_SL(subl, "%s - %s") BINARY_SL(subssl, "ORC_CLAMP_SL((orc_int64)%s - (orc_int64)%s)") BINARY_UL(subusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s - (orc_int64)(orc_uint32)%s)") BINARY_SL(xorl, "%s ^ %s") UNARY_SQ(copyq, "%s") BINARY_SQ(cmpeqq, "(%s == %s) ? (~0) : 0") BINARY_SQ(cmpgtsq, "(%s > %s) ? (~0) : 0") BINARY_SQ(andq, "%s & %s") BINARY_SQ(andnq, "(~%s) & %s") BINARY_SQ(orq, "%s | %s") BINARY_SQ(xorq, "%s ^ %s") BINARY_SQ(addq, "%s + %s") BINARY_SQ(subq, "%s - %s") BINARY_SQ(shlq, "%s << %s") BINARY_SQ(shrsq, "%s >> %s") BINARY_UQ(shruq, "((orc_uint64)%s) >> %s") UNARY_BW(convsbw, "%s") UNARY_BW(convubw, "(orc_uint8)%s") UNARY_WB(convwb, "%s") UNARY_WB(convhwb, "((orc_uint16)%s)>>8") UNARY_WB(convssswb, "ORC_CLAMP_SB(%s)") UNARY_WB(convsuswb, "ORC_CLAMP_UB(%s)") UNARY_WB(convusswb, "ORC_MIN((orc_uint16)%s,ORC_SB_MAX)") UNARY_WB(convuuswb, "ORC_MIN((orc_uint16)%s,ORC_UB_MAX)") UNARY_WL(convswl, "%s") UNARY_WL(convuwl, "(orc_uint16)%s") UNARY_LW(convlw, "%s") UNARY_WB(convhlw, "((orc_uint32)%s)>>16") UNARY_LW(convssslw, "ORC_CLAMP_SW(%s)") UNARY_LW(convsuslw, "ORC_CLAMP_UW(%s)") UNARY_LW(convusslw, "ORC_CLAMP((orc_uint32)%s,0,ORC_SW_MAX)") UNARY_LW(convuuslw, "ORC_CLAMP_UW((orc_uint32)%s)") UNARY_LQ(convslq, "%s") UNARY_LQ(convulq, "(orc_uint32)%s") UNARY_LW(convql, "%s") UNARY_LW(convsssql, "ORC_CLAMP_SL(%s)") UNARY_LW(convsusql, "ORC_CLAMP_UL(%s)") UNARY_LW(convussql, "ORC_CLAMP_SL((orc_uint64)%s)") UNARY_LW(convuusql, "ORC_CLAMP_UL((orc_uint64)%s)") BINARY_BW(mulsbw, "%s * %s") BINARY_BW(mulubw, "((orc_uint8)%s) * ((orc_uint8)%s)") BINARY_WL(mulswl, "%s * %s") BINARY_WL(muluwl, "((orc_uint16)%s) * ((orc_uint16)%s)") BINARY_LQ(mulslq, "((orc_int64)%s) * ((orc_int64)%s)") BINARY_LQ(mululq, "((orc_uint64)((orc_uint32)%s)) * ((orc_uint64)((orc_uint32)%s))") UNARY_UW(swapw, "ORC_SWAP_W(%s)") UNARY_UL(swapl, "ORC_SWAP_L(%s)") UNARY_UQ(swapq, "ORC_SWAP_Q(%s)") BINARY_F(addf, "%s + %s") BINARY_F(subf, "%s - %s") BINARY_F(mulf, "%s * %s") BINARY_F(divf, "%s / %s") UNARY_F(sqrtf, "sqrt(%s)") BINARY_FL(cmpeqf, "(%s == %s) ? (~0) : 0") BINARY_FL(cmpltf, "(%s < %s) ? (~0) : 0") BINARY_FL(cmplef, "(%s <= %s) ? (~0) : 0") BINARY_D(addd, "%s + %s") BINARY_D(subd, "%s - %s") BINARY_D(muld, "%s * %s") BINARY_D(divd, "%s / %s") UNARY_D(sqrtd, "sqrt(%s)") BINARY_DQ(cmpeqd, "(%s == %s) ? ORC_UINT64_C(~0) : 0") BINARY_DQ(cmpltd, "(%s < %s) ? ORC_UINT64_C(~0) : 0") BINARY_DQ(cmpled, "(%s <= %s) ? ORC_UINT64_C(~0) : 0") orc-0.4.18/orc/orcprogram-arm.c0000664000175000017500000003332612071634360013202 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #define SIZE 65536 void orc_arm_emit_loop (OrcCompiler *compiler); void orc_compiler_orc_arm_register_rules (OrcTarget *target); void orc_compiler_orc_arm_init (OrcCompiler *compiler); unsigned int orc_compiler_orc_arm_get_default_flags (void); void orc_compiler_orc_arm_assemble (OrcCompiler *compiler); void orc_compiler_rewrite_vars (OrcCompiler *compiler); void orc_compiler_dump (OrcCompiler *compiler); void arm_add_strides (OrcCompiler *compiler); void orc_arm_emit_prologue (OrcCompiler *compiler) { unsigned int regs = 0; int i; orc_compiler_append_code(compiler,".global %s\n", compiler->program->name); orc_compiler_append_code(compiler,"%s:\n", compiler->program->name); for(i=0;i<16;i++){ if (compiler->used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) { regs |= (1<used_regs[ORC_GP_REG_BASE + i] && compiler->save_regs[ORC_GP_REG_BASE + i]) { regs |= (1<valid_regs[i] = 1; } //compiler->valid_regs[ORC_ARM_SB] = 0; compiler->valid_regs[ORC_ARM_IP] = 0; compiler->valid_regs[ORC_ARM_SP] = 0; compiler->valid_regs[ORC_ARM_LR] = 0; compiler->valid_regs[ORC_ARM_PC] = 0; for(i=4;i<11;i++) { compiler->save_regs[ORC_GP_REG_BASE+i] = 1; } for(i=0;ialloc_regs[i] = 0; compiler->used_regs[i] = 0; } compiler->exec_reg = ORC_ARM_A1; compiler->valid_regs[compiler->exec_reg] = 0; compiler->gp_tmpreg = ORC_ARM_A2; compiler->valid_regs[compiler->gp_tmpreg] = 0; compiler->tmpreg = ORC_ARM_A3; compiler->valid_regs[compiler->tmpreg] = 0; compiler->loop_shift = 0; } void orc_arm_load_constants_outer (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: //orc_arm_emit_load_imm (compiler, compiler->vars[i].alloc, // (int)compiler->vars[i].value); break; case ORC_VAR_TYPE_PARAM: ORC_PROGRAM_ERROR(compiler,"unimplemented"); return; /* FIXME offset is too large */ //orc_arm_loadw (compiler, compiler->vars[i].alloc, // compiler->exec_reg, // (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i])); break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: break; default: break; } } for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; OrcRule *rule; if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", i, insn->opcode->name); rule = insn->rule; if (rule && rule->emit) { rule->emit (compiler, rule->emit_user, insn); } else { ORC_COMPILER_ERROR(compiler,"No rule for: %s", opcode->name); } } } void orc_arm_load_constants_inner (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_arm_emit_load_reg (compiler, compiler->vars[i].ptr_register, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); break; default: break; } } } #if 0 void orc_arm_emit_load_src (OrcCompiler *compiler, OrcVariable *var) { int ptr_reg; if (var->ptr_register == 0) { int i; i = var - compiler->vars; //orc_arm_emit_mov_memoffset_reg (compiler, orc_arm_ptr_size, // (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), // compiler->exec_reg, X86_ECX); ptr_reg = ORC_ARM_PC; } else { ptr_reg = var->ptr_register; } switch (var->size << compiler->loop_shift) { case 1: orc_arm_loadb (compiler, var->alloc, ptr_reg, 0); //orc_arm_emit_mov_memoffset_reg (compiler, 1, 0, ptr_reg, X86_ECX); //orc_arm_emit_mov_reg_arm (compiler, X86_ECX, var->alloc); break; case 2: orc_arm_loadw (compiler, var->alloc, ptr_reg, 0); //orc_arm_emit_mov_memoffset_reg (compiler, 2, 0, ptr_reg, X86_ECX); //orc_arm_emit_mov_reg_arm (compiler, X86_ECX, var->alloc); break; case 4: orc_arm_loadl (compiler, var->alloc, ptr_reg, 0); //orc_arm_emit_mov_memoffset_arm (compiler, 4, 0, ptr_reg, var->alloc); break; //case 8: //orc_arm_emit_mov_memoffset_arm (compiler, 8, 0, ptr_reg, var->alloc); break; //case 16: //orc_arm_emit_mov_memoffset_arm (compiler, 16, 0, ptr_reg, var->alloc); break; default: ORC_COMPILER_ERROR(compiler, "bad size %d", var->size << compiler->loop_shift); } } void orc_arm_emit_store_dest (OrcCompiler *compiler, OrcVariable *var) { int ptr_reg; if (var->ptr_register == 0) { //orc_arm_emit_mov_memoffset_reg (compiler, orc_arm_ptr_size, // var->ptr_offset, compiler->exec_reg, X86_ECX); ptr_reg = ORC_ARM_PC; } else { ptr_reg = var->ptr_register; } switch (var->size << compiler->loop_shift) { case 1: orc_arm_storeb (compiler, ptr_reg, 0, var->alloc); //orc_arm_emit_mov_orc_arm_reg (compiler, var->alloc, X86_ECX); //orc_arm_emit_mov_reg_memoffset (compiler, 1, X86_ECX, 0, ptr_reg); break; case 2: orc_arm_storew (compiler, ptr_reg, 0, var->alloc); //orc_arm_emit_mov_orc_arm_reg (compiler, var->alloc, X86_ECX); //orc_arm_emit_mov_reg_memoffset (compiler, 2, X86_ECX, 0, ptr_reg); break; case 4: orc_arm_storel (compiler, ptr_reg, 0, var->alloc); //orc_arm_emit_mov_orc_arm_memoffset (compiler, 4, var->alloc, 0, ptr_reg, // var->is_aligned, var->is_uncached); break; case 8: //orc_arm_emit_mov_orc_arm_memoffset (compiler, 8, var->alloc, 0, ptr_reg, // var->is_aligned, var->is_uncached); break; case 16: //orc_arm_emit_mov_orc_arm_memoffset (compiler, 16, var->alloc, 0, ptr_reg, // var->is_aligned, var->is_uncached); break; default: ORC_COMPILER_ERROR(compiler, "bad size %d", var->size << compiler->loop_shift); } } #endif void orc_compiler_orc_arm_assemble (OrcCompiler *compiler) { int dest_var = ORC_VAR_D1; compiler->vars[dest_var].is_aligned = FALSE; orc_arm_emit_prologue (compiler); orc_arm_load_constants_outer (compiler); if (compiler->program->is_2d) { if (compiler->program->constant_m > 0) { orc_arm_emit_load_imm (compiler, ORC_ARM_A3, compiler->program->constant_m ); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2])); } else { orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A1])); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2])); } orc_arm_emit_label (compiler, 8); } orc_arm_emit_load_reg (compiler, ORC_ARM_IP, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,n)); orc_arm_load_constants_inner (compiler); orc_arm_emit_label (compiler, 1); orc_arm_emit_cmp_i (compiler, ORC_ARM_COND_AL, ORC_ARM_IP, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_EQ, 3); orc_arm_emit_label (compiler, 2); orc_arm_emit_loop (compiler); orc_arm_emit_sub_i (compiler, ORC_ARM_COND_AL, 0, ORC_ARM_IP, ORC_ARM_IP, 1); orc_arm_emit_cmp_i (compiler, ORC_ARM_COND_AL, ORC_ARM_IP, 0); orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, 2); orc_arm_emit_label (compiler, 3); if (compiler->program->is_2d) { arm_add_strides (compiler); orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A2])); orc_arm_emit_sub_imm (compiler, ORC_ARM_A3, ORC_ARM_A3, 1, TRUE); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2])); orc_arm_emit_branch (compiler, ORC_ARM_COND_NE, 8); } orc_arm_emit_epilogue (compiler); orc_arm_do_fixups (compiler); } void orc_arm_emit_loop (OrcCompiler *compiler) { int j; int k; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; if (insn->flags & ORC_INSN_FLAG_INVARIANT) continue; orc_compiler_append_code(compiler,"# %d: %s", j, insn->opcode->name); /* set up args */ #if 0 for(k=0;kn_src + opcode->n_dest;k++){ args[k] = compiler->vars + insn->args[k]; orc_compiler_append_code(compiler," %d", args[k]->alloc); if (args[k]->is_chained) { orc_compiler_append_code(compiler," (chained)"); } } #endif orc_compiler_append_code(compiler,"\n"); for(k=0;ksrc_size[k] == 0) continue; switch (compiler->vars[insn->src_args[k]].vartype) { case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: //orc_arm_emit_load_src (compiler, &compiler->vars[insn->src_args[k]]); break; case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_TEMP: break; default: break; } } rule = insn->rule; if (rule && rule->emit) { int src = ORC_SRC_ARG (compiler, insn, 0); int dest = ORC_DEST_ARG (compiler, insn, 0); if (dest != src) { orc_arm_emit_mov_r (compiler, ORC_ARM_COND_AL, 0, dest, src); } rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_append_code(compiler,"No rule for: %s\n", opcode->name); } for(k=0;kdest_size[k] == 0) continue; switch (compiler->vars[insn->dest_args[k]].vartype) { case ORC_VAR_TYPE_DEST: //orc_arm_emit_store_dest (compiler, &compiler->vars[insn->dest_args[k]]); break; case ORC_VAR_TYPE_TEMP: break; default: break; } } } for(k=0;kvars[k].name == NULL) continue; if (compiler->vars[k].vartype == ORC_VAR_TYPE_SRC || compiler->vars[k].vartype == ORC_VAR_TYPE_DEST) { if (compiler->vars[k].ptr_register) { orc_arm_emit_add_i (compiler, ORC_ARM_COND_AL, 0, compiler->vars[k].ptr_register, compiler->vars[k].ptr_register, compiler->vars[k].size << compiler->loop_shift); } else { //orc_arm_emit_add_imm_memoffset (compiler, orc_arm_ptr_size, // compiler->vars[k].size << compiler->loop_shift, // (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]), // compiler->exec_reg); } } } } void arm_add_strides (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_arm_emit_load_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); orc_arm_emit_load_reg (compiler, ORC_ARM_A2, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i])); orc_arm_emit_add (compiler, ORC_ARM_A3, ORC_ARM_A3, ORC_ARM_A2); orc_arm_emit_store_reg (compiler, ORC_ARM_A3, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: ORC_COMPILER_ERROR(compiler,"bad vartype"); break; } } } orc-0.4.18/orc/orc.c0000664000175000017500000000243112111024531011012 00000000000000 #include "config.h" #include #include #include #include #include #include #include "orcinternal.h" /** * SECTION:orc * @title: Orc * @short_description: Library Initialization */ void _orc_debug_init(void); void _orc_once_init(void); void _orc_compiler_init(void); /** * orc_init: * * This function initializes the Orc library, and * should be called before using any other Orc function. * Subsequent calls to this function have no effect. */ void orc_init (void) { static volatile int inited = FALSE; if (!inited) { orc_global_mutex_lock (); if (!inited) { ORC_ASSERT(sizeof(OrcExecutor) == sizeof(OrcExecutorAlt)); _orc_debug_init(); _orc_compiler_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 #ifdef ENABLE_BACKEND_MIPS orc_mips_init(); #endif inited = TRUE; } orc_global_mutex_unlock (); } } orc-0.4.18/orc/orccompiler.h0000664000175000017500000000726312111024531012562 00000000000000 #ifndef _ORC_COMPILER_H_ #define _ORC_COMPILER_H_ #include #include #include #include #include #include #include #include ORC_BEGIN_DECLS typedef struct _OrcFixup OrcFixup; #define ORC_ENABLE_ASM_CODE #ifdef ORC_ENABLE_ASM_CODE #define ORC_ASM_CODE(compiler,...) orc_compiler_append_code(compiler, __VA_ARGS__) #else #define ORC_ASM_CODE(compiler,...) #endif #define ORC_COMPILER_ERROR(compiler, ...) do { \ compiler->error = TRUE; \ compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; \ orc_debug_print(ORC_DEBUG_WARNING, __FILE__, ORC_FUNCTION, __LINE__, __VA_ARGS__); \ } while (0) #if 0 /* FIXME in orcutils.h since it's needed in orccode.h */ typedef enum { ORC_COMPILE_RESULT_OK = 0, ORC_COMPILE_RESULT_UNKNOWN_COMPILE = 0x100, ORC_COMPILE_RESULT_MISSING_RULE = 0x101, ORC_COMPILE_RESULT_UNKNOWN_PARSE = 0x200, ORC_COMPILE_RESULT_PARSE = 0x201, ORC_COMPILE_RESULT_VARIABLE = 0x202 } OrcCompileResult; #endif #define ORC_COMPILE_RESULT_IS_SUCCESSFUL(x) ((x) < 0x100) #define ORC_COMPILE_RESULT_IS_FATAL(x) ((x) >= 0x200) /** * OrcFixup: * * The OrcFixup structure has no public members */ struct _OrcFixup { /*< private >*/ unsigned char *ptr; int type; int label; }; /** * OrcCompiler: * * The OrcCompiler structure has no public members */ struct _OrcCompiler { /*< private >*/ OrcProgram *program; OrcTarget *target; unsigned int target_flags; OrcInstruction insns[ORC_N_INSNS]; int n_insns; OrcVariable vars[ORC_N_COMPILER_VARIABLES]; int n_temp_vars; int n_dup_vars; unsigned char *code; unsigned char *codeptr; OrcConstant constants[ORC_N_CONSTANTS]; int n_constants; OrcFixup fixups[ORC_N_FIXUPS]; int n_fixups; unsigned char *labels[ORC_N_LABELS]; int labels_int[ORC_N_LABELS]; int n_labels; int error; char *error_msg; OrcCompileResult result; int valid_regs[ORC_N_REGS]; int save_regs[ORC_N_REGS]; int used_regs[ORC_N_REGS]; int alloc_regs[ORC_N_REGS]; int loop_shift; int long_jumps; int use_frame_pointer; char *asm_code; int asm_code_len; int is_64bit; int tmpreg; int tmpreg2; int exec_reg; int gp_tmpreg; int insn_index; int unroll_index; int need_mask_regs; int unroll_shift; int alloc_loop_counter; int allow_gp_on_stack; int loop_counter; int size_region; int has_iterator_opcode; int offset; int min_temp_reg; int max_used_temp_reg; int insn_shift; /* used when emitting rules */ int max_var_size; /* size of largest var */ int load_params; void *output_insns; int n_output_insns; int n_output_insns_alloc; }; int orc_compiler_label_new (OrcCompiler *compiler); int orc_compiler_get_constant (OrcCompiler *compiler, int size, int value); int orc_compiler_get_constant_long (OrcCompiler *compiler, orc_uint32 a, orc_uint32 b, orc_uint32 c, orc_uint32 d); int orc_compiler_try_get_constant_long (OrcCompiler *compiler, orc_uint32 a, orc_uint32 b, orc_uint32 c, orc_uint32 d); int orc_compiler_get_temp_constant (OrcCompiler *compiler, int size, int value); int orc_compiler_get_temp_reg (OrcCompiler *compiler); int orc_compiler_get_constant_reg (OrcCompiler *compiler); void orc_compiler_error (OrcCompiler *compiler, const char *fmt, ...); void orc_compiler_append_code (OrcCompiler *p, const char *fmt, ...) ORC_GNU_PRINTF(2,3); #ifdef ORC_ENABLE_UNSTABLE_API int orc_compiler_flag_check (const char *flag); extern int _orc_compiler_flag_backup; extern int _orc_compiler_flag_emulate; extern int _orc_compiler_flag_debug; extern int _orc_compiler_flag_randomize; #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcrules-neon.c0000664000175000017500000026153412071634360013051 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include void orc_neon_emit_loadiq (OrcCompiler *compiler, int dest, int param); void orc_neon_emit_loadpq (OrcCompiler *compiler, int dest, int param); static const orc_uint32 orc_neon_constants[][4] = { { 0x03030303, 0x07070707, 0x0b0b0b0b, 0x0f0f0f0f }, }; const char *orc_neon_reg_name (int reg) { static const char *vec_regs[] = { "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15", "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31", }; if (reg < ORC_VEC_REG_BASE || reg >= ORC_VEC_REG_BASE+32) { return "ERROR"; } return vec_regs[reg&0x1f]; } const char *orc_neon_reg_name_quad (int reg) { static const char *vec_regs[] = { "q0", "ERROR", "q1", "ERROR", "q2", "ERROR", "q3", "ERROR", "q4", "ERROR", "q5", "ERROR", "q6", "ERROR", "q7", "ERROR", "q8", "ERROR", "q9", "ERROR", "q10", "ERROR", "q11", "ERROR", "q12", "ERROR", "q13", "ERROR", "q14", "ERROR", "q15", "ERROR", }; if (reg < ORC_VEC_REG_BASE || reg >= ORC_VEC_REG_BASE+32) { return "ERROR"; } return vec_regs[reg&0x1f]; } static void orc_neon_emit_binary (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1, int src2) { ORC_ASSERT((code & 0x004ff0af) == 0); ORC_ASM_CODE(p," %s %s, %s, %s\n", name, orc_neon_reg_name (dest), orc_neon_reg_name (src1), orc_neon_reg_name (src2)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<16; code |= ((src1>>4)&0x1)<<7; code |= (src2&0xf)<<0; code |= ((src2>>4)&0x1)<<5; orc_arm_emit (p, code); } #define NEON_BINARY(code,a,b,c) \ ((code) | \ (((a)&0xf)<<12) | \ ((((a)>>4)&0x1)<<22) | \ (((b)&0xf)<<16) | \ ((((b)>>4)&0x1)<<7) | \ (((c)&0xf)<<0) | \ ((((c)>>4)&0x1)<<5)) static void orc_neon_emit_binary_long (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1, int src2) { ORC_ASSERT((code & 0x004ff0af) == 0); ORC_ASM_CODE(p," %s %s, %s, %s\n", name, orc_neon_reg_name_quad (dest), orc_neon_reg_name (src1), orc_neon_reg_name (src2)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<16; code |= ((src1>>4)&0x1)<<7; code |= (src2&0xf)<<0; code |= ((src2>>4)&0x1)<<5; orc_arm_emit (p, code); } #if 0 static void orc_neon_emit_binary_narrow (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1, int src2) { ORC_ASSERT((code & 0x004ff0af) == 0); ORC_ASM_CODE(p," %s %s, %s, %s\n", name, orc_neon_reg_name (dest), orc_neon_reg_name_quad (src1), orc_neon_reg_name_quad (src2)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<16; code |= ((src1>>4)&0x1)<<7; code |= (src2&0xf)<<0; code |= ((src2>>4)&0x1)<<5; orc_arm_emit (p, code); } #endif static void orc_neon_emit_binary_quad (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1, int src2) { ORC_ASSERT((code & 0x004ff0af) == 0); ORC_ASM_CODE(p," %s %s, %s, %s\n", name, orc_neon_reg_name_quad (dest), orc_neon_reg_name_quad (src1), orc_neon_reg_name_quad (src2)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<16; code |= ((src1>>4)&0x1)<<7; code |= (src2&0xf)<<0; code |= ((src2>>4)&0x1)<<5; code |= 0x40; orc_arm_emit (p, code); } static void orc_neon_emit_unary (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1) { ORC_ASSERT((code & 0x0040f02f) == 0); ORC_ASM_CODE(p," %s %s, %s\n", name, orc_neon_reg_name (dest), orc_neon_reg_name (src1)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<0; code |= ((src1>>4)&0x1)<<5; orc_arm_emit (p, code); } static void orc_neon_emit_unary_long (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1) { ORC_ASSERT((code & 0x0040f02f) == 0); ORC_ASM_CODE(p," %s %s, %s\n", name, orc_neon_reg_name_quad (dest), orc_neon_reg_name (src1)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<0; code |= ((src1>>4)&0x1)<<5; orc_arm_emit (p, code); } static void orc_neon_emit_unary_narrow (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1) { ORC_ASSERT((code & 0x0040f02f) == 0); ORC_ASM_CODE(p," %s %s, %s\n", name, orc_neon_reg_name (dest), orc_neon_reg_name_quad (src1)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<0; code |= ((src1>>4)&0x1)<<5; orc_arm_emit (p, code); } static void orc_neon_emit_unary_quad (OrcCompiler *p, const char *name, unsigned int code, int dest, int src1) { ORC_ASSERT((code & 0x0040f02f) == 0); ORC_ASM_CODE(p," %s %s, %s\n", name, orc_neon_reg_name_quad (dest), orc_neon_reg_name_quad (src1)); code |= (dest&0xf)<<12; code |= ((dest>>4)&0x1)<<22; code |= (src1&0xf)<<0; code |= ((src1>>4)&0x1)<<5; code |= 0x40; orc_arm_emit (p, code); } void orc_neon_emit_mov (OrcCompiler *compiler, int dest, int src) { orc_neon_emit_binary (compiler, "vorr", 0xf2200110, dest, src, src); } void orc_neon_emit_mov_quad (OrcCompiler *compiler, int dest, int src) { orc_neon_emit_binary_quad (compiler, "vorr", 0xf2200110, dest, src, src); } void orc_neon_preload (OrcCompiler *compiler, OrcVariable *var, int write, int offset) { orc_uint32 code; /* Don't use multiprocessing extensions */ write = FALSE; ORC_ASM_CODE(compiler," pld%s [%s, #%d]\n", write ? "w" : "", orc_arm_reg_name (var->ptr_register), offset); code = 0xf510f000; if (!write) code |= (1<<22); code |= (var->ptr_register&0xf) << 16; if (offset < 0) { code |= ((-offset)&0xfff) << 0; } else { code |= (offset&0xfff) << 0; code |= (1<<23); } orc_arm_emit (compiler, code); } #if 0 void orc_neon_load_halfvec_aligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.32 %s[0], [%s]%s\n", orc_neon_reg_name (var->alloc), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf4a0080d; code |= (var->ptr_register&0xf) << 16; code |= (var->alloc&0xf) << 12; code |= ((var->alloc>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_load_vec_aligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.64 %s, [%s]%s\n", orc_neon_reg_name (var->alloc), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf42007cd; code |= (var->ptr_register&0xf) << 16; code |= (var->alloc&0xf) << 12; code |= ((var->alloc>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_load_vec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.8 %s, [%s]%s\n", orc_neon_reg_name (var->alloc), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf420070d; code |= (var->ptr_register&0xf) << 16; code |= ((var->alloc)&0xf) << 12; code |= (((var->alloc)>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); #if 0 /* used with need_mask_regs */ ORC_ASM_CODE(compiler," vld1.64 %s, [%s]%s\n", orc_neon_reg_name (var->aligned_data + 1), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf42007cd; code |= (var->ptr_register&0xf) << 16; code |= ((var->aligned_data+1)&0xf) << 12; code |= (((var->aligned_data+1)>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); ORC_ASM_CODE(compiler," vtbl.8 %s, {%s,%s}, %s\n", orc_neon_reg_name (var->alloc), orc_neon_reg_name (var->aligned_data), orc_neon_reg_name (var->aligned_data+1), orc_neon_reg_name (var->mask_alloc)); code = NEON_BINARY(0xf3b00900, var->alloc, var->aligned_data, var->mask_alloc); orc_arm_emit (compiler, code); //orc_neon_emit_mov (compiler, var->alloc, var->mask_alloc); orc_neon_emit_mov (compiler, var->aligned_data, var->aligned_data + 1); #endif } void orc_neon_load_halfvec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.8 %s, [%s]\n", orc_neon_reg_name (var->alloc), orc_arm_reg_name (var->ptr_register)); code = 0xf420070d; code |= (var->ptr_register&0xf) << 16; code |= ((var->alloc)&0xf) << 12; code |= (((var->alloc)>>4)&0x1) << 22; //code |= (!update) << 1; code |= (1) << 1; orc_arm_emit (compiler, code); if (update) { orc_arm_emit_add_imm (compiler, var->ptr_register, var->ptr_register, 4); } #if 0 /* used with need_mask_regs */ ORC_ASM_CODE(compiler," vld1.32 %s[1], [%s]%s\n", orc_neon_reg_name (var->aligned_data), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf4a0088d; code |= (var->ptr_register&0xf) << 16; code |= ((var->aligned_data)&0xf) << 12; code |= (((var->aligned_data)>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); ORC_ASM_CODE(compiler," vtbl.8 %s, {%s,%s}, %s\n", orc_neon_reg_name (var->alloc), orc_neon_reg_name (var->aligned_data), orc_neon_reg_name (var->aligned_data + 1), orc_neon_reg_name (var->mask_alloc)); code = NEON_BINARY(0xf3b00900, var->alloc, var->aligned_data, var->mask_alloc); orc_arm_emit (compiler, code); orc_neon_emit_unary (compiler, "vrev64.i32", 0xf3b80000, var->aligned_data, var->aligned_data); #endif } void orc_neon_load_fourvec_aligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.64 { %s, %s, %s, %s }, [%s,:256]%s\n", orc_neon_reg_name (var->alloc), orc_neon_reg_name (var->alloc + 1), orc_neon_reg_name (var->alloc + 2), orc_neon_reg_name (var->alloc + 3), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf42002dd; code |= (var->ptr_register&0xf) << 16; code |= (var->alloc&0xf) << 12; code |= ((var->alloc>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_load_fourvec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.8 { %s, %s, %s, %s }, [%s]%s\n", orc_neon_reg_name (var->alloc), orc_neon_reg_name (var->alloc + 1), orc_neon_reg_name (var->alloc + 2), orc_neon_reg_name (var->alloc + 3), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf420020d; code |= (var->ptr_register&0xf) << 16; code |= ((var->alloc)&0xf) << 12; code |= (((var->alloc)>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_load_twovec_aligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.64 { %s, %s }, [%s,:128]%s\n", orc_neon_reg_name (var->alloc), orc_neon_reg_name (var->alloc + 1), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf4200aed; code |= (var->ptr_register&0xf) << 16; code |= (var->alloc&0xf) << 12; code |= ((var->alloc>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_load_twovec_unaligned (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.8 { %s, %s }, [%s]%s\n", orc_neon_reg_name (var->alloc), orc_neon_reg_name (var->alloc + 1), orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = 0xf4200a0d; code |= (var->ptr_register&0xf) << 16; code |= ((var->alloc)&0xf) << 12; code |= (((var->alloc)>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_loadb (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; int i; if (var->is_aligned && compiler->insn_shift == 5) { orc_neon_load_fourvec_aligned (compiler, var, update); } else if (var->is_aligned && compiler->insn_shift == 4) { orc_neon_load_twovec_aligned (compiler, var, update); } else if (var->is_aligned && compiler->insn_shift == 3) { orc_neon_load_vec_aligned (compiler, var, update); } else if (var->is_aligned && compiler->insn_shift == 2) { orc_neon_load_halfvec_aligned (compiler, var, update); } else if (compiler->insn_shift == 5) { orc_neon_load_fourvec_unaligned (compiler, var, update); } else if (compiler->insn_shift == 4) { orc_neon_load_twovec_unaligned (compiler, var, update); } else if (compiler->insn_shift == 3) { orc_neon_load_vec_unaligned (compiler, var, update); } else if (compiler->insn_shift == 2) { orc_neon_load_halfvec_unaligned (compiler, var, update); } else { if (compiler->insn_shift > 1) { ORC_ERROR("slow load"); } for(i=0;i<(1<insn_shift);i++){ ORC_ASM_CODE(compiler," vld1.8 %s[%d], [%s]%s\n", orc_neon_reg_name (var->alloc + (i>>3)), i&7, orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = NEON_BINARY(0xf4a0000d, var->alloc + (i>>3), var->ptr_register, 0); code |= (i&7) << 5; code |= (!update) << 1; orc_arm_emit (compiler, code); } } } void orc_neon_loadw (OrcCompiler *compiler, OrcVariable *var, int update) { if (var->is_aligned && compiler->insn_shift == 3) { orc_neon_load_twovec_aligned (compiler, var, update); } else if (var->is_aligned && compiler->insn_shift == 2) { orc_neon_load_vec_aligned (compiler, var, update); } else if (var->is_aligned && compiler->insn_shift == 1) { orc_neon_load_halfvec_aligned (compiler, var, update); } else if (compiler->insn_shift == 3) { orc_neon_load_twovec_unaligned (compiler, var, update); } else if (compiler->insn_shift == 2) { orc_neon_load_vec_unaligned (compiler, var, update); } else if (compiler->insn_shift == 1) { orc_neon_load_halfvec_unaligned (compiler, var, update); } else { orc_uint32 code; int i; if (compiler->insn_shift == 2) { orc_neon_load_vec_aligned (compiler, var, update); return; } else if (compiler->insn_shift == 1) { orc_neon_load_halfvec_aligned (compiler, var, update); return; } if (compiler->insn_shift > 1) { ORC_ERROR("slow load"); } for(i=0;i<(1<insn_shift);i++){ ORC_ASM_CODE(compiler," vld1.16 %s[%d], [%s]%s\n", orc_neon_reg_name (var->alloc + (i>>2)), i&3, orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = NEON_BINARY(0xf4a0040d, var->alloc + (i>>2), var->ptr_register, 0); code |= (i&3) << 6; code |= (!update) << 1; orc_arm_emit (compiler, code); } } } void orc_neon_loadl (OrcCompiler *compiler, OrcVariable *var, int update) { orc_uint32 code; int i; if (var->is_aligned && compiler->insn_shift == 2) { orc_neon_load_twovec_aligned (compiler, var, update); } else if (var->is_aligned && compiler->insn_shift == 1) { orc_neon_load_vec_aligned (compiler, var, update); } else if (compiler->insn_shift == 2) { orc_neon_load_twovec_unaligned (compiler, var, update); } else if (compiler->insn_shift == 1) { orc_neon_load_vec_unaligned (compiler, var, update); } else { if (compiler->insn_shift > 0) { //ORC_ERROR("slow load"); } for(i=0;i<(1<insn_shift);i++){ ORC_ASM_CODE(compiler," vld1.32 %s[%d], [%s]%s\n", orc_neon_reg_name (var->alloc + (i>>1)), i & 1, orc_arm_reg_name (var->ptr_register), update ? "!" : ""); code = NEON_BINARY(0xf4a0080d, var->alloc + (i>>1), var->ptr_register, 0); code |= (i&1)<<7; code |= (!update) << 1; orc_arm_emit (compiler, code); } } } void orc_neon_loadq (OrcCompiler *compiler, int dest, int src1, int update, int is_aligned) { orc_uint32 code; ORC_ASM_CODE(compiler," vld1.64 %s, [%s]%s\n", orc_neon_reg_name (dest), orc_arm_reg_name (src1), update ? "!" : ""); code = 0xf42007cd; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= ((dest>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } void orc_neon_storeb (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned) { orc_uint32 code; int i; if (is_aligned && compiler->insn_shift == 5) { ORC_ASM_CODE(compiler," vst1.8 { %s, %s, %s, %s }, [%s,:256]%s\n", orc_neon_reg_name (src1), orc_neon_reg_name (src1+1), orc_neon_reg_name (src1+2), orc_neon_reg_name (src1+3), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf400023d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else if (compiler->insn_shift == 5) { ORC_ASM_CODE(compiler," vst1.8 { %s, %s, %s, %s }, [%s]%s\n", orc_neon_reg_name (src1), orc_neon_reg_name (src1+1), orc_neon_reg_name (src1+2), orc_neon_reg_name (src1+3), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf400020d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else if (is_aligned && compiler->insn_shift == 4) { ORC_ASM_CODE(compiler," vst1.8 { %s, %s }, [%s,:128]%s\n", orc_neon_reg_name (src1), orc_neon_reg_name (src1+1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf4000a2d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else if (compiler->insn_shift == 4) { ORC_ASM_CODE(compiler," vst1.8 { %s, %s }, [%s]%s\n", orc_neon_reg_name (src1), orc_neon_reg_name (src1+1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf4000a0d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else if (is_aligned && compiler->insn_shift == 3) { ORC_ASM_CODE(compiler," vst1.8 %s, [%s,:64]%s\n", orc_neon_reg_name (src1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf400071d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else { for(i=0;i<(1<insn_shift);i++){ ORC_ASM_CODE(compiler," vst1.8 %s[%d], [%s]%s\n", orc_neon_reg_name (src1 + (i>>3)), i&7, orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf480000d; code |= (dest&0xf) << 16; code |= ((src1 + (i>>3))&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (i&7)<<5; code |= (!update) << 1; orc_arm_emit (compiler, code); } } } void orc_neon_storew (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned) { orc_uint32 code; int i; if (is_aligned && compiler->insn_shift == 3) { ORC_ASM_CODE(compiler," vst1.16 { %s, %s }, [%s,:128]%s\n", orc_neon_reg_name (src1), orc_neon_reg_name (src1 + 1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf4000a6d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else if (is_aligned && compiler->insn_shift == 2) { ORC_ASM_CODE(compiler," vst1.16 %s, [%s,:64]%s\n", orc_neon_reg_name (src1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf400075d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else { for(i=0;i<(1<insn_shift);i++){ ORC_ASM_CODE(compiler," vst1.16 %s[%d], [%s]%s\n", orc_neon_reg_name (src1 + (i>>2)), i&3, orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf480040d; code |= (dest&0xf) << 16; code |= ((src1 + (i>>2))&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (i&3)<<6; code |= (!update) << 1; orc_arm_emit (compiler, code); } } } void orc_neon_storel (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned) { orc_uint32 code; int i; if (is_aligned && compiler->insn_shift == 2) { ORC_ASM_CODE(compiler," vst1.32 { %s, %s }, [%s,:128]%s\n", orc_neon_reg_name (src1), orc_neon_reg_name (src1 + 1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf4000aad; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else if (is_aligned && compiler->insn_shift == 1) { ORC_ASM_CODE(compiler," vst1.32 %s, [%s,:64]%s\n", orc_neon_reg_name (src1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf400079d; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } else { for(i=0;i<(1<insn_shift);i++){ ORC_ASM_CODE(compiler," vst1.32 %s[%d], [%s]%s\n", orc_neon_reg_name (src1 + (i>>1)), i&1, orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf480080d; code |= (dest&0xf) << 16; code |= ((src1 + (i>>1))&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (i&1)<<7; code |= (!update) << 1; orc_arm_emit (compiler, code); } } } void orc_neon_storeq (OrcCompiler *compiler, int dest, int update, int src1, int is_aligned) { orc_uint32 code; ORC_ASM_CODE(compiler," vst1.64 %s, [%s]%s\n", orc_neon_reg_name (src1), orc_arm_reg_name (dest), update ? "!" : ""); code = 0xf40007cd; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= ((src1>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } #endif static void neon_rule_loadpX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int size = ORC_PTR_TO_INT (user); if (src->vartype == ORC_VAR_TYPE_CONST) { if (size == 1) { orc_neon_emit_loadib (compiler, dest->alloc, src->value.i); } else if (size == 2) { orc_neon_emit_loadiw (compiler, dest->alloc, src->value.i); } else if (size == 4) { orc_neon_emit_loadil (compiler, dest->alloc, src->value.i); } else if (size == 8) { if (src->size == 8) { ORC_COMPILER_ERROR(compiler,"64-bit constants not implemented"); } orc_neon_emit_loadiq (compiler, dest->alloc, src->value.i); } else { ORC_PROGRAM_ERROR(compiler,"unimplemented"); } } else { if (size == 1) { orc_neon_emit_loadpb (compiler, dest->alloc, insn->src_args[0]); } else if (size == 2) { orc_neon_emit_loadpw (compiler, dest->alloc, insn->src_args[0]); } else if (size == 4) { orc_neon_emit_loadpl (compiler, dest->alloc, insn->src_args[0]); } else if (size == 8) { if (src->size == 8) { ORC_COMPILER_ERROR(compiler,"64-bit parameters not implemented"); } orc_neon_emit_loadpq (compiler, dest->alloc, insn->src_args[0]); } else { ORC_PROGRAM_ERROR(compiler,"unimplemented"); } } } static void neon_rule_loadX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int update = FALSE; unsigned int code = 0; int size = src->size << compiler->insn_shift; int type = ORC_PTR_TO_INT(user); int ptr_register; int is_aligned = src->is_aligned; /* FIXME this should be fixed at a higher level */ if (src->vartype != ORC_VAR_TYPE_SRC && src->vartype != ORC_VAR_TYPE_DEST) { ORC_COMPILER_ERROR(compiler, "loadX used with non src/dest"); return; } if (src->vartype == ORC_VAR_TYPE_DEST) update = FALSE; if (type == 1) { if (compiler->vars[insn->src_args[1]].vartype != ORC_VAR_TYPE_CONST) { ORC_PROGRAM_ERROR(compiler,"unimplemented"); return; } ptr_register = compiler->gp_tmpreg; orc_arm_emit_add_imm (compiler, ptr_register, src->ptr_register, compiler->vars[insn->src_args[1]].value.i * src->size); update = FALSE; is_aligned = FALSE; } else { ptr_register = src->ptr_register; } if (size >= 8) { if (is_aligned) { if (size == 32) { ORC_ASM_CODE(compiler," vld1.64 { %s, %s, %s, %s }, [%s,:256]%s\n", orc_neon_reg_name (dest->alloc), orc_neon_reg_name (dest->alloc + 1), orc_neon_reg_name (dest->alloc + 2), orc_neon_reg_name (dest->alloc + 3), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf42002dd; } else if (size == 16) { ORC_ASM_CODE(compiler," vld1.64 { %s, %s }, [%s,:128]%s\n", orc_neon_reg_name (dest->alloc), orc_neon_reg_name (dest->alloc + 1), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf4200aed; } else if (size == 8) { ORC_ASM_CODE(compiler," vld1.64 %s, [%s]%s\n", orc_neon_reg_name (dest->alloc), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf42007cd; } else { ORC_COMPILER_ERROR(compiler,"bad aligned load size %d", src->size << compiler->insn_shift); } } else { if (size == 32) { ORC_ASM_CODE(compiler," vld1.8 { %s, %s, %s, %s }, [%s]%s\n", orc_neon_reg_name (dest->alloc), orc_neon_reg_name (dest->alloc + 1), orc_neon_reg_name (dest->alloc + 2), orc_neon_reg_name (dest->alloc + 3), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf420020d; } else if (size == 16) { ORC_ASM_CODE(compiler," vld1.8 { %s, %s }, [%s]%s\n", orc_neon_reg_name (dest->alloc), orc_neon_reg_name (dest->alloc + 1), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf4200a0d; } else if (size == 8) { ORC_ASM_CODE(compiler," vld1.8 %s, [%s]%s\n", orc_neon_reg_name (dest->alloc), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf420070d; } else { ORC_COMPILER_ERROR(compiler,"bad unaligned load size %d", src->size << compiler->insn_shift); } } } else { int shift; if (size == 4) { shift = 2; } else if (size == 2) { shift = 1; } else { shift = 0; } ORC_ASM_CODE(compiler," vld1.%d %s[0], [%s]%s\n", 8<alloc), orc_arm_reg_name (ptr_register), update ? "!" : ""); code = 0xf4a0000d; code |= shift<<10; code |= (0&7)<<5; } code |= (ptr_register&0xf) << 16; code |= (dest->alloc&0xf) << 12; code |= ((dest->alloc>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } static void neon_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int update = FALSE; unsigned int code = 0; int size = dest->size << compiler->insn_shift; if (size >= 8) { if (dest->is_aligned) { if (size == 32) { ORC_ASM_CODE(compiler," vst1.64 { %s, %s, %s, %s }, [%s,:256]%s\n", orc_neon_reg_name (src->alloc), orc_neon_reg_name (src->alloc + 1), orc_neon_reg_name (src->alloc + 2), orc_neon_reg_name (src->alloc + 3), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf40002dd; } else if (size == 16) { ORC_ASM_CODE(compiler," vst1.64 { %s, %s }, [%s,:128]%s\n", orc_neon_reg_name (src->alloc), orc_neon_reg_name (src->alloc + 1), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf4000aed; } else if (size == 8) { ORC_ASM_CODE(compiler," vst1.64 %s, [%s]%s\n", orc_neon_reg_name (src->alloc), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf40007cd; } else { ORC_COMPILER_ERROR(compiler,"bad aligned store size %d", size); } } else { if (size == 32) { ORC_ASM_CODE(compiler," vst1.8 { %s, %s, %s, %s }, [%s]%s\n", orc_neon_reg_name (src->alloc), orc_neon_reg_name (src->alloc + 1), orc_neon_reg_name (src->alloc + 2), orc_neon_reg_name (src->alloc + 3), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf400020d; } else if (size == 16) { ORC_ASM_CODE(compiler," vst1.8 { %s, %s }, [%s]%s\n", orc_neon_reg_name (src->alloc), orc_neon_reg_name (src->alloc + 1), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf4000a0d; } else if (size == 8) { ORC_ASM_CODE(compiler," vst1.8 %s, [%s]%s\n", orc_neon_reg_name (src->alloc), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf400070d; } else { ORC_COMPILER_ERROR(compiler,"bad aligned store size %d", size); } } } else { int shift; if (size == 4) { shift = 2; } else if (size == 2) { shift = 1; } else { shift = 0; } ORC_ASM_CODE(compiler," vst1.%d %s[0], [%s]%s\n", 8<alloc), orc_arm_reg_name (dest->ptr_register), update ? "!" : ""); code = 0xf480000d; code |= shift<<10; code |= (0&7)<<5; } code |= (dest->ptr_register&0xf) << 16; code |= (src->alloc&0xf) << 12; code |= ((src->alloc>>4)&0x1) << 22; code |= (!update) << 1; orc_arm_emit (compiler, code); } static int orc_neon_get_const_shift (unsigned int value) { int shift = 0; while((value & 0xff) != value) { shift++; value >>= 1; } return shift; } void orc_neon_emit_loadib (OrcCompiler *compiler, int reg, int value) { orc_uint32 code; if (value == 0) { orc_neon_emit_binary_quad (compiler, "veor", 0xf3000110, reg, reg, reg); return; } value &= 0xff; ORC_ASM_CODE(compiler," vmov.i8 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800e10; code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (value&0xf) << 0; code |= (value&0x70) << 12; code |= (value&0x80) << 17; code |= 0x40; orc_arm_emit (compiler, code); } void orc_neon_emit_loadiw (OrcCompiler *compiler, int reg, int value) { orc_uint32 code; int shift; int neg = FALSE; if (value == 0) { orc_neon_emit_binary_quad (compiler, "veor", 0xf3000110, reg, reg, reg); return; } if (value < 0) { neg = TRUE; value = ~value; } shift = orc_neon_get_const_shift (value); if ((value & (0xff<>= shift; if (neg) { ORC_ASM_CODE(compiler," vmvn.i16 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800830; } else { ORC_ASM_CODE(compiler," vmov.i16 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800810; } code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (value&0xf) << 0; code |= (value&0x70) << 12; code |= (value&0x80) << 17; code |= 0x40; orc_arm_emit (compiler, code); if (shift > 0) { ORC_ASM_CODE(compiler," vshl.i16 %s, %s, #%d\n", orc_neon_reg_name_quad (reg), orc_neon_reg_name_quad (reg), shift); code = 0xf2900510; code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (reg&0xf) << 0; code |= ((reg>>4)&0x1) << 5; code |= (shift&0xf) << 16; code |= 0x40; orc_arm_emit (compiler, code); } return; } ORC_COMPILER_ERROR(compiler, "unimplemented load of constant %d", value); } void orc_neon_emit_loadil (OrcCompiler *compiler, int reg, int value) { orc_uint32 code; int shift; int neg = FALSE; if (value == 0) { orc_neon_emit_binary_quad (compiler, "veor", 0xf3000110, reg, reg, reg); return; } if (value < 0) { neg = TRUE; value = ~value; } shift = orc_neon_get_const_shift (value); if ((value & (0xff<>= shift; if (neg) { ORC_ASM_CODE(compiler," vmvn.i32 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800030; } else { ORC_ASM_CODE(compiler," vmov.i32 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800010; } code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (value&0xf) << 0; code |= (value&0x70) << 12; code |= (value&0x80) << 17; code |= 0x40; orc_arm_emit (compiler, code); if (shift > 0) { ORC_ASM_CODE(compiler," vshl.i32 %s, %s, #%d\n", orc_neon_reg_name_quad (reg), orc_neon_reg_name_quad (reg), shift); code = 0xf2a00510; code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (reg&0xf) << 0; code |= ((reg>>4)&0x1) << 5; code |= (shift&0x1f) << 16; code |= 0x40; orc_arm_emit (compiler, code); } return; } ORC_COMPILER_ERROR(compiler, "unimplemented load of constant %d", value); } void orc_neon_emit_loadiq (OrcCompiler *compiler, int reg, int value) { //orc_uint32 code; //int shift; //int neg = FALSE; if (value == 0) { orc_neon_emit_binary_quad (compiler, "veor", 0xf3000110, reg, reg, reg); return; } if (value < 0) { //neg = TRUE; value = ~value; } #if 0 shift = orc_neon_get_const_shift (value); if ((value & (0xff<>= shift; if (neg) { ORC_ASM_CODE(compiler," vmvn.i64 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800030; } else { ORC_ASM_CODE(compiler," vmov.i64 %s, #%d\n", orc_neon_reg_name_quad (reg), value); code = 0xf2800010; } code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (value&0xf) << 0; code |= (value&0x70) << 12; code |= (value&0x80) << 17; code |= 0x40; orc_arm_emit (compiler, code); if (shift > 0) { ORC_ASM_CODE(compiler," vshl.i64 %s, %s, #%d\n", orc_neon_reg_name_quad (reg), orc_neon_reg_name_quad (reg), shift); code = 0xf2a00510; code |= (reg&0xf) << 12; code |= ((reg>>4)&0x1) << 22; code |= (reg&0xf) << 0; code |= ((reg>>4)&0x1) << 5; code |= (shift&0xf) << 16; code |= 0x40; orc_arm_emit (compiler, code); } return; } #endif ORC_COMPILER_ERROR(compiler, "unimplemented load of constant %d", value); } void orc_neon_emit_loadpb (OrcCompiler *compiler, int dest, int param) { orc_uint32 code; orc_arm_emit_add_imm (compiler, compiler->gp_tmpreg, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, params[param])); ORC_ASM_CODE(compiler," vld1.8 {%s[],%s[]}, [%s]\n", orc_neon_reg_name (dest), orc_neon_reg_name (dest+1), orc_arm_reg_name (compiler->gp_tmpreg)); code = 0xf4a00c2f; code |= (compiler->gp_tmpreg&0xf) << 16; code |= (dest&0xf) << 12; code |= ((dest>>4)&0x1) << 22; orc_arm_emit (compiler, code); } void orc_neon_emit_loadpw (OrcCompiler *compiler, int dest, int param) { orc_uint32 code; orc_arm_emit_add_imm (compiler, compiler->gp_tmpreg, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, params[param])); ORC_ASM_CODE(compiler," vld1.16 {%s[],%s[]}, [%s]\n", orc_neon_reg_name (dest), orc_neon_reg_name (dest+1), orc_arm_reg_name (compiler->gp_tmpreg)); code = 0xf4a00c6f; code |= (compiler->gp_tmpreg&0xf) << 16; code |= (dest&0xf) << 12; code |= ((dest>>4)&0x1) << 22; orc_arm_emit (compiler, code); } void orc_neon_emit_loadpl (OrcCompiler *compiler, int dest, int param) { orc_uint32 code; orc_arm_emit_add_imm (compiler, compiler->gp_tmpreg, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, params[param])); ORC_ASM_CODE(compiler," vld1.32 {%s[],%s[]}, [%s]\n", orc_neon_reg_name (dest), orc_neon_reg_name (dest+1), orc_arm_reg_name (compiler->gp_tmpreg)); code = 0xf4a00caf; code |= (compiler->gp_tmpreg&0xf) << 16; code |= (dest&0xf) << 12; code |= ((dest>>4)&0x1) << 22; orc_arm_emit (compiler, code); } void orc_neon_emit_loadpq (OrcCompiler *compiler, int dest, int param) { orc_uint32 code; int update = FALSE; orc_arm_emit_add_imm (compiler, compiler->gp_tmpreg, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, params[param])); ORC_ASM_CODE(compiler," vld1.32 %s[0], [%s]%s\n", orc_neon_reg_name (dest), orc_arm_reg_name (compiler->gp_tmpreg), update ? "!" : ""); code = 0xf4a0000d; code |= 2<<10; code |= (0&7)<<5; orc_arm_emit (compiler, code); orc_arm_emit_add_imm (compiler, compiler->gp_tmpreg, compiler->exec_reg, ORC_STRUCT_OFFSET(OrcExecutor, params[param + (ORC_VAR_T1-ORC_VAR_P1)])); ORC_ASM_CODE(compiler," vld1.32 %s[1], [%s]%s\n", orc_neon_reg_name (dest), orc_arm_reg_name (compiler->gp_tmpreg), update ? "!" : ""); code = 0xf4a0000d; code |= 2<<10; code |= (1&7)<<5; orc_arm_emit (compiler, code); } #define UNARY(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_unary (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ } else if (p->insn_shift == vec_shift + 1) { \ orc_neon_emit_unary_quad (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define UNARY_LONG(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_unary_long (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define UNARY_NARROW(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_unary_narrow (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define BINARY(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_binary (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[1]].alloc); \ } else if (p->insn_shift == vec_shift + 1) { \ orc_neon_emit_binary_quad (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[1]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define BINARY_LONG(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_binary_long (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[1]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define BINARY_NARROW(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_binary_narrow (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[1]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define MOVE(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ if (p->vars[insn->dest_args[0]].alloc == p->vars[insn->src_args[0]].alloc) { \ return; \ } \ if (p->insn_shift <= vec_shift) { \ orc_neon_emit_binary (p, "vorr", 0xf2200110, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ } else if (p->insn_shift == vec_shift + 1) { \ orc_neon_emit_binary_quad (p, "vorr", 0xf2200110, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } typedef struct { orc_uint32 code; char *name; int negate; int bits; int vec_shift; } ShiftInfo; ShiftInfo immshift_info[] = { { 0xf2880510, "vshl.i8", FALSE, 8, 3 }, /* shlb */ { 0xf2880010, "vshr.s8", TRUE, 8, 3 }, /* shrsb */ { 0xf3880010, "vshr.u8", TRUE, 8, 3 }, /* shrub */ { 0xf2900510, "vshl.i16", FALSE, 16, 2 }, { 0xf2900010, "vshr.s16", TRUE, 16, 2 }, { 0xf3900010, "vshr.u16", TRUE, 16, 2 }, { 0xf2a00510, "vshl.i32", FALSE, 32, 1 }, { 0xf2a00010, "vshr.s32", TRUE, 32, 1 }, { 0xf3a00010, "vshr.u32", TRUE, 32, 1 } }; ShiftInfo regshift_info[] = { { 0xf3000400, "vshl.u8", FALSE, 0, 3 }, /* shlb */ { 0xf2000400, "vshl.s8", TRUE, 0, 3 }, /* shrsb */ { 0xf3000400, "vshl.u8", TRUE, 0, 3 }, /* shrub */ { 0xf3100400, "vshl.u16", FALSE, 0, 2 }, { 0xf2100400, "vshl.s16", TRUE, 0, 2 }, { 0xf3100400, "vshl.u16", TRUE, 0, 2 }, { 0xf3200400, "vshl.u32", FALSE, 0, 1 }, { 0xf2200400, "vshl.s32", TRUE, 0, 1 }, { 0xf3200400, "vshl.u32", TRUE, 0, 1 } }; static void orc_neon_rule_shift (OrcCompiler *p, void *user, OrcInstruction *insn) { int type = ORC_PTR_TO_INT(user); orc_uint32 code; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { int shift = p->vars[insn->src_args[1]].value.i; if (shift < 0) { ORC_COMPILER_ERROR(p, "shift negative"); return; } if (shift >= immshift_info[type].bits) { ORC_COMPILER_ERROR(p, "shift too large"); return; } code = immshift_info[type].code; if (p->insn_shift <= immshift_info[type].vec_shift) { ORC_ASM_CODE(p," %s %s, %s, #%d\n", immshift_info[type].name, orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), (int)p->vars[insn->src_args[1]].value.i); } else { ORC_ASM_CODE(p," %s %s, %s, #%d\n", immshift_info[type].name, orc_neon_reg_name_quad (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc), (int)p->vars[insn->src_args[1]].value.i); code |= 0x40; } code |= (p->vars[insn->dest_args[0]].alloc&0xf)<<12; code |= ((p->vars[insn->dest_args[0]].alloc>>4)&0x1)<<22; code |= (p->vars[insn->src_args[0]].alloc&0xf)<<0; code |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<5; if (immshift_info[type].negate) { shift = immshift_info[type].bits - shift; } code |= shift<<16; orc_arm_emit (p, code); } else if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { orc_neon_emit_loadpb (p, p->tmpreg, insn->src_args[1]); if (regshift_info[type].negate) { orc_neon_emit_unary_quad (p, "vneg.s8", 0xf3b10380, p->tmpreg, p->tmpreg); } code = regshift_info[type].code; if (p->insn_shift <= regshift_info[type].vec_shift) { ORC_ASM_CODE(p," %s %s, %s, %s\n", regshift_info[type].name, orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name (p->tmpreg)); } else { ORC_ASM_CODE(p," %s %s, %s, %s\n", regshift_info[type].name, orc_neon_reg_name_quad (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg)); code |= 0x40; } code |= (p->vars[insn->dest_args[0]].alloc&0xf)<<12; code |= ((p->vars[insn->dest_args[0]].alloc>>4)&0x1)<<22; code |= (p->vars[insn->src_args[0]].alloc&0xf)<<0; code |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<5; code |= (p->tmpreg&0xf)<<16; code |= ((p->tmpreg>>4)&0x1)<<7; orc_arm_emit (p, code); } else { ORC_PROGRAM_ERROR(p,"shift rule only works with constants and params"); } } #if 0 static void orc_neon_rule_shrsw (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_uint32 code; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { code = 0xf2900010; ORC_ASM_CODE(p," vshr.s16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), p->vars[insn->src_args[1]].value); code |= (p->vars[insn->dest_args[0]].alloc&0xf)<<12; code |= ((p->vars[insn->dest_args[0]].alloc>>4)&0x1)<<22; code |= (p->vars[insn->src_args[0]].alloc&0xf)<<0; code |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<5; code |= ((16 - p->vars[insn->src_args[1]].value)&0xf)<<16; orc_arm_emit (p, code); } else if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { code = 0xf2100400; ORC_ASM_CODE(p," vshl.s16 %s, %s, %s\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[1]].alloc)); code |= (p->vars[insn->dest_args[0]].alloc&0xf)<<12; code |= ((p->vars[insn->dest_args[0]].alloc>>4)&0x1)<<22; code |= (p->vars[insn->src_args[0]].alloc&0xf)<<0; code |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<5; code |= (p->vars[insn->src_args[1]].alloc&0xf)<<16; code |= ((p->vars[insn->src_args[1]].alloc>>4)&0x1)<<7; orc_arm_emit (p, code); } else { ORC_PROGRAM_ERROR(p,"shift rule only works with constants and params"); } } static void orc_neon_rule_shrsl (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_uint32 code; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { code = 0xf2900010; ORC_ASM_CODE(p," vshr.s32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), p->vars[insn->src_args[1]].value); code |= (p->vars[insn->dest_args[0]].alloc&0xf)<<12; code |= ((p->vars[insn->dest_args[0]].alloc>>4)&0x1)<<22; code |= (p->vars[insn->src_args[0]].alloc&0xf)<<0; code |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<5; code |= ((16 - p->vars[insn->src_args[1]].value)&0xf)<<16; orc_arm_emit (p, code); } else if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { code = 0xf2100400; ORC_ASM_CODE(p," vshl.s32 %s, %s, %s\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[1]].alloc)); code |= (p->vars[insn->dest_args[0]].alloc&0xf)<<12; code |= ((p->vars[insn->dest_args[0]].alloc>>4)&0x1)<<22; code |= (p->vars[insn->src_args[0]].alloc&0xf)<<0; code |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<5; code |= (p->vars[insn->src_args[1]].alloc&0xf)<<16; code |= ((p->vars[insn->src_args[1]].alloc>>4)&0x1)<<7; orc_arm_emit (p, code); } else { ORC_PROGRAM_ERROR(p,"shift rule only works with constants and params"); } } #endif static void orc_neon_rule_andn (OrcCompiler *p, void *user, OrcInstruction *insn) { int max_shift = ORC_PTR_TO_INT(user); /* this is special because the operand order is reversed */ if (p->insn_shift <= max_shift) { \ orc_neon_emit_binary (p, "vbic", 0xf2100110, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc, p->vars[insn->src_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vbic", 0xf2100110, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc, p->vars[insn->src_args[0]].alloc); } } UNARY(absb,"vabs.s8",0xf3b10300, 3) BINARY(addb,"vadd.i8",0xf2000800, 3) BINARY(addssb,"vqadd.s8",0xf2000010, 3) BINARY(addusb,"vqadd.u8",0xf3000010, 3) BINARY(andb,"vand",0xf2000110, 3) //BINARY(andnb,"vbic",0xf2100110, 3) BINARY(avgsb,"vrhadd.s8",0xf2000100, 3) BINARY(avgub,"vrhadd.u8",0xf3000100, 3) BINARY(cmpeqb,"vceq.i8",0xf3000810, 3) BINARY(cmpgtsb,"vcgt.s8",0xf2000300, 3) MOVE(copyb,"vmov",0xf2200110, 3) BINARY(maxsb,"vmax.s8",0xf2000600, 3) BINARY(maxub,"vmax.u8",0xf3000600, 3) BINARY(minsb,"vmin.s8",0xf2000610, 3) BINARY(minub,"vmin.u8",0xf3000610, 3) BINARY(mullb,"vmul.i8",0xf2000910, 3) BINARY(orb,"vorr",0xf2200110, 3) //LSHIFT(shlb,"vshl.i8",0xf2880510, 3) //RSHIFT(shrsb,"vshr.s8",0xf2880010,8, 3) //RSHIFT(shrub,"vshr.u8",0xf3880010,8, 3) BINARY(subb,"vsub.i8",0xf3000800, 3) BINARY(subssb,"vqsub.s8",0xf2000210, 3) BINARY(subusb,"vqsub.u8",0xf3000210, 3) BINARY(xorb,"veor",0xf3000110, 3) UNARY(absw,"vabs.s16",0xf3b50300, 2) BINARY(addw,"vadd.i16",0xf2100800, 2) BINARY(addssw,"vqadd.s16",0xf2100010, 2) BINARY(addusw,"vqadd.u16",0xf3100010, 2) BINARY(andw,"vand",0xf2000110, 2) //BINARY(andnw,"vbic",0xf2100110, 2) BINARY(avgsw,"vrhadd.s16",0xf2100100, 2) BINARY(avguw,"vrhadd.u16",0xf3100100, 2) BINARY(cmpeqw,"vceq.i16",0xf3100810, 2) BINARY(cmpgtsw,"vcgt.s16",0xf2100300, 2) MOVE(copyw,"vmov",0xf2200110, 2) BINARY(maxsw,"vmax.s16",0xf2100600, 2) BINARY(maxuw,"vmax.u16",0xf3100600, 2) BINARY(minsw,"vmin.s16",0xf2100610, 2) BINARY(minuw,"vmin.u16",0xf3100610, 2) BINARY(mullw,"vmul.i16",0xf2100910, 2) BINARY(orw,"vorr",0xf2200110, 2) //LSHIFT(shlw,"vshl.i16",0xf2900510, 2) //RSHIFT(shrsw,"vshr.s16",0xf2900010,16, 2) //RSHIFT(shruw,"vshr.u16",0xf3900010,16, 2) BINARY(subw,"vsub.i16",0xf3100800, 2) BINARY(subssw,"vqsub.s16",0xf2100210, 2) BINARY(subusw,"vqsub.u16",0xf3100210, 2) BINARY(xorw,"veor",0xf3000110, 2) UNARY(absl,"vabs.s32",0xf3b90300, 1) BINARY(addl,"vadd.i32",0xf2200800, 1) BINARY(addssl,"vqadd.s32",0xf2200010, 1) BINARY(addusl,"vqadd.u32",0xf3200010, 1) BINARY(andl,"vand",0xf2000110, 1) //BINARY(andnl,"vbic",0xf2100110, 1) BINARY(avgsl,"vrhadd.s32",0xf2200100, 1) BINARY(avgul,"vrhadd.u32",0xf3200100, 1) BINARY(cmpeql,"vceq.i32",0xf3200810, 1) BINARY(cmpgtsl,"vcgt.s32",0xf2200300, 1) MOVE(copyl,"vmov",0xf2200110, 1) BINARY(maxsl,"vmax.s32",0xf2200600, 1) BINARY(maxul,"vmax.u32",0xf3200600, 1) BINARY(minsl,"vmin.s32",0xf2200610, 1) BINARY(minul,"vmin.u32",0xf3200610, 1) BINARY(mulll,"vmul.i32",0xf2200910, 1) BINARY(orl,"vorr",0xf2200110, 1) //LSHIFT(shll,"vshl.i32",0xf2a00510, 1) //RSHIFT(shrsl,"vshr.s32",0xf2a00010,32, 1) //RSHIFT(shrul,"vshr.u32",0xf3a00010,32, 1) BINARY(subl,"vsub.i32",0xf3200800, 1) BINARY(subssl,"vqsub.s32",0xf2200210, 1) BINARY(subusl,"vqsub.u32",0xf3200210, 1) BINARY(xorl,"veor",0xf3000110, 1) //UNARY(absq,"vabs.s64",0xf3b10300, 0) BINARY(addq,"vadd.i64",0xf2300800, 0) //BINARY(addssq,"vqadd.s64",0xf2000010, 0) //BINARY(addusq,"vqadd.u64",0xf3000010, 0) BINARY(andq,"vand",0xf2000110, 0) //BINARY(avgsq,"vrhadd.s64",0xf2000100, 0) //BINARY(avguq,"vrhadd.u64",0xf3000100, 0) //BINARY(cmpeqq,"vceq.i64",0xf3000810, 0) //BINARY(cmpgtsq,"vcgt.s64",0xf2000300, 0) MOVE(copyq,"vmov",0xf2200110, 0) //BINARY(maxsq,"vmax.s64",0xf2000600, 0) //BINARY(maxuq,"vmax.u64",0xf3000600, 0) //BINARY(minsq,"vmin.s64",0xf2000610, 0) //BINARY(minuq,"vmin.u64",0xf3000610, 0) //BINARY(mullq,"vmul.i64",0xf2000910, 0) BINARY(orq,"vorr",0xf2200110, 0) BINARY(subq,"vsub.i64",0xf3300800, 0) //BINARY(subssq,"vqsub.s64",0xf2000210, 0) //BINARY(subusq,"vqsub.u64",0xf3000210, 0) BINARY(xorq,"veor",0xf3000110, 0) UNARY_LONG(convsbw,"vmovl.s8",0xf2880a10, 3) UNARY_LONG(convubw,"vmovl.u8",0xf3880a10, 3) UNARY_LONG(convswl,"vmovl.s16",0xf2900a10, 2) UNARY_LONG(convuwl,"vmovl.u16",0xf3900a10, 2) UNARY_LONG(convslq,"vmovl.s32",0xf2a00a10, 1) UNARY_LONG(convulq,"vmovl.u32",0xf3a00a10, 1) UNARY_NARROW(convwb,"vmovn.i16",0xf3b20200, 3) UNARY_NARROW(convssswb,"vqmovn.s16",0xf3b20280, 3) UNARY_NARROW(convsuswb,"vqmovun.s16",0xf3b20240, 3) UNARY_NARROW(convuuswb,"vqmovn.u16",0xf3b202c0, 3) UNARY_NARROW(convlw,"vmovn.i32",0xf3b60200, 2) UNARY_NARROW(convql,"vmovn.i64",0xf3ba0200, 1) UNARY_NARROW(convssslw,"vqmovn.s32",0xf3b60280, 2) UNARY_NARROW(convsuslw,"vqmovun.s32",0xf3b60240, 2) UNARY_NARROW(convuuslw,"vqmovn.u32",0xf3b602c0, 2) UNARY_NARROW(convsssql,"vqmovn.s64",0xf3ba0280, 1) UNARY_NARROW(convsusql,"vqmovun.s64",0xf3ba0240, 1) UNARY_NARROW(convuusql,"vqmovn.u64",0xf3ba02c0, 1) BINARY_LONG(mulsbw,"vmull.s8",0xf2800c00, 3) BINARY_LONG(mulubw,"vmull.u8",0xf3800c00, 3) BINARY_LONG(mulswl,"vmull.s16",0xf2900c00, 2) BINARY_LONG(muluwl,"vmull.u16",0xf3900c00, 2) UNARY(swapw,"vrev16.i8",0xf3b00100, 2) UNARY(swapl,"vrev32.i8",0xf3b00080, 1) UNARY(swapq,"vrev64.i8",0xf3b00000, 0) UNARY(swapwl,"vrev32.i16",0xf3b40080, 1) UNARY(swaplq,"vrev64.i32",0xf3b80000, 0) UNARY_NARROW(select0ql,"vmovn.i64",0xf3ba0200, 1) UNARY_NARROW(select0lw,"vmovn.i32",0xf3b60200, 2) UNARY_NARROW(select0wb,"vmovn.i16",0xf3b20200, 3) BINARY(addf,"vadd.f32",0xf2000d00, 1) BINARY(subf,"vsub.f32",0xf2200d00, 1) BINARY(mulf,"vmul.f32",0xf3000d10, 1) BINARY(maxf,"vmax.f32",0xf2000f00, 1) BINARY(minf,"vmin.f32",0xf2200f00, 1) BINARY(cmpeqf,"vceq.f32",0xf2000e00, 1) //BINARY_R(cmpltf,"vclt.f32",0xf3200e00, 1) //BINARY_R(cmplef,"vcle.f32",0xf3000e00, 1) UNARY(convfl,"vcvt.s32.f32",0xf3bb0700, 1) UNARY(convlf,"vcvt.f32.s32",0xf3bb0600, 1) #define UNARY_VFP(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_neon_emit_unary (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc); \ if (p->insn_shift == vec_shift + 1) { \ orc_neon_emit_unary (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc + 1, \ p->vars[insn->src_args[0]].alloc + 1); \ } else { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } #define BINARY_VFP(opcode,insn_name,code,vec_shift) \ static void \ orc_neon_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_neon_emit_binary (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->src_args[1]].alloc); \ if (p->insn_shift == vec_shift + 1) { \ orc_neon_emit_binary (p, insn_name, code, \ p->vars[insn->dest_args[0]].alloc+1, \ p->vars[insn->src_args[0]].alloc+1, \ p->vars[insn->src_args[1]].alloc+1); \ } else if (p->insn_shift > vec_shift + 1) { \ ORC_COMPILER_ERROR(p, "shift too large"); \ } \ } BINARY_VFP(addd,"vadd.f64",0xee300b00, 0) BINARY_VFP(subd,"vsub.f64",0xee300b40, 0) BINARY_VFP(muld,"vmul.f64",0xee200b00, 0) BINARY_VFP(divd,"vdiv.f64",0xee800b00, 0) UNARY_VFP(sqrtd,"vsqrt.f64",0xeeb10b00, 0) //BINARY_VFP(cmpeqd,"vcmpe.f64",0xee000000, 0) UNARY_VFP(convdf,"vcvt.f64.f32",0xee200b00, 0) UNARY_VFP(convfd,"vcvt.f32.f64",0xee200b00, 0) #if 1 #define NUM_ITERS_DIVF 2 static void orc_neon_rule_divf (OrcCompiler *p, void *user, OrcInstruction *insn) { int vec_shift = 1; if (p->insn_shift <= vec_shift) { int i; orc_neon_emit_unary (p, "vrecpe.f32", 0xf3bb0500, p->tmpreg, p->vars[insn->src_args[1]].alloc); for(i = 0; i < NUM_ITERS_DIVF; i++) { orc_neon_emit_binary (p, "vrecps.f32", 0xf2000f10, p->tmpreg2, //correction factor p->tmpreg, //the last estimate p->vars[insn->src_args[1]].alloc); //the original number orc_neon_emit_binary (p, "vmul.f32", 0xf3000d10, p->tmpreg, //revised estimate p->tmpreg, //last estimate p->tmpreg2); //correction factor } orc_neon_emit_binary (p, "vmul.f32", 0xf3000d10, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc, p->tmpreg); } else if (p->insn_shift == vec_shift + 1) { int i; orc_neon_emit_unary_quad (p, "vrecpe.f32", 0xf3bb0500, p->tmpreg, p->vars[insn->src_args[1]].alloc); for(i = 0; i < NUM_ITERS_DIVF; i++) { orc_neon_emit_binary_quad (p, "vrecps.f32", 0xf2000f10, p->tmpreg2, //correction factor p->tmpreg, //the last estimate p->vars[insn->src_args[1]].alloc); //the original number orc_neon_emit_binary_quad (p, "vmul.f32", 0xf3000d10, p->tmpreg, //revised estimate p->tmpreg, //last estimate p->tmpreg2); //correction factor } orc_neon_emit_binary_quad (p, "vmul.f32", 0xf3000d10, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc, p->tmpreg); } else { ORC_COMPILER_ERROR(p, "shift too large"); } } #endif #if 1 #define NUM_ITERS_SQRTF 2 static void orc_neon_rule_sqrtf (OrcCompiler *p, void *user, OrcInstruction *insn) { int vec_shift = 1; if (p->insn_shift <= vec_shift) { int i; orc_neon_emit_unary (p, "vrsqrte.f32", 0xf3bb0580, p->tmpreg, p->vars[insn->src_args[0]].alloc); for(i = 0; i < NUM_ITERS_SQRTF; i++) { orc_neon_emit_binary (p, "vmul.f32", 0xf3000d10, p->tmpreg2, p->tmpreg, p->vars[insn->src_args[0]].alloc); orc_neon_emit_binary (p, "vrsqrts.f32", 0xf2200f10, p->tmpreg2, p->tmpreg, p->tmpreg2); orc_neon_emit_binary (p, "vmul.f32", 0xf3000d10, p->tmpreg, p->tmpreg, p->tmpreg2); } orc_neon_emit_unary(p, "vrecpe.f32", 0xf3bb0500, p->vars[insn->dest_args[0]].alloc, p->tmpreg); for(i=0; i < NUM_ITERS_DIVF; i++) { orc_neon_emit_binary (p, "vrecps.f32", 0xf2000f10, p->tmpreg2, //correction factor p->vars[insn->dest_args[0]].alloc, //the last estimate p->tmpreg); //the original number orc_neon_emit_binary (p, "vmul.f32", 0xf3000d10, p->vars[insn->dest_args[0]].alloc, //revised estimate p->vars[insn->dest_args[0]].alloc, //last estimate p->tmpreg2); //correction factor } } else if (p->insn_shift == vec_shift + 1) { int i; orc_neon_emit_unary_quad (p, "vrsqrte.f32", 0xf3bb0580, p->tmpreg, p->vars[insn->src_args[0]].alloc); for(i = 0; i < NUM_ITERS_SQRTF; i++) { orc_neon_emit_binary_quad (p, "vmul.f32", 0xf3000d10, p->tmpreg2, p->tmpreg, p->vars[insn->src_args[0]].alloc); orc_neon_emit_binary_quad (p, "vrsqrts.f32", 0xf2200f10, p->tmpreg2, p->tmpreg, p->tmpreg2); orc_neon_emit_binary_quad (p, "vmul.f32", 0xf3000d10, p->tmpreg, p->tmpreg, p->tmpreg2); } orc_neon_emit_unary_quad(p, "vrecpe.f32", 0xf3bb0500, p->vars[insn->dest_args[0]].alloc, p->tmpreg); for(i=0; i < NUM_ITERS_DIVF; i++) { orc_neon_emit_binary_quad (p, "vrecps.f32", 0xf2000f10, p->tmpreg2, //correction factor p->vars[insn->dest_args[0]].alloc, //the last estimate p->tmpreg); //the original number orc_neon_emit_binary_quad (p, "vmul.f32", 0xf3000d10, p->vars[insn->dest_args[0]].alloc, //revised estimate p->vars[insn->dest_args[0]].alloc, //last estimate p->tmpreg2); //correction factor } } else { ORC_COMPILER_ERROR(p, "shift too large"); } } #endif static void orc_neon_rule_accw (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; if (p->insn_shift < 2) { ORC_ASM_CODE(p," vshl.i64 %s, %s, #%d\n", orc_neon_reg_name (p->tmpreg), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), 48); code = NEON_BINARY(0xf2a00590, p->tmpreg, 0, p->vars[insn->src_args[0]].alloc); code |= (48) << 16; orc_arm_emit (p, code); orc_neon_emit_binary (p, "vadd.i16", 0xf2100800, p->vars[insn->dest_args[0]].alloc, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_binary (p, "vadd.i16", 0xf2100800, p->vars[insn->dest_args[0]].alloc, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } } static void orc_neon_rule_accl (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; if (p->insn_shift < 1) { ORC_ASM_CODE(p," vshl.i64 %s, %s, #%d\n", orc_neon_reg_name (p->tmpreg), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), 32); code = NEON_BINARY(0xf2a00590, p->tmpreg, 0, p->vars[insn->src_args[0]].alloc); code |= (32) << 16; orc_arm_emit (p, code); orc_neon_emit_binary (p, "vadd.i32", 0xf2200800, p->vars[insn->dest_args[0]].alloc, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_binary (p, "vadd.i32", 0xf2200800, p->vars[insn->dest_args[0]].alloc, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } } static void orc_neon_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; ORC_ASM_CODE(p," vshrn.i16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc), 8); code = NEON_BINARY (0xf2880810, p->vars[insn->dest_args[0]].alloc, 0, p->vars[insn->src_args[0]].alloc); orc_arm_emit (p, code); } static void orc_neon_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; ORC_ASM_CODE(p," vshrn.i32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc), 16); code = NEON_BINARY (0xf2900810, p->vars[insn->dest_args[0]].alloc, 0, p->vars[insn->src_args[0]].alloc); orc_arm_emit (p, code); } static void orc_neon_rule_select1ql (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; ORC_ASM_CODE(p," vtrn.32 %s, %s\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc)); code = NEON_BINARY (0xf2a00810, p->vars[insn->dest_args[0]].alloc, 0, p->vars[insn->src_args[0]].alloc); orc_arm_emit (p, code); } static void orc_neon_rule_convhwb (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; ORC_ASM_CODE(p," vshrn.i16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc), 8); code = NEON_BINARY (0xf2880810, p->vars[insn->dest_args[0]].alloc, 0, p->vars[insn->src_args[0]].alloc); orc_arm_emit (p, code); } static void orc_neon_rule_convhlw (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; ORC_ASM_CODE(p," vshrn.i32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->vars[insn->src_args[0]].alloc), 16); code = NEON_BINARY (0xf2900810, p->vars[insn->dest_args[0]].alloc, 0, p->vars[insn->src_args[0]].alloc); orc_arm_emit (p, code); } static void orc_neon_rule_mergebw (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->insn_shift <= 2) { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } if (p->vars[insn->src_args[1]].last_use != p->insn_index) { orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->src_args[1]].alloc); orc_neon_emit_unary (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_unary (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc); } } else { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov_quad (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_mov_quad (p, p->tmpreg, p->vars[insn->src_args[1]].alloc); orc_neon_emit_unary_quad (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } } static void orc_neon_rule_mergewl (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->insn_shift <= 1) { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } if (p->vars[insn->src_args[1]].last_use != p->insn_index) { orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->src_args[1]].alloc); orc_neon_emit_unary (p, "vzip.16", 0xf3b60180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_unary (p, "vzip.16", 0xf3b60180, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc); } } else { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov_quad (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } if (p->vars[insn->src_args[1]].last_use != p->insn_index) { orc_neon_emit_mov_quad (p, p->tmpreg, p->vars[insn->src_args[1]].alloc); orc_neon_emit_unary_quad (p, "vzip.16", 0xf3b60180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_unary_quad (p, "vzip.16", 0xf3b60180, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc); } } } static void orc_neon_rule_mergelq (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->insn_shift <= 0) { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } if (p->vars[insn->src_args[1]].last_use != p->insn_index) { orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->src_args[1]].alloc); orc_neon_emit_unary (p, "vtrn.32", 0xf3ba0080, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_unary (p, "vtrn.32", 0xf3ba0080, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc); } } else { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov_quad (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } if (p->vars[insn->src_args[1]].last_use != p->insn_index) { orc_neon_emit_mov_quad (p, p->tmpreg, p->vars[insn->src_args[1]].alloc); orc_neon_emit_unary_quad (p, "vzip.32", 0xf3ba0180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { orc_neon_emit_unary_quad (p, "vzip.32", 0xf3ba0180, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[1]].alloc); } } } static void orc_neon_rule_splatbw (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->insn_shift <= 2) { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->dest_args[0]].alloc); orc_neon_emit_unary (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov_quad (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_mov_quad (p, p->tmpreg, p->vars[insn->dest_args[0]].alloc); orc_neon_emit_unary_quad (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } } static void orc_neon_rule_splatbl (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->insn_shift <= 1) { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->dest_args[0]].alloc); orc_neon_emit_unary (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->dest_args[0]].alloc); orc_neon_emit_unary (p, "vzip.16", 0xf3b60180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { if (p->vars[insn->dest_args[0]].alloc != p->vars[insn->src_args[0]].alloc) { orc_neon_emit_mov_quad (p, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->dest_args[0]].alloc); orc_neon_emit_unary_quad (p, "vzip.8", 0xf3b20180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); orc_neon_emit_mov (p, p->tmpreg, p->vars[insn->dest_args[0]].alloc); orc_neon_emit_unary_quad (p, "vzip.16", 0xf3b60180, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } } static void orc_neon_rule_splatw3q (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_uint32 code; int offset = 0; int label = 20; orc_arm_add_fixup (p, label, 1); ORC_ASM_CODE(p," vldr %s, .L%d+%d\n", orc_neon_reg_name (p->tmpreg), label, offset); code = 0xed9f0b00; code |= (p->tmpreg&0xf) << 12; code |= ((p->tmpreg>>4)&0x1) << 22; code |= ((offset - 8) >> 2)&0xff; orc_arm_emit (p, code); ORC_ASM_CODE(p," vtbl.8 %s, { %s, %s }, %s\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc + 1), orc_neon_reg_name (p->tmpreg)); code = NEON_BINARY(0xf3b00900, p->vars[insn->dest_args[0]].alloc, p->vars[insn->src_args[0]].alloc, p->tmpreg); orc_arm_emit (p, code); if (p->insn_shift > 0) { ORC_ASM_CODE(p," vtbl.8 %s, { %s }, %s\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc+1), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc+1), orc_neon_reg_name (p->tmpreg)); code = NEON_BINARY(0xf3b00800, p->vars[insn->dest_args[0]].alloc+1, p->vars[insn->src_args[0]].alloc+1, p->tmpreg); orc_arm_emit (p, code); } } static void orc_neon_rule_accsadubl (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_uint32 x; unsigned int code; if (p->insn_shift < 2) { x = 0xf3800700; ORC_ASM_CODE(p," vabdl.u8 %s, %s, %s\n", orc_neon_reg_name_quad (p->tmpreg), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[1]].alloc)); x |= (p->tmpreg&0xf)<<12; x |= ((p->tmpreg>>4)&0x1)<<22; x |= (p->vars[insn->src_args[0]].alloc&0xf)<<16; x |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<7; x |= (p->vars[insn->src_args[1]].alloc&0xf)<<0; x |= ((p->vars[insn->src_args[1]].alloc>>4)&0x1)<<5; orc_arm_emit (p, x); ORC_ASM_CODE(p," vshl.i64 %s, %s, #%d\n", orc_neon_reg_name (p->tmpreg), orc_neon_reg_name (p->tmpreg), 64 - (16<insn_shift)); code = NEON_BINARY(0xf2a00590, p->tmpreg, 0, p->tmpreg); code |= (64 - (16<insn_shift)) << 16; orc_arm_emit (p, code); orc_neon_emit_unary (p, "vpadal.u16", 0xf3b40680, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } else { x = 0xf3800700; ORC_ASM_CODE(p," vabdl.u8 %s, %s, %s\n", orc_neon_reg_name_quad (p->tmpreg), orc_neon_reg_name (p->vars[insn->src_args[0]].alloc), orc_neon_reg_name (p->vars[insn->src_args[1]].alloc)); x |= (p->tmpreg&0xf)<<12; x |= ((p->tmpreg>>4)&0x1)<<22; x |= (p->vars[insn->src_args[0]].alloc&0xf)<<16; x |= ((p->vars[insn->src_args[0]].alloc>>4)&0x1)<<7; x |= (p->vars[insn->src_args[1]].alloc&0xf)<<0; x |= ((p->vars[insn->src_args[1]].alloc>>4)&0x1)<<5; orc_arm_emit (p, x); orc_neon_emit_unary (p, "vpadal.u16", 0xf3b40680, p->vars[insn->dest_args[0]].alloc, p->tmpreg); } } static void orc_neon_rule_signw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* slow */ orc_neon_emit_loadiw (p, p->tmpreg, 1); if (p->insn_shift < 3) { orc_neon_emit_binary (p, "vmin.s16", 0xf2100610, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->src_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vmin.s16", 0xf2100610, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_loadiw (p, p->tmpreg, -1); if (p->insn_shift < 3) { orc_neon_emit_binary (p, "vmax.s16", 0xf2100600, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->dest_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vmax.s16", 0xf2100600, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->dest_args[0]].alloc); } } static void orc_neon_rule_signb (OrcCompiler *p, void *user, OrcInstruction *insn) { /* slow */ orc_neon_emit_loadib (p, p->tmpreg, 1); if (p->insn_shift < 4) { orc_neon_emit_binary (p, "vmin.s8", 0xf2000610, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->src_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vmin.s8", 0xf2000610, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_loadib (p, p->tmpreg, -1); if (p->insn_shift < 4) { orc_neon_emit_binary (p, "vmax.s8", 0xf2000600, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->dest_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vmax.s8", 0xf2000600, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->dest_args[0]].alloc); } } static void orc_neon_rule_signl (OrcCompiler *p, void *user, OrcInstruction *insn) { /* slow */ orc_neon_emit_loadil (p, p->tmpreg, 1); if (p->insn_shift < 2) { orc_neon_emit_binary (p, "vmin.s32", 0xf2200610, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->src_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vmin.s32", 0xf2200610, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->src_args[0]].alloc); } orc_neon_emit_loadil (p, p->tmpreg, -1); if (p->insn_shift < 2) { orc_neon_emit_binary (p, "vmax.s32", 0xf2200600, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->dest_args[0]].alloc); } else { orc_neon_emit_binary_quad (p, "vmax.s32", 0xf2200600, p->vars[insn->dest_args[0]].alloc, p->tmpreg, p->vars[insn->dest_args[0]].alloc); } } static void orc_neon_rule_mulhub (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; orc_neon_emit_binary_long (p, "vmull.u8",0xf3800c00, p->tmpreg, p->vars[insn->src_args[0]].alloc, p->vars[insn->src_args[1]].alloc); ORC_ASM_CODE(p," vshrn.i16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg), 8); code = NEON_BINARY (0xf2880810, p->vars[insn->dest_args[0]].alloc, p->tmpreg, 0); orc_arm_emit (p, code); if (p->insn_shift == 4) { orc_neon_emit_binary_long (p, "vmull.u8",0xf3800c00, p->tmpreg, p->vars[insn->src_args[0]].alloc + 1, p->vars[insn->src_args[1]].alloc + 1); ORC_ASM_CODE(p," vshrn.i16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc + 1), orc_neon_reg_name_quad (p->tmpreg), 8); code = NEON_BINARY (0xf2880810, p->vars[insn->dest_args[0]].alloc + 1, p->tmpreg, 0); orc_arm_emit (p, code); } } static void orc_neon_rule_mulhsb (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; orc_neon_emit_binary_long (p, "vmull.s8",0xf2800c00, p->tmpreg, p->vars[insn->src_args[0]].alloc, p->vars[insn->src_args[1]].alloc); ORC_ASM_CODE(p," vshrn.i16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg), 8); code = NEON_BINARY (0xf2880810, p->vars[insn->dest_args[0]].alloc, p->tmpreg, 0); orc_arm_emit (p, code); if (p->insn_shift == 4) { orc_neon_emit_binary_long (p, "vmull.s8",0xf2800c00, p->tmpreg, p->vars[insn->src_args[0]].alloc + 1, p->vars[insn->src_args[1]].alloc + 1); ORC_ASM_CODE(p," vshrn.i16 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc + 1), orc_neon_reg_name_quad (p->tmpreg), 8); code = NEON_BINARY (0xf2880810, p->vars[insn->dest_args[0]].alloc + 1, p->tmpreg, 0); orc_arm_emit (p, code); } } static void orc_neon_rule_mulhuw (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; orc_neon_emit_binary_long (p, "vmull.u16",0xf3900c00, p->tmpreg, p->vars[insn->src_args[0]].alloc, p->vars[insn->src_args[1]].alloc); ORC_ASM_CODE(p," vshrn.i32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg), 16); code = NEON_BINARY (0xf2900810, p->vars[insn->dest_args[0]].alloc, p->tmpreg, 0); orc_arm_emit (p, code); if (p->insn_shift == 3) { orc_neon_emit_binary_long (p, "vmull.u16",0xf3900c00, p->tmpreg, p->vars[insn->src_args[0]].alloc + 1, p->vars[insn->src_args[1]].alloc + 1); ORC_ASM_CODE(p," vshrn.i32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc + 1), orc_neon_reg_name_quad (p->tmpreg), 16); code = NEON_BINARY (0xf2900810, p->vars[insn->dest_args[0]].alloc + 1, p->tmpreg, 0); orc_arm_emit (p, code); } } static void orc_neon_rule_mulhsw (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; orc_neon_emit_binary_long (p, "vmull.s16",0xf2900c00, p->tmpreg, p->vars[insn->src_args[0]].alloc, p->vars[insn->src_args[1]].alloc); ORC_ASM_CODE(p," vshrn.i32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg), 16); code = NEON_BINARY (0xf2900810, p->vars[insn->dest_args[0]].alloc, p->tmpreg, 0); orc_arm_emit (p, code); if (p->insn_shift == 3) { orc_neon_emit_binary_long (p, "vmull.s16",0xf2900c00, p->tmpreg, p->vars[insn->src_args[0]].alloc + 1, p->vars[insn->src_args[1]].alloc + 1); ORC_ASM_CODE(p," vshrn.i32 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc + 1), orc_neon_reg_name_quad (p->tmpreg), 16); code = NEON_BINARY (0xf2900810, p->vars[insn->dest_args[0]].alloc + 1, p->tmpreg, 0); orc_arm_emit (p, code); } } static void orc_neon_rule_mulhul (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; orc_neon_emit_binary_long (p, "vmull.u32",0xf3a00c00, p->tmpreg, p->vars[insn->src_args[0]].alloc, p->vars[insn->src_args[1]].alloc); ORC_ASM_CODE(p," vshrn.i64 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg), 32); code = NEON_BINARY (0xf2a00810, p->vars[insn->dest_args[0]].alloc, p->tmpreg, 0); orc_arm_emit (p, code); if (p->insn_shift == 2) { orc_neon_emit_binary_long (p, "vmull.u32",0xf3a00c00, p->tmpreg, p->vars[insn->src_args[0]].alloc + 1, p->vars[insn->src_args[1]].alloc + 1); ORC_ASM_CODE(p," vshrn.i64 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc + 1), orc_neon_reg_name_quad (p->tmpreg), 32); code = NEON_BINARY (0xf2a00810, p->vars[insn->dest_args[0]].alloc + 1, p->tmpreg, 0); orc_arm_emit (p, code); } } static void orc_neon_rule_mulhsl (OrcCompiler *p, void *user, OrcInstruction *insn) { unsigned int code; orc_neon_emit_binary_long (p, "vmull.s32",0xf2a00c00, p->tmpreg, p->vars[insn->src_args[0]].alloc, p->vars[insn->src_args[1]].alloc); ORC_ASM_CODE(p," vshrn.i64 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc), orc_neon_reg_name_quad (p->tmpreg), 32); code = NEON_BINARY (0xf2a00810, p->vars[insn->dest_args[0]].alloc, p->tmpreg, 0); orc_arm_emit (p, code); if (p->insn_shift == 2) { orc_neon_emit_binary_long (p, "vmull.s32",0xf2a00c00, p->tmpreg, p->vars[insn->src_args[0]].alloc + 1, p->vars[insn->src_args[1]].alloc + 1); ORC_ASM_CODE(p," vshrn.i64 %s, %s, #%d\n", orc_neon_reg_name (p->vars[insn->dest_args[0]].alloc + 1), orc_neon_reg_name_quad (p->tmpreg), 32); code = NEON_BINARY (0xf2a00810, p->vars[insn->dest_args[0]].alloc + 1, p->tmpreg, 0); orc_arm_emit (p, code); } } static void orc_neon_rule_splitql (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest0 = p->vars[insn->dest_args[0]].alloc; int dest1 = p->vars[insn->dest_args[1]].alloc; int src = p->vars[insn->src_args[0]].alloc; if (p->insn_shift < 1) { if (src != dest0) { orc_neon_emit_mov (p, dest0, src); } if (src != dest1) { orc_neon_emit_mov (p, dest1, src); } orc_neon_emit_unary (p, "vtrn.32", 0xf3ba0080, dest1, dest0); } else { if (src != dest0) { orc_neon_emit_mov_quad (p, dest0, src); } if (src != dest1) { orc_neon_emit_mov_quad (p, dest1, src); } orc_neon_emit_unary_quad (p, "vuzp.32", 0xf3ba0140, dest1, dest0); } } static void orc_neon_rule_splitlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest0 = p->vars[insn->dest_args[0]].alloc; int dest1 = p->vars[insn->dest_args[1]].alloc; int src = p->vars[insn->src_args[0]].alloc; if (p->insn_shift < 2) { if (src != dest0) { orc_neon_emit_mov (p, dest0, src); } if (src != dest1) { orc_neon_emit_mov (p, dest1, src); } orc_neon_emit_unary (p, "vuzp.16", 0xf3b60100, dest1, dest0); } else { if (src != dest0) { orc_neon_emit_mov_quad (p, dest0, src); } if (src != dest1) { orc_neon_emit_mov_quad (p, dest1, src); } orc_neon_emit_unary_quad (p, "vuzp.16", 0xf3b60140, dest1, dest0); } } static void orc_neon_rule_splitwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest0 = p->vars[insn->dest_args[0]].alloc; int dest1 = p->vars[insn->dest_args[1]].alloc; int src = p->vars[insn->src_args[0]].alloc; if (p->insn_shift < 2) { if (src != dest0) { orc_neon_emit_mov (p, dest0, src); } if (src != dest1) { orc_neon_emit_mov (p, dest1, src); } orc_neon_emit_unary (p, "vuzp.8", 0xf3b20100, dest1, dest0); } else { if (src != dest0) { orc_neon_emit_mov_quad (p, dest0, src); } if (src != dest1) { orc_neon_emit_mov_quad (p, dest1, src); } orc_neon_emit_unary_quad (p, "vuzp.8", 0xf3b20140, dest1, dest0); } } static void orc_neon_rule_div255w (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int src = p->vars[insn->src_args[0]].alloc; int tmp = p->tmpreg; if (p->insn_shift < 3) { ORC_ASM_CODE(p," vrshrn.u16 %s, %s, #%d\n", orc_neon_reg_name(tmp), orc_neon_reg_name_quad(src), 8); orc_arm_emit (p, NEON_BINARY (0xf2880850, tmp, 0, src)); orc_neon_emit_unary_long (p, "vmovl.u8",0xf3880a10, tmp, tmp); orc_neon_emit_binary (p, "vadd.i16", 0xf2100800, tmp, tmp, src); ORC_ASM_CODE(p," vrshrn.u16 %s, %s, #%d\n", orc_neon_reg_name(dest), orc_neon_reg_name_quad(tmp), 8); orc_arm_emit (p, NEON_BINARY (0xf2880850, dest, 0, tmp)); orc_neon_emit_unary_long (p, "vmovl.u8",0xf3880a10, dest, dest); } else { ORC_ASM_CODE(p," vrshrn.u16 %s, %s, #%d\n", orc_neon_reg_name(tmp), orc_neon_reg_name_quad(src), 8); orc_arm_emit (p, NEON_BINARY (0xf2880850, tmp, 0, src)); orc_neon_emit_unary_long (p, "vmovl.u8",0xf3880a10, tmp, tmp); orc_neon_emit_binary_quad (p, "vadd.i16", 0xf2100800, tmp, tmp, src); ORC_ASM_CODE(p," vrshrn.u16 %s, %s, #%d\n", orc_neon_reg_name(dest), orc_neon_reg_name_quad(tmp), 8); orc_arm_emit (p, NEON_BINARY (0xf2880850, dest, 0, tmp)); orc_neon_emit_unary_long (p, "vmovl.u8",0xf3880a10, dest, dest); } } void orc_compiler_neon_register_rules (OrcTarget *target) { OrcRuleSet *rule_set; rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, 0); #define REG(x) \ orc_rule_register (rule_set, #x , orc_neon_rule_ ## x, NULL) REG(absb); REG(addb); REG(addssb); REG(addusb); REG(andb); //REG(andnb); REG(avgsb); REG(avgub); REG(cmpeqb); REG(cmpgtsb); REG(copyb); REG(maxsb); REG(maxub); REG(minsb); REG(minub); REG(mullb); REG(mulhsb); REG(mulhub); REG(orb); //REG(shlb); //REG(shrsb); //REG(shrub); REG(signb); REG(subb); REG(subssb); REG(subusb); REG(xorb); REG(absw); REG(addw); REG(addssw); REG(addusw); REG(andw); //REG(andnw); REG(avgsw); REG(avguw); REG(cmpeqw); REG(cmpgtsw); REG(copyw); REG(maxsw); REG(maxuw); REG(minsw); REG(minuw); REG(mullw); REG(mulhsw); REG(mulhuw); REG(orw); //REG(shlw); //REG(shrsw); //REG(shruw); REG(signw); REG(subw); REG(subssw); REG(subusw); REG(xorw); REG(absl); REG(addl); REG(addssl); REG(addusl); REG(andl); //REG(andnl); REG(avgsl); REG(avgul); REG(cmpeql); REG(cmpgtsl); REG(copyl); REG(maxsl); REG(maxul); REG(minsl); REG(minul); REG(mulll); REG(mulhsl); REG(mulhul); REG(orl); //REG(shll); //REG(shrsl); //REG(shrul); REG(signl); REG(subl); REG(subssl); REG(subusl); REG(xorl); REG(addq); REG(andq); REG(orq); REG(copyq); REG(subq); REG(xorq); REG(convsbw); REG(convubw); REG(convswl); REG(convuwl); REG(convslq); REG(convulq); REG(convlw); REG(convql); REG(convssslw); REG(convsuslw); REG(convuuslw); REG(convsssql); REG(convsusql); REG(convuusql); REG(convwb); REG(convhwb); REG(convhlw); REG(convssswb); REG(convsuswb); REG(convuuswb); REG(mulsbw); REG(mulubw); REG(mulswl); REG(muluwl); REG(accw); REG(accl); REG(accsadubl); REG(swapw); REG(swapl); REG(swapq); REG(swapwl); REG(swaplq); REG(select0wb); REG(select1wb); REG(select0lw); REG(select1lw); REG(select0ql); if (0) REG(select1ql); REG(mergebw); REG(mergewl); REG(mergelq); REG(splitql); REG(splitlw); REG(splitwb); REG(addf); REG(subf); REG(mulf); REG(divf); REG(sqrtf); REG(maxf); REG(minf); REG(cmpeqf); //REG(cmpltf); //REG(cmplef); REG(convfl); REG(convlf); REG(addd); REG(subd); REG(muld); REG(divd); REG(sqrtd); //REG(cmpeqd); REG(convdf); REG(convfd); REG(splatbw); REG(splatbl); REG(splatw3q); REG(div255w); orc_rule_register (rule_set, "loadpb", neon_rule_loadpX, (void *)1); orc_rule_register (rule_set, "loadpw", neon_rule_loadpX, (void *)2); orc_rule_register (rule_set, "loadpl", neon_rule_loadpX, (void *)4); orc_rule_register (rule_set, "loadpq", neon_rule_loadpX, (void *)8); orc_rule_register (rule_set, "loadb", neon_rule_loadX, (void *)0); orc_rule_register (rule_set, "loadw", neon_rule_loadX, (void *)0); orc_rule_register (rule_set, "loadl", neon_rule_loadX, (void *)0); orc_rule_register (rule_set, "loadq", neon_rule_loadX, (void *)0); orc_rule_register (rule_set, "loadoffb", neon_rule_loadX, (void *)1); orc_rule_register (rule_set, "loadoffw", neon_rule_loadX, (void *)1); orc_rule_register (rule_set, "loadoffl", neon_rule_loadX, (void *)1); orc_rule_register (rule_set, "storeb", neon_rule_storeX, (void *)0); orc_rule_register (rule_set, "storew", neon_rule_storeX, (void *)0); orc_rule_register (rule_set, "storel", neon_rule_storeX, (void *)0); orc_rule_register (rule_set, "storeq", neon_rule_storeX, (void *)0); orc_rule_register (rule_set, "shlb", orc_neon_rule_shift, (void *)0); orc_rule_register (rule_set, "shrsb", orc_neon_rule_shift, (void *)1); orc_rule_register (rule_set, "shrub", orc_neon_rule_shift, (void *)2); orc_rule_register (rule_set, "shlw", orc_neon_rule_shift, (void *)3); orc_rule_register (rule_set, "shrsw", orc_neon_rule_shift, (void *)4); orc_rule_register (rule_set, "shruw", orc_neon_rule_shift, (void *)5); orc_rule_register (rule_set, "shll", orc_neon_rule_shift, (void *)6); orc_rule_register (rule_set, "shrsl", orc_neon_rule_shift, (void *)7); orc_rule_register (rule_set, "shrul", orc_neon_rule_shift, (void *)8); orc_rule_register (rule_set, "andnb", orc_neon_rule_andn, (void *)3); orc_rule_register (rule_set, "andnw", orc_neon_rule_andn, (void *)2); orc_rule_register (rule_set, "andnl", orc_neon_rule_andn, (void *)1); orc_rule_register (rule_set, "andnq", orc_neon_rule_andn, (void *)0); } orc-0.4.18/orc/orcexecutor.h0000664000175000017500000000665712111024531012614 00000000000000 #ifndef _ORC_EXECUTOR_H_ #define _ORC_EXECUTOR_H_ #include #include ORC_BEGIN_DECLS typedef struct _OrcOpcodeExecutor OrcOpcodeExecutor; typedef struct _OrcExecutor OrcExecutor; typedef struct _OrcExecutorAlt OrcExecutorAlt; typedef void (*OrcOpcodeEmulateFunc)(OrcOpcodeExecutor *ex, void *user); typedef void (*OrcOpcodeEmulateNFunc)(OrcOpcodeExecutor *ex, int index, int n); typedef void (*OrcOpcodeEmulate16Func)(OrcOpcodeExecutor *ex); typedef void (*OrcExecutorFunc)(OrcExecutor *ex); /** * OrcOpcodeExecutor: * * The OrcOpcodeExecutor structure has no public members */ struct _OrcOpcodeExecutor { /*< private >*/ int src_values[ORC_STATIC_OPCODE_N_SRC]; int dest_values[ORC_STATIC_OPCODE_N_DEST]; OrcOpcodeEmulateNFunc emulateN; void *src_ptrs[ORC_STATIC_OPCODE_N_SRC]; void *dest_ptrs[ORC_STATIC_OPCODE_N_DEST]; int shift; }; /** * OrcExecutor: * */ struct _OrcExecutor { /*< private >*/ OrcProgram *program; int n; int counter1; int counter2; int counter3; void *arrays[ORC_N_VARIABLES]; int params[ORC_N_VARIABLES]; int accumulators[4]; /* exec pointer is stored in arrays[ORC_VAR_A1] */ /* OrcCode pointer is stored in arrays[ORC_VAR_A2] */ /* row pointers are stored in arrays[i+ORC_VAR_C1] */ /* the stride for arrays[x] is stored in params[x] */ /* m is stored in params[ORC_VAR_A1] */ /* m_index is stored in params[ORC_VAR_A2] */ /* elapsed time is stored in params[ORC_VAR_A3] */ /* high half of params is stored in params[ORC_VAR_T1..] */ }; /* the alternate view of OrcExecutor */ struct _OrcExecutorAlt { /*< private >*/ OrcProgram *program; int n; int counter1; int counter2; int counter3; void *arrays[ORC_N_ARRAYS]; OrcExecutorFunc exec; OrcCode *code; void *unused1[ORC_N_VARIABLES - ORC_N_ARRAYS - 2]; int strides[ORC_N_ARRAYS]; int m; int m_index; int time; int unused2; int unused4[8]; int params[ORC_VAR_T1-ORC_VAR_P1]; int params_hi[ORC_VAR_T1-ORC_VAR_P1]; int unused3[ORC_N_VARIABLES - ORC_VAR_T9]; int accumulators[4]; }; #define ORC_EXECUTOR_EXEC(ex) ((OrcExecutorFunc)((ex)->arrays[ORC_VAR_A1])) #define ORC_EXECUTOR_M(ex) ((ex)->params[ORC_VAR_A1]) #define ORC_EXECUTOR_M_INDEX(ex) ((ex)->params[ORC_VAR_A2]) #define ORC_EXECUTOR_TIME(ex) ((ex)->params[ORC_VAR_A3]) OrcExecutor * orc_executor_new (OrcProgram *program); void orc_executor_free (OrcExecutor *ex); void orc_executor_set_program (OrcExecutor *ex, OrcProgram *program); void orc_executor_set_array (OrcExecutor *ex, int var, void *ptr); void orc_executor_set_stride (OrcExecutor *ex, int var, int stride); void orc_executor_set_array_str (OrcExecutor *ex, const char *name, void *ptr); void orc_executor_set_param (OrcExecutor *ex, int var, int value); void orc_executor_set_param_str (OrcExecutor *ex, const char *name, int value); void orc_executor_set_param_float (OrcExecutor *ex, int var, float value); void orc_executor_set_param_int64 (OrcExecutor *ex, int var, orc_int64 value); void orc_executor_set_param_double (OrcExecutor *ex, int var, double value); int orc_executor_get_accumulator (OrcExecutor *ex, int var); int orc_executor_get_accumulator_str (OrcExecutor *ex, const char *name); void orc_executor_set_n (OrcExecutor *ex, int n); void orc_executor_set_m (OrcExecutor *ex, int m); void orc_executor_emulate (OrcExecutor *ex); void orc_executor_run (OrcExecutor *ex); void orc_executor_run_backup (OrcExecutor *ex); ORC_END_DECLS #endif orc-0.4.18/orc/orcbytecode.h0000664000175000017500000000105512111024531012537 00000000000000 #ifndef _ORC_BYTECODE_H_ #define _ORC_BYTECODE_H_ #include #include ORC_BEGIN_DECLS typedef struct _OrcBytecode OrcBytecode; struct _OrcBytecode { /*< private >*/ orc_uint8 *bytecode; int length; int alloc_len; }; #ifdef ORC_ENABLE_UNSTABLE_API OrcBytecode * orc_bytecode_new (void); void orc_bytecode_free (OrcBytecode *bytecode); OrcBytecode * orc_bytecode_from_program (OrcProgram *p); int orc_bytecode_parse_function (OrcProgram *program, const orc_uint8 *bytecode); #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcemulateopcodes.c0000664000175000017500000032722412071634360013772 00000000000000 /* autogenerated by generate-emulation */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ void emulate_absb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: absb */ var33 = ORC_ABS(var32); /* 2: storeb */ ptr0[i] = var33; } } void emulate_addb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: addb */ var34 = var32 + var33; /* 3: storeb */ ptr0[i] = var34; } } void emulate_addssb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: addssb */ var34 = ORC_CLAMP_SB(var32 + var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_addusb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: addusb */ var34 = ORC_CLAMP_UB((orc_uint8)var32 + (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_andb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: andb */ var34 = var32 & var33; /* 3: storeb */ ptr0[i] = var34; } } void emulate_andnb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: andnb */ var34 = (~var32) & var33; /* 3: storeb */ ptr0[i] = var34; } } void emulate_avgsb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgsb */ var34 = (var32 + var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } void emulate_avgub (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } void emulate_cmpeqb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: cmpeqb */ var34 = (var32 == var33) ? (~0) : 0; /* 3: storeb */ ptr0[i] = var34; } } void emulate_cmpgtsb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: cmpgtsb */ var34 = (var32 > var33) ? (~0) : 0; /* 3: storeb */ ptr0[i] = var34; } } void emulate_copyb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void emulate_loadb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[offset + i]; /* 1: storeb */ ptr0[i] = var32; } } void emulate_loadoffb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadoffb */ var32 = ptr4[offset + i + ((orc_union64 *)(ex->src_ptrs[1]))->i]; /* 1: storeb */ ptr0[i] = var32; } } void emulate_loadupdb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadupdb */ var32 = ptr4[(offset + i)>>1]; /* 1: storeb */ ptr0[i] = var32; } } void emulate_loadupib (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadupib */ var32 = ((offset + i)&1) ? ((orc_uint8)ptr4[(offset + i)>>1] + (orc_uint8)ptr4[((offset + i)>>1)+1] + 1)>>1 : ptr4[(offset + i)>>1]; /* 1: storeb */ ptr0[i] = var32; } } void emulate_loadpb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; /* 0: loadpb */ var32 = ((orc_union64 *)(ex->src_ptrs[0]))->i; for (i = 0; i < n; i++) { /* 1: storeb */ ptr0[i] = var32; } } void emulate_ldresnearb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: ldresnearb */ var32 = ptr4[(((orc_union64 *)(ex->src_ptrs[1]))->i + (offset + i)*((orc_union64 *)(ex->src_ptrs[2]))->i)>>16]; /* 1: storeb */ ptr0[i] = var32; } } void emulate_ldresnearl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: ldresnearl */ var32 = ptr4[(((orc_union64 *)(ex->src_ptrs[1]))->i + (offset + i)*((orc_union64 *)(ex->src_ptrs[2]))->i)>>16]; /* 1: storel */ ptr0[i] = var32; } } void emulate_ldreslinb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: ldreslinb */ { int tmp = ((orc_union64 *)(ex->src_ptrs[1]))->i + (offset + i) * ((orc_union64 *)(ex->src_ptrs[2]))->i; var32 = ((orc_uint8)ptr4[tmp>>16] * (256-((tmp>>8)&0xff)) + (orc_uint8)ptr4[(tmp>>16)+1] * ((tmp>>8)&0xff))>>8; } /* 1: storeb */ ptr0[i] = var32; } } void emulate_ldreslinl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: ldreslinl */ { int tmp = ((orc_union64 *)(ex->src_ptrs[1]))->i + (offset + i) * ((orc_union64 *)(ex->src_ptrs[2]))->i; orc_union32 a = ptr4[tmp>>16]; orc_union32 b = ptr4[(tmp>>16)+1]; var32.x4[0] = ((orc_uint8)a.x4[0] * (256-((tmp>>8)&0xff)) + (orc_uint8)b.x4[0] * ((tmp>>8)&0xff))>>8; var32.x4[1] = ((orc_uint8)a.x4[1] * (256-((tmp>>8)&0xff)) + (orc_uint8)b.x4[1] * ((tmp>>8)&0xff))>>8; var32.x4[2] = ((orc_uint8)a.x4[2] * (256-((tmp>>8)&0xff)) + (orc_uint8)b.x4[2] * ((tmp>>8)&0xff))>>8; var32.x4[3] = ((orc_uint8)a.x4[3] * (256-((tmp>>8)&0xff)) + (orc_uint8)b.x4[3] * ((tmp>>8)&0xff))>>8; } /* 1: storel */ ptr0[i] = var32; } } void emulate_maxsb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: maxsb */ var34 = ORC_MAX(var32, var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_maxub (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: maxub */ var34 = ORC_MAX((orc_uint8)var32, (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_minsb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: minsb */ var34 = ORC_MIN(var32, var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_minub (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: minub */ var34 = ORC_MIN((orc_uint8)var32, (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_mullb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mullb */ var34 = (var32 * var33) & 0xff; /* 3: storeb */ ptr0[i] = var34; } } void emulate_mulhsb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mulhsb */ var34 = (var32 * var33) >> 8; /* 3: storeb */ ptr0[i] = var34; } } void emulate_mulhub (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mulhub */ var34 = ((orc_uint32)(orc_uint8)var32 * (orc_uint32)(orc_uint8)var33) >> 8; /* 3: storeb */ ptr0[i] = var34; } } void emulate_orb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: orb */ var34 = var32 | var33; /* 3: storeb */ ptr0[i] = var34; } } void emulate_shlb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: shlb */ var33 = var32 << ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storeb */ ptr0[i] = var33; } } void emulate_shrsb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: shrsb */ var33 = var32 >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storeb */ ptr0[i] = var33; } } void emulate_shrub (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: shrub */ var33 = ((orc_uint8)var32) >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storeb */ ptr0[i] = var33; } } void emulate_signb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: signb */ var33 = ORC_CLAMP(var32,-1,1); /* 2: storeb */ ptr0[i] = var33; } } void emulate_storeb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: storeb */ ptr0[offset + i] = var32; } } void emulate_subb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: subb */ var34 = var32 - var33; /* 3: storeb */ ptr0[i] = var34; } } void emulate_subssb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: subssb */ var34 = ORC_CLAMP_SB(var32 - var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_subusb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: subusb */ var34 = ORC_CLAMP_UB((orc_uint8)var32 - (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } void emulate_xorb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: xorb */ var34 = var32 ^ var33; /* 3: storeb */ ptr0[i] = var34; } } void emulate_absw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: absw */ var33.i = ORC_ABS(var32.i); /* 2: storew */ ptr0[i] = var33; } } void emulate_addw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } void emulate_addssw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addssw */ var34.i = ORC_CLAMP_SW(var32.i + var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_addusw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addusw */ var34.i = ORC_CLAMP_UW((orc_uint16)var32.i + (orc_uint16)var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_andw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: andw */ var34.i = var32.i & var33.i; /* 3: storew */ ptr0[i] = var34; } } void emulate_andnw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: andnw */ var34.i = (~var32.i) & var33.i; /* 3: storew */ ptr0[i] = var34; } } void emulate_avgsw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var34.i = (var32.i + var33.i + 1)>>1; /* 3: storew */ ptr0[i] = var34; } } void emulate_avguw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: avguw */ var34.i = ((orc_uint16)var32.i + (orc_uint16)var33.i + 1)>>1; /* 3: storew */ ptr0[i] = var34; } } void emulate_cmpeqw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: cmpeqw */ var34.i = (var32.i == var33.i) ? (~0) : 0; /* 3: storew */ ptr0[i] = var34; } } void emulate_cmpgtsw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: cmpgtsw */ var34.i = (var32.i > var33.i) ? (~0) : 0; /* 3: storew */ ptr0[i] = var34; } } void emulate_copyw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } void emulate_div255w (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: div255w */ var33.i = ((orc_uint16)(((orc_uint16)(var32.i+128)) + (((orc_uint16)(var32.i+128))>>8)))>>8; /* 2: storew */ ptr0[i] = var33; } } void emulate_divluw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: divluw */ var34.i = ((var33.i&0xff) == 0) ? 255 : ORC_CLAMP_UB(((orc_uint16)var32.i)/((orc_uint16)var33.i&0xff)); /* 3: storew */ ptr0[i] = var34; } } void emulate_loadw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[offset + i]; /* 1: storew */ ptr0[i] = var32; } } void emulate_loadoffw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadoffw */ var32 = ptr4[offset + i + ((orc_union64 *)(ex->src_ptrs[1]))->i]; /* 1: storew */ ptr0[i] = var32; } } void emulate_loadpw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; /* 0: loadpw */ var32.i = ((orc_union64 *)(ex->src_ptrs[0]))->i; for (i = 0; i < n; i++) { /* 1: storew */ ptr0[i] = var32; } } void emulate_maxsw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: maxsw */ var34.i = ORC_MAX(var32.i, var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_maxuw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: maxuw */ var34.i = ORC_MAX((orc_uint16)var32.i, (orc_uint16)var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_minsw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: minsw */ var34.i = ORC_MIN(var32.i, var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_minuw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: minuw */ var34.i = ORC_MIN((orc_uint16)var32.i, (orc_uint16)var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_mullw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mullw */ var34.i = (var32.i * var33.i) & 0xffff; /* 3: storew */ ptr0[i] = var34; } } void emulate_mulhsw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mulhsw */ var34.i = (var32.i * var33.i) >> 16; /* 3: storew */ ptr0[i] = var34; } } void emulate_mulhuw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mulhuw */ var34.i = ((orc_uint32)((orc_uint16)var32.i) * (orc_uint32)((orc_uint16)var33.i)) >> 16; /* 3: storew */ ptr0[i] = var34; } } void emulate_orw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: orw */ var34.i = var32.i | var33.i; /* 3: storew */ ptr0[i] = var34; } } void emulate_shlw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storew */ ptr0[i] = var33; } } void emulate_shrsw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shrsw */ var33.i = var32.i >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storew */ ptr0[i] = var33; } } void emulate_shruw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shruw */ var33.i = ((orc_uint16)var32.i) >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storew */ ptr0[i] = var33; } } void emulate_signw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: signw */ var33.i = ORC_CLAMP(var32.i,-1,1); /* 2: storew */ ptr0[i] = var33; } } void emulate_storew (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: storew */ ptr0[offset + i] = var32; } } void emulate_subw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } void emulate_subssw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subssw */ var34.i = ORC_CLAMP_SW(var32.i - var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_subusw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subusw */ var34.i = ORC_CLAMP_UW((orc_uint16)var32.i - (orc_uint16)var33.i); /* 3: storew */ ptr0[i] = var34; } } void emulate_xorw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: xorw */ var34.i = var32.i ^ var33.i; /* 3: storew */ ptr0[i] = var34; } } void emulate_absl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: absl */ var33.i = ORC_ABS(var32.i); /* 2: storel */ ptr0[i] = var33; } } void emulate_addl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addl */ var34.i = var32.i + var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_addssl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addssl */ var34.i = ORC_CLAMP_SL((orc_int64)var32.i + (orc_int64)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_addusl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addusl */ var34.i = ORC_CLAMP_UL((orc_int64)(orc_uint32)var32.i + (orc_int64)(orc_uint32)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_andl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: andl */ var34.i = var32.i & var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_andnl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: andnl */ var34.i = (~var32.i) & var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_avgsl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: avgsl */ var34.i = ((orc_int64)var32.i + (orc_int64)var33.i + 1)>>1; /* 3: storel */ ptr0[i] = var34; } } void emulate_avgul (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: avgul */ var34.i = ((orc_uint64)(orc_uint32)var32.i + (orc_uint64)(orc_uint32)var33.i + 1)>>1; /* 3: storel */ ptr0[i] = var34; } } void emulate_cmpeql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: cmpeql */ var34.i = (var32.i == var33.i) ? (~0) : 0; /* 3: storel */ ptr0[i] = var34; } } void emulate_cmpgtsl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: cmpgtsl */ var34.i = (var32.i > var33.i) ? (~0) : 0; /* 3: storel */ ptr0[i] = var34; } } void emulate_copyl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } void emulate_loadl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[offset + i]; /* 1: storel */ ptr0[i] = var32; } } void emulate_loadoffl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadoffl */ var32 = ptr4[offset + i + ((orc_union64 *)(ex->src_ptrs[1]))->i]; /* 1: storel */ ptr0[i] = var32; } } void emulate_loadpl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; /* 0: loadpl */ var32.i = ((orc_union64 *)(ex->src_ptrs[0]))->i; for (i = 0; i < n; i++) { /* 1: storel */ ptr0[i] = var32; } } void emulate_maxsl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: maxsl */ var34.i = ORC_MAX(var32.i, var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_maxul (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: maxul */ var34.i = ORC_MAX((orc_uint32)var32.i, (orc_uint32)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_minsl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: minsl */ var34.i = ORC_MIN(var32.i, var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_minul (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: minul */ var34.i = ORC_MIN((orc_uint32)var32.i, (orc_uint32)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_mulll (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mulll */ var34.i = (var32.i * var33.i) & 0xffffffff; /* 3: storel */ ptr0[i] = var34; } } void emulate_mulhsl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mulhsl */ var34.i = ((orc_int64)var32.i * (orc_int64)var33.i) >> 32; /* 3: storel */ ptr0[i] = var34; } } void emulate_mulhul (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mulhul */ var34.i = ((orc_uint64)(orc_uint32)var32.i * (orc_uint64)(orc_uint32)var33.i) >> 32; /* 3: storel */ ptr0[i] = var34; } } void emulate_orl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: orl */ var34.i = var32.i | var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_shll (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: shll */ var33.i = var32.i << ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storel */ ptr0[i] = var33; } } void emulate_shrsl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: shrsl */ var33.i = var32.i >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storel */ ptr0[i] = var33; } } void emulate_shrul (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: shrul */ var33.i = ((orc_uint32)var32.i) >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storel */ ptr0[i] = var33; } } void emulate_signl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: signl */ var33.i = ORC_CLAMP(var32.i,-1,1); /* 2: storel */ ptr0[i] = var33; } } void emulate_storel (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: storel */ ptr0[offset + i] = var32; } } void emulate_subl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: subl */ var34.i = var32.i - var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_subssl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: subssl */ var34.i = ORC_CLAMP_SL((orc_int64)var32.i - (orc_int64)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_subusl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: subusl */ var34.i = ORC_CLAMP_UL((orc_int64)(orc_uint32)var32.i - (orc_int64)(orc_uint32)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_xorl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: xorl */ var34.i = var32.i ^ var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_loadq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[offset + i]; /* 1: storeq */ ptr0[i] = var32; } } void emulate_loadpq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var32; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; /* 0: loadpq */ var32.i = ((orc_union64 *)(ex->src_ptrs[0]))->i; for (i = 0; i < n; i++) { /* 1: storeq */ ptr0[i] = var32; } } void emulate_storeq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: storeq */ ptr0[offset + i] = var32; } } void emulate_splatw3q (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: splatw3q */ var33.i = ((((orc_uint64)var32.i)>>48) << 48) | ((((orc_uint64)var32.i)>>48)<<32) | ((((orc_uint64)var32.i)>>48) << 16) | ((((orc_uint64)var32.i)>>48)); /* 2: storeq */ ptr0[i] = var33; } } void emulate_copyq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_cmpeqq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: cmpeqq */ var34.i = (var32.i == var33.i) ? (~0) : 0; /* 3: storeq */ ptr0[i] = var34; } } void emulate_cmpgtsq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: cmpgtsq */ var34.i = (var32.i > var33.i) ? (~0) : 0; /* 3: storeq */ ptr0[i] = var34; } } void emulate_andq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: andq */ var34.i = var32.i & var33.i; /* 3: storeq */ ptr0[i] = var34; } } void emulate_andnq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: andnq */ var34.i = (~var32.i) & var33.i; /* 3: storeq */ ptr0[i] = var34; } } void emulate_orq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: orq */ var34.i = var32.i | var33.i; /* 3: storeq */ ptr0[i] = var34; } } void emulate_xorq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: xorq */ var34.i = var32.i ^ var33.i; /* 3: storeq */ ptr0[i] = var34; } } void emulate_addq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: addq */ var34.i = var32.i + var33.i; /* 3: storeq */ ptr0[i] = var34; } } void emulate_subq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: subq */ var34.i = var32.i - var33.i; /* 3: storeq */ ptr0[i] = var34; } } void emulate_shlq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: shlq */ var33.i = var32.i << ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_shrsq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: shrsq */ var33.i = var32.i >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_shruq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: shruq */ var33.i = ((orc_uint64)var32.i) >> ((orc_union64 *)(ex->src_ptrs[1]))->i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_convsbw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convsbw */ var33.i = var32; /* 2: storew */ ptr0[i] = var33; } } void emulate_convubw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } void emulate_splatbw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: splatbw */ var33.i = ((var32&0xff) << 8) | (var32&0xff); /* 2: storew */ ptr0[i] = var33; } } void emulate_splatbl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: splatbl */ var33.i = ((var32&0xff) << 24) | ((var32&0xff)<<16) | ((var32&0xff) << 8) | (var32&0xff); /* 2: storel */ ptr0[i] = var33; } } void emulate_convswl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convswl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } void emulate_convuwl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convuwl */ var33.i = (orc_uint16)var32.i; /* 2: storel */ ptr0[i] = var33; } } void emulate_convslq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convslq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_convulq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convulq */ var33.i = (orc_uint32)var32.i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_convwb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convwb */ var33 = var32.i; /* 2: storeb */ ptr0[i] = var33; } } void emulate_convhwb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convhwb */ var33 = ((orc_uint16)var32.i)>>8; /* 2: storeb */ ptr0[i] = var33; } } void emulate_convssswb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convssswb */ var33 = ORC_CLAMP_SB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } void emulate_convsuswb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } void emulate_convusswb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convusswb */ var33 = ORC_MIN((orc_uint16)var32.i,ORC_SB_MAX); /* 2: storeb */ ptr0[i] = var33; } } void emulate_convuuswb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convuuswb */ var33 = ORC_MIN((orc_uint16)var32.i,ORC_UB_MAX); /* 2: storeb */ ptr0[i] = var33; } } void emulate_convlw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convlw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } void emulate_convhlw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convhlw */ var33.i = ((orc_uint32)var32.i)>>16; /* 2: storew */ ptr0[i] = var33; } } void emulate_convssslw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convssslw */ var33.i = ORC_CLAMP_SW(var32.i); /* 2: storew */ ptr0[i] = var33; } } void emulate_convsuslw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convsuslw */ var33.i = ORC_CLAMP_UW(var32.i); /* 2: storew */ ptr0[i] = var33; } } void emulate_convusslw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convusslw */ var33.i = ORC_CLAMP((orc_uint32)var32.i,0,ORC_SW_MAX); /* 2: storew */ ptr0[i] = var33; } } void emulate_convuuslw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convuuslw */ var33.i = ORC_CLAMP_UW((orc_uint32)var32.i); /* 2: storew */ ptr0[i] = var33; } } void emulate_convql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convql */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } void emulate_convsssql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convsssql */ var33.i = ORC_CLAMP_SL(var32.i); /* 2: storel */ ptr0[i] = var33; } } void emulate_convsusql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convsusql */ var33.i = ORC_CLAMP_UL(var32.i); /* 2: storel */ ptr0[i] = var33; } } void emulate_convussql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convussql */ var33.i = ORC_CLAMP_SL((orc_uint64)var32.i); /* 2: storel */ ptr0[i] = var33; } } void emulate_convuusql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convuusql */ var33.i = ORC_CLAMP_UL((orc_uint64)var32.i); /* 2: storel */ ptr0[i] = var33; } } void emulate_mulsbw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mulsbw */ var34.i = var32 * var33; /* 3: storew */ ptr0[i] = var34; } } void emulate_mulubw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mulubw */ var34.i = ((orc_uint8)var32) * ((orc_uint8)var33); /* 3: storew */ ptr0[i] = var34; } } void emulate_mulswl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mulswl */ var34.i = var32.i * var33.i; /* 3: storel */ ptr0[i] = var34; } } void emulate_muluwl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: muluwl */ var34.i = ((orc_uint16)var32.i) * ((orc_uint16)var33.i); /* 3: storel */ ptr0[i] = var34; } } void emulate_mulslq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mulslq */ var34.i = ((orc_int64)var32.i) * ((orc_int64)var33.i); /* 3: storeq */ ptr0[i] = var34; } } void emulate_mululq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mululq */ var34.i = ((orc_uint64)((orc_uint32)var32.i)) * ((orc_uint64)((orc_uint32)var33.i)); /* 3: storeq */ ptr0[i] = var34; } } void emulate_accw (OrcOpcodeExecutor *ex, int offset, int n) { int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var32; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: accw */ var12.i = var12.i + var32.i; } ((orc_union32 *)ex->dest_ptrs[0])->i = (var12.i + ((orc_union32 *)ex->dest_ptrs[0])->i) & 0xffff; } void emulate_accl (OrcOpcodeExecutor *ex, int offset, int n) { int i; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union32 var32; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: accl */ var12.i = var12.i + var32.i; } ((orc_union32 *)ex->dest_ptrs[0])->i += var12.i; } void emulate_accsadubl (OrcOpcodeExecutor *ex, int offset, int n) { int i; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } ((orc_union32 *)ex->dest_ptrs[0])->i += var12.i; } void emulate_swapw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: swapw */ var33.i = ORC_SWAP_W(var32.i); /* 2: storew */ ptr0[i] = var33; } } void emulate_swapl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: swapl */ var33.i = ORC_SWAP_L(var32.i); /* 2: storel */ ptr0[i] = var33; } } void emulate_swapwl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: swapwl */ var33.i = ((var32.i&0x0000ffff) << 16) | ((var32.i&0xffff0000) >> 16); /* 2: storel */ ptr0[i] = var33; } } void emulate_swapq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: swapq */ var33.i = ORC_SWAP_Q(var32.i); /* 2: storeq */ ptr0[i] = var33; } } void emulate_swaplq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: swaplq */ var33.i = (ORC_UINT64_C(var32.i&0x00000000ffffffff) << 32) | (ORC_UINT64_C(var32.i&0xffffffff00000000) >> 32); /* 2: storeq */ ptr0[i] = var33; } } void emulate_select0wb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } void emulate_select1wb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } void emulate_select0lw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var32.i; var33.i = _src.x2[0]; } /* 2: storew */ ptr0[i] = var33; } } void emulate_select1lw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var32.i; var33.i = _src.x2[1]; } /* 2: storew */ ptr0[i] = var33; } } void emulate_select0ql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: select0ql */ { orc_union64 _src; _src.i = var32.i; var33.i = _src.x2[0]; } /* 2: storel */ ptr0[i] = var33; } } void emulate_select1ql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: select1ql */ { orc_union64 _src; _src.i = var32.i; var33.i = _src.x2[1]; } /* 2: storel */ ptr0[i] = var33; } } void emulate_mergelq (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mergelq */ { orc_union64 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storeq */ ptr0[i] = var34; } } void emulate_mergewl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; ptr5 = (orc_union16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } void emulate_mergebw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr4 = (orc_int8 *)ex->src_ptrs[0]; ptr5 = (orc_int8 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mergebw */ { orc_union16 _dest; _dest.x2[0] = var32; _dest.x2[1] = var33; var34.i = _dest.i; } /* 3: storew */ ptr0[i] = var34; } } void emulate_splitql (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 * ORC_RESTRICT ptr1; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr1 = (orc_union32 *)ex->dest_ptrs[1]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: splitql */ { orc_union64 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storel */ ptr0[i] = var33; /* 3: storel */ ptr1[i] = var34; } } void emulate_splitlw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->dest_ptrs[0]; ptr1 = (orc_union16 *)ex->dest_ptrs[1]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var32.i; var33.i = _src.x2[1]; var34.i = _src.x2[0]; } /* 2: storew */ ptr0[i] = var33; /* 3: storew */ ptr1[i] = var34; } } void emulate_splitwb (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_int8 * ORC_RESTRICT ptr0; orc_int8 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->dest_ptrs[0]; ptr1 = (orc_int8 *)ex->dest_ptrs[1]; ptr4 = (orc_union16 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: splitwb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; var34 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; /* 3: storeb */ ptr1[i] = var34; } } void emulate_addf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); _dest1.f = _src1.f + _src2.f; var34.i = ORC_DENORMAL(_dest1.i); } /* 3: storel */ ptr0[i] = var34; } } void emulate_subf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: subf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); _dest1.f = _src1.f - _src2.f; var34.i = ORC_DENORMAL(_dest1.i); } /* 3: storel */ ptr0[i] = var34; } } void emulate_mulf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: mulf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); _dest1.f = _src1.f * _src2.f; var34.i = ORC_DENORMAL(_dest1.i); } /* 3: storel */ ptr0[i] = var34; } } void emulate_divf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: divf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); _dest1.f = _src1.f / _src2.f; var34.i = ORC_DENORMAL(_dest1.i); } /* 3: storel */ ptr0[i] = var34; } } void emulate_sqrtf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: sqrtf */ { orc_union32 _src1; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var32.i); _dest1.f = sqrt(_src1.f); var33.i = ORC_DENORMAL(_dest1.i); } /* 2: storel */ ptr0[i] = var33; } } void emulate_maxf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: maxf */ { orc_union32 _src1; orc_union32 _src2; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); if (ORC_ISNAN(_src1.i)) var34.i = _src1.i; else if (ORC_ISNAN(_src2.i)) var34.i = _src2.i; else var34.i = (_src1.f > _src2.f) ? _src1.i : _src2.i; } /* 3: storel */ ptr0[i] = var34; } } void emulate_minf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: minf */ { orc_union32 _src1; orc_union32 _src2; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); if (ORC_ISNAN(_src1.i)) var34.i = _src1.i; else if (ORC_ISNAN(_src2.i)) var34.i = _src2.i; else var34.i = (_src1.f < _src2.f) ? _src1.i : _src2.i; } /* 3: storel */ ptr0[i] = var34; } } void emulate_cmpeqf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: cmpeqf */ { orc_union32 _src1; orc_union32 _src2; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); var34.i = (_src1.f == _src2.f) ? (~0) : 0; } /* 3: storel */ ptr0[i] = var34; } } void emulate_cmpltf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: cmpltf */ { orc_union32 _src1; orc_union32 _src2; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); var34.i = (_src1.f < _src2.f) ? (~0) : 0; } /* 3: storel */ ptr0[i] = var34; } } void emulate_cmplef (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_union32 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: cmplef */ { orc_union32 _src1; orc_union32 _src2; _src1.i = ORC_DENORMAL(var32.i); _src2.i = ORC_DENORMAL(var33.i); var34.i = (_src1.f <= _src2.f) ? (~0) : 0; } /* 3: storel */ ptr0[i] = var34; } } void emulate_convfl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convfl */ { int tmp; tmp = (int)var32.f; if (tmp == 0x80000000 && !(var32.i&0x80000000)) tmp = 0x7fffffff; var33.i = tmp; } /* 2: storel */ ptr0[i] = var33; } } void emulate_convlf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convlf */ var33.f = var32.i; /* 2: storel */ ptr0[i] = var33; } } void emulate_addd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: addd */ { orc_union64 _src1; orc_union64 _src2; orc_union64 _dest1; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); _dest1.f = _src1.f + _src2.f; var34.i = ORC_DENORMAL_DOUBLE(_dest1.i); } /* 3: storeq */ ptr0[i] = var34; } } void emulate_subd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: subd */ { orc_union64 _src1; orc_union64 _src2; orc_union64 _dest1; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); _dest1.f = _src1.f - _src2.f; var34.i = ORC_DENORMAL_DOUBLE(_dest1.i); } /* 3: storeq */ ptr0[i] = var34; } } void emulate_muld (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: muld */ { orc_union64 _src1; orc_union64 _src2; orc_union64 _dest1; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); _dest1.f = _src1.f * _src2.f; var34.i = ORC_DENORMAL_DOUBLE(_dest1.i); } /* 3: storeq */ ptr0[i] = var34; } } void emulate_divd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: divd */ { orc_union64 _src1; orc_union64 _src2; orc_union64 _dest1; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); _dest1.f = _src1.f / _src2.f; var34.i = ORC_DENORMAL_DOUBLE(_dest1.i); } /* 3: storeq */ ptr0[i] = var34; } } void emulate_sqrtd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: sqrtd */ { orc_union64 _src1; orc_union64 _dest1; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _dest1.f = sqrt(_src1.f); var33.i = ORC_DENORMAL_DOUBLE(_dest1.i); } /* 2: storeq */ ptr0[i] = var33; } } void emulate_maxd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: maxd */ { orc_union64 _src1; orc_union64 _src2; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); if (ORC_ISNAN_DOUBLE(_src1.i)) var34.i = _src1.i; else if (ORC_ISNAN_DOUBLE(_src2.i)) var34.i = _src2.i; else var34.i = (_src1.f > _src2.f) ? _src1.i : _src2.i; } /* 3: storeq */ ptr0[i] = var34; } } void emulate_mind (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: mind */ { orc_union64 _src1; orc_union64 _src2; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); if (ORC_ISNAN_DOUBLE(_src1.i)) var34.i = _src1.i; else if (ORC_ISNAN_DOUBLE(_src2.i)) var34.i = _src2.i; else var34.i = (_src1.f < _src2.f) ? _src1.i : _src2.i; } /* 3: storeq */ ptr0[i] = var34; } } void emulate_cmpeqd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: cmpeqd */ { orc_union64 _src1; orc_union64 _src2; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); var34.i = (_src1.f == _src2.f) ? ORC_UINT64_C(~0) : 0; } /* 3: storeq */ ptr0[i] = var34; } } void emulate_cmpltd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: cmpltd */ { orc_union64 _src1; orc_union64 _src2; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); var34.i = (_src1.f < _src2.f) ? ORC_UINT64_C(~0) : 0; } /* 3: storeq */ ptr0[i] = var34; } } void emulate_cmpled (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var32; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; ptr5 = (orc_union64 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: loadq */ var33 = ptr5[i]; /* 2: cmpled */ { orc_union64 _src1; orc_union64 _src2; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _src2.i = ORC_DENORMAL_DOUBLE(var33.i); var34.i = (_src1.f <= _src2.f) ? ORC_UINT64_C(~0) : 0; } /* 3: storeq */ ptr0[i] = var34; } } void emulate_convdl (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convdl */ { int tmp; tmp = var32.f; if (tmp == 0x80000000 && !(var32.i & ORC_UINT64_C(0x8000000000000000))) tmp = 0x7fffffff; var33.i = tmp; } /* 2: storel */ ptr0[i] = var33; } } void emulate_convld (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convld */ var33.f = var32.i; /* 2: storeq */ ptr0[i] = var33; } } void emulate_convfd (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union64 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: convfd */ { orc_union32 _src1; _src1.i = ORC_DENORMAL(var32.i); var33.f = _src1.f; } /* 2: storeq */ ptr0[i] = var33; } } void emulate_convdf (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union64 *)ex->src_ptrs[0]; for (i = 0; i < n; i++) { /* 0: loadq */ var32 = ptr4[i]; /* 1: convdf */ { orc_union64 _src1; orc_union32 _dest; _src1.i = ORC_DENORMAL_DOUBLE(var32.i); _dest.f = _src1.f; var33.i = ORC_DENORMAL(_dest.i); } /* 2: storel */ ptr0[i] = var33; } } orc-0.4.18/orc/orccpu-arm.c0000664000175000017500000001141012071634360012310 00000000000000/* * ORC - Oil Runtime Compiler * Copyright (c) 2003,2004 David A. Schleef * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__linux__) #include #endif /***** arm *****/ #ifdef __arm__ #if 0 static unsigned long orc_profile_stamp_xscale(void) { unsigned int ts; __asm__ __volatile__ ( " mrc p14, 0, %0, c1, c0, 0 \n" : "=r" (ts)); return ts; } #endif #if defined(__linux__) static unsigned long orc_check_neon_proc_auxv (void) { unsigned long flags = 0; unsigned long aux[2]; ssize_t count; int fd; fd = open("/proc/self/auxv", O_RDONLY); if (fd < 0) { return 0; } while (1) { count = read(fd, aux, sizeof(aux)); if (count < sizeof(aux)) { break; } if (aux[0] == AT_HWCAP) { //if (aux[1] & 64) flags |= ORC_TARGET_NEON_VFP; //if (aux[1] & 512) flags |= ORC_TARGET_NEON_IWMMXT; if (aux[1] & 4096) flags |= ORC_TARGET_NEON_NEON; if (aux[1] & 128) flags |= ORC_TARGET_ARM_EDSP; ORC_INFO("arm hwcap %08x", aux[1]); } if (aux[0] == AT_PLATFORM) { ORC_INFO("arm platform %s", (char *)aux[1]); } else if (aux[0] == AT_NULL) { break; } } close(fd); return flags; } #endif #ifdef unused static void orc_cpu_arm_getflags_cpuinfo (char *cpuinfo) { char *cpuinfo_flags; char **flags; char **f; cpuinfo_flags = get_cpuinfo_line(cpuinfo, "Features"); if (cpuinfo_flags == NULL) { free (cpuinfo); return; } flags = strsplit(cpuinfo_flags, ' '); for (f = flags; *f; f++) { #if 0 if (strcmp (*f, "edsp") == 0) { ORC_DEBUG ("cpu feature %s", *f); orc_cpu_flags |= ORC_CPU_FLAG_EDSP; } if (strcmp (*f, "vfp") == 0) { ORC_DEBUG ("cpu feature %s", *f); orc_cpu_flags |= ORC_CPU_FLAG_VFP; } #endif free (*f); } free (flags); free (cpuinfo_flags); } static char * get_proc_cpuinfo (void) { char *cpuinfo; int fd; int n; cpuinfo = malloc(4096); if (cpuinfo == NULL) return NULL; fd = open("/proc/cpuinfo", O_RDONLY); if (fd < 0) { free (cpuinfo); return NULL; } n = read(fd, cpuinfo, 4095); if (n < 0) { free (cpuinfo); close (fd); return NULL; } cpuinfo[n] = 0; close (fd); return cpuinfo; } #endif unsigned long orc_arm_get_cpu_flags (void) { unsigned long neon_flags = 0; #ifdef __linux__ neon_flags = orc_check_neon_proc_auxv (); #endif #ifdef unused #ifdef __linux__ int arm_implementer = 0; char *cpuinfo; char *s; cpuinfo = get_proc_cpuinfo(); if (cpuinfo == NULL) return; s = get_cpuinfo_line(cpuinfo, "CPU implementer"); if (s) { arm_implementer = strtoul (s, NULL, 0); free(s); } switch(arm_implementer) { case 0x69: /* Intel */ case 0x41: /* ARM */ /* ARM chips are known to not have timestamping available from * user space */ break; default: break; } #if 0 s = get_cpuinfo_line(cpuinfo, "CPU architecture"); if (s) { int arm_arch; arm_arch = strtoul (s, NULL, 0); if (arm_arch >= 6) orc_cpu_flags |= ORC_CPU_FLAG_ARM6; free(s); } #endif orc_cpu_arm_getflags_cpuinfo (cpuinfo); free (cpuinfo); #endif #endif if (orc_compiler_flag_check ("-neon")) { neon_flags &= ~ORC_TARGET_NEON_NEON; } return neon_flags; } #endif orc-0.4.18/orc/orcrules-sse.c0000664000175000017500000026326112071634360012703 00000000000000 #include "config.h" #include #include #include #include #include #include #include #undef MMX #define SIZE 65536 /* sse rules */ static void sse_rule_loadpX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int reg; int size = ORC_PTR_TO_INT(user); if (src->vartype == ORC_VAR_TYPE_PARAM) { reg = dest->alloc; if (size == 8 && src->size == 8) { orc_x86_emit_mov_memoffset_sse (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]]), compiler->exec_reg, reg, FALSE); #ifndef MMX orc_sse_emit_movhps_load_memoffset (compiler, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]), compiler->exec_reg, reg); orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(2,0,2,0), reg, reg); #else /* FIXME yes, I understand this is terrible */ orc_sse_emit_pinsrw_memoffset (compiler, 2, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]) + 0, compiler->exec_reg, reg); orc_sse_emit_pinsrw_memoffset (compiler, 3, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]) + 2, compiler->exec_reg, reg); #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(1,0,1,0), reg, reg); #endif #endif } else { orc_x86_emit_mov_memoffset_sse (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]]), compiler->exec_reg, reg, FALSE); if (size < 8) { if (size == 1) { orc_sse_emit_punpcklbw (compiler, reg, reg); } #ifndef MMX if (size <= 2) { orc_sse_emit_pshuflw (compiler, 0, reg, reg); } orc_sse_emit_pshufd (compiler, 0, reg, reg); #else if (size <= 2) { orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(0,0,0,0), reg, reg); } else { orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); } #endif } else { #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(1,0,1,0), reg, reg); #endif } } } else if (src->vartype == ORC_VAR_TYPE_CONST) { orc_sse_load_constant (compiler, dest->alloc, size, src->value.i); } else { ORC_ASSERT(0); } } static void sse_rule_loadX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; offset = compiler->offset * src->size; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 2: orc_sse_emit_pxor (compiler, dest->alloc, dest->alloc); orc_sse_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); break; case 4: orc_x86_emit_mov_memoffset_sse (compiler, 4, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 8: orc_x86_emit_mov_memoffset_sse (compiler, 8, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 16: orc_x86_emit_mov_memoffset_sse (compiler, 16, offset, ptr_reg, dest->alloc, src->is_aligned); break; default: orc_compiler_error (compiler, "bad load size %d", src->size << compiler->loop_shift); break; } src->update_type = 2; } static void sse_rule_loadoffX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; if (compiler->vars[insn->src_args[1]].vartype != ORC_VAR_TYPE_CONST) { orc_compiler_error (compiler, "code generation rule for %s only works with constant offset", insn->opcode->name); return; } offset = (compiler->offset + compiler->vars[insn->src_args[1]].value.i) * src->size; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 2: orc_sse_emit_pxor (compiler, dest->alloc, dest->alloc); orc_sse_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); break; case 4: orc_x86_emit_mov_memoffset_sse (compiler, 4, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 8: orc_x86_emit_mov_memoffset_sse (compiler, 8, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 16: orc_x86_emit_mov_memoffset_sse (compiler, 16, offset, ptr_reg, dest->alloc, src->is_aligned); break; default: orc_compiler_error (compiler,"bad load size %d", src->size << compiler->loop_shift); break; } src->update_type = 2; } static void sse_rule_loadupib (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; int tmp = orc_compiler_get_temp_reg (compiler); offset = (compiler->offset * src->size) >> 1; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: case 2: orc_sse_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); orc_sse_emit_movdqa (compiler, dest->alloc, tmp); orc_sse_emit_psrlw_imm (compiler, 8, tmp); break; case 4: orc_sse_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); orc_sse_emit_pinsrw_memoffset (compiler, 0, offset + 1, ptr_reg, tmp); break; case 8: orc_x86_emit_mov_memoffset_sse (compiler, 4, offset, ptr_reg, dest->alloc, FALSE); orc_x86_emit_mov_memoffset_sse (compiler, 4, offset + 1, ptr_reg, tmp, FALSE); break; case 16: orc_x86_emit_mov_memoffset_sse (compiler, 8, offset, ptr_reg, dest->alloc, FALSE); orc_x86_emit_mov_memoffset_sse (compiler, 8, offset + 1, ptr_reg, tmp, FALSE); break; case 32: orc_x86_emit_mov_memoffset_sse (compiler, 16, offset, ptr_reg, dest->alloc, FALSE); orc_x86_emit_mov_memoffset_sse (compiler, 16, offset + 1, ptr_reg, tmp, FALSE); break; default: orc_compiler_error(compiler,"bad load size %d", src->size << compiler->loop_shift); break; } orc_sse_emit_pavgb (compiler, dest->alloc, tmp); orc_sse_emit_punpcklbw (compiler, tmp, dest->alloc); src->update_type = 1; } static void sse_rule_loadupdb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; offset = (compiler->offset * src->size) >> 1; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: case 2: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 4: orc_sse_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); break; case 8: orc_x86_emit_mov_memoffset_sse (compiler, 4, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 16: orc_x86_emit_mov_memoffset_sse (compiler, 8, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 32: orc_x86_emit_mov_memoffset_sse (compiler, 16, offset, ptr_reg, dest->alloc, src->is_aligned); break; default: orc_compiler_error(compiler,"bad load size %d", src->size << compiler->loop_shift); break; } switch (src->size) { case 1: orc_sse_emit_punpcklbw (compiler, dest->alloc, dest->alloc); break; case 2: orc_sse_emit_punpcklwd (compiler, dest->alloc, dest->alloc); break; case 4: orc_sse_emit_punpckldq (compiler, dest->alloc, dest->alloc); break; } src->update_type = 1; } static void sse_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int offset; int ptr_reg; offset = compiler->offset * dest->size; if (dest->ptr_register == 0) { orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, dest->ptr_offset, compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = dest->ptr_register; } switch (dest->size << compiler->loop_shift) { case 1: /* FIXME we might be using ecx twice here */ if (ptr_reg == compiler->gp_tmpreg) { orc_compiler_error (compiler, "unimplemented corner case in %s", insn->opcode->name); } orc_sse_emit_movd_store_register (compiler, src->alloc, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 1, compiler->gp_tmpreg, offset, ptr_reg); break; case 2: if (compiler->target_flags & ORC_TARGET_SSE_SSE4_1) { orc_sse_emit_pextrw_memoffset (compiler, 0, offset, src->alloc, ptr_reg); } else { /* FIXME we might be using ecx twice here */ if (ptr_reg == compiler->gp_tmpreg) { orc_compiler_error(compiler, "unimplemented corner case in %s", insn->opcode->name); } orc_sse_emit_movd_store_register (compiler, src->alloc, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 2, compiler->gp_tmpreg, offset, ptr_reg); } break; case 4: orc_x86_emit_mov_sse_memoffset (compiler, 4, src->alloc, offset, ptr_reg, dest->is_aligned, dest->is_uncached); break; case 8: orc_x86_emit_mov_sse_memoffset (compiler, 8, src->alloc, offset, ptr_reg, dest->is_aligned, dest->is_uncached); break; case 16: orc_x86_emit_mov_sse_memoffset (compiler, 16, src->alloc, offset, ptr_reg, dest->is_aligned, dest->is_uncached); break; default: orc_compiler_error (compiler, "bad size"); break; } dest->update_type = 2; } #if try1 static void sse_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int tmp2 = orc_compiler_get_temp_reg (compiler); int tmpc; orc_sse_emit_movd_store_register (compiler, X86_XMM6, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_sse_emit_movdqu_load_memindex (compiler, 0, src->ptr_register, compiler->gp_tmpreg, 4, dest->alloc); #if 0 orc_sse_emit_movdqa (compiler, X86_XMM6, tmp); orc_sse_emit_pslld_imm (compiler, 10, tmp); orc_sse_emit_psrld_imm (compiler, 26, tmp); orc_sse_emit_pslld_imm (compiler, 2, tmp); orc_sse_emit_movdqa (compiler, tmp, tmp2); orc_sse_emit_pslld_imm (compiler, 8, tmp2); orc_sse_emit_por (compiler, tmp2, tmp); orc_sse_emit_movdqa (compiler, tmp, tmp2); orc_sse_emit_pslld_imm (compiler, 16, tmp2); orc_sse_emit_por (compiler, tmp2, tmp); #else orc_sse_emit_movdqa (compiler, X86_XMM6, tmp); tmpc = orc_compiler_get_constant_long (compiler, 0x02020202, 0x06060606, 0x0a0a0a0a, 0x0e0e0e0e); orc_sse_emit_pshufb (compiler, tmpc, tmp); orc_sse_emit_paddb (compiler, tmp, tmp); orc_sse_emit_paddb (compiler, tmp, tmp); #endif orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(0,0,0,0), tmp, tmp2); orc_sse_emit_psubd (compiler, tmp2, tmp); tmpc = orc_compiler_get_constant (compiler, 4, 0x03020100); orc_sse_emit_paddd (compiler, tmpc, tmp); orc_sse_emit_pshufb (compiler, tmp, dest->alloc); orc_sse_emit_movdqa (compiler, X86_XMM7, tmp); orc_sse_emit_pslld_imm (compiler, compiler->loop_shift, tmp); orc_sse_emit_paddd (compiler, tmp, X86_XMM6); src->update_type = 0; } #endif static void sse_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; int increment_var = insn->src_args[2]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int i; for(i=0;i<(1<loop_shift);i++){ if (i == 0) { orc_x86_emit_mov_memoffset_sse (compiler, 4, 0, src->ptr_register, dest->alloc, FALSE); } else { orc_x86_emit_mov_memindex_sse (compiler, 4, 0, src->ptr_register, compiler->gp_tmpreg, 2, tmp, FALSE); #ifdef MMX //orc_mmx_emit_punpckldq (compiler, tmp, dest->alloc); orc_sse_emit_psllq_imm (compiler, 8*4*i, tmp); orc_sse_emit_por (compiler, tmp, dest->alloc); #else orc_sse_emit_pslldq_imm (compiler, 4*i, tmp); orc_sse_emit_por (compiler, tmp, dest->alloc); #endif } if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, 4, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); } orc_x86_emit_add_reg_reg_shift (compiler, compiler->is_64bit ? 8 : 4, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); src->update_type = 0; } #ifndef MMX static void sse_rule_ldreslinl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; int increment_var = insn->src_args[2]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int tmp2 = orc_compiler_get_temp_reg (compiler); int regsize = compiler->is_64bit ? 8 : 4; int i; if (compiler->loop_shift == 0) { orc_x86_emit_mov_memoffset_sse (compiler, 8, 0, src->ptr_register, tmp, FALSE); orc_sse_emit_pxor (compiler, tmp2, tmp2); orc_sse_emit_punpcklbw (compiler, tmp2, tmp); orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(3,2,3,2), tmp, tmp2); orc_sse_emit_psubw (compiler, tmp, tmp2); orc_sse_emit_movd_load_register (compiler, src->ptr_offset, tmp); orc_sse_emit_pshuflw (compiler, ORC_SSE_SHUF(0,0,0,0), tmp, tmp); orc_sse_emit_psrlw_imm (compiler, 8, tmp); orc_sse_emit_pmullw (compiler, tmp2, tmp); orc_sse_emit_psraw_imm (compiler, 8, tmp); orc_sse_emit_pxor (compiler, tmp2, tmp2); orc_sse_emit_packsswb (compiler, tmp2, tmp); orc_x86_emit_mov_memoffset_sse (compiler, 4, 0, src->ptr_register, dest->alloc, FALSE); orc_sse_emit_paddb (compiler, tmp, dest->alloc); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, regsize, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_add_reg_reg_shift (compiler, regsize, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); } else { int tmp3 = orc_compiler_get_temp_reg (compiler); int tmp4 = orc_compiler_get_temp_reg (compiler); for(i=0;i<(1<loop_shift);i+=2){ orc_x86_emit_mov_memoffset_sse (compiler, 8, 0, src->ptr_register, tmp, FALSE); orc_sse_emit_movd_load_register (compiler, src->ptr_offset, tmp4); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, 4, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_mov_memindex_sse (compiler, 8, 0, src->ptr_register, compiler->gp_tmpreg, 2, tmp2, FALSE); orc_sse_emit_punpckldq (compiler, tmp2, tmp); orc_sse_emit_movdqa (compiler, tmp, tmp2); if (i == 0) { orc_sse_emit_movdqa (compiler, tmp, dest->alloc); } else { orc_sse_emit_punpcklqdq (compiler, tmp, dest->alloc); } orc_sse_emit_pxor (compiler, tmp3, tmp3); orc_sse_emit_punpcklbw (compiler, tmp3, tmp); orc_sse_emit_punpckhbw (compiler, tmp3, tmp2); orc_sse_emit_psubw (compiler, tmp, tmp2); orc_sse_emit_pinsrw_register (compiler, 1, src->ptr_offset, tmp4); #if 0 orc_sse_emit_punpcklwd (compiler, tmp4, tmp4); orc_sse_emit_punpckldq (compiler, tmp4, tmp4); #else orc_sse_emit_pshuflw (compiler, ORC_SSE_SHUF(1,1,0,0), tmp4, tmp4); orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(1,1,0,0), tmp4, tmp4); #endif orc_sse_emit_psrlw_imm (compiler, 8, tmp4); orc_sse_emit_pmullw (compiler, tmp4, tmp2); orc_sse_emit_psraw_imm (compiler, 8, tmp2); orc_sse_emit_pxor (compiler, tmp, tmp); orc_sse_emit_packsswb (compiler, tmp, tmp2); if (i != 0) { orc_sse_emit_pslldq_imm (compiler, 8, tmp2); } orc_sse_emit_paddb (compiler, tmp2, dest->alloc); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, 4, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_add_reg_reg_shift (compiler, 8, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); } } src->update_type = 0; } #else static void mmx_rule_ldreslinl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; int increment_var = insn->src_args[2]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int tmp2 = orc_compiler_get_temp_reg (compiler); int zero; int regsize = compiler->is_64bit ? 8 : 4; int i; zero = orc_compiler_get_constant (compiler, 1, 0); for(i=0;i<(1<loop_shift);i++){ orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, tmp, FALSE); orc_x86_emit_mov_memoffset_mmx (compiler, 4, 4, src->ptr_register, tmp2, FALSE); orc_mmx_emit_punpcklbw (compiler, zero, tmp); orc_mmx_emit_punpcklbw (compiler, zero, tmp2); orc_mmx_emit_psubw (compiler, tmp, tmp2); orc_sse_emit_movd_load_register (compiler, src->ptr_offset, tmp); orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(0,0,0,0), tmp, tmp); orc_mmx_emit_psrlw_imm (compiler, 8, tmp); orc_mmx_emit_pmullw (compiler, tmp2, tmp); orc_mmx_emit_psraw_imm (compiler, 8, tmp); orc_mmx_emit_pxor (compiler, tmp2, tmp2); orc_mmx_emit_packsswb (compiler, tmp2, tmp); if (i == 0) { orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, dest->alloc, FALSE); orc_mmx_emit_paddb (compiler, tmp, dest->alloc); } else { orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, tmp2, FALSE); orc_mmx_emit_paddb (compiler, tmp, tmp2); orc_mmx_emit_psllq_imm (compiler, 32, tmp2); orc_mmx_emit_por (compiler, tmp2, dest->alloc); } if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, regsize, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_add_reg_reg_shift (compiler, regsize, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); } src->update_type = 0; } #endif static void sse_rule_copyx (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->vars[insn->src_args[0]].alloc == p->vars[insn->dest_args[0]].alloc) { return; } orc_sse_emit_movdqa (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } #define UNARY(opcode,insn_name,code) \ static void \ sse_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } #define BINARY(opcode,insn_name,code) \ static void \ sse_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[1]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } UNARY(absb,pabsb,0x381c) BINARY(addb,paddb,0xfc) BINARY(addssb,paddsb,0xec) BINARY(addusb,paddusb,0xdc) BINARY(andb,pand,0xdb) BINARY(andnb,pandn,0xdf) BINARY(avgub,pavgb,0xe0) BINARY(cmpeqb,pcmpeqb,0x74) BINARY(cmpgtsb,pcmpgtb,0x64) BINARY(maxsb,pmaxsb,0x383c) BINARY(maxub,pmaxub,0xde) BINARY(minsb,pminsb,0x3838) BINARY(minub,pminub,0xda) //BINARY(mullb,pmullb,0xd5) //BINARY(mulhsb,pmulhb,0xe5) //BINARY(mulhub,pmulhub,0xe4) BINARY(orb,por,0xeb) //UNARY(signb,psignb,0x3808) BINARY(subb,psubb,0xf8) BINARY(subssb,psubsb,0xe8) BINARY(subusb,psubusb,0xd8) BINARY(xorb,pxor,0xef) UNARY(absw,pabsw,0x381d) BINARY(addw,paddw,0xfd) BINARY(addssw,paddsw,0xed) BINARY(addusw,paddusw,0xdd) BINARY(andw,pand,0xdb) BINARY(andnw,pandn,0xdf) BINARY(avguw,pavgw,0xe3) BINARY(cmpeqw,pcmpeqw,0x75) BINARY(cmpgtsw,pcmpgtw,0x65) BINARY(maxsw,pmaxsw,0xee) BINARY(maxuw,pmaxuw,0x383e) BINARY(minsw,pminsw,0xea) BINARY(minuw,pminuw,0x383a) BINARY(mullw,pmullw,0xd5) BINARY(mulhsw,pmulhw,0xe5) BINARY(mulhuw,pmulhuw,0xe4) BINARY(orw,por,0xeb) //UNARY(signw,psignw,0x3809) BINARY(subw,psubw,0xf9) BINARY(subssw,psubsw,0xe9) BINARY(subusw,psubusw,0xd9) BINARY(xorw,pxor,0xef) UNARY(absl,pabsd,0x381e) BINARY(addl,paddd,0xfe) //BINARY(addssl,paddsd,0xed) //BINARY(addusl,paddusd,0xdd) BINARY(andl,pand,0xdb) BINARY(andnl,pandn,0xdf) //BINARY(avgul,pavgd,0xe3) BINARY(cmpeql,pcmpeqd,0x76) BINARY(cmpgtsl,pcmpgtd,0x66) BINARY(maxsl,pmaxsd,0x383d) BINARY(maxul,pmaxud,0x383f) BINARY(minsl,pminsd,0x3839) BINARY(minul,pminud,0x383b) BINARY(mulll,pmulld,0x3840) //BINARY(mulhsl,pmulhd,0xe5) //BINARY(mulhul,pmulhud,0xe4) BINARY(orl,por,0xeb) //UNARY(signl,psignd,0x380a) BINARY(subl,psubd,0xfa) //BINARY(subssl,psubsd,0xe9) //BINARY(subusl,psubusd,0xd9) BINARY(xorl,pxor,0xef) BINARY(andq,pand,0xdb) BINARY(andnq,pandn,0xdf) BINARY(orq,por,0xeb) BINARY(xorq,pxor,0xef) BINARY(cmpeqq,pcmpeqq,0x3829) BINARY(cmpgtsq,pcmpgtq,0x3837) #ifndef MMX BINARY(addq,paddq,0xd4) BINARY(subq,psubq,0xfb) #endif static void sse_rule_accw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_paddw (p, src, dest); } static void sse_rule_accl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX if (p->loop_shift == 0) { orc_sse_emit_pslldq_imm (p, 12, src); } #endif orc_sse_emit_paddd (p, src, dest); } static void sse_rule_accsadubl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = p->vars[insn->src_args[0]].alloc; int src2 = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); #ifndef MMX if (p->loop_shift <= 2) { orc_sse_emit_movdqa (p, src1, tmp); orc_sse_emit_pslldq_imm (p, 16 - (1<loop_shift), tmp); orc_sse_emit_movdqa (p, src2, tmp2); orc_sse_emit_pslldq_imm (p, 16 - (1<loop_shift), tmp2); orc_sse_emit_psadbw (p, tmp2, tmp); } else if (p->loop_shift == 3) { orc_sse_emit_movdqa (p, src1, tmp); orc_sse_emit_psadbw (p, src2, tmp); orc_sse_emit_pslldq_imm (p, 8, tmp); } else { orc_sse_emit_movdqa (p, src1, tmp); orc_sse_emit_psadbw (p, src2, tmp); } #else if (p->loop_shift <= 2) { orc_sse_emit_movdqa (p, src1, tmp); orc_sse_emit_psllq_imm (p, 8*(8 - (1<loop_shift)), tmp); orc_sse_emit_movdqa (p, src2, tmp2); orc_sse_emit_psllq_imm (p, 8*(8 - (1<loop_shift)), tmp2); orc_sse_emit_psadbw (p, tmp2, tmp); } else { orc_sse_emit_movdqa (p, src1, tmp); orc_sse_emit_psadbw (p, src2, tmp); } #endif orc_sse_emit_paddd (p, tmp, dest); } #ifndef MMX static void sse_rule_signX_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int opcodes[] = { ORC_X86_psignb, ORC_X86_psignw, ORC_X86_psignd }; int type = ORC_PTR_TO_INT(user); int tmpc; tmpc = orc_compiler_get_temp_constant (p, 1<vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 2, 0x0001); orc_sse_emit_pminsw (p, tmp, dest); tmp = orc_compiler_get_constant (p, 2, 0xffff); orc_sse_emit_pmaxsw (p, tmp, dest); } static void sse_rule_absb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_pxor (p, tmp, tmp); orc_sse_emit_pcmpgtb (p, src, tmp); orc_sse_emit_pxor (p, tmp, dest); orc_sse_emit_psubb (p, tmp, dest); } static void sse_rule_absw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (src == dest) { orc_sse_emit_movdqa (p, src, tmp); } else { orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_movdqa (p, tmp, dest); } orc_sse_emit_psraw_imm (p, 15, tmp); orc_sse_emit_pxor (p, tmp, dest); orc_sse_emit_psubw (p, tmp, dest); } static void sse_rule_absl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (src == dest) { orc_sse_emit_movdqa (p, src, tmp); } else { orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_movdqa (p, tmp, dest); } orc_sse_emit_psrad_imm (p, 31, tmp); orc_sse_emit_pxor (p, tmp, dest); orc_sse_emit_psubd (p, tmp, dest); } static void sse_rule_shift (OrcCompiler *p, void *user, OrcInstruction *insn) { int type = ORC_PTR_TO_INT(user); //int imm_code1[] = { 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73 }; //int imm_code2[] = { 6, 2, 4, 6, 2, 4, 6, 2 }; //int reg_code[] = { 0xf1, 0xd1, 0xe1, 0xf2, 0xd2, 0xe2, 0xf3, 0xd3 }; //const char *code[] = { "psllw", "psrlw", "psraw", "pslld", "psrld", "psrad", "psllq", "psrlq" }; const int opcodes[] = { ORC_X86_psllw, ORC_X86_psrlw, ORC_X86_psraw, ORC_X86_pslld, ORC_X86_psrld, ORC_X86_psrad, ORC_X86_psllq, ORC_X86_psrlq }; const int opcodes_imm[] = { ORC_X86_psllw_imm, ORC_X86_psrlw_imm, ORC_X86_psraw_imm, ORC_X86_pslld_imm, ORC_X86_psrld_imm, ORC_X86_psrad_imm, ORC_X86_psllq_imm, ORC_X86_psrlq_imm }; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_x86_emit_cpuinsn_imm (p, opcodes_imm[type], p->vars[insn->src_args[1]].value.i, 16, p->vars[insn->dest_args[0]].alloc); } else if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { int tmp = orc_compiler_get_temp_reg (p); /* FIXME this is a gross hack to reload the register with a * 64-bit version of the parameter. */ orc_x86_emit_mov_memoffset_sse (p, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[1]]), p->exec_reg, tmp, FALSE); orc_x86_emit_cpuinsn_size (p, opcodes[type], 16, tmp, p->vars[insn->dest_args[0]].alloc); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant or parameter shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void sse_rule_shlb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_sse_emit_psllw_imm (p, p->vars[insn->src_args[1]].value.i, dest); tmp = orc_compiler_get_constant (p, 1, 0xff&(0xff<vars[insn->src_args[1]].value.i)); orc_sse_emit_pand (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void sse_rule_shrsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_psraw_imm (p, p->vars[insn->src_args[1]].value.i, tmp); orc_sse_emit_psrlw_imm (p, 8, tmp); orc_sse_emit_psraw_imm (p, 8 + p->vars[insn->src_args[1]].value.i, dest); orc_sse_emit_psllw_imm (p, 8, dest); orc_sse_emit_por (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void sse_rule_shrub (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_sse_emit_psrlw_imm (p, p->vars[insn->src_args[1]].value.i, dest); tmp = orc_compiler_get_constant (p, 1, (0xff>>p->vars[insn->src_args[1]].value.i)); orc_sse_emit_pand (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void sse_rule_shrsq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { #ifndef MMX orc_sse_emit_pshufd (p, ORC_SSE_SHUF(3,3,1,1), src, tmp); #else orc_mmx_emit_pshufw (p, ORC_MMX_SHUF(3,2,3,2), src, tmp); #endif orc_sse_emit_psrad_imm (p, 31, tmp); orc_sse_emit_psllq_imm (p, 64-p->vars[insn->src_args[1]].value.i, tmp); orc_sse_emit_psrlq_imm (p, p->vars[insn->src_args[1]].value.i, dest); orc_sse_emit_por (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void sse_rule_convsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpcklbw (p, src, dest); orc_sse_emit_psraw_imm (p, 8, dest); } static void sse_rule_convubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* FIXME need a zero register */ if (0) { orc_sse_emit_punpcklbw (p, src, dest); orc_sse_emit_psrlw_imm (p, 8, dest); } else { orc_sse_emit_pxor(p, tmp, tmp); orc_sse_emit_punpcklbw (p, tmp, dest); } } static void sse_rule_convssswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_packsswb (p, src, dest); } static void sse_rule_convsuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_packuswb (p, src, dest); } static void sse_rule_convuuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_movdqa (p, src, dest); orc_sse_emit_psrlw_imm (p, 15, tmp); orc_sse_emit_psllw_imm (p, 14, tmp); orc_sse_emit_por (p, tmp, dest); orc_sse_emit_psllw_imm (p, 1, tmp); orc_sse_emit_pxor (p, tmp, dest); orc_sse_emit_packuswb (p, dest, dest); } static void sse_rule_convwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_psllw_imm (p, 8, dest); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_packuswb (p, dest, dest); } static void sse_rule_convhwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_packuswb (p, dest, dest); } static void sse_rule_convswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpcklwd (p, src, dest); orc_sse_emit_psrad_imm (p, 16, dest); } static void sse_rule_convuwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* FIXME need a zero register */ if (0) { orc_sse_emit_punpcklwd (p, src, dest); orc_sse_emit_psrld_imm (p, 16, dest); } else { orc_sse_emit_pxor(p, tmp, tmp); orc_sse_emit_punpcklwd (p, tmp, dest); } } static void sse_rule_convlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_pslld_imm (p, 16, dest); orc_sse_emit_psrad_imm (p, 16, dest); orc_sse_emit_packssdw (p, dest, dest); } static void sse_rule_convhlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_psrad_imm (p, 16, dest); orc_sse_emit_packssdw (p, dest, dest); } static void sse_rule_convssslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_packssdw (p, src, dest); } static void sse_rule_convsuslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_packusdw (p, src, dest); } static void sse_rule_convslq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_psrad_imm (p, 31, tmp); orc_sse_emit_punpckldq (p, tmp, dest); } static void sse_rule_convulq (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 4, 0); orc_sse_emit_punpckldq (p, tmp, dest); } static void sse_rule_convql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,2,0), src, dest); #else orc_sse_emit_movdqa (p, src, dest); #endif } static void sse_rule_splatw3q (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX orc_sse_emit_pshuflw (p, ORC_SSE_SHUF(3,3,3,3), dest, dest); orc_sse_emit_pshufhw (p, ORC_SSE_SHUF(3,3,3,3), dest, dest); #else orc_mmx_emit_pshufw (p, ORC_SSE_SHUF(3,3,3,3), dest, dest); #endif } static void sse_rule_splatbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpcklbw (p, dest, dest); } static void sse_rule_splatbl (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpcklbw (p, dest, dest); orc_sse_emit_punpcklwd (p, dest, dest); } static void sse_rule_div255w (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmpc; tmpc = orc_compiler_get_constant (p, 2, 0x0080); orc_sse_emit_paddw (p, tmpc, dest); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_psrlw_imm (p, 8, tmp); orc_sse_emit_paddw (p, tmp, dest); orc_sse_emit_psrlw_imm (p, 8, dest); } #if 1 static void sse_rule_divluw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* About 5.2 cycles per array member on ginger */ int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int a = orc_compiler_get_temp_reg (p); int j = orc_compiler_get_temp_reg (p); int j2 = orc_compiler_get_temp_reg (p); int l = orc_compiler_get_temp_reg (p); int divisor = orc_compiler_get_temp_reg (p); int tmp; int i; orc_sse_emit_movdqa (p, src, divisor); orc_sse_emit_psllw_imm (p, 8, divisor); orc_sse_emit_psrlw_imm (p, 1, divisor); orc_sse_load_constant (p, a, 2, 0x00ff); tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_sse_emit_movdqa (p, tmp, j); orc_sse_emit_psrlw_imm (p, 8, j); orc_sse_emit_pxor (p, tmp, dest); for(i=0;i<7;i++){ orc_sse_emit_movdqa (p, divisor, l); orc_sse_emit_pxor (p, tmp, l); orc_sse_emit_pcmpgtw (p, dest, l); orc_sse_emit_movdqa (p, l, j2); orc_sse_emit_pandn (p, divisor, l); orc_sse_emit_psubw (p, l, dest); orc_sse_emit_psrlw_imm (p, 1, divisor); orc_sse_emit_pand (p, j, j2); orc_sse_emit_pxor (p, j2, a); orc_sse_emit_psrlw_imm (p, 1, j); } orc_sse_emit_movdqa (p, divisor, l); orc_sse_emit_pxor (p, tmp, l); orc_sse_emit_pcmpgtw (p, dest, l); orc_sse_emit_pand (p, j, l); orc_sse_emit_pxor (p, l, a); orc_sse_emit_movdqa (p, a, dest); } #else static void sse_rule_divluw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* About 8.4 cycles per array member on ginger */ int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int b = orc_compiler_get_temp_reg (p); int a = orc_compiler_get_temp_reg (p); int k = orc_compiler_get_temp_reg (p); int j = orc_compiler_get_temp_reg (p); int tmp; int i; orc_sse_emit_movdqa (p, dest, b); tmp = orc_compiler_get_constant (p, 2, 0x00ff); orc_sse_emit_pand (p, tmp, src); tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_sse_emit_pxor (p, tmp, b); orc_sse_emit_pxor (p, a, a); orc_sse_emit_movdqa (p, tmp, j); orc_sse_emit_psrlw_imm (p, 8, j); for(i=0;i<8;i++){ orc_sse_emit_por (p, j, a); orc_sse_emit_movdqa (p, a, k); orc_sse_emit_pmullw (p, src, k); orc_sse_emit_pxor (p, tmp, k); orc_sse_emit_pcmpgtw (p, b, k); orc_sse_emit_pand (p, j, k); orc_sse_emit_pxor (p, k, a); orc_sse_emit_psrlw_imm (p, 1, j); } orc_sse_emit_movdqa (p, a, dest); } #endif static void sse_rule_mulsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_punpcklbw (p, src, tmp); orc_sse_emit_psraw_imm (p, 8, tmp); orc_sse_emit_punpcklbw (p, dest, dest); orc_sse_emit_psraw_imm (p, 8, dest); orc_sse_emit_pmullw (p, tmp, dest); } static void sse_rule_mulubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_punpcklbw (p, src, tmp); orc_sse_emit_psrlw_imm (p, 8, tmp); orc_sse_emit_punpcklbw (p, dest, dest); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_pmullw (p, tmp, dest); } static void sse_rule_mullb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pmullw (p, src, dest); orc_sse_emit_psllw_imm (p, 8, dest); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_movdqa (p, src, tmp2); orc_sse_emit_psraw_imm (p, 8, tmp2); orc_sse_emit_psraw_imm (p, 8, tmp); orc_sse_emit_pmullw (p, tmp2, tmp); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_mulhsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_movdqa (p, dest, tmp2); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_psraw_imm (p, 8, tmp); orc_sse_emit_psllw_imm (p, 8, dest); orc_sse_emit_psraw_imm (p, 8, dest); orc_sse_emit_pmullw (p, tmp, dest); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_psraw_imm (p, 8, tmp); orc_sse_emit_psraw_imm (p, 8, tmp2); orc_sse_emit_pmullw (p, tmp, tmp2); orc_sse_emit_psrlw_imm (p, 8, tmp2); orc_sse_emit_psllw_imm (p, 8, tmp2); orc_sse_emit_por (p, tmp2, dest); } static void sse_rule_mulhub (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_movdqa (p, dest, tmp2); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_psrlw_imm (p, 8, tmp); orc_sse_emit_psllw_imm (p, 8, dest); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_pmullw (p, tmp, dest); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_psrlw_imm (p, 8, tmp); orc_sse_emit_psrlw_imm (p, 8, tmp2); orc_sse_emit_pmullw (p, tmp, tmp2); orc_sse_emit_psrlw_imm (p, 8, tmp2); orc_sse_emit_psllw_imm (p, 8, tmp2); orc_sse_emit_por (p, tmp2, dest); } static void sse_rule_mulswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pmulhw (p, src, tmp); orc_sse_emit_pmullw (p, src, dest); orc_sse_emit_punpcklwd (p, tmp, dest); } static void sse_rule_muluwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pmulhuw (p, src, tmp); orc_sse_emit_pmullw (p, src, dest); orc_sse_emit_punpcklwd (p, tmp, dest); } static void sse_rule_mulll_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); orc_x86_emit_mov_sse_memoffset (p, 16, p->vars[insn->src_args[0]].alloc, offset, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_sse_memoffset (p, 16, p->vars[insn->src_args[1]].alloc, offset + 16, p->exec_reg, FALSE, FALSE); for(i=0;i<(1<insn_shift);i++) { orc_x86_emit_mov_memoffset_reg (p, 4, offset + 4*i, p->exec_reg, p->gp_tmpreg); orc_x86_emit_imul_memoffset_reg (p, 4, offset + 16+4*i, p->exec_reg, p->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (p, 4, p->gp_tmpreg, offset + 4*i, p->exec_reg); } orc_x86_emit_mov_memoffset_sse (p, 16, offset, p->exec_reg, p->vars[insn->dest_args[0]].alloc, FALSE); } #ifndef MMX static void sse_rule_mulhsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,3,0,1), dest, tmp); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,3,0,1), src, tmp2); orc_sse_emit_pmuldq (p, src, dest); orc_sse_emit_pmuldq (p, tmp, tmp2); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,3,1), dest, dest); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,3,1), tmp2, tmp2); orc_sse_emit_punpckldq (p, tmp2, dest); } #endif #ifndef MMX static void sse_rule_mulhsl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; int regsize = p->is_64bit ? 8 : 4; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); orc_x86_emit_mov_sse_memoffset (p, 16, p->vars[insn->src_args[0]].alloc, offset, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_sse_memoffset (p, 16, p->vars[insn->src_args[1]].alloc, offset + 16, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EAX, offset + 32, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EDX, offset + 40, p->exec_reg); for(i=0;i<(1<insn_shift);i++) { orc_x86_emit_mov_memoffset_reg (p, 4, offset + 4*i, p->exec_reg, X86_EAX); orc_x86_emit_cpuinsn_memoffset (p, ORC_X86_imul_rm, 4, offset + 16 + 4*i, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, 4, X86_EDX, offset + 4*i, p->exec_reg); } orc_x86_emit_mov_memoffset_sse (p, 16, offset, p->exec_reg, p->vars[insn->dest_args[0]].alloc, FALSE); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 32, p->exec_reg, X86_EAX); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 40, p->exec_reg, X86_EDX); } #endif #ifndef MMX static void sse_rule_mulhul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,3,0,1), dest, tmp); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,3,0,1), src, tmp2); orc_sse_emit_pmuludq (p, src, dest); orc_sse_emit_pmuludq (p, tmp, tmp2); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,3,1), dest, dest); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,3,1), tmp2, tmp2); orc_sse_emit_punpckldq (p, tmp2, dest); } #endif static void sse_rule_mulslq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_punpckldq (p, dest, dest); orc_sse_emit_punpckldq (p, tmp, tmp); orc_sse_emit_pmuldq (p, tmp, dest); } #ifndef MMX static void sse_rule_mulslq_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; int regsize = p->is_64bit ? 8 : 4; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); orc_x86_emit_mov_sse_memoffset (p, 8, p->vars[insn->src_args[0]].alloc, offset, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_sse_memoffset (p, 8, p->vars[insn->src_args[1]].alloc, offset + 8, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EAX, offset + 32, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EDX, offset + 40, p->exec_reg); for(i=0;i<(1<insn_shift);i++) { orc_x86_emit_mov_memoffset_reg (p, 4, offset + 4*i, p->exec_reg, X86_EAX); orc_x86_emit_cpuinsn_memoffset (p, ORC_X86_imul_rm, 4, offset + 8 + 4*i, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, 4, X86_EAX, offset + 16 + 8*i, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, 4, X86_EDX, offset + 16 + 8*i + 4, p->exec_reg); } orc_x86_emit_mov_memoffset_sse (p, 16, offset + 16, p->exec_reg, p->vars[insn->dest_args[0]].alloc, FALSE); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 32, p->exec_reg, X86_EAX); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 40, p->exec_reg, X86_EDX); } #endif #ifndef MMX static void sse_rule_mululq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_punpckldq (p, dest, dest); orc_sse_emit_punpckldq (p, tmp, tmp); orc_sse_emit_pmuludq (p, tmp, dest); } #endif static void sse_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ /* same as convlw */ orc_sse_emit_pslld_imm (p, 16, dest); orc_sse_emit_psrad_imm (p, 16, dest); orc_sse_emit_packssdw (p, dest, dest); } static void sse_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ orc_sse_emit_psrad_imm (p, 16, dest); orc_sse_emit_packssdw (p, dest, dest); } static void sse_rule_select0ql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* same as convql */ #ifndef MMX orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,2,0), src, dest); #else orc_sse_emit_movdqa (p, src, dest); #endif } static void sse_rule_select1ql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_psrlq_imm (p, 32, dest); #ifndef MMX orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,2,0), src, dest); #else orc_sse_emit_movdqa (p, src, dest); #endif } static void sse_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ /* same as convwb */ orc_sse_emit_psllw_imm (p, 8, dest); orc_sse_emit_psraw_imm (p, 8, dest); orc_sse_emit_packsswb (p, dest, dest); } static void sse_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ orc_sse_emit_psraw_imm (p, 8, dest); orc_sse_emit_packsswb (p, dest, dest); } static void sse_rule_splitql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest1 = p->vars[insn->dest_args[0]].alloc; int dest2 = p->vars[insn->dest_args[1]].alloc; #ifndef MMX orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,0,2,0), src, dest2); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(3,1,3,1), src, dest1); #else orc_sse_emit_movdqa (p, src, dest2); orc_sse_emit_pshufw (p, ORC_SSE_SHUF(3,2,3,2), src, dest1); #endif } static void sse_rule_splitlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest1 = p->vars[insn->dest_args[0]].alloc; int dest2 = p->vars[insn->dest_args[1]].alloc; /* FIXME slow */ orc_sse_emit_psrad_imm (p, 16, dest1); orc_sse_emit_packssdw (p, dest1, dest1); if (dest2 != src) { orc_sse_emit_movdqa (p, src, dest2); } orc_sse_emit_pslld_imm (p, 16, dest2); orc_sse_emit_psrad_imm (p, 16, dest2); orc_sse_emit_packssdw (p, dest2, dest2); } static void sse_rule_splitwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest1 = p->vars[insn->dest_args[0]].alloc; int dest2 = p->vars[insn->dest_args[1]].alloc; int tmp = orc_compiler_get_constant (p, 2, 0xff); /* FIXME slow */ orc_sse_emit_psraw_imm (p, 8, dest1); orc_sse_emit_packsswb (p, dest1, dest1); if (dest2 != src) { orc_sse_emit_movdqa (p, src, dest2); } #if 0 orc_sse_emit_psllw_imm (p, 8, dest2); orc_sse_emit_psraw_imm (p, 8, dest2); orc_sse_emit_packsswb (p, dest2, dest2); #else orc_sse_emit_pand (p, tmp, dest2); orc_sse_emit_packuswb (p, dest2, dest2); #endif } static void sse_rule_mergebw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpcklbw (p, src, dest); } static void sse_rule_mergewl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpcklwd (p, src, dest); } static void sse_rule_mergelq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_sse_emit_punpckldq (p, src, dest); } static void sse_rule_swapw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_swapl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pslld_imm (p, 16, tmp); orc_sse_emit_psrld_imm (p, 16, dest); orc_sse_emit_por (p, tmp, dest); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_swapwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pslld_imm (p, 16, tmp); orc_sse_emit_psrld_imm (p, 16, dest); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_swapq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_psllq_imm (p, 32, tmp); orc_sse_emit_psrlq_imm (p, 32, dest); orc_sse_emit_por (p, tmp, dest); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pslld_imm (p, 16, tmp); orc_sse_emit_psrld_imm (p, 16, dest); orc_sse_emit_por (p, tmp, dest); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_psllw_imm (p, 8, tmp); orc_sse_emit_psrlw_imm (p, 8, dest); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_swaplq (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX orc_sse_emit_pshufd (p, ORC_SSE_SHUF(2,3,0,1), dest, dest); #else orc_mmx_emit_pshufw (p, ORC_MMX_SHUF(1,0,3,2), dest, dest); #endif } #ifndef MMX static void sse_rule_swapw_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x02030001, 0x06070405, 0x0a0b0809, 0x0e0f0c0d); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_swapw (p, user, insn); } } static void sse_rule_swapl_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_swapl (p, user, insn); } } static void sse_rule_swapwl_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_swapl (p, user, insn); } } static void sse_rule_swapq_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x04050607, 0x00010203, 0x0c0d0e0f, 0x08090a0b); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_swapq (p, user, insn); } } static void sse_rule_select0lw_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x05040100, 0x0d0c0908, 0x05040100, 0x0d0c0908); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_select0lw (p, user, insn); } } static void sse_rule_select1lw_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x07060302, 0x0f0e0b0a, 0x07060302, 0x0f0e0b0a); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_select1lw (p, user, insn); } } static void sse_rule_select0wb_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x06040200, 0x0e0c0a08, 0x06040200, 0x0e0c0a08); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_select0wb (p, user, insn); } } static void sse_rule_select1wb_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x07050301, 0x0f0d0b09, 0x07050301, 0x0f0d0b09); if (tmp != ORC_REG_INVALID) { orc_sse_emit_pshufb (p, tmp, dest); } else { sse_rule_select1wb (p, user, insn); } } #endif /* slow rules */ static void sse_rule_maxuw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); orc_sse_emit_pmaxsw (p, src, dest); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); } static void sse_rule_minuw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); orc_sse_emit_pminsw (p, src, dest); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); } static void sse_rule_avgsb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 1, 0x80); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); orc_sse_emit_pavgb (p, src, dest); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); } static void sse_rule_avgsw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); orc_sse_emit_pavgw (p, src, dest); orc_sse_emit_pxor(p, tmp, src); orc_sse_emit_pxor(p, tmp, dest); } static void sse_rule_maxsb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pcmpgtb (p, src, tmp); orc_sse_emit_pand (p, tmp, dest); orc_sse_emit_pandn (p, src, tmp); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_minsb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pcmpgtb (p, dest, tmp); orc_sse_emit_pand (p, tmp, dest); orc_sse_emit_pandn (p, src, tmp); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_maxsl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pcmpgtd (p, src, tmp); orc_sse_emit_pand (p, tmp, dest); orc_sse_emit_pandn (p, src, tmp); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_minsl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pcmpgtd (p, dest, tmp); orc_sse_emit_pand (p, tmp, dest); orc_sse_emit_pandn (p, src, tmp); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_maxul_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmpc; tmpc = orc_compiler_get_constant (p, 4, 0x80000000); orc_sse_emit_pxor(p, tmpc, src); orc_sse_emit_pxor(p, tmpc, dest); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pcmpgtd (p, src, tmp); orc_sse_emit_pand (p, tmp, dest); orc_sse_emit_pandn (p, src, tmp); orc_sse_emit_por (p, tmp, dest); orc_sse_emit_pxor(p, tmpc, src); orc_sse_emit_pxor(p, tmpc, dest); } static void sse_rule_minul_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmpc; tmpc = orc_compiler_get_constant (p, 4, 0x80000000); orc_sse_emit_pxor(p, tmpc, src); orc_sse_emit_pxor(p, tmpc, dest); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pcmpgtd (p, dest, tmp); orc_sse_emit_pand (p, tmp, dest); orc_sse_emit_pandn (p, src, tmp); orc_sse_emit_por (p, tmp, dest); orc_sse_emit_pxor(p, tmpc, src); orc_sse_emit_pxor(p, tmpc, dest); } static void sse_rule_avgsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* (a+b+1) >> 1 = (a|b) - ((a^b)>>1) */ orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pxor(p, src, tmp); orc_sse_emit_psrad_imm(p, 1, tmp); orc_sse_emit_por(p, src, dest); orc_sse_emit_psubd(p, tmp, dest); } static void sse_rule_avgul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* (a+b+1) >> 1 = (a|b) - ((a^b)>>1) */ orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_pxor(p, src, tmp); orc_sse_emit_psrld_imm(p, 1, tmp); orc_sse_emit_por(p, src, dest); orc_sse_emit_psubd(p, tmp, dest); } static void sse_rule_addssl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); #if 0 int tmp2 = orc_compiler_get_temp_reg (p); int tmp3 = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pand (p, dest, tmp); orc_sse_emit_movdqa (p, src, tmp2); orc_sse_emit_pxor (p, dest, tmp2); orc_sse_emit_psrad_imm (p, 1, tmp2); orc_sse_emit_paddd (p, tmp2, tmp); orc_sse_emit_psrad (p, 30, tmp); orc_sse_emit_pslld (p, 30, tmp); orc_sse_emit_movdqa (p, tmp, tmp2); orc_sse_emit_pslld_imm (p, 1, tmp2); orc_sse_emit_movdqa (p, tmp, tmp3); orc_sse_emit_pxor (p, tmp2, tmp3); orc_sse_emit_psrad_imm (p, 31, tmp3); orc_sse_emit_psrad_imm (p, 31, tmp2); tmp = orc_compiler_get_constant (p, 4, 0x80000000); orc_sse_emit_pxor (p, tmp, tmp2); // clamped value orc_sse_emit_pand (p, tmp3, tmp2); orc_sse_emit_paddd (p, src, dest); orc_sse_emit_pandn (p, dest, tmp3); // tmp is mask: ~0 is for clamping orc_sse_emit_movdqa (p, tmp3, dest); orc_sse_emit_por (p, tmp2, dest); #endif int s = orc_compiler_get_temp_reg (p); int t = orc_compiler_get_temp_reg (p); /* From Tim Terriberry: (slightly faster than above) m=0xFFFFFFFF; s=_a; t=_a; s^=_b; _a+=_b; t^=_a; t^=m; m>>=1; s|=t; t=_b; s>>=31; t>>=31; _a&=s; t^=m; s=~s&t; _a|=s; */ orc_sse_emit_movdqa (p, dest, s); orc_sse_emit_movdqa (p, dest, t); orc_sse_emit_pxor (p, src, s); orc_sse_emit_paddd (p, src, dest); orc_sse_emit_pxor (p, dest, t); tmp = orc_compiler_get_constant (p, 4, 0xffffffff); orc_sse_emit_pxor (p, tmp, t); orc_sse_emit_por (p, t, s); orc_sse_emit_movdqa (p, src, t); orc_sse_emit_psrad_imm (p, 31, s); orc_sse_emit_psrad_imm (p, 31, t); orc_sse_emit_pand (p, s, dest); tmp = orc_compiler_get_constant (p, 4, 0x7fffffff); orc_sse_emit_pxor (p, tmp, t); orc_sse_emit_pandn (p, t, s); orc_sse_emit_por (p, s, dest); } static void sse_rule_subssl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); int tmp3 = orc_compiler_get_temp_reg (p); tmp = orc_compiler_get_temp_constant (p, 4, 0xffffffff); orc_sse_emit_pxor (p, src, tmp); orc_sse_emit_movdqa (p, tmp, tmp2); orc_sse_emit_por (p, dest, tmp); orc_sse_emit_pxor (p, dest, tmp2); orc_sse_emit_psrad_imm (p, 1, tmp2); orc_sse_emit_psubd (p, tmp2, tmp); orc_sse_emit_psrad_imm (p, 30, tmp); orc_sse_emit_pslld_imm (p, 30, tmp); orc_sse_emit_movdqa (p, tmp, tmp2); orc_sse_emit_pslld_imm (p, 1, tmp2); orc_sse_emit_movdqa (p, tmp, tmp3); orc_sse_emit_pxor (p, tmp2, tmp3); orc_sse_emit_psrad_imm (p, 31, tmp3); // tmp3 is mask: ~0 is for clamping orc_sse_emit_psrad_imm (p, 31, tmp2); tmp = orc_compiler_get_constant (p, 4, 0x80000000); orc_sse_emit_pxor (p, tmp, tmp2); // clamped value orc_sse_emit_pand (p, tmp3, tmp2); orc_sse_emit_psubd (p, src, dest); orc_sse_emit_pandn (p, dest, tmp3); orc_sse_emit_movdqa (p, tmp3, dest); orc_sse_emit_por (p, tmp2, dest); } static void sse_rule_addusl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); #if 0 /* an alternate version. slower. */ /* Compute the bit that gets carried from bit 0 to bit 1 */ orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pand (p, dest, tmp); orc_sse_emit_pslld_imm (p, 31, tmp); orc_sse_emit_psrld_imm (p, 31, tmp); /* Add in (src>>1) */ orc_sse_emit_movdqa (p, src, tmp2); orc_sse_emit_psrld_imm (p, 1, tmp2); orc_sse_emit_paddd (p, tmp2, tmp); /* Add in (dest>>1) */ orc_sse_emit_movdqa (p, dest, tmp2); orc_sse_emit_psrld_imm (p, 1, tmp2); orc_sse_emit_paddd (p, tmp2, tmp); /* turn overflow bit into mask */ orc_sse_emit_psrad_imm (p, 31, tmp); /* compute the sum, then or over the mask */ orc_sse_emit_paddd (p, src, dest); orc_sse_emit_por (p, tmp, dest); #endif orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_pand (p, dest, tmp); orc_sse_emit_movdqa (p, src, tmp2); orc_sse_emit_pxor (p, dest, tmp2); orc_sse_emit_psrld_imm (p, 1, tmp2); orc_sse_emit_paddd (p, tmp2, tmp); orc_sse_emit_psrad_imm (p, 31, tmp); orc_sse_emit_paddd (p, src, dest); orc_sse_emit_por (p, tmp, dest); } static void sse_rule_subusl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, src, tmp2); orc_sse_emit_psrld_imm (p, 1, tmp2); orc_sse_emit_movdqa (p, dest, tmp); orc_sse_emit_psrld_imm (p, 1, tmp); orc_sse_emit_psubd (p, tmp, tmp2); /* turn overflow bit into mask */ orc_sse_emit_psrad_imm (p, 31, tmp2); /* compute the difference, then and over the mask */ orc_sse_emit_psubd (p, src, dest); orc_sse_emit_pand (p, tmp2, dest); } #ifndef MMX /* float ops */ #define UNARY_F(opcode,insn_name,code) \ static void \ sse_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } #define BINARY_F(opcode,insn_name,code) \ static void \ sse_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[1]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } BINARY_F(addf, addps, 0x58) BINARY_F(subf, subps, 0x5c) BINARY_F(mulf, mulps, 0x59) BINARY_F(divf, divps, 0x5e) UNARY_F(sqrtf, sqrtps, 0x51) #define UNARY_D(opcode,insn_name,code) \ static void \ sse_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } #define BINARY_D(opcode,insn_name,code) \ static void \ sse_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[1]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } BINARY_D(addd, addpd, 0x58) BINARY_D(subd, subpd, 0x5c) BINARY_D(muld, mulpd, 0x59) BINARY_D(divd, divpd, 0x5e) UNARY_D(sqrtd, sqrtpd, 0x51) static void sse_rule_minf (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_sse_emit_minps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, p->vars[insn->src_args[1]].alloc, tmp); orc_sse_emit_minps (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_sse_emit_minps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_sse_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void sse_rule_mind (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_sse_emit_minpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, p->vars[insn->src_args[1]].alloc, tmp); orc_sse_emit_minpd (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_sse_emit_minpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_sse_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void sse_rule_maxf (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_sse_emit_maxps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, p->vars[insn->src_args[1]].alloc, tmp); orc_sse_emit_maxps (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_sse_emit_maxps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_sse_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void sse_rule_maxd (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_sse_emit_maxpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_sse_emit_movdqa (p, p->vars[insn->src_args[1]].alloc, tmp); orc_sse_emit_maxpd (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_sse_emit_maxpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_sse_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void sse_rule_cmpeqf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cmpeqps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_cmpeqd (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cmpeqpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_cmpltf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cmpltps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_cmpltd (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cmpltpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_cmplef (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cmpleps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_cmpled (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cmplepd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_convfl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmpc; int tmp = orc_compiler_get_temp_reg (p); tmpc = orc_compiler_get_temp_constant (p, 4, 0x80000000); orc_sse_emit_movdqa (p, src, tmp); orc_sse_emit_cvttps2dq (p, src, dest); orc_sse_emit_psrad_imm (p, 31, tmp); orc_sse_emit_pcmpeqd (p, dest, tmpc); orc_sse_emit_pandn (p, tmpc, tmp); orc_sse_emit_paddd (p, tmp, dest); } static void sse_rule_convdl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmpc; int tmp = orc_compiler_get_temp_reg (p); tmpc = orc_compiler_get_temp_constant (p, 4, 0x80000000); orc_sse_emit_pshufd (p, ORC_SSE_SHUF(3,1,3,1), src, tmp); orc_sse_emit_cvttpd2dq (p, src, dest); orc_sse_emit_psrad_imm (p, 31, tmp); orc_sse_emit_pcmpeqd (p, dest, tmpc); orc_sse_emit_pandn (p, tmpc, tmp); orc_sse_emit_paddd (p, tmp, dest); } static void sse_rule_convlf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cvtdq2ps (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_convld (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cvtdq2pd (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_convfd (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cvtps2pd (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } static void sse_rule_convdf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_sse_emit_cvtpd2ps (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } #endif #define UNARY_SSE41(opcode,insn_name) \ static void \ sse_rule_ ## opcode ## _sse41 (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_sse_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } UNARY_SSE41(convsbw,pmovsxbw); UNARY_SSE41(convswl,pmovsxwd); UNARY_SSE41(convslq,pmovsxdq); UNARY_SSE41(convubw,pmovzxbw); UNARY_SSE41(convuwl,pmovzxwd); UNARY_SSE41(convulq,pmovzxdq); void orc_compiler_sse_register_rules (OrcTarget *target) { OrcRuleSet *rule_set; #define REG(x) \ orc_rule_register (rule_set, #x , sse_rule_ ## x, NULL) /* SSE 2 */ #ifndef MMX rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_SSE_SSE2); #else rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_MMX_MMX); #endif orc_rule_register (rule_set, "loadb", sse_rule_loadX, NULL); orc_rule_register (rule_set, "loadw", sse_rule_loadX, NULL); orc_rule_register (rule_set, "loadl", sse_rule_loadX, NULL); orc_rule_register (rule_set, "loadq", sse_rule_loadX, NULL); orc_rule_register (rule_set, "loadoffb", sse_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffw", sse_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffl", sse_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadupdb", sse_rule_loadupdb, NULL); orc_rule_register (rule_set, "loadupib", sse_rule_loadupib, NULL); orc_rule_register (rule_set, "loadpb", sse_rule_loadpX, (void *)1); orc_rule_register (rule_set, "loadpw", sse_rule_loadpX, (void *)2); orc_rule_register (rule_set, "loadpl", sse_rule_loadpX, (void *)4); orc_rule_register (rule_set, "loadpq", sse_rule_loadpX, (void *)8); orc_rule_register (rule_set, "ldresnearl", sse_rule_ldresnearl, NULL); orc_rule_register (rule_set, "ldreslinl", sse_rule_ldreslinl, NULL); orc_rule_register (rule_set, "storeb", sse_rule_storeX, NULL); orc_rule_register (rule_set, "storew", sse_rule_storeX, NULL); orc_rule_register (rule_set, "storel", sse_rule_storeX, NULL); orc_rule_register (rule_set, "storeq", sse_rule_storeX, NULL); REG(addb); REG(addssb); REG(addusb); REG(andb); REG(andnb); REG(avgub); REG(cmpeqb); REG(cmpgtsb); REG(maxub); REG(minub); REG(orb); REG(subb); REG(subssb); REG(subusb); REG(xorb); REG(addw); REG(addssw); REG(addusw); REG(andw); REG(andnw); REG(avguw); REG(cmpeqw); REG(cmpgtsw); REG(maxsw); REG(minsw); REG(mullw); REG(mulhsw); REG(mulhuw); REG(orw); REG(subw); REG(subssw); REG(subusw); REG(xorw); REG(addl); REG(andl); REG(andnl); REG(cmpeql); REG(cmpgtsl); REG(orl); REG(subl); REG(xorl); REG(andq); REG(andnq); REG(orq); REG(xorq); REG(select0ql); REG(select1ql); REG(select0lw); REG(select1lw); REG(select0wb); REG(select1wb); REG(mergebw); REG(mergewl); REG(mergelq); orc_rule_register (rule_set, "copyb", sse_rule_copyx, NULL); orc_rule_register (rule_set, "copyw", sse_rule_copyx, NULL); orc_rule_register (rule_set, "copyl", sse_rule_copyx, NULL); orc_rule_register (rule_set, "copyq", sse_rule_copyx, NULL); orc_rule_register (rule_set, "shlw", sse_rule_shift, (void *)0); orc_rule_register (rule_set, "shruw", sse_rule_shift, (void *)1); orc_rule_register (rule_set, "shrsw", sse_rule_shift, (void *)2); orc_rule_register (rule_set, "shll", sse_rule_shift, (void *)3); orc_rule_register (rule_set, "shrul", sse_rule_shift, (void *)4); orc_rule_register (rule_set, "shrsl", sse_rule_shift, (void *)5); orc_rule_register (rule_set, "shlq", sse_rule_shift, (void *)6); orc_rule_register (rule_set, "shruq", sse_rule_shift, (void *)7); orc_rule_register (rule_set, "shrsq", sse_rule_shrsq, NULL); orc_rule_register (rule_set, "convsbw", sse_rule_convsbw, NULL); orc_rule_register (rule_set, "convubw", sse_rule_convubw, NULL); orc_rule_register (rule_set, "convssswb", sse_rule_convssswb, NULL); orc_rule_register (rule_set, "convsuswb", sse_rule_convsuswb, NULL); orc_rule_register (rule_set, "convuuswb", sse_rule_convuuswb, NULL); orc_rule_register (rule_set, "convwb", sse_rule_convwb, NULL); orc_rule_register (rule_set, "convswl", sse_rule_convswl, NULL); orc_rule_register (rule_set, "convuwl", sse_rule_convuwl, NULL); orc_rule_register (rule_set, "convssslw", sse_rule_convssslw, NULL); orc_rule_register (rule_set, "convql", sse_rule_convql, NULL); orc_rule_register (rule_set, "convslq", sse_rule_convslq, NULL); orc_rule_register (rule_set, "convulq", sse_rule_convulq, NULL); //orc_rule_register (rule_set, "convsssql", sse_rule_convsssql, NULL); orc_rule_register (rule_set, "mulsbw", sse_rule_mulsbw, NULL); orc_rule_register (rule_set, "mulubw", sse_rule_mulubw, NULL); orc_rule_register (rule_set, "mulswl", sse_rule_mulswl, NULL); orc_rule_register (rule_set, "muluwl", sse_rule_muluwl, NULL); orc_rule_register (rule_set, "accw", sse_rule_accw, NULL); orc_rule_register (rule_set, "accl", sse_rule_accl, NULL); orc_rule_register (rule_set, "accsadubl", sse_rule_accsadubl, NULL); #ifndef MMX /* These require the SSE2 flag, although could be used with MMX. That flag is not yet handled. */ orc_rule_register (rule_set, "mululq", sse_rule_mululq, NULL); REG(addq); REG(subq); orc_rule_register (rule_set, "addf", sse_rule_addf, NULL); orc_rule_register (rule_set, "subf", sse_rule_subf, NULL); orc_rule_register (rule_set, "mulf", sse_rule_mulf, NULL); orc_rule_register (rule_set, "divf", sse_rule_divf, NULL); orc_rule_register (rule_set, "minf", sse_rule_minf, NULL); orc_rule_register (rule_set, "maxf", sse_rule_maxf, NULL); orc_rule_register (rule_set, "sqrtf", sse_rule_sqrtf, NULL); orc_rule_register (rule_set, "cmpeqf", sse_rule_cmpeqf, NULL); orc_rule_register (rule_set, "cmpltf", sse_rule_cmpltf, NULL); orc_rule_register (rule_set, "cmplef", sse_rule_cmplef, NULL); orc_rule_register (rule_set, "convfl", sse_rule_convfl, NULL); orc_rule_register (rule_set, "convlf", sse_rule_convlf, NULL); orc_rule_register (rule_set, "addd", sse_rule_addd, NULL); orc_rule_register (rule_set, "subd", sse_rule_subd, NULL); orc_rule_register (rule_set, "muld", sse_rule_muld, NULL); orc_rule_register (rule_set, "divd", sse_rule_divd, NULL); orc_rule_register (rule_set, "mind", sse_rule_mind, NULL); orc_rule_register (rule_set, "maxd", sse_rule_maxd, NULL); orc_rule_register (rule_set, "sqrtd", sse_rule_sqrtd, NULL); orc_rule_register (rule_set, "cmpeqd", sse_rule_cmpeqd, NULL); orc_rule_register (rule_set, "cmpltd", sse_rule_cmpltd, NULL); orc_rule_register (rule_set, "cmpled", sse_rule_cmpled, NULL); orc_rule_register (rule_set, "convdl", sse_rule_convdl, NULL); orc_rule_register (rule_set, "convld", sse_rule_convld, NULL); orc_rule_register (rule_set, "convfd", sse_rule_convfd, NULL); orc_rule_register (rule_set, "convdf", sse_rule_convdf, NULL); #endif /* slow rules */ orc_rule_register (rule_set, "maxuw", sse_rule_maxuw_slow, NULL); orc_rule_register (rule_set, "minuw", sse_rule_minuw_slow, NULL); orc_rule_register (rule_set, "avgsb", sse_rule_avgsb_slow, NULL); orc_rule_register (rule_set, "avgsw", sse_rule_avgsw_slow, NULL); orc_rule_register (rule_set, "maxsb", sse_rule_maxsb_slow, NULL); orc_rule_register (rule_set, "minsb", sse_rule_minsb_slow, NULL); orc_rule_register (rule_set, "maxsl", sse_rule_maxsl_slow, NULL); orc_rule_register (rule_set, "minsl", sse_rule_minsl_slow, NULL); orc_rule_register (rule_set, "maxul", sse_rule_maxul_slow, NULL); orc_rule_register (rule_set, "minul", sse_rule_minul_slow, NULL); orc_rule_register (rule_set, "convlw", sse_rule_convlw, NULL); orc_rule_register (rule_set, "signw", sse_rule_signw_slow, NULL); orc_rule_register (rule_set, "absb", sse_rule_absb_slow, NULL); orc_rule_register (rule_set, "absw", sse_rule_absw_slow, NULL); orc_rule_register (rule_set, "absl", sse_rule_absl_slow, NULL); orc_rule_register (rule_set, "swapw", sse_rule_swapw, NULL); orc_rule_register (rule_set, "swapl", sse_rule_swapl, NULL); orc_rule_register (rule_set, "swapwl", sse_rule_swapwl, NULL); orc_rule_register (rule_set, "swapq", sse_rule_swapq, NULL); orc_rule_register (rule_set, "swaplq", sse_rule_swaplq, NULL); orc_rule_register (rule_set, "splitql", sse_rule_splitql, NULL); orc_rule_register (rule_set, "splitlw", sse_rule_splitlw, NULL); orc_rule_register (rule_set, "splitwb", sse_rule_splitwb, NULL); orc_rule_register (rule_set, "avgsl", sse_rule_avgsl, NULL); orc_rule_register (rule_set, "avgul", sse_rule_avgul, NULL); orc_rule_register (rule_set, "shlb", sse_rule_shlb, NULL); orc_rule_register (rule_set, "shrsb", sse_rule_shrsb, NULL); orc_rule_register (rule_set, "shrub", sse_rule_shrub, NULL); orc_rule_register (rule_set, "mulll", sse_rule_mulll_slow, NULL); #ifndef MMX orc_rule_register (rule_set, "mulhsl", sse_rule_mulhsl_slow, NULL); orc_rule_register (rule_set, "mulhul", sse_rule_mulhul, NULL); orc_rule_register (rule_set, "mulslq", sse_rule_mulslq_slow, NULL); #endif orc_rule_register (rule_set, "mullb", sse_rule_mullb, NULL); orc_rule_register (rule_set, "mulhsb", sse_rule_mulhsb, NULL); orc_rule_register (rule_set, "mulhub", sse_rule_mulhub, NULL); orc_rule_register (rule_set, "addssl", sse_rule_addssl_slow, NULL); orc_rule_register (rule_set, "subssl", sse_rule_subssl_slow, NULL); orc_rule_register (rule_set, "addusl", sse_rule_addusl_slow, NULL); orc_rule_register (rule_set, "subusl", sse_rule_subusl_slow, NULL); orc_rule_register (rule_set, "convhwb", sse_rule_convhwb, NULL); orc_rule_register (rule_set, "convhlw", sse_rule_convhlw, NULL); orc_rule_register (rule_set, "splatw3q", sse_rule_splatw3q, NULL); orc_rule_register (rule_set, "splatbw", sse_rule_splatbw, NULL); orc_rule_register (rule_set, "splatbl", sse_rule_splatbl, NULL); orc_rule_register (rule_set, "div255w", sse_rule_div255w, NULL); orc_rule_register (rule_set, "divluw", sse_rule_divluw, NULL); /* SSE 3 -- no rules */ /* SSSE 3 */ rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_SSE_SSSE3); #ifndef MMX orc_rule_register (rule_set, "signb", sse_rule_signX_ssse3, (void *)0); orc_rule_register (rule_set, "signw", sse_rule_signX_ssse3, (void *)1); orc_rule_register (rule_set, "signl", sse_rule_signX_ssse3, (void *)2); #endif REG(absb); REG(absw); REG(absl); #ifndef MMX orc_rule_register (rule_set, "swapw", sse_rule_swapw_ssse3, NULL); orc_rule_register (rule_set, "swapl", sse_rule_swapl_ssse3, NULL); orc_rule_register (rule_set, "swapwl", sse_rule_swapwl_ssse3, NULL); orc_rule_register (rule_set, "swapq", sse_rule_swapq_ssse3, NULL); orc_rule_register (rule_set, "select0lw", sse_rule_select0lw_ssse3, NULL); orc_rule_register (rule_set, "select1lw", sse_rule_select1lw_ssse3, NULL); orc_rule_register (rule_set, "select0wb", sse_rule_select0wb_ssse3, NULL); orc_rule_register (rule_set, "select1wb", sse_rule_select1wb_ssse3, NULL); #endif /* SSE 4.1 */ rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_SSE_SSE4_1); REG(maxsb); REG(minsb); REG(maxuw); REG(minuw); REG(maxsl); REG(maxul); REG(minsl); REG(minul); REG(mulll); orc_rule_register (rule_set, "convsbw", sse_rule_convsbw_sse41, NULL); orc_rule_register (rule_set, "convswl", sse_rule_convswl_sse41, NULL); orc_rule_register (rule_set, "convslq", sse_rule_convslq_sse41, NULL); orc_rule_register (rule_set, "convubw", sse_rule_convubw_sse41, NULL); orc_rule_register (rule_set, "convuwl", sse_rule_convuwl_sse41, NULL); orc_rule_register (rule_set, "convulq", sse_rule_convulq_sse41, NULL); orc_rule_register (rule_set, "convsuslw", sse_rule_convsuslw, NULL); orc_rule_register (rule_set, "mulslq", sse_rule_mulslq, NULL); #ifndef MMX orc_rule_register (rule_set, "mulhsl", sse_rule_mulhsl, NULL); #endif REG(cmpeqq); /* SSE 4.2 -- no rules */ rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_SSE_SSE4_2); REG(cmpgtsq); /* SSE 4a -- no rules */ } orc-0.4.18/orc/generate-bytecode.c0000664000175000017500000001317612177015514013642 00000000000000 #include "config.h" #include #include #include #include #include #include int verbose = 0; int error = 0; int compat; char *target = "sse"; #define ORC_VERSION(a,b,c,d) ((a)*1000000 + (b)*10000 + (c)*100 + (d)) #define REQUIRE(a,b,c,d) do { \ if (ORC_VERSION((a),(b),(c),(d)) > compat) { \ fprintf(stderr, "Feature used that is incompatible with --compat\n"); \ exit (1); \ } \ } while (0) void help (void) { printf("Usage:\n"); printf(" generate-bytecode [OPTION...]\n"); printf("\n"); printf("Help Options:\n"); printf(" -h, --help Show help options\n"); printf("\n"); printf("Application Options:\n"); printf(" -o, --output FILE Write output to FILE\n"); printf(" --header Write header instead of .c file\n"); printf("\n"); exit (0); } int main (int argc, char *argv[]) { char *output_file = NULL; char *input_file = NULL; char *include_file = NULL; FILE *output; int i; OrcOpcodeSet *opcode_set; int output_header = FALSE; orc_init (); for(i=1;i\n"); fprintf(output, "#include \n"); if (include_file) { fprintf(output, "#include <%s>\n", include_file); } fprintf(output, "\n"); fprintf(output, "typedef enum {\n"); fprintf(output, " ORC_BC_END,\n"); fprintf(output, " ORC_BC_BEGIN_FUNCTION,\n"); fprintf(output, " ORC_BC_END_FUNCTION,\n"); fprintf(output, " ORC_BC_SET_CONSTANT_N,\n"); fprintf(output, " ORC_BC_SET_N_MULTIPLE,\n"); fprintf(output, " ORC_BC_SET_N_MINIMUM,\n"); fprintf(output, " ORC_BC_SET_N_MAXIMUM,\n"); fprintf(output, " ORC_BC_SET_2D,\n"); fprintf(output, " ORC_BC_SET_CONSTANT_M,\n"); fprintf(output, " ORC_BC_SET_NAME,\n"); fprintf(output, " ORC_BC_SET_BACKUP_FUNCTION,\n"); fprintf(output, " ORC_BC_ADD_DESTINATION,\n"); fprintf(output, " ORC_BC_ADD_SOURCE,\n"); fprintf(output, " ORC_BC_ADD_ACCUMULATOR,\n"); fprintf(output, " ORC_BC_ADD_CONSTANT,\n"); fprintf(output, " ORC_BC_ADD_CONSTANT_INT64,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER_FLOAT,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER_INT64,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER_DOUBLE,\n"); fprintf(output, " ORC_BC_ADD_TEMPORARY,\n"); fprintf(output, " ORC_BC_INSTRUCTION_FLAGS,\n"); for (i=22;i<32;i++){ fprintf(output, " ORC_BC_RESERVED_%d,\n", i); } for(i=0;in_opcodes;i++){ OrcStaticOpcode *opcode = opcode_set->opcodes + i; if ((i+32)%10 == 0) { fprintf(output, " /* %d */\n", i+32); } fprintf(output, " ORC_BC_%s,\n", opcode->name); } fprintf(output, " /* %d */\n", i+32); fprintf(output, " ORC_BC_LAST\n"); fprintf(output, "} OrcBytecodes;\n"); } else { fprintf(output, "#ifdef HAVE_CONFIG_H\n"); fprintf(output, "#include \"config.h\"\n"); fprintf(output, "#endif\n"); fprintf(output, " ORC_BC_END,\n"); fprintf(output, " ORC_BC_BEGIN_FUNCTION,\n"); fprintf(output, " ORC_BC_END_FUNCTION,\n"); fprintf(output, " ORC_BC_SET_CONSTANT_N,\n"); fprintf(output, " ORC_BC_SET_N_MULTIPLE,\n"); fprintf(output, " ORC_BC_SET_N_MINIMUM,\n"); fprintf(output, " ORC_BC_SET_N_MAXIMUM,\n"); fprintf(output, " ORC_BC_SET_2D,\n"); fprintf(output, " ORC_BC_SET_CONSTANT_M,\n"); fprintf(output, " ORC_BC_SET_NAME,\n"); fprintf(output, " ORC_BC_SET_BACKUP_FUNCTION,\n"); fprintf(output, " ORC_BC_ADD_DESTINATION,\n"); fprintf(output, " ORC_BC_ADD_SOURCE,\n"); fprintf(output, " ORC_BC_ADD_ACCUMULATOR,\n"); fprintf(output, " ORC_BC_ADD_CONSTANT,\n"); fprintf(output, " ORC_BC_ADD_CONSTANT_INT64,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER_FLOAT,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER_INT64,\n"); fprintf(output, " ORC_BC_ADD_PARAMETER_DOUBLE,\n"); fprintf(output, " ORC_BC_ADD_TEMPORARY,\n"); fprintf(output, " ORC_BC_INSTRUCTION_FLAGS,\n"); for (i=22;i<32;i++){ fprintf(output, " ORC_BC_RESERVED_%d,\n", i); } for(i=0;in_opcodes;i++){ OrcStaticOpcode *opcode = opcode_set->opcodes + i; if ((i+32)%10 == 0) { fprintf(output, " /* %d */\n", i+32); } fprintf(output, " { \"%s\" },\n", opcode->name); } fprintf(output, " /* %d */\n", i+32); fprintf(output, " ORC_BC_LAST\n"); fprintf(output, "} OrcBytecodes;\n"); } fclose (output); if (error) exit(1); return 0; } orc-0.4.18/orc/orcparse.c0000664000175000017500000003355212177015514012072 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include /** * SECTION:orcparse * @title: Parser * @short_description: Parse Orc source code */ typedef struct _OrcParser OrcParser; struct _OrcParser { const char *code; int code_length; const char *p; int line_number; char *line; int creg_index; OrcOpcodeSet *opcode_set; OrcProgram *program; OrcProgram *error_program; OrcProgram **programs; int n_programs; int n_programs_alloc; char *log; int log_size; int log_alloc; }; static void orc_parse_get_line (OrcParser *parser); static OrcStaticOpcode * get_opcode (OrcParser *parser, const char *opcode); static void orc_parse_log (OrcParser *parser, const char *format, ...); static int opcode_n_args (OrcStaticOpcode *opcode); static void orc_parse_sanity_check (OrcParser *parser, OrcProgram *program); int orc_parse (const char *code, OrcProgram ***programs) { return orc_parse_full (code, programs, NULL); } int orc_parse_full (const char *code, OrcProgram ***programs, char **log) { OrcParser _parser; OrcParser *parser = &_parser; char *init_function = NULL; memset (parser, 0, sizeof(*parser)); parser->code = code; parser->code_length = strlen (code); parser->line_number = 0; parser->p = code; parser->opcode_set = orc_opcode_set_get ("sys"); parser->log = malloc(100); parser->log_alloc = 100; parser->log_size = 0; parser->log[0] = 0; while (parser->p[0] != 0) { char *p; char *end; char *token[10]; int n_tokens; orc_parse_get_line (parser); if (parser->program) orc_program_set_line (parser->program, parser->line_number); p = parser->line; end = p + strlen (p); //printf("%d: %s\n", parser->line_number, parser->line); while (p[0] == ' ' || p[0] == '\t') p++; if (p[0] == 0) { continue; } if (p[0] == '#') { //printf("comment: %s\n", p+1); continue; } n_tokens = 0; while (p < end) { while (p[0] != 0 && (p[0] == ' ' || p[0] == '\t')) p++; if (p[0] == 0 || p[0] == '#') break; token[n_tokens] = p; while (p[0] != 0 && p[0] != ' ' && p[0] != '\t' && p[0] != ',') p++; n_tokens++; p[0] = 0; p++; } if (n_tokens == 0) { continue; } { int i; for(i=0;iprogram) { orc_parse_sanity_check (parser, parser->program); } parser->program = orc_program_new (); orc_program_set_name (parser->program, token[1]); if (parser->n_programs == parser->n_programs_alloc) { parser->n_programs_alloc += 32; parser->programs = realloc (parser->programs, sizeof(OrcProgram *)*parser->n_programs_alloc); } parser->programs[parser->n_programs] = parser->program; parser->n_programs++; parser->creg_index = 1; } else if (strcmp (token[0], ".init") == 0) { free (init_function); init_function = NULL; if (n_tokens < 2) { orc_parse_log (parser, "error: line %d: .init without function name\n", parser->line_number); } else { init_function = strdup (token[1]); } } else if (strcmp (token[0], ".flags") == 0) { int i; for(i=1;iprogram); } } } else if (strcmp (token[0], ".n") == 0) { int i; for(i=1;iline_number); } else { orc_program_set_n_multiple (parser->program, strtol (token[1], NULL, 0)); i++; } } else if (strcmp (token[i], "min") == 0) { if (i == n_tokens - 1) { orc_parse_log (parser, "error: line %d: .n min requires multiple value\n", parser->line_number); } else { orc_program_set_n_minimum (parser->program, strtol (token[1], NULL, 0)); i++; } } else if (strcmp (token[i], "max") == 0) { if (i == n_tokens - 1) { orc_parse_log (parser, "error: line %d: .n max requires multiple value\n", parser->line_number); } else { orc_program_set_n_maximum (parser->program, strtol (token[1], NULL, 0)); i++; } } else { orc_program_set_constant_n (parser->program, strtol (token[1], NULL, 0)); } } } else if (strcmp (token[0], ".m") == 0) { int size = strtol (token[1], NULL, 0); orc_program_set_constant_m (parser->program, size); } else if (strcmp (token[0], ".source") == 0) { int size = strtol (token[1], NULL, 0); int var; int i; var = orc_program_add_source (parser->program, size, token[2]); for(i=3;iline_number); } else { int alignment = strtol (token[i+1], NULL, 0); orc_program_set_var_alignment (parser->program, var, alignment); i++; } } else { orc_program_set_type_name (parser->program, var, token[i]); } } } else if (strcmp (token[0], ".dest") == 0) { int size = strtol (token[1], NULL, 0); int var; int i; var = orc_program_add_destination (parser->program, size, token[2]); for(i=3;iline_number); } else { int alignment = strtol (token[i+1], NULL, 0); orc_program_set_var_alignment (parser->program, var, alignment); i++; } } else { orc_program_set_type_name (parser->program, var, token[i]); } } } else if (strcmp (token[0], ".accumulator") == 0) { int size = strtol (token[1], NULL, 0); int var; var = orc_program_add_accumulator (parser->program, size, token[2]); if (n_tokens > 3) { orc_program_set_type_name (parser->program, var, token[3]); } } else if (strcmp (token[0], ".temp") == 0) { int size = strtol (token[1], NULL, 0); orc_program_add_temporary (parser->program, size, token[2]); } else if (strcmp (token[0], ".param") == 0) { int size = strtol (token[1], NULL, 0); orc_program_add_parameter (parser->program, size, token[2]); } else if (strcmp (token[0], ".longparam") == 0) { int size = strtol (token[1], NULL, 0); orc_program_add_parameter_int64 (parser->program, size, token[2]); } else if (strcmp (token[0], ".const") == 0) { int size = strtol (token[1], NULL, 0); orc_program_add_constant_str (parser->program, size, token[3], token[2]); } else if (strcmp (token[0], ".floatparam") == 0) { int size = strtol (token[1], NULL, 0); orc_program_add_parameter_float (parser->program, size, token[2]); } else if (strcmp (token[0], ".doubleparam") == 0) { int size = strtol (token[1], NULL, 0); orc_program_add_parameter_double (parser->program, size, token[2]); } else { orc_parse_log (parser, "error: line %d: unknown directive: %s\n", parser->line_number, token[0]); } } else { OrcStaticOpcode *o; unsigned int flags = 0; int offset = 0; if (strcmp (token[0], "x4") == 0) { flags |= ORC_INSTRUCTION_FLAG_X4; offset = 1; } else if (strcmp (token[0], "x2") == 0) { flags |= ORC_INSTRUCTION_FLAG_X2; offset = 1; } o = get_opcode (parser, token[offset]); if (o) { int n_args = opcode_n_args (o); int i; if (n_tokens != 1 + offset + n_args) { orc_parse_log (parser, "error: line %d: too %s arguments for %s (expected %d)\n", parser->line_number, (n_tokens < 1+offset+n_args) ? "few" : "many", token[offset], n_args); } for(i=offset+1;iprogram, 0, token[i], token[i]); } } if (n_tokens - offset == 5) { orc_program_append_str_2 (parser->program, token[offset], flags, token[offset+1], token[offset+2], token[offset+3], token[offset+4]); } else if (n_tokens - offset == 4) { orc_program_append_str_2 (parser->program, token[offset], flags, token[offset+1], token[offset+2], token[offset+3], NULL); } else { orc_program_append_str_2 (parser->program, token[offset], flags, token[offset+1], token[offset+2], NULL, NULL); } } else { orc_parse_log (parser, "error: line %d: unknown opcode: %s\n", parser->line_number, token[offset]); } } } if (parser->program) { orc_parse_sanity_check (parser, parser->program); } if (parser->line) free (parser->line); if (log) { *log = parser->log; } else { free (parser->log); } if (parser->programs && parser->programs[0]) { parser->programs[0]->init_function = init_function; } else { free (init_function); } *programs = parser->programs; return parser->n_programs; } static OrcStaticOpcode * get_opcode (OrcParser *parser, const char *opcode) { int i; for(i=0;iopcode_set->n_opcodes;i++){ if (strcmp (opcode, parser->opcode_set->opcodes[i].name) == 0) { return parser->opcode_set->opcodes + i; } } return NULL; } static int opcode_n_args (OrcStaticOpcode *opcode) { int i; int n = 0; for(i=0;idest_size[i] != 0) n++; } for(i=0;isrc_size[i] != 0) n++; } return n; } static void orc_parse_log_valist (OrcParser *parser, const char *format, va_list args) { char s[100]; int len; if (parser->error_program != parser->program) { sprintf(s, "In function %s:\n", parser->program->name); len = strlen(s); if (parser->log_size + len + 1 >= parser->log_alloc) { parser->log_alloc += 100; parser->log = realloc (parser->log, parser->log_alloc); } strcpy (parser->log + parser->log_size, s); parser->log_size += len; parser->error_program = parser->program; } vsprintf(s, format, args); len = strlen(s); if (parser->log_size + len + 1 >= parser->log_alloc) { parser->log_alloc += 100; parser->log = realloc (parser->log, parser->log_alloc); } strcpy (parser->log + parser->log_size, s); parser->log_size += len; } static void orc_parse_log (OrcParser *parser, const char *format, ...) { va_list var_args; va_start (var_args, format); orc_parse_log_valist (parser, format, var_args); va_end (var_args); } static void orc_parse_get_line (OrcParser *parser) { const char *end; int n; if (parser->line) { free (parser->line); parser->line = NULL; } end = strchr (parser->p, '\n'); if (end == NULL) { end = parser->code + parser->code_length; } n = end - parser->p; parser->line = malloc (n + 1); memcpy (parser->line, parser->p, n); parser->line[n] = 0; parser->p = end; if (parser->p[0] == '\n') { parser->p++; } parser->line_number++; } static void orc_parse_sanity_check (OrcParser *parser, OrcProgram *program) { int i; int j; for(i=0;i<=ORC_VAR_T15;i++) { if (program->vars[i].size == 0) continue; for(j=i+1;j<=ORC_VAR_T15;j++) { if (program->vars[j].size == 0) continue; if (strcmp (program->vars[i].name, program->vars[j].name) == 0) { orc_parse_log (parser, "error: duplicate variable name: %s\n", program->vars[i].name); } } } for(i=0;in_insns;i++){ OrcInstruction *insn = program->insns + i; OrcStaticOpcode *opcode = insn->opcode; for(j=0;jdest_size[j] == 0) continue; if (program->vars[insn->dest_args[j]].used && program->vars[insn->dest_args[j]].vartype == ORC_VAR_TYPE_DEST) { orc_parse_log (parser, "error: destination \"%s\" written multiple times\n", program->vars[insn->dest_args[j]].name); } program->vars[insn->dest_args[j]].used = TRUE; } for(j=0;jsrc_size[j] == 0) continue; if (program->vars[insn->src_args[j]].used && program->vars[insn->src_args[j]].vartype == ORC_VAR_TYPE_SRC) { orc_parse_log (parser, "error: source \"%s\" read multiple times\n", program->vars[insn->src_args[j]].name); } if (!program->vars[insn->src_args[j]].used && program->vars[insn->src_args[j]].vartype == ORC_VAR_TYPE_TEMP) { orc_parse_log (parser, "error: variable \"%s\" used before being written\n", program->vars[insn->src_args[j]].name); } } } } const char * orc_parse_get_init_function (OrcProgram *program) { return program->init_function; } orc-0.4.18/orc/orcdebug.h0000644000175000017500000001203711734121707012044 00000000000000/* * ORC - Library of Optimized Inner Loops * Copyright (c) 2003,2004 David A. Schleef * 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 _ORC_DEBUG_H_ #define _ORC_DEBUG_H_ #include #include #include ORC_BEGIN_DECLS /** * OrcDebugPrintFunc: * @level: the debug level * @file: name of the file where the debug message occurs * @func: name of the function where the debug message occurs * @line: line in the file where the debug message occurs * @format: a printf format * @varargs: varargs for the printf format * * Typedef describing functions that can be registered using * orc_debug_set_print_function() so that it is called to * print debugging messages. */ typedef void (*OrcDebugPrintFunc) (int level, const char *file, const char *func, int line, const char *format, va_list varargs); /** * OrcDebugLevel: * @ORC_DEBUG_NONE: No debugging. Used to disable debugging output. * @ORC_DEBUG_ERROR: The level for messages indicating that an error * has occurred that causes Orc to produce incorrect results. Also * used temporarily by developers for testing code. * @ORC_DEBUG_WARNING: Messages at this level indicate something has * occurred that a developer looking into an application problem may * want to know. * @ORC_DEBUG_INFO: Messages at this level provide high-level * information about Orc internals. * @ORC_DEBUG_DEBUG: The default level for logging messages. * @ORC_DEBUG_LOG: The level for messages that probably don't need to * be logged at all. * * Enumeration describing debug levels in Orc. */ typedef enum { ORC_DEBUG_NONE = 0, ORC_DEBUG_ERROR, ORC_DEBUG_WARNING, ORC_DEBUG_INFO, ORC_DEBUG_DEBUG, ORC_DEBUG_LOG } OrcDebugLevel; /** * ORC_ERROR: * @...: printf-style format and arguments * * Macro to call ORC_DEBUG_PRINT() with a level of #ORC_DEBUG_ERROR. */ #define ORC_ERROR(...) ORC_DEBUG_PRINT(ORC_DEBUG_ERROR, __VA_ARGS__) /** * ORC_WARNING: * @...: printf-style format and arguments * * Macro to call ORC_DEBUG_PRINT() with a level of #ORC_DEBUG_WARNING. */ #define ORC_WARNING(...) ORC_DEBUG_PRINT(ORC_DEBUG_WARNING, __VA_ARGS__) /** * ORC_INFO: * @...: printf-style format and arguments * * Macro to call ORC_DEBUG_PRINT() with a level of #ORC_DEBUG_INFO. */ #define ORC_INFO(...) ORC_DEBUG_PRINT(ORC_DEBUG_INFO, __VA_ARGS__) /** * ORC_DEBUG: * @...: printf-style format and arguments * * Macro to call ORC_DEBUG_PRINT() with a level of #ORC_DEBUG_DEBUG. */ #define ORC_DEBUG(...) ORC_DEBUG_PRINT(ORC_DEBUG_DEBUG, __VA_ARGS__) /** * ORC_LOG: * @...: printf-style format and arguments * * Macro to call ORC_DEBUG_PRINT() with a level of #ORC_DEBUG_LOG. */ #define ORC_LOG(...) ORC_DEBUG_PRINT(ORC_DEBUG_LOG, __VA_ARGS__) /** * ORC_FUNCTION: * * Internal macro that points to __PRETTY_FUNCTION__ or __func__ * if the former is not available. */ #if defined (__GNUC__) || defined (__PRETTY_FUNCTION__) #define ORC_FUNCTION __PRETTY_FUNCTION__ #elif defined(__func__) #define ORC_FUNCTION __func__ #else #define ORC_FUNCTION "" #endif /** * ORC_DEBUG_PRINT: * @level: debug level of message * @Varargs: printf-style format and arguments * * Macro to call orc_debug_print() with the correct values for * the name of the source file, line of source file, and function. */ #define ORC_DEBUG_PRINT(level, ...) do { \ orc_debug_print((level), __FILE__, ORC_FUNCTION, __LINE__, __VA_ARGS__); \ }while(0) #define ORC_ASSERT(test) do { \ if (!(test)) { \ ORC_ERROR("assertion failed: " #test ); \ abort(); \ } \ } while(0) void orc_debug_set_print_function (OrcDebugPrintFunc func); int orc_debug_get_level (void); void orc_debug_set_level (int level); void _orc_debug_init (void); void orc_debug_print (int level, const char *file, const char *func, int line, const char *format, ...); ORC_END_DECLS #endif orc-0.4.18/orc/orccodemem.c0000664000175000017500000001513612071634360012366 00000000000000 #include "config.h" #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #ifdef HAVE_CODEMEM_MMAP #include #endif #ifdef HAVE_CODEMEM_VIRTUALALLOC #include #endif #include #include #define SIZE 65536 typedef struct _OrcCodeRegion OrcCodeRegion; struct _OrcCodeRegion { orc_uint8 *write_ptr; orc_uint8 *exec_ptr; int size; OrcCodeChunk *chunks; }; struct _OrcCodeChunk { /*< private >*/ struct _OrcCodeChunk *next; struct _OrcCodeChunk *prev; struct _OrcCodeRegion *region; int used; int offset; int size; }; void orc_code_region_allocate_codemem (OrcCodeRegion *region); static OrcCodeRegion **orc_code_regions; static int orc_code_n_regions; OrcCodeRegion * orc_code_region_new (void) { OrcCodeRegion *region; OrcCodeChunk *chunk; region = malloc(sizeof(OrcCodeRegion)); memset (region, 0, sizeof(OrcCodeRegion)); orc_code_region_allocate_codemem (region); chunk = malloc(sizeof(OrcCodeChunk)); memset (chunk, 0, sizeof(OrcCodeChunk)); chunk->offset = 0; chunk->used = FALSE; chunk->region = region; chunk->size = region->size; region->chunks = chunk; return region; } OrcCodeChunk * orc_code_chunk_split (OrcCodeChunk *chunk, int size) { OrcCodeChunk *newchunk; newchunk = malloc(sizeof(OrcCodeChunk)); memset (newchunk, 0, sizeof(OrcCodeChunk)); newchunk->region = chunk->region; newchunk->offset = chunk->offset + size; newchunk->size = chunk->size - size; newchunk->next = chunk->next; newchunk->prev = chunk->prev; chunk->size = size; if (chunk->next) { chunk->next->prev = newchunk; } chunk->next = newchunk; return newchunk; } void orc_code_chunk_merge (OrcCodeChunk *chunk) { OrcCodeChunk *chunk2 = chunk->next; chunk->next = chunk2->next; if (chunk2->next) { chunk2->next->prev = chunk; } chunk->size += chunk2->size; free(chunk2); } OrcCodeChunk * orc_code_region_get_free_chunk (int size) { int i; OrcCodeRegion *region; OrcCodeChunk *chunk; orc_global_mutex_lock (); for(i=0;ichunks; chunk; chunk = chunk->next) { if (!chunk->used && size <= chunk->size) { orc_global_mutex_unlock (); return chunk; } } } orc_code_regions = realloc (orc_code_regions, sizeof(void *)*(orc_code_n_regions+1)); orc_code_regions[orc_code_n_regions] = orc_code_region_new (); region = orc_code_regions[orc_code_n_regions]; orc_code_n_regions++; for(chunk = region->chunks; chunk; chunk = chunk->next) { if (!chunk->used && size <= chunk->size){ orc_global_mutex_unlock (); return chunk; } } orc_global_mutex_unlock (); ORC_ASSERT(0); return NULL; } void orc_code_allocate_codemem (OrcCode *code, int size) { OrcCodeRegion *region; OrcCodeChunk *chunk; int aligned_size = (size + 15) & (~15); chunk = orc_code_region_get_free_chunk (aligned_size); region = chunk->region; if (chunk->size > aligned_size) { orc_code_chunk_split (chunk, aligned_size); } chunk->used = TRUE; code->chunk = chunk; code->code = ORC_PTR_OFFSET(region->write_ptr, chunk->offset); code->exec = ORC_PTR_OFFSET(region->exec_ptr, chunk->offset); code->code_size = size; //compiler->codeptr = ORC_PTR_OFFSET(region->write_ptr, chunk->offset); } void orc_code_chunk_free (OrcCodeChunk *chunk) { if (_orc_compiler_flag_debug) { /* If debug is turned on, don't free code */ return; } chunk->used = FALSE; if (chunk->next && !chunk->next->used) { orc_code_chunk_merge (chunk); } if (chunk->prev && !chunk->prev->used) { orc_code_chunk_merge (chunk->prev); } } #ifdef HAVE_CODEMEM_MMAP int orc_code_region_allocate_codemem_dual_map (OrcCodeRegion *region, const char *dir, int force_unlink) { int fd; int n; char *filename; filename = malloc (strlen ("/orcexec..") + strlen (dir) + 6 + 1); sprintf(filename, "%s/orcexec.XXXXXX", dir); fd = mkstemp (filename); if (fd == -1) { ORC_WARNING ("failed to create temp file"); free (filename); return FALSE; } if (force_unlink || !_orc_compiler_flag_debug) { unlink (filename); } free (filename); n = ftruncate (fd, SIZE); if (n < 0) { ORC_WARNING("failed to expand file to size"); close (fd); return FALSE; } region->exec_ptr = mmap (NULL, SIZE, PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0); if (region->exec_ptr == MAP_FAILED) { ORC_WARNING("failed to create exec map"); close (fd); return FALSE; } region->write_ptr = mmap (NULL, SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (region->write_ptr == MAP_FAILED) { ORC_WARNING ("failed to create write map"); close (fd); return FALSE; } region->size = SIZE; close (fd); return TRUE; } #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif int orc_code_region_allocate_codemem_anon_map (OrcCodeRegion *region) { region->exec_ptr = mmap (NULL, SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); if (region->exec_ptr == MAP_FAILED) { ORC_WARNING("failed to create write/exec map"); return FALSE; } region->write_ptr = region->exec_ptr; region->size = SIZE; return TRUE; } void orc_code_region_allocate_codemem (OrcCodeRegion *region) { const char *tmpdir; tmpdir = getenv ("TMPDIR"); if (tmpdir && orc_code_region_allocate_codemem_dual_map (region, tmpdir, FALSE)) return; if (orc_code_region_allocate_codemem_dual_map (region, "/tmp", FALSE)) return; tmpdir = getenv ("XDG_RUNTIME_DIR"); if (tmpdir && orc_code_region_allocate_codemem_dual_map (region, tmpdir, FALSE)) return; tmpdir = getenv ("HOME"); if (tmpdir && orc_code_region_allocate_codemem_dual_map (region, tmpdir, FALSE)) return; if (orc_code_region_allocate_codemem_anon_map (region)) return; ORC_ERROR("Failed to create write and exec mmap regions. This " "is probably because SELinux execmem check is enabled (good) " "and $TMPDIR and $HOME are mounted noexec (bad)."); } #endif #ifdef HAVE_CODEMEM_VIRTUALALLOC void orc_code_region_allocate_codemem (OrcCodeRegion *region) { region->write_ptr = VirtualAlloc(NULL, SIZE, MEM_COMMIT, PAGE_EXECUTE_READWRITE); region->exec_ptr = region->write_ptr; region->size = SIZE; } #endif #ifdef HAVE_CODEMEM_MALLOC void orc_code_region_allocate_codemem (OrcCodeRegion *region) { region->write_ptr = malloc(SIZE); region->exec_ptr = region->write_ptr; region->size = SIZE; } #endif orc-0.4.18/orc/orcconstant.h0000664000175000017500000000075412111024531012577 00000000000000 #ifndef _ORC_CONSTANT_H_ #define _ORC_CONSTANT_H_ #include #include ORC_BEGIN_DECLS enum { ORC_CONST_ZERO, ORC_CONST_SPLAT_B, ORC_CONST_SPLAT_W, ORC_CONST_SPLAT_L, ORC_CONST_FULL }; /** * OrcConstant: * * The OrcConstant structure has no public members */ struct _OrcConstant { /*< private >*/ int type; int alloc_reg; unsigned int value; unsigned int full_value[4]; int use_count; int is_long; }; ORC_END_DECLS #endif orc-0.4.18/orc/orcbytecode.c0000664000175000017500000003466612206163032012555 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include void bytecode_append_code (OrcBytecode *bytecode, int code); void bytecode_append_int (OrcBytecode *bytecode, int value); void bytecode_append_uint32 (OrcBytecode *bytecode, orc_uint32 value); void bytecode_append_uint64 (OrcBytecode *bytecode, orc_uint64 value); void bytecode_append_string (OrcBytecode *bytecode, char *s); OrcBytecode * orc_bytecode_new (void) { OrcBytecode *bytecode; bytecode = malloc (sizeof(OrcBytecode)); memset (bytecode, 0, sizeof(OrcBytecode)); bytecode->alloc_len = 256; bytecode->bytecode = malloc(bytecode->alloc_len); return bytecode; } void orc_bytecode_free (OrcBytecode *bytecode) { free (bytecode->bytecode); free (bytecode); } OrcBytecode * orc_bytecode_from_program (OrcProgram *p) { OrcBytecode *bytecode = orc_bytecode_new (); int i; OrcVariable *var; OrcOpcodeSet *opcode_set; opcode_set = orc_opcode_set_get ("sys"); bytecode_append_code (bytecode, ORC_BC_BEGIN_FUNCTION); if (p->constant_n != 0) { bytecode_append_code (bytecode, ORC_BC_SET_CONSTANT_N); bytecode_append_int (bytecode, p->constant_n); } if (p->n_multiple != 0) { bytecode_append_code (bytecode, ORC_BC_SET_N_MULTIPLE); bytecode_append_int (bytecode, p->n_multiple); } if (p->n_minimum != 0) { bytecode_append_code (bytecode, ORC_BC_SET_N_MINIMUM); bytecode_append_int (bytecode, p->n_minimum); } if (p->n_maximum != 0) { bytecode_append_code (bytecode, ORC_BC_SET_N_MAXIMUM); bytecode_append_int (bytecode, p->n_maximum); } if (p->is_2d) { bytecode_append_code (bytecode, ORC_BC_SET_2D); if (p->constant_m != 0) { bytecode_append_code (bytecode, ORC_BC_SET_CONSTANT_M); bytecode_append_int (bytecode, p->constant_m); } } if (p->name) { bytecode_append_code (bytecode, ORC_BC_SET_NAME); bytecode_append_string (bytecode, p->name); } #if 0 //if (!is_inline) { if (p->backup_function) { bytecode_append_code (bytecode, ORC_BC_SET_BACKUP_FUNCTION); bytecode_pointer (bytecode, p->backup_function); } #endif for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { bytecode_append_code (bytecode, ORC_BC_ADD_DESTINATION); bytecode_append_int (bytecode, var->size); bytecode_append_int (bytecode, var->alignment); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { bytecode_append_code (bytecode, ORC_BC_ADD_SOURCE); bytecode_append_int (bytecode, var->size); bytecode_append_int (bytecode, var->alignment); } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { bytecode_append_code (bytecode, ORC_BC_ADD_ACCUMULATOR); bytecode_append_int (bytecode, var->size); //bytecode_append_int (bytecode, var->alignment); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_C1 + i]; if (var->size == 0) continue; if (var->size <= 4) { bytecode_append_code (bytecode, ORC_BC_ADD_CONSTANT); bytecode_append_int (bytecode, var->size); bytecode_append_uint32 (bytecode, (orc_uint32)var->value.i); } else if (var->size > 4) { bytecode_append_code (bytecode, ORC_BC_ADD_CONSTANT_INT64); bytecode_append_int (bytecode, var->size); bytecode_append_uint64 (bytecode, (orc_uint64)var->value.i); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { switch (var->param_type) { case ORC_PARAM_TYPE_INT: bytecode_append_code (bytecode, ORC_BC_ADD_PARAMETER); break; case ORC_PARAM_TYPE_FLOAT: bytecode_append_code (bytecode, ORC_BC_ADD_PARAMETER_FLOAT); break; case ORC_PARAM_TYPE_INT64: bytecode_append_code (bytecode, ORC_BC_ADD_PARAMETER_INT64); break; case ORC_PARAM_TYPE_DOUBLE: bytecode_append_code (bytecode, ORC_BC_ADD_PARAMETER_INT64); break; default: ORC_ASSERT(0); break; } bytecode_append_int (bytecode, var->size); } } for(i=0;i<16;i++){ var = &p->vars[ORC_VAR_T1 + i]; if (var->size) { bytecode_append_code (bytecode, ORC_BC_ADD_TEMPORARY); bytecode_append_int (bytecode, var->size); } } for(i=0;in_insns;i++){ OrcInstruction *insn = p->insns + i; if (insn->flags) { bytecode_append_code (bytecode, ORC_BC_INSTRUCTION_FLAGS); bytecode_append_int (bytecode, insn->flags); } bytecode_append_code (bytecode, (insn->opcode - opcode_set->opcodes) + 32); if (insn->opcode->dest_size[0] != 0) { bytecode_append_int (bytecode, insn->dest_args[0]); } if (insn->opcode->dest_size[1] != 0) { bytecode_append_int (bytecode, insn->dest_args[1]); } if (insn->opcode->src_size[0] != 0) { bytecode_append_int (bytecode, insn->src_args[0]); } if (insn->opcode->src_size[1] != 0) { bytecode_append_int (bytecode, insn->src_args[1]); } if (insn->opcode->src_size[2] != 0) { bytecode_append_int (bytecode, insn->src_args[2]); } } bytecode_append_code (bytecode, ORC_BC_END_FUNCTION); bytecode_append_code (bytecode, ORC_BC_END); return bytecode; } void bytecode_append_byte (OrcBytecode *bytecode, int byte) { if (bytecode->length >= bytecode->alloc_len) { bytecode->alloc_len += 256; bytecode->bytecode = realloc (bytecode->bytecode, bytecode->alloc_len); } bytecode->bytecode[bytecode->length] = byte; bytecode->length++; } void bytecode_append_code (OrcBytecode *bytecode, int code) { bytecode_append_byte (bytecode, code); #if 0 OrcOpcodeSet *opcode_set = orc_opcode_set_get ("sys"); fprintf(bytecode, "\n "); if (code >= 32) { fprintf(bytecode, "ORC_BC_%s, ", opcode_set->opcodes[code-32].name); } else { static char *codes[32] = { "END", "BEGIN_FUNCTION", "END_FUNCTION", "SET_CONSTANT_N", "SET_N_MULTIPLE", "SET_N_MINIMUM", "SET_N_MAXIMUM", "SET_2D", "SET_CONSTANT_M", "SET_NAME", "SET_BACKUP_FUNCTION", "ADD_DESTINATION", "ADD_SOURCE", "ADD_ACCUMULATOR", "ADD_CONSTANT", "ADD_CONSTANT_INT64", "ADD_PARAMETER", "ADD_PARAMETER_FLOAT", "ADD_PARAMETER_INT64", "ADD_PARAMETER_DOUBLE", "ADD_TEMPORARY", "RESERVED_21", "RESERVED_22", "RESERVED_23", "RESERVED_24", "RESERVED_25", "RESERVED_26", "RESERVED_27", "RESERVED_28", "RESERVED_29", "RESERVED_30", "RESERVED_31" }; fprintf(bytecode, "ORC_BC_%s, ", codes[code]); } #endif } void bytecode_append_int (OrcBytecode *bytecode, int value) { ORC_ASSERT(value >= 0); if (value < 255) { bytecode_append_byte (bytecode, value); } else if (value < 65535) { bytecode_append_byte (bytecode, 255); bytecode_append_byte (bytecode, value & 0xff); bytecode_append_byte (bytecode, value >> 8); } else { ORC_ASSERT(0); } } void bytecode_append_uint32 (OrcBytecode *bytecode, orc_uint32 value) { bytecode_append_byte (bytecode, value & 0xff); bytecode_append_byte (bytecode, (value >> 8) & 0xff); bytecode_append_byte (bytecode, (value >> 16) & 0xff); bytecode_append_byte (bytecode, (value >> 24) & 0xff); } void bytecode_append_uint64 (OrcBytecode *bytecode, orc_uint64 value) { bytecode_append_byte (bytecode, value & 0xff); bytecode_append_byte (bytecode, (value >> 8) & 0xff); bytecode_append_byte (bytecode, (value >> 16) & 0xff); bytecode_append_byte (bytecode, (value >> 24) & 0xff); bytecode_append_byte (bytecode, (value >> 32) & 0xff); bytecode_append_byte (bytecode, (value >> 40) & 0xff); bytecode_append_byte (bytecode, (value >> 48) & 0xff); bytecode_append_byte (bytecode, (value >> 56) & 0xff); } void bytecode_append_string (OrcBytecode *bytecode, char *s) { int i; int len = strlen(s); bytecode_append_int (bytecode, len); for(i=0;ibytecode[parse->parse_offset]; parse->parse_offset++; return value; } int orc_bytecode_parse_get_int (OrcBytecodeParse *parse) { int value; value = orc_bytecode_parse_get_byte(parse); if (value == 255) { value = orc_bytecode_parse_get_byte(parse); value |= orc_bytecode_parse_get_byte(parse) << 8; } return value; } char * orc_bytecode_parse_get_string (OrcBytecodeParse *parse) { int len; int i; char *s; len = orc_bytecode_parse_get_int (parse); s = malloc (len + 1); for(i=0;ibytecode = bytecode; opcode_set = orc_opcode_set_get ("sys"); while (1) { bc = orc_bytecode_parse_get_int (parse); if (bc < ORC_BC_absb) { switch (bc) { case ORC_BC_END: /* FIXME this is technically an error */ return 0; case ORC_BC_BEGIN_FUNCTION: //in_function = TRUE; break; case ORC_BC_END_FUNCTION: return 0; case ORC_BC_SET_CONSTANT_N: program->constant_n = orc_bytecode_parse_get_int (parse); break; case ORC_BC_SET_N_MULTIPLE: program->n_multiple = orc_bytecode_parse_get_int (parse); break; case ORC_BC_SET_N_MINIMUM: program->n_minimum = orc_bytecode_parse_get_int (parse); break; case ORC_BC_SET_N_MAXIMUM: program->n_maximum = orc_bytecode_parse_get_int (parse); break; case ORC_BC_SET_2D: program->is_2d = TRUE; break; case ORC_BC_SET_CONSTANT_M: program->constant_m = orc_bytecode_parse_get_int (parse); break; case ORC_BC_SET_NAME: program->name = orc_bytecode_parse_get_string (parse); break; case ORC_BC_SET_BACKUP_FUNCTION: /* FIXME error */ break; case ORC_BC_ADD_DESTINATION: size = orc_bytecode_parse_get_int (parse); alignment = orc_bytecode_parse_get_int (parse); orc_program_add_destination_full (program, size, "d", "unknown", alignment); break; case ORC_BC_ADD_SOURCE: size = orc_bytecode_parse_get_int (parse); alignment = orc_bytecode_parse_get_int (parse); orc_program_add_source_full (program, size, "s", "unknown", alignment); break; case ORC_BC_ADD_ACCUMULATOR: size = orc_bytecode_parse_get_int (parse); orc_program_add_accumulator (program, size, "a"); break; case ORC_BC_ADD_CONSTANT: { orc_uint32 value; size = orc_bytecode_parse_get_int (parse); value = orc_bytecode_parse_get_uint32 (parse); orc_program_add_constant (program, size, value, "c"); } break; case ORC_BC_ADD_CONSTANT_INT64: { orc_uint64 value; size = orc_bytecode_parse_get_int (parse); value = orc_bytecode_parse_get_uint64 (parse); orc_program_add_constant_int64 (program, size, value, "c"); } break; case ORC_BC_ADD_PARAMETER: size = orc_bytecode_parse_get_int (parse); orc_program_add_parameter (program, size, "p"); break; case ORC_BC_ADD_PARAMETER_FLOAT: size = orc_bytecode_parse_get_int (parse); orc_program_add_parameter_float (program, size, "p"); break; case ORC_BC_ADD_PARAMETER_INT64: size = orc_bytecode_parse_get_int (parse); orc_program_add_parameter_int64 (program, size, "p"); break; case ORC_BC_ADD_PARAMETER_DOUBLE: size = orc_bytecode_parse_get_int (parse); orc_program_add_parameter_double (program, size, "p"); break; case ORC_BC_ADD_TEMPORARY: size = orc_bytecode_parse_get_int (parse); orc_program_add_temporary (program, size, "t"); break; case ORC_BC_INSTRUCTION_FLAGS: instruction_flags = orc_bytecode_parse_get_int (parse); break; default: break; } } else { OrcInstruction *insn; insn = program->insns + program->n_insns; insn->opcode = opcode_set->opcodes + (bc - 32); if (insn->opcode->dest_size[0] != 0) { insn->dest_args[0] = orc_bytecode_parse_get_int (parse); } if (insn->opcode->dest_size[1] != 0) { insn->dest_args[1] = orc_bytecode_parse_get_int (parse); } if (insn->opcode->src_size[0] != 0) { insn->src_args[0] = orc_bytecode_parse_get_int (parse); } if (insn->opcode->src_size[1] != 0) { insn->src_args[1] = orc_bytecode_parse_get_int (parse); } if (insn->opcode->src_size[2] != 0) { insn->src_args[2] = orc_bytecode_parse_get_int (parse); } insn->flags = instruction_flags; instruction_flags = 0; program->n_insns++; } } } orc-0.4.18/orc/orcpowerpc.c0000664000175000017500000004215612111024531012422 00000000000000 #include "config.h" #include #include #include #include #include #include #include /** * SECTION:orcpowerpc * @title: PowerPC * @short_description: code generation for PowerPC */ void orc_compiler_powerpc_init (OrcCompiler *compiler); void orc_compiler_powerpc_assemble (OrcCompiler *compiler); void orc_compiler_powerpc_register_rules (OrcTarget *target); const char * powerpc_get_regname(int i) { static const char *powerpc_regs[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", }; if (i>=ORC_GP_REG_BASE && icodeptr++ = (insn>>24); *compiler->codeptr++ = (insn>>16); *compiler->codeptr++ = (insn>>8); *compiler->codeptr++ = (insn>>0); } void powerpc_emit_add (OrcCompiler *compiler, int regd, int rega, int regb) { unsigned int insn; ORC_ASM_CODE(compiler," add %s, %s, %s\n", powerpc_get_regname(regd), powerpc_get_regname(rega), powerpc_get_regname(regb)); insn = 0x7c000214 | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= (powerpc_regnum (regb)<<11); powerpc_emit (compiler, insn); } void powerpc_emit_addi_rec (OrcCompiler *compiler, int regd, int rega, int imm) { unsigned int insn; ORC_ASM_CODE(compiler," addic. %s, %s, %d\n", powerpc_get_regname(regd), powerpc_get_regname(rega), imm); insn = 0x34000000 | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= imm&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_addi (OrcCompiler *compiler, int regd, int rega, int imm) { unsigned int insn; ORC_ASM_CODE(compiler," addi %s, %s, %d\n", powerpc_get_regname(regd), powerpc_get_regname(rega), imm); insn = (14<<26) | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= imm&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_lwz (OrcCompiler *compiler, int regd, int rega, int imm) { unsigned int insn; ORC_ASM_CODE(compiler," lwz %s, %d(%s)\n", powerpc_get_regname(regd), imm, powerpc_get_regname(rega)); insn = (32<<26) | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= imm&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_stw (OrcCompiler *compiler, int regs, int rega, int offset) { unsigned int insn; ORC_ASM_CODE(compiler," stw %s, %d(%s)\n", powerpc_get_regname(regs), offset, powerpc_get_regname(rega)); insn = 0x90000000 | (powerpc_regnum (regs)<<21) | (powerpc_regnum (rega)<<16); insn |= offset&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_stwu (OrcCompiler *compiler, int regs, int rega, int offset) { unsigned int insn; ORC_ASM_CODE(compiler," stwu %s, %d(%s)\n", powerpc_get_regname(regs), offset, powerpc_get_regname(rega)); insn = (37<<26) | (powerpc_regnum (regs)<<21) | (powerpc_regnum (rega)<<16); insn |= offset&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_ld (OrcCompiler *compiler, int regd, int rega, int imm) { unsigned int insn; ORC_ASM_CODE(compiler," ld %s, %d(%s)\n", powerpc_get_regname(regd), imm, powerpc_get_regname(rega)); insn = (58<<26) | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= imm&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_std (OrcCompiler *compiler, int regs, int rega, int offset) { unsigned int insn; ORC_ASM_CODE(compiler," std %s, %d(%s)\n", powerpc_get_regname(regs), offset, powerpc_get_regname(rega)); insn = (62<<26) | (powerpc_regnum (regs)<<21) | (powerpc_regnum (rega)<<16); insn |= offset&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_stdu (OrcCompiler *compiler, int regs, int rega, int offset) { unsigned int insn; ORC_ASM_CODE(compiler," stdu %s, %d(%s)\n", powerpc_get_regname(regs), offset, powerpc_get_regname(rega)); insn = (62<<26) | (powerpc_regnum (regs)<<21) | (powerpc_regnum (rega)<<16); insn |= (offset&0xffff) | 1; powerpc_emit (compiler, insn); } void powerpc_emit_srawi (OrcCompiler *compiler, int regd, int rega, int shift, int record) { unsigned int insn; ORC_ASM_CODE(compiler," srawi%s %s, %s, %d\n", (record)?".":"", powerpc_get_regname(regd), powerpc_get_regname(rega), shift); insn = (31<<26) | (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= (shift<<11) | (824<<1) | record; powerpc_emit (compiler, insn); } void powerpc_emit_655510 (OrcCompiler *compiler, int major, int d, int a, int b, int minor) { unsigned int insn; insn = (major<<26) | (d<<21) | (a<<16); insn |= (b<<11) | (minor<<0); powerpc_emit (compiler, insn); } void powerpc_emit_D (OrcCompiler *compiler, const char *name, unsigned int insn, int regd, int rega, int imm) { ORC_ASM_CODE(compiler," %s %s, %s, %d\n", name, powerpc_get_regname(regd), powerpc_get_regname(rega), imm); insn |= (powerpc_regnum (regd)<<21) | (powerpc_regnum (rega)<<16); insn |= imm&0xffff; powerpc_emit (compiler, insn); } void powerpc_emit_X (OrcCompiler *compiler, unsigned int insn, int d, int a, int b) { #if 0 unsigned int insn; insn = (major<<26) | (d<<21) | (a<<16); insn |= (b<<11) | (minor<<1) | (0<<0); powerpc_emit (compiler, insn); #endif insn |= ((d&0x1f)<<21); insn |= ((a&0x1f)<<16); insn |= ((b&0x1f)<<11); powerpc_emit (compiler, insn); } void powerpc_emit_VA (OrcCompiler *compiler, const char *name, unsigned int insn, int d, int a, int b, int c) { ORC_ASM_CODE(compiler," %s %s, %s, %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(a), powerpc_get_regname(b), powerpc_get_regname(c)); insn |= ((d&0x1f)<<21) | ((a&0x1f)<<16) | ((b&0x1f)<<11) | ((c&0x1f)<<6); powerpc_emit (compiler, insn); } void powerpc_emit_VA_acb (OrcCompiler *compiler, const char *name, unsigned int insn, int d, int a, int b, int c) { ORC_ASM_CODE(compiler," %s %s, %s, %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(a), powerpc_get_regname(c), powerpc_get_regname(b)); insn |= ((d&0x1f)<<21) | ((a&0x1f)<<16) | ((b&0x1f)<<11) | ((c&0x1f)<<6); powerpc_emit (compiler, insn); } void powerpc_emit_VXR (OrcCompiler *compiler, const char *name, unsigned int insn, int d, int a, int b, int record) { ORC_ASM_CODE(compiler," %s %s, %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(a), powerpc_get_regname(b)); insn |= ((d&0x1f)<<21) | ((a&0x1f)<<16) | ((b&0x1f)<<11); insn |= ((record&0x1)<<10); powerpc_emit (compiler, insn); } void powerpc_emit_VX (OrcCompiler *compiler, unsigned int insn, int d, int a, int b) { insn |= ((d&0x1f)<<21); insn |= ((a&0x1f)<<16); insn |= ((b&0x1f)<<11); powerpc_emit (compiler, insn); } void powerpc_emit_VX_2 (OrcCompiler *p, const char *name, unsigned int insn, int d, int a, int b) { ORC_ASM_CODE(p," %s %s, %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(a), powerpc_get_regname(b)); powerpc_emit_VX(p, insn, powerpc_regnum(d), powerpc_regnum(a), powerpc_regnum(b)); } void powerpc_emit_VX_b (OrcCompiler *p, const char *name, unsigned int insn, int b) { ORC_ASM_CODE(p," %s %s\n", name, powerpc_get_regname(b)); powerpc_emit_VX(p, insn, 0, 0, powerpc_regnum(b)); } void powerpc_emit_VX_db (OrcCompiler *p, const char *name, unsigned int insn, int d, int b) { ORC_ASM_CODE(p," %s %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(b)); powerpc_emit_VX(p, insn, powerpc_regnum(d), 0, powerpc_regnum(b)); } void powerpc_emit_VX_dbi (OrcCompiler *p, const char *name, unsigned int insn, int d, int b, int imm) { ORC_ASM_CODE(p," %s %s, %s, %d\n", name, powerpc_get_regname(d), powerpc_get_regname(b), imm); powerpc_emit_VX(p, insn, powerpc_regnum(d), imm, powerpc_regnum(b)); } void powerpc_emit_VX_3_reg (OrcCompiler *p, const char *name, unsigned int insn, int d, int a, int b, int c) { ORC_ASM_CODE(p," %s %s, %s, %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(a), powerpc_get_regname(b), powerpc_get_regname(c)); powerpc_emit_VX(p, insn, powerpc_regnum(d), powerpc_regnum(a), powerpc_regnum(b)); } void powerpc_emit_VX_3 (OrcCompiler *p, const char *name, unsigned int insn, int d, int a, int b, int c) { ORC_ASM_CODE(p," %s %s, %s, %s, %d\n", name, powerpc_get_regname(d), powerpc_get_regname(a), powerpc_get_regname(b), c); powerpc_emit_VX(p, insn, powerpc_regnum(d), powerpc_regnum(a), powerpc_regnum(b)); } void powerpc_emit_VX_4 (OrcCompiler *p, const char *name, unsigned int insn, int d, int a) { ORC_ASM_CODE(p," %s %s, %s\n", name, powerpc_get_regname(d), powerpc_get_regname(a)); powerpc_emit_VX(p, insn, powerpc_regnum(d), 0, powerpc_regnum(a)); } void powerpc_do_fixups (OrcCompiler *compiler) { int i; unsigned int insn; for(i=0;in_fixups;i++){ unsigned char *label = compiler->labels[compiler->fixups[i].label]; unsigned char *ptr = compiler->fixups[i].ptr; insn = *(unsigned int *)ptr; switch (compiler->fixups[i].type) { case 0: *(unsigned int *)ptr = (insn&0xffff0000) | ((insn + (label-ptr))&0xffff); break; case 1: *(unsigned int *)ptr = (insn&0xffff0000) | ((insn + (label-compiler->code))&0xffff); break; case 2: *(unsigned int *)ptr = (insn&0xfc000000) | ((insn + (label-ptr))&0x03ffffff); break; } } } void orc_powerpc_flush_cache (OrcCode *code) { #ifdef HAVE_POWERPC unsigned char *ptr; int cache_line_size = 32; int i; int size = code->code_size; ptr = code->code; #ifdef __powerpc64__ *(unsigned char **) ptr = (unsigned char *) code->exec + 24; #endif for (i=0;iexec; for (i=0;iconstants[i].value; switch (p->constants[i].type) { case ORC_CONST_ZERO: powerpc_emit_VX_2(p, "vxor", 0x100004c4, reg, reg, reg); return; case ORC_CONST_SPLAT_B: if (value < 16 && value >= -16) { ORC_ASM_CODE(p," vspltisb %s, %d\n", powerpc_get_regname(reg), value); powerpc_emit_VX(p, 0x1000030c, powerpc_regnum(reg), value & 0x1f, 0); return; } break; case ORC_CONST_SPLAT_W: if (value < 16 && value >= -16) { ORC_ASM_CODE(p," vspltish %s, %d\n", powerpc_get_regname(reg), value); powerpc_emit_VX(p, 0x1000034c, powerpc_regnum(reg), value & 0x1f, 0); return; } break; case ORC_CONST_SPLAT_L: if (value < 16 && value >= -16) { ORC_ASM_CODE(p," vspltisw %s, %d\n", powerpc_get_regname(reg), value); powerpc_emit_VX(p, 0x1000038c, powerpc_regnum(reg), value & 0x1f, 0); return; } break; default: break; } switch (p->constants[i].type) { case ORC_CONST_ZERO: for(j=0;j<4;j++){ p->constants[i].full_value[j] = 0; } break; case ORC_CONST_SPLAT_B: value &= 0xff; value |= (value<<8); value |= (value<<16); for(j=0;j<4;j++){ p->constants[i].full_value[j] = value; } break; case ORC_CONST_SPLAT_W: value &= 0xffff; value |= (value<<16); for(j=0;j<4;j++){ p->constants[i].full_value[j] = value; } break; case ORC_CONST_SPLAT_L: for(j=0;j<4;j++){ p->constants[i].full_value[j] = value; } break; default: break; } powerpc_load_long_constant (p, reg, p->constants[i].full_value[0], p->constants[i].full_value[1], p->constants[i].full_value[2], p->constants[i].full_value[3]); } void powerpc_load_long_constant (OrcCompiler *p, int reg, orc_uint32 a, orc_uint32 b, orc_uint32 c, orc_uint32 d) { int label_skip, label_data; int greg = p->gp_tmpreg; label_skip = orc_compiler_label_new (p); label_data = orc_compiler_label_new (p); powerpc_emit_b (p, label_skip); while ((p->codeptr - p->code) & 0xf) { ORC_ASM_CODE(p," .long 0x00000000\n"); powerpc_emit (p, 0x00000000); } powerpc_emit_label (p, label_data); ORC_ASM_CODE(p," .long 0x%08x\n", a); powerpc_emit (p, a); ORC_ASM_CODE(p," .long 0x%08x\n", b); powerpc_emit (p, b); ORC_ASM_CODE(p," .long 0x%08x\n", c); powerpc_emit (p, c); ORC_ASM_CODE(p," .long 0x%08x\n", d); powerpc_emit (p, d); powerpc_emit_label (p, label_skip); if (p->is_64bit) { powerpc_emit_ld (p, greg, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[ORC_VAR_A2])); powerpc_emit_ld (p, greg, greg, (int)ORC_STRUCT_OFFSET(OrcCode, exec)); } else { powerpc_emit_lwz (p, greg, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[ORC_VAR_A2])); powerpc_emit_lwz (p, greg, greg, (int)ORC_STRUCT_OFFSET(OrcCode, exec)); } powerpc_add_fixup (p, 1, p->codeptr, label_data); { unsigned int insn; ORC_ASM_CODE(p," addi %s, %s, %db - %s\n", powerpc_get_regname(greg), powerpc_get_regname(greg), label_data, p->program->name); insn = (14<<26) | (powerpc_regnum (greg)<<21) | (powerpc_regnum (greg)<<16); insn |= 0; powerpc_emit (p, insn); } ORC_ASM_CODE(p," lvx %s, 0, %s\n", powerpc_get_regname(reg), powerpc_get_regname(greg)); powerpc_emit_X (p, 0x7c0000ce, reg, 0, greg); } int powerpc_get_constant (OrcCompiler *p, int type, int value) { int reg = orc_compiler_get_temp_reg (p); int i; for(i=0;in_constants;i++){ if (p->constants[i].type == type && p->constants[i].value == value) { if (p->constants[i].alloc_reg != 0) { return p->constants[i].alloc_reg; } break; } } if (i == p->n_constants) { p->n_constants++; p->constants[i].type = type; p->constants[i].value = value; p->constants[i].alloc_reg = 0; } powerpc_load_constant (p, i, reg); return reg; } int powerpc_get_constant_full (OrcCompiler *p, int value0, int value1, int value2, int value3) { int reg = p->tmpreg; int i; for(i=0;in_constants;i++){ #if 0 if (p->constants[i].type == type && p->constants[i].value == value) { if (p->constants[i].alloc_reg != 0) { return p->constants[i].alloc_reg; } break; } #endif } if (i == p->n_constants) { p->n_constants++; p->constants[i].type = ORC_CONST_FULL; p->constants[i].full_value[0] = value0; p->constants[i].full_value[1] = value1; p->constants[i].full_value[2] = value2; p->constants[i].full_value[3] = value3; p->constants[i].alloc_reg = 0; } powerpc_load_constant (p, i, reg); return reg; } void powerpc_emit_ret (OrcCompiler *compiler) { ORC_ASM_CODE(compiler," ret\n"); //*compiler->codeptr++ = 0xc3; } void powerpc_add_fixup (OrcCompiler *compiler, int type, unsigned char *ptr, int label) { compiler->fixups[compiler->n_fixups].ptr = ptr; compiler->fixups[compiler->n_fixups].label = label; compiler->fixups[compiler->n_fixups].type = type; compiler->n_fixups++; if (compiler->n_fixups >= ORC_N_FIXUPS) { ORC_ERROR("too many fixups"); } } void powerpc_add_label (OrcCompiler *compiler, unsigned char *ptr, int label) { compiler->labels[label] = ptr; } void powerpc_emit_b (OrcCompiler *compiler, int label) { ORC_ASM_CODE(compiler," b %d%c\n", label, (compiler->labels[label]!=NULL) ? 'b' : 'f'); powerpc_add_fixup (compiler, 2, compiler->codeptr, label); powerpc_emit (compiler, 0x48000000); } void powerpc_emit_beq (OrcCompiler *compiler, int label) { ORC_ASM_CODE(compiler," ble- %d%c\n", label, (compiler->labels[label]!=NULL) ? 'b' : 'f'); powerpc_add_fixup (compiler, 0, compiler->codeptr, label); powerpc_emit (compiler, 0x40810000); } void powerpc_emit_bne (OrcCompiler *compiler, int label) { ORC_ASM_CODE(compiler," bdnz+ %d%c\n", label, (compiler->labels[label]!=NULL) ? 'b' : 'f'); powerpc_add_fixup (compiler, 0, compiler->codeptr, label); powerpc_emit (compiler, 0x42000000); } void powerpc_emit_label (OrcCompiler *compiler, int label) { ORC_ASM_CODE(compiler,"%d:\n", label); powerpc_add_label (compiler, compiler->codeptr, label); } orc-0.4.18/orc/orcx86.h0000644000175000017500000001762211642206054011405 00000000000000 #ifndef _ORC_X86_H_ #define _ORC_X86_H_ #include #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API enum { X86_EAX = ORC_GP_REG_BASE, X86_ECX, X86_EDX, X86_EBX, X86_ESP, X86_EBP, X86_ESI, X86_EDI, X86_R8, X86_R9, X86_R10, X86_R11, X86_R12, X86_R13, X86_R14, X86_R15 }; enum { ORC_X86_UNKNOWN, ORC_X86_P6, ORC_X86_NETBURST, ORC_X86_CORE, ORC_X86_PENRYN, ORC_X86_NEHALEM, ORC_X86_BONNELL, ORC_X86_WESTMERE, ORC_X86_SANDY_BRIDGE, ORC_X86_K5, ORC_X86_K6, ORC_X86_K7, ORC_X86_K8, ORC_X86_K10 }; const char * orc_x86_get_regname(int i); int orc_x86_get_regnum(int i); const char * orc_x86_get_regname_8(int i); const char * orc_x86_get_regname_16(int i); const char * orc_x86_get_regname_64(int i); const char * orc_x86_get_regname_ptr(OrcCompiler *compiler, int i); const char * orc_x86_get_regname_size(int i, int size); void orc_x86_emit_push (OrcCompiler *compiler, int size, int reg); void orc_x86_emit_pop (OrcCompiler *compiler, int size, int reg); #define orc_x86_emit_mov_imm_reg(p,size,value,reg) \ orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_mov_imm32_r, size, value, reg) #define orc_x86_emit_mov_reg_reg(p,size,src,dest) \ orc_x86_emit_cpuinsn_size (p, ORC_X86_mov_r_rm, size, src, dest) #define orc_x86_emit_test_reg_reg(p,size,src,dest) \ orc_x86_emit_cpuinsn_size (p, ORC_X86_test, size, src, dest) #define orc_x86_emit_sar_imm_reg(p,size,value,reg) do { \ if (value == 1) { \ orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_sar, size, value, reg); \ } else if (value > 1) { \ orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_sar_imm, size, value, reg); \ } \ } while (0) #define orc_x86_emit_and_imm_memoffset(p,size,value,offset,reg) \ orc_x86_emit_cpuinsn_imm_memoffset (p, (value >= -128 && value < 128) ? \ ORC_X86_and_imm8_rm : ORC_X86_and_imm32_rm, size, value, offset, reg) #define orc_x86_emit_and_imm_reg(p,size,value,reg) do { \ if ((value) >= -128 && (value) < 128) { \ orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_and_imm8_rm, size, value, reg); \ } else { \ if ((reg) == X86_EAX) { \ orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_and_imm32_a, size, value, reg); \ } else { \ orc_x86_emit_cpuinsn_imm_reg (p, ORC_X86_and_imm32_rm, size, value, reg); \ } \ } \ } while (0) #define orc_x86_emit_add_imm_memoffset(p,size,value,offset,reg) \ orc_x86_emit_cpuinsn_imm_memoffset (p, (value >= -128 && value < 128) ? \ ORC_X86_add_imm8_rm : ORC_X86_add_imm32_rm, size, value, offset, reg) #define orc_x86_emit_add_reg_memoffset(p,size,src,offset,dest) \ orc_x86_emit_cpuinsn_reg_memoffset(p, ORC_X86_add_r_rm, src, offset, dest) #define orc_x86_emit_add_reg_reg(p,size,src,dest) \ orc_x86_emit_cpuinsn_size(p, ORC_X86_add_r_rm, size, src, dest) #define orc_x86_emit_add_memoffset_reg(p,size,offset,src,dest) \ orc_x86_emit_cpuinsn_memoffset_reg(p, ORC_X86_add_rm_r, size, offset, src, dest) #define orc_x86_emit_sub_reg_reg(p,size,src,dest) \ orc_x86_emit_cpuinsn_size(p, ORC_X86_sub_r_rm, size, src, dest) #define orc_x86_emit_sub_memoffset_reg(p,size,offset,src,dest) \ orc_x86_emit_cpuinsn_memoffset_reg(p, ORC_X86_sub_rm_r, size, offset, src, dest) #define orc_x86_emit_imul_memoffset_reg(p,size,offset,src,dest) \ orc_x86_emit_cpuinsn_memoffset_reg(p, ORC_X86_imul_rm_r, size, offset, src, dest) #define orc_x86_emit_cmp_reg_memoffset(p,size,src,offset,dest) \ orc_x86_emit_cpuinsn_reg_memoffset(p, ORC_X86_cmp_r_rm, src, offset, dest) #define orc_x86_emit_jmp(p,label) \ orc_x86_emit_cpuinsn_branch (p, ORC_X86_jmp, label) #define orc_x86_emit_jg(p,label) \ orc_x86_emit_cpuinsn_branch (p, ORC_X86_jg, label) #define orc_x86_emit_jle(p,label) \ orc_x86_emit_cpuinsn_branch (p, ORC_X86_jle, label) #define orc_x86_emit_je(p,label) \ orc_x86_emit_cpuinsn_branch (p, ORC_X86_jz, label) #define orc_x86_emit_jne(p,label) \ orc_x86_emit_cpuinsn_branch (p, ORC_X86_jnz, label) #define orc_x86_emit_align(p,align_shift) \ orc_x86_emit_cpuinsn_align (p, ORC_X86_ALIGN, align_shift) #define orc_x86_emit_label(p,label) \ orc_x86_emit_cpuinsn_label (p, ORC_X86_LABEL, label) #define orc_x86_emit_emms(p) \ orc_x86_emit_cpuinsn_none (p, ORC_X86_emms) #define orc_x86_emit_rdtsc(p) \ orc_x86_emit_cpuinsn_none (p, ORC_X86_rdtsc) #define orc_x86_emit_ret(p) \ orc_x86_emit_cpuinsn_none (p, ((p)->is_64bit) ? ORC_X86_retq : ORC_X86_ret) #define orc_x86_emit_test_imm_memoffset(p,size,value,offset,dest) \ orc_x86_emit_cpuinsn_imm_memoffset (p, ORC_X86_test_imm, size, value, \ offset, dest) void orc_x86_emit_mov_memoffset_reg (OrcCompiler *compiler, int size, int offset, int reg1, int reg2); void orc_x86_emit_mov_reg_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2); void orc_x86_emit_dec_memoffset (OrcCompiler *compiler, int size, int offset, int reg); void orc_x86_emit_add_imm_reg (OrcCompiler *compiler, int size, int value, int reg, orc_bool record); void orc_x86_emit_add_reg_reg_shift (OrcCompiler *compiler, int size, int reg1, int reg2, int shift); void orc_x86_emit_cmp_imm_memoffset (OrcCompiler *compiler, int size, int value, int offset, int reg); void orc_x86_emit_cmp_imm_reg (OrcCompiler *compiler, int size, int value, int reg); void orc_x86_emit_rep_movs (OrcCompiler *compiler, int size); void orc_x86_emit_prologue (OrcCompiler *compiler); void orc_x86_emit_epilogue (OrcCompiler *compiler); void orc_x86_emit_rex (OrcCompiler *compiler, int size, int reg1, int reg2, int reg3); void orc_x86_emit_modrm_memoffset_old (OrcCompiler *compiler, int reg1, int offset, int reg2); void orc_x86_emit_modrm_memoffset (OrcCompiler *compiler, int offset, int reg1, int reg2); void orc_x86_emit_modrm_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_modrm_memindex (OrcCompiler *compiler, int reg1, int offset, int reg2, int regindex, int shift); void orc_x86_emit_modrm_memindex2 (OrcCompiler *compiler, int offset, int src, int src_index, int shift, int dest); void x86_add_fixup (OrcCompiler *compiler, unsigned char *ptr, int label, int type); void x86_add_label (OrcCompiler *compiler, unsigned char *ptr, int label); void x86_add_label2 (OrcCompiler *compiler, int index, int label); void orc_x86_do_fixups (OrcCompiler *compiler); int orc_x86_assemble_copy_check (OrcCompiler *compiler); void orc_x86_assemble_copy (OrcCompiler *compiler); void orc_x86_emit_cpuinsn_size (OrcCompiler *p, int opcode, int size, int src, int dest); void orc_x86_emit_cpuinsn_imm (OrcCompiler *p, int opcode, int imm, int src, int dest); void orc_x86_emit_cpuinsn_load_memoffset (OrcCompiler *p, int size, int index, int offset, int src, int dest, int imm); void orc_x86_emit_cpuinsn_store_memoffset (OrcCompiler *p, int size, int index, int src, int offset, int dest, int imm); void orc_x86_emit_cpuinsn_load_memindex (OrcCompiler *p, int index, int size, int imm, int offset, int src, int src_index, int shift, int dest); void orc_x86_emit_cpuinsn_load_register (OrcCompiler *p, int index, int imm, int src, int dest); void orc_x86_emit_cpuinsn_imm_reg (OrcCompiler *p, int index, int size, int imm, int dest); void orc_x86_emit_cpuinsn_imm_memoffset (OrcCompiler *p, int index, int size, int imm, int offset, int dest); void orc_x86_emit_cpuinsn_reg_memoffset (OrcCompiler *p, int index, int src, int offset, int dest); void orc_x86_emit_cpuinsn_reg_memoffset_8 (OrcCompiler *p, int index, int src, int offset, int dest); void orc_x86_emit_cpuinsn_memoffset_reg (OrcCompiler *p, int index, int size, int offset, int src, int dest); void orc_x86_emit_cpuinsn_memoffset (OrcCompiler *p, int index, int size, int offset, int srcdest); void orc_x86_emit_cpuinsn_branch (OrcCompiler *p, int index, int label); void orc_x86_emit_cpuinsn_label (OrcCompiler *p, int index, int label); void orc_x86_emit_cpuinsn_none (OrcCompiler *p, int index); void orc_x86_emit_cpuinsn_align (OrcCompiler *p, int index, int align_shift); #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcrules-arm.c0000664000175000017500000016041612111042347012657 00000000000000 #include "config.h" #include #include #include #include #include #include #include #define BINARY_DP(opcode,insn_name) \ static void \ arm_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ int src1 = ORC_SRC_ARG (p, insn, 0); \ int src2 = ORC_SRC_ARG (p, insn, 1); \ int dest = ORC_DEST_ARG (p, insn, 0); \ \ orc_arm_emit_ ##insn_name## _r (p, ORC_ARM_COND_AL, 0, \ dest, src1, src2); \ } #define BINARY_MM(opcode,insn_name) \ static void \ arm_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ int src1 = ORC_SRC_ARG (p, insn, 0); \ int src2 = ORC_SRC_ARG (p, insn, 1); \ int dest = ORC_DEST_ARG (p, insn, 0); \ \ orc_arm_emit_##insn_name (p, ORC_ARM_COND_AL, dest, src1, src2); \ } /* multiplies */ #define orc_arm_smulxy(cond,x,y,Rd,Rm,Rs) (0x01600080|((cond)<<28)|(((Rd)&15)<<16)|(((Rs)&15)<<8)|((y)<<6)|((x)<<5)|((Rm)&15)) #define orc_arm_emit_smulbb(p,cond,Rd,Rm,Rs) do { \ ORC_ASM_CODE (p, "smulbb %s, %s, %s\n", orc_arm_reg_name (Rd), \ orc_arm_reg_name (Rm), orc_arm_reg_name(Rs)); \ orc_arm_emit (p, orc_arm_smulxy (cond,0,0,Rd,Rm,Rs)); \ } while (0) #define orc_arm_emit_smulbt(p,cond,Rd,Rm,Rs) do { \ ORC_ASM_CODE (p, "smulbt %s, %s, %s\n", orc_arm_reg_name (Rd), \ orc_arm_reg_name (Rm), orc_arm_reg_name(Rs)); \ orc_arm_emit (p, orc_arm_smulxy (cond,0,1,Rd,Rm,Rs)); \ } while (0) #define orc_arm_emit_smultb(p,cond,Rd,Rm,Rs) do { \ ORC_ASM_CODE (p, "smultb %s, %s, %s\n", orc_arm_reg_name (Rd), \ orc_arm_reg_name (Rm), orc_arm_reg_name(Rs)); \ orc_arm_emit (p, orc_arm_smulxy (cond,1,0,Rd,Rm,Rs)); \ } while (0) #define orc_arm_emit_smultt(p,cond,Rd,Rm,Rs) do { \ ORC_ASM_CODE (p, "smultt %s, %s, %s\n", orc_arm_reg_name (Rd), \ orc_arm_reg_name (Rm), orc_arm_reg_name(Rs)); \ orc_arm_emit (p, orc_arm_smulxy (cond,1,1,Rd,Rm,Rs)); \ } while (0) #define orc_arm_mul(cond,S,Rd,Rm,Rs) (0x00000090|((cond)<<28)|((S)<<20)|(((Rd)&15)<<16)|(((Rs)&15)<<8)|((Rm)&15)) #define orc_arm_emit_mul(p,cond,S,Rd,Rm,Rs) do { \ ORC_ASM_CODE (p, "mul %s, %s, %s\n", orc_arm_reg_name (Rd), \ orc_arm_reg_name (Rm), orc_arm_reg_name(Rs)); \ orc_arm_emit (p, orc_arm_mul (cond,S,Rd,Rm,Rs)); \ } while (0) #define orc_arm_mull(op,cond,S,RdL,RdH,Rn,Rm) (op|((cond)<<28)|((S)<<20)|(((Rn)&15)<<16)|(((RdL)&15)<<12)|(((RdH)&15)<<8)|((Rm)&15)) #define orc_arm_emit_smull(p,cond,S,RdL,RdH,Rn,Rm) do { \ ORC_ASM_CODE (p, "smull %s, %s, %s, %s\n", orc_arm_reg_name (RdL), \ orc_arm_reg_name (RdH), \ orc_arm_reg_name (Rn), orc_arm_reg_name(Rm)); \ orc_arm_emit(p,orc_arm_mull (0x00c00090,cond,S,RdL,Rm,RdH,Rn)); \ } while (0) #define orc_arm_emit_umull(p,cond,S,RdL,RdH,Rn,Rm) do { \ ORC_ASM_CODE (p, "umull %s, %s, %s, %s\n", orc_arm_reg_name (RdL), \ orc_arm_reg_name (RdH), \ orc_arm_reg_name (Rn), orc_arm_reg_name(Rm)); \ orc_arm_emit(p,orc_arm_mull (0x00800090,cond,S,RdL,RdH,Rn,Rm)); \ } while (0) static void arm_rule_loadpX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { if (compiler->vars[insn->src_args[0]].vartype == ORC_VAR_TYPE_CONST) { orc_arm_emit_load_imm (compiler, compiler->vars[insn->dest_args[0]].alloc, (int)compiler->vars[insn->src_args[0]].value.i); } else { orc_arm_loadw (compiler, compiler->vars[insn->dest_args[0]].alloc, compiler->exec_reg, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]])); } } static void arm_rule_loadX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = compiler->vars[insn->src_args[0]].ptr_register; int dest = compiler->vars[insn->dest_args[0]].alloc; int size; orc_uint32 code; int offset = 0; size = (compiler->vars[insn->src_args[0]].size << compiler->loop_shift); if (size == 4) { code = 0xe5900000; ORC_ASM_CODE(compiler," ldr %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src), offset); } else if (size == 2) { code = 0xe1d000b0; ORC_ASM_CODE(compiler," ldrh %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src), offset); } else { code = 0xe5d00000; ORC_ASM_CODE(compiler," ldrb %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src), offset); } code |= (src&0xf) << 16; code |= (dest&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; orc_arm_emit (compiler, code); } static void arm_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { int src = compiler->vars[insn->src_args[0]].alloc; int dest = compiler->vars[insn->dest_args[0]].ptr_register; int size; orc_uint32 code; int offset = 0; size = (compiler->vars[insn->src_args[0]].size << compiler->loop_shift); if (size == 4) { code = 0xe5800000; ORC_ASM_CODE(compiler," str %s, [%s, #%d]\n", orc_arm_reg_name (src), orc_arm_reg_name (dest), offset); } else if (size == 2) { code = 0xe1c000b0; ORC_ASM_CODE(compiler," strh %s, [%s, #%d]\n", orc_arm_reg_name (src), orc_arm_reg_name (dest), offset); } else { code = 0xe5c00000; ORC_ASM_CODE(compiler," strb %s, [%s, #%d]\n", orc_arm_reg_name (src), orc_arm_reg_name (dest), offset); } code |= (dest&0xf) << 16; code |= (src&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; orc_arm_emit (compiler, code); } void orc_arm_loadb (OrcCompiler *compiler, int dest, int src1, int offset) { orc_uint32 code; code = 0xe5d00000; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; ORC_ASM_CODE(compiler," ldrb %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), offset); orc_arm_emit (compiler, code); } void orc_arm_storeb (OrcCompiler *compiler, int dest, int offset, int src1) { orc_uint32 code; code = 0xe5c00000; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; ORC_ASM_CODE(compiler," strb %s, [%s, #%d]\n", orc_arm_reg_name (src1), orc_arm_reg_name (dest), offset); orc_arm_emit (compiler, code); } void orc_arm_loadl (OrcCompiler *compiler, int dest, int src1, int offset) { orc_uint32 code; code = 0xe5900000; code |= (src1&0xf) << 16; code |= (dest&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; ORC_ASM_CODE(compiler," ldr %s, [%s, #%d]\n", orc_arm_reg_name (dest), orc_arm_reg_name (src1), offset); orc_arm_emit (compiler, code); } void orc_arm_storel (OrcCompiler *compiler, int dest, int offset, int src1) { orc_uint32 code; code = 0xe5800000; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; ORC_ASM_CODE(compiler," str %s, [%s, #%d]\n", orc_arm_reg_name (src1), orc_arm_reg_name (dest), offset); orc_arm_emit (compiler, code); } void orc_arm_storew (OrcCompiler *compiler, int dest, int offset, int src1) { orc_uint32 code; code = 0xe1c000b0; code |= (dest&0xf) << 16; code |= (src1&0xf) << 12; code |= (offset&0xf0) << 4; code |= offset&0x0f; ORC_ASM_CODE(compiler," strh %s, [%s, #%d]\n", orc_arm_reg_name (src1), orc_arm_reg_name (dest), offset); orc_arm_emit (compiler, code); } void orc_arm_emit_mov_iw (OrcCompiler *p, int cond, int dest, int val, int loop) { /* dest = val */ orc_arm_emit_mov_i (p, cond, 0, dest, val); if (loop > 1) /* 2 words: dest |= dest << 16 */ orc_arm_emit_orr_rsi (p, cond, 0, dest, dest, dest, ORC_ARM_LSL, 16); } void orc_arm_emit_mov_ib (OrcCompiler *p, int cond, int dest, int val, int loop) { /* 1 byte */ orc_arm_emit_mov_i (p, cond, 0, dest, val); if (loop > 1) /* 2 bytes: dest |= dest << 8 */ orc_arm_emit_orr_rsi (p, cond, 0, dest, dest, dest, ORC_ARM_LSL, 8); if (loop > 2) /* 4 bytes: dest |= dest << 16 */ orc_arm_emit_orr_rsi (p, cond, 0, dest, dest, dest, ORC_ARM_LSL, 16); } /* byte instructions */ static void arm_rule_absX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; int type = ORC_PTR_TO_INT(user); orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, dest, 0); if (type == 0) { /* negate tmp = 0 - src1 */ orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, tmp, dest, src1); /* check sign dest = src1 - 0 */ orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, dest, src1, dest); } else { /* negate tmp = 0 - src1 */ orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, tmp, dest, src1); /* check sign dest = src1 - 0 */ orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, dest, src1, dest); } /* take positive or negative values */ orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src1, tmp); } BINARY_MM (addb, sadd8); BINARY_MM (addssb, qadd8); BINARY_MM (addusb, uqadd8); BINARY_DP (andX, and); static void arm_rule_andnX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_bic_r (p, ORC_ARM_COND_AL, 0, dest, src2, src1); } static void arm_rule_avgX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int mask = p->tmpreg; int tmp = p->gp_tmpreg; int dest = ORC_DEST_ARG (p, insn, 0); int type = ORC_PTR_TO_INT(user); /* signed variant, make a mask, FIXME, instruction constants */ if (type >= 2) { /* mask for word 0x80008000 */ orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, mask, 0x80000000); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, mask, mask, mask, ORC_ARM_LSR, 16); if (type >= 3) { /* mask for byte 0x80808080 */ orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, mask, mask, mask, ORC_ARM_LSR, 8); } /* signed variant, bias the inputs */ orc_arm_emit_eor_r (p, ORC_ARM_COND_AL, 0, src1, src1, mask); orc_arm_emit_eor_r (p, ORC_ARM_COND_AL, 0, src2, src2, mask); } /* dest = (s1 | s2) - (((s1 ^ s2) & ~(0x1 >>> (shift*2))) >> 1) */ /* (s1 | s2) */ orc_arm_emit_orr_r (p, ORC_ARM_COND_AL, 0, tmp, src1, src2); /* (s1 ^ s2) */ orc_arm_emit_eor_r (p, ORC_ARM_COND_AL, 0, dest, src1, src2); /* clear the bits we will shift into view in the next instruction, FIXME, we * need instruction wide constants */ if (type <= 1) { /* clear 0x00010000 */ orc_arm_emit_bic_i (p, ORC_ARM_COND_AL, 0, dest, dest, 0x00010000); if (type == 0) { /* clear 0x00000100 */ orc_arm_emit_bic_i (p, ORC_ARM_COND_AL, 0, dest, dest, 0x00000100); /* clear 0x01000000 */ orc_arm_emit_bic_i (p, ORC_ARM_COND_AL, 0, dest, dest, 0x01000000); } } else if (type >= 2) { /* already have a mask, use it here */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, mask, ORC_ARM_LSR, 7); } /* do final right shift and subtraction */ orc_arm_emit_sub_rsi (p, ORC_ARM_COND_AL, 0, dest, tmp, dest, ORC_ARM_LSR, 1); if (type >= 2) { /* signed variant, unbias input again */ orc_arm_emit_eor_r (p, ORC_ARM_COND_AL, 0, src1, src1, mask); orc_arm_emit_eor_r (p, ORC_ARM_COND_AL, 0, src2, src2, mask); } } static void arm_rule_cmpeqX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; int size = ORC_PTR_TO_INT(user); /* bytes that are equal will have all bits 0 */ orc_arm_emit_eor_r (p, ORC_ARM_COND_AL, 0, tmp, src1, src2); /* clear dest register */ orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, dest, 0); /* tmp = 0 - tmp, set GE flags for 0 bytes */ if (size == 1) { orc_arm_emit_usub8 (p, ORC_ARM_COND_AL, tmp, dest, tmp); } else { orc_arm_emit_usub16 (p, ORC_ARM_COND_AL, tmp, dest, tmp); } /* make 0xffffffff in tmp */ orc_arm_emit_mvn_i (p, ORC_ARM_COND_AL, 0, tmp, 0); /* set 0xff for 0 bytes, 0x00 otherwise */ orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, tmp, dest); } static void arm_rule_cmpgtsX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; int size = ORC_PTR_TO_INT(user); /* dest = src2 - src1, set GE flags for src2 >= src1 */ if (size == 1) { orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, dest, src2, src1); } else { orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, dest, src2, src1); } /* clear dest register */ orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, dest, 0); /* make 0xffffffff in tmp */ orc_arm_emit_mvn_i (p, ORC_ARM_COND_AL, 0, tmp, 0); /* set 0x00 for src2 >= src1 bytes, 0xff if src2 < src1 */ orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, dest, tmp); } static void arm_rule_copyX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_mov_r (p, ORC_ARM_COND_AL, 0, dest, src1); } static void arm_rule_maxsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src1, src2); } static void arm_rule_maxub (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_usub8 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src1, src2); } static void arm_rule_minsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src2, src1); } static void arm_rule_minub (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_usub8 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src2, src1); } static void arm_rule_mullb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; int tmp2 = p->gp_tmpreg; int tmp3 = ORC_ARM_V8; int loop = 1; /* extract and multiply first item */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp2, src2); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, tmp1, tmp2); if (loop > 1) { if (loop > 2) { /* third item, reuse extracted bits for first item */ orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge with first */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, dest, tmp1, 16); } /* clear upper bits */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); /* extract and multiply second item */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp1, src1, 8); orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp2, src2, 8); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, tmp3, tmp1, tmp2); if (loop > 2) { /* forth item */ orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge with second */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, tmp3, tmp3, tmp1, 16); } /* clear upper bits */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp3, tmp3); /* merge results */ orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, tmp3, ORC_ARM_LSL, 8); } } static void arm_rule_mulhsb (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_SB(mulhsb, "(%s * %s) >> 8") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; int tmp2 = p->gp_tmpreg; int tmp3 = ORC_ARM_V8; int loop = 1; /* first item (and third) */ orc_arm_emit_sxtb16 (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_sxtb16 (p, ORC_ARM_COND_AL, tmp2, src2); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, tmp1, tmp2); if (loop > 1) { if (loop > 2) { /* third item */ orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge with first */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, dest, tmp1, 16); } /* extract upper bits */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, dest, dest, 8); /* second item (and fourth) */ orc_arm_emit_sxtb16_r8 (p, ORC_ARM_COND_AL, tmp1, src1, 8); orc_arm_emit_sxtb16_r8 (p, ORC_ARM_COND_AL, tmp2, src2, 8); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, tmp3, tmp1, tmp2); if (loop > 2) { /* forth item */ orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge with second */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, tmp3, tmp3, tmp1, 16); } /* extract upper bits */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp3, tmp3, 8); /* merge tmp3 */ orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, tmp3, ORC_ARM_LSL, 8); } else { /* bring upper bits in position */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_mulhub (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_UB(mulhub, "((orc_uint32)(uint8_t)%s * (orc_uint32)(uint8_t)%s) >> 8") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; int tmp2 = p->gp_tmpreg; int tmp3 = ORC_ARM_V8; int loop = 1; /* first item (and third) */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp2, src2); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, tmp1, tmp2); if (loop > 1) { if (loop > 2) { /* third item */ orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge with first */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, dest, tmp1, 16); } /* extract upper bits */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, dest, dest, 8); /* second item (and fourth) */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp1, src1, 8); orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp2, src2, 8); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, tmp3, tmp1, tmp2); if (loop > 2) { /* forth item */ orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge with second */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, tmp3, tmp3, tmp1, 16); } /* extract upper bits */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp3, tmp3, 8); /* merge tmp3 */ orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, tmp3, ORC_ARM_LSL, 8); } else { /* bring upper bits in position */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, ORC_ARM_LSR, 8); } } BINARY_DP (orX, orr); static void arm_rule_shlX (OrcCompiler *p, void *user, OrcInstruction *insn) { /* degrades nicely to trivial shift when not doing parallel shifts */ int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int mask = p->tmpreg; int src2type = ORC_SRC_TYPE (p, insn, 1); int size = ORC_PTR_TO_INT(user); int loop = 4 / size; /* number of items in one register */ if (src2type == ORC_VAR_TYPE_CONST) { int val = ORC_SRC_VAL (p, insn, 1); if (loop > 1 && size != 4 && val < 5) { for (;val; val--) { /* small values, do a series of additions, we need at least 5 * instructions for the generic case below. */ if (size == 1) orc_arm_emit_uadd8 (p, ORC_ARM_COND_AL, dest, src1, src1); else orc_arm_emit_uadd16 (p, ORC_ARM_COND_AL, dest, src1, src1); } } else { /* bigger values, shift and mask out excess bits */ if (val >= size) { /* too big, clear all */ orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, dest, 0); } else if (val > 0) { if (loop > 1 && size < 4) { /* shift, note that we skip the next instructions when 0 */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 1, dest, src1, ORC_ARM_LSL, val); if (size == 1) /* make loop * 0x80 */ orc_arm_emit_mov_ib (p, ORC_ARM_COND_NE, mask, 0x80, loop); else /* make loop * 0x8000 */ orc_arm_emit_mov_iw (p, ORC_ARM_COND_NE, mask, 0x8000, loop); /* make mask, this mask has enough bits but is shifted one position to the right */ orc_arm_emit_sub_rsi (p, ORC_ARM_COND_NE, 0, mask, mask, mask, ORC_ARM_LSR, val); /* clear upper bits */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_NE, 0, dest, dest, mask, ORC_ARM_LSL, 1); } else { orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_LSL, val); } } } } else if (src2type == ORC_VAR_TYPE_PARAM) { int src2 = ORC_SRC_ARG (p, insn, 1); if (loop > 1 && size < 4) { /* shift with register value, note that we skip the next instructions when 0 */ orc_arm_emit_mov_rsr (p, ORC_ARM_COND_AL, 1, dest, src1, ORC_ARM_LSL, src2); if (size == 1) /* make loop * 0x80 */ orc_arm_emit_mov_ib (p, ORC_ARM_COND_NE, mask, 0x80, loop); else /* make loop * 0x8000 */ orc_arm_emit_mov_iw (p, ORC_ARM_COND_NE, mask, 0x8000, loop); /* make mask */ orc_arm_emit_sub_rsr (p, ORC_ARM_COND_NE, 0, mask, mask, mask, ORC_ARM_LSR, src2); /* clear bits */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_NE, 0, dest, dest, mask, ORC_ARM_LSL, 1); } else { orc_arm_emit_mov_rsr (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_LSL, src2); } } else { ORC_COMPILER_ERROR(p,"rule only works with constants or parameters"); } } static void arm_rule_shrsX (OrcCompiler *p, void *user, OrcInstruction *insn) { /* degrades nicely to trivial shift when not doing parallel shifts */ int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int mask = p->tmpreg; int tmp = p->gp_tmpreg; int src2type = ORC_SRC_TYPE (p, insn, 1); int size = ORC_PTR_TO_INT(user); int loop = 4 / size; /* number of items in one register */ if (src2type == ORC_VAR_TYPE_CONST) { int val = ORC_SRC_VAL (p, insn, 1); if (val > 0) { /* clamp max shift so we can sign extend */ if (val >= size) val = size - 1; /* shift */ if (size < 4) { if (size == 2 && val == 8) { /* half word shift by 8 */ orc_arm_emit_sxtb16_r8 (p, ORC_ARM_COND_AL, dest, src1, 8); } else { if (size == 1) /* make loop * 80, position of sign bit after shift */ orc_arm_emit_mov_ib (p, ORC_ARM_COND_AL, mask, 0x80, loop); else /* make loop * 8000 */ orc_arm_emit_mov_iw (p, ORC_ARM_COND_AL, mask, 0x8000, loop); /* make mask, save in tmp, we need the original mask */ orc_arm_emit_sub_rsi (p, ORC_ARM_COND_AL, 0, tmp, mask, mask, ORC_ARM_LSR, val); /* do the shift */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 1, dest, src1, ORC_ARM_LSR, val); /* clear upper bits */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_NE, 0, dest, dest, tmp, ORC_ARM_LSL, 1); /* flip sign bit */ orc_arm_emit_eor_r (p, ORC_ARM_COND_NE, 0, dest, dest, mask); /* extend sign bits */ if (size == 1) orc_arm_emit_usub8 (p, ORC_ARM_COND_NE, dest, dest, mask); else orc_arm_emit_usub16 (p, ORC_ARM_COND_NE, dest, dest, mask); } } else { /* full word shift */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_ASR, val); } } } else if (src2type == ORC_VAR_TYPE_PARAM) { int src2 = ORC_SRC_ARG (p, insn, 1); if (size < 4) { if (size == 1) /* make loop * 0x80 */ orc_arm_emit_mov_ib (p, ORC_ARM_COND_AL, mask, 0x80, loop); else /* make loop * 0x8000 */ orc_arm_emit_mov_iw (p, ORC_ARM_COND_AL, mask, 0x8000, loop); /* make mask */ orc_arm_emit_sub_rsr (p, ORC_ARM_COND_AL, 0, tmp, mask, mask, ORC_ARM_LSR, src2); /* do the shift */ orc_arm_emit_mov_rsr (p, ORC_ARM_COND_AL, 1, dest, src1, ORC_ARM_LSR, src2); /* clear upper bits */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_NE, 0, dest, dest, tmp, ORC_ARM_LSL, 1); /* flip sign bit */ orc_arm_emit_eor_r (p, ORC_ARM_COND_NE, 0, dest, dest, mask); /* extend sign bits */ if (size == 1) orc_arm_emit_usub8 (p, ORC_ARM_COND_NE, dest, dest, mask); else orc_arm_emit_usub16 (p, ORC_ARM_COND_NE, dest, dest, mask); } else { /* full word shift with register value */ orc_arm_emit_mov_rsr (p, ORC_ARM_COND_AL, 0, dest, dest, ORC_ARM_ASR, src2); } } else { ORC_COMPILER_ERROR(p,"rule only works with constants or parameters"); } } static void arm_rule_shruX (OrcCompiler *p, void *user, OrcInstruction *insn) { /* degrades nicely to trivial shift when not doing parallel shifts */ int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int mask = p->tmpreg; int src2type = ORC_SRC_TYPE (p, insn, 1); int size = ORC_PTR_TO_INT(user); int loop = 4 / size; /* number of items in one register */ if (src2type == ORC_VAR_TYPE_CONST) { int val = ORC_SRC_VAL (p, insn, 1); /* shift and mask out excess bits */ if (val >= size) { /* too big, clear all */ orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, dest, 0); } else if (val > 0) { if (size < 4) { if (size == 2 && val == 8) { /* half word shift by 8 */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, dest, src1, 8); } else { /* do the shift, set S flags */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 1, dest, src1, ORC_ARM_LSR, val); if (size == 1) /* make loop * 0x80 */ orc_arm_emit_mov_ib (p, ORC_ARM_COND_NE, mask, 0x80, loop); else /* make loop * 0x8000 */ orc_arm_emit_mov_iw (p, ORC_ARM_COND_NE, mask, 0x8000, loop); /* make mask */ orc_arm_emit_sub_rsi (p, ORC_ARM_COND_NE, 0, mask, mask, mask, ORC_ARM_LSR, val); /* clear upper bits */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_NE, 0, dest, dest, mask, ORC_ARM_LSL, 1); } } else { /* one 4 byte shift, no need for the S flag */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_LSR, val); } } } else if (src2type == ORC_VAR_TYPE_PARAM) { int src2 = ORC_SRC_ARG (p, insn, 1); if (size < 4) { /* shift with register value */ orc_arm_emit_mov_rsr (p, ORC_ARM_COND_AL, 1, dest, src1, ORC_ARM_LSR, src2); if (size == 1) /* make loop * 0x80 */ orc_arm_emit_mov_ib (p, ORC_ARM_COND_NE, mask, 0x80, loop); else /* make loop * 0x8000 */ orc_arm_emit_mov_iw (p, ORC_ARM_COND_NE, mask, 0x8000, loop); /* make mask */ orc_arm_emit_sub_rsr (p, ORC_ARM_COND_NE, 0, mask, mask, mask, ORC_ARM_LSR, src2); /* clear bits */ orc_arm_emit_bic_rsi (p, ORC_ARM_COND_NE, 0, dest, dest, mask, ORC_ARM_LSL, 1); } else { /* shift with register value */ orc_arm_emit_mov_rsr (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_LSR, src2); } } else { ORC_COMPILER_ERROR(p,"rule only works with constants or parameters"); } } static void arm_rule_signX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int zero = p->tmpreg; int ones = p->gp_tmpreg; int tmp = ORC_ARM_V8; int type = ORC_PTR_TO_INT(user); /* make 0 */ orc_arm_emit_mov_i (p, ORC_ARM_COND_AL, 0, zero, 0); /* make 0xffffffff */ orc_arm_emit_mvn_i (p, ORC_ARM_COND_AL, 0, ones, 0); /* dest = src1 - 0 (src1 >= 0 ? 0 : -1) */ if (type == 0) orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, dest, src1, zero); else orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, dest, src1, zero); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, zero, ones); /* tmp = 0 - src1 (src1 <= 0 ? 0 : -1) */ if (type == 0) orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, tmp, zero, src1); else orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, tmp, zero, src1); orc_arm_emit_sel (p, ORC_ARM_COND_AL, tmp, zero, ones); /* (src1 >= 0 ? 0 : -1) - (src1 <= 0 ? 0 : -1) */ if (type == 0) orc_arm_emit_ssub8 (p, ORC_ARM_COND_AL, dest, dest, tmp); else orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, dest, dest, tmp); } BINARY_MM (subb, ssub8); BINARY_MM (subssb, qsub8); BINARY_MM (subusb, uqsub8); BINARY_DP (xorX, eor); BINARY_MM (addw, sadd16); BINARY_MM (addssw, qadd16); BINARY_MM (addusw, uqadd16); static void arm_rule_maxsw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src1, src2); } static void arm_rule_maxuw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_usub16 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src1, src2); } static void arm_rule_minsw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_ssub16 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src2, src1); } static void arm_rule_minuw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_usub16 (p, ORC_ARM_COND_AL, dest, src1, src2); orc_arm_emit_sel (p, ORC_ARM_COND_AL, dest, src2, src1); } static void arm_rule_mullw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; int loop = 1; orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, src1, src2); if (loop == 2) { orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp, src1, src2); orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, dest, tmp, 16); } } static void arm_rule_mulhsw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; int loop = 1; orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, src1, src2); if (loop == 1) { orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, ORC_ARM_ASR, 16); } else { orc_arm_emit_smultt (p, ORC_ARM_COND_AL, tmp, src1, src2); orc_arm_emit_pkhtb_s (p, ORC_ARM_COND_AL, dest, tmp, dest, 16); } } static void arm_rule_mulhuw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_UW(mulhuw, "((orc_uint32)((uint16_t)%s) * (orc_uint32)((uint16_t)%s)) >> 16") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; int tmp2 = p->gp_tmpreg; int loop = 1; /* extract first halves */ orc_arm_emit_uxth (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_uxth (p, ORC_ARM_COND_AL, tmp2, src2); /* multiply, result should fit in the word */ orc_arm_emit_mul (p, ORC_ARM_COND_AL, 0, dest, tmp1, tmp2); if (loop == 1) { orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, ORC_ARM_LSR, 16); } else { /* second halves */ orc_arm_emit_uxth_r8 (p, ORC_ARM_COND_AL, tmp1, src1, 16); orc_arm_emit_uxth_r8 (p, ORC_ARM_COND_AL, tmp2, src2, 16); orc_arm_emit_mul (p, ORC_ARM_COND_AL, 0, tmp1, tmp1, tmp2); /* merge */ orc_arm_emit_pkhtb_s (p, ORC_ARM_COND_AL, dest, tmp1, dest, 16); } } BINARY_MM (subw, ssub16); BINARY_MM (subssw, qsub16); BINARY_MM (subusw, uqsub16); static void arm_rule_absl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); /* reverse sign 0 - src1, assume the value is negative */ orc_arm_emit_rsb_i (p, ORC_ARM_COND_AL, 1, dest, src1, 0); /* if we got negative, copy the original value again */ orc_arm_emit_mov_r (p, ORC_ARM_COND_MI, 0, dest, src1); } BINARY_DP (addl, add); BINARY_MM (addssl, qadd); static void arm_rule_addusl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* add numbers */ orc_arm_emit_add_r (p, ORC_ARM_COND_AL, 1, dest, src1, src2); /* on overflow, move ffffffff */ orc_arm_emit_mvn_i (p, ORC_ARM_COND_CS, 0, dest, 0); } static void arm_rule_avgXl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* set the carry flag */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src1); /* src1 + src2 + 1 */ orc_arm_emit_adc_r (p, ORC_ARM_COND_AL, 0, dest, src1, src2); /* rotate right, top bit is the carry */ orc_arm_emit_mov_rrx (p, ORC_ARM_COND_AL, 0, dest, dest); } static void arm_rule_cmpeql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* compare */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src2); /* set to all 0 when not equal */ orc_arm_emit_mov_i (p, ORC_ARM_COND_NE, 0, dest, 0); /* set to all ff when equal */ orc_arm_emit_mvn_i (p, ORC_ARM_COND_EQ, 0, dest, 0); } static void arm_rule_cmpgtsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* compare */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src2); /* set to all 0 when less or equal */ orc_arm_emit_mov_i (p, ORC_ARM_COND_LE, 0, dest, 0); /* set to all ff when greater */ orc_arm_emit_mvn_i (p, ORC_ARM_COND_GT, 0, dest, 0); } static void arm_rule_maxsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* compare */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src2); /* conditionally move result */ orc_arm_emit_mov_r (p, ORC_ARM_COND_GE, 0, dest, src1); orc_arm_emit_mov_r (p, ORC_ARM_COND_LT, 0, dest, src2); } static void arm_rule_maxul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* compare */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src2); /* conditionally move result */ orc_arm_emit_mov_r (p, ORC_ARM_COND_CS, 0, dest, src1); orc_arm_emit_mov_r (p, ORC_ARM_COND_CC, 0, dest, src2); } static void arm_rule_minsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* compare */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src2); /* conditionally move result */ orc_arm_emit_mov_r (p, ORC_ARM_COND_GE, 0, dest, src2); orc_arm_emit_mov_r (p, ORC_ARM_COND_LT, 0, dest, src1); } static void arm_rule_minul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* compare */ orc_arm_emit_cmp_r (p, ORC_ARM_COND_AL, src1, src2); /* conditionally move result */ orc_arm_emit_mov_r (p, ORC_ARM_COND_CS, 0, dest, src2); orc_arm_emit_mov_r (p, ORC_ARM_COND_CC, 0, dest, src1); } static void arm_rule_mulll (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_mul (p, ORC_ARM_COND_AL, 0, dest, src1, src2); } static void arm_rule_mulhsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; orc_arm_emit_smull (p, ORC_ARM_COND_AL, 0, tmp, dest, src1, src2); } static void arm_rule_mulhul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; orc_arm_emit_umull (p, ORC_ARM_COND_AL, 0, tmp, dest, src1, src2); } static void arm_rule_signl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; /* dest = 0 - src1 */ orc_arm_emit_rsb_i (p, ORC_ARM_COND_AL, 0, dest, src1, 0); /* move src1 sign into tmp */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, tmp, src1, ORC_ARM_ASR, 31); /* dest = tmp - (dest >> 31) */ orc_arm_emit_sub_rsi (p, ORC_ARM_COND_AL, 0, dest, tmp, dest, ORC_ARM_ASR, 31); } BINARY_DP (subl, sub); BINARY_MM (subssl, qsub); static void arm_rule_subusl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); /* subtract numbers */ orc_arm_emit_sub_r (p, ORC_ARM_COND_AL, 1, dest, src1, src2); /* overflow, move 00000000 */ orc_arm_emit_mov_i (p, ORC_ARM_COND_CC, 0, dest, 0); } static void arm_rule_convsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; if (loop == 1) { /* single byte */ orc_arm_emit_sxtb (p, ORC_ARM_COND_AL, dest, src1); } else { /* two bytes */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, src1, src1, 8); orc_arm_emit_sxtb16 (p, ORC_ARM_COND_AL, dest, dest); } } static void arm_rule_convubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; if (loop == 1) { /* single byte */ orc_arm_emit_uxtb (p, ORC_ARM_COND_AL, dest, src1); } else { /* two bytes */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, src1, src1, 8); orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); } } static void arm_rule_convswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_sxth (p, ORC_ARM_COND_AL, dest, src1); } static void arm_rule_convuwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_uxth (p, ORC_ARM_COND_AL, dest, src1); } static void arm_rule_convwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; if (loop == 2) { /* two words */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, src1); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_convssswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; orc_arm_emit_ssat16 (p, ORC_ARM_COND_AL, dest, 8, src1); if (loop == 2) { /* two words */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_convsuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; orc_arm_emit_usat16 (p, ORC_ARM_COND_AL, dest, 8, src1); if (loop == 2) { /* two words */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_convusswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; /* sign bias */ orc_arm_emit_eor_i (p, ORC_ARM_COND_AL, 0, dest, src1, 0x00008000); if (loop == 2) orc_arm_emit_eor_i (p, ORC_ARM_COND_AL, 0, dest, dest, 0x80000000); /* saturate to signed region */ orc_arm_emit_usat16 (p, ORC_ARM_COND_AL, dest, 7, dest); if (loop == 2) { /* pack two words */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_convuuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; /* sign bias */ orc_arm_emit_eor_i (p, ORC_ARM_COND_AL, 0, dest, src1, 0x00008000); if (loop == 2) orc_arm_emit_eor_i (p, ORC_ARM_COND_AL, 0, dest, dest, 0x80000000); /* saturate to unsigned region */ orc_arm_emit_usat16 (p, ORC_ARM_COND_AL, dest, 8, dest); if (loop == 2) { /* pack two words */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_convlw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* NOP */ } static void arm_rule_convssslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_ssat (p, ORC_ARM_COND_AL, dest, 16, src1); } static void arm_rule_convsuslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_usat (p, ORC_ARM_COND_AL, dest, 16, src1); } static void arm_rule_convusslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); /* sign bias */ orc_arm_emit_eor_i (p, ORC_ARM_COND_AL, 0, dest, src1, 0x80000000); /* saturate to signed region */ orc_arm_emit_usat (p, ORC_ARM_COND_AL, dest, 15, dest); } static void arm_rule_convuuslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); /* sign bias */ orc_arm_emit_eor_i (p, ORC_ARM_COND_AL, 0, dest, src1, 0x80000000); /* saturate to unsigned region */ orc_arm_emit_usat (p, ORC_ARM_COND_AL, dest, 16, dest); } static void arm_rule_mulsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_BW(mulsbw, "%s * %s") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; int tmp2 = p->gp_tmpreg; int loop = 1; /* first item */ orc_arm_emit_sxtb16 (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_sxtb16 (p, ORC_ARM_COND_AL, tmp2, src2); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, tmp1, tmp2); if (loop > 1) { /* second item */ orc_arm_emit_sxtb16_r8 (p, ORC_ARM_COND_AL, tmp1, src1, 8); orc_arm_emit_sxtb16_r8 (p, ORC_ARM_COND_AL, tmp2, src2, 8); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge results */ orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, tmp1, ORC_ARM_LSL, 16); } } static void arm_rule_mulubw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_BW(mulubw, "(uint8_t)%s * (uint8_t)%s") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; int tmp2 = p->gp_tmpreg; int loop = 1; /* first item */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp2, src2); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, dest, tmp1, tmp2); if (loop > 1) { /* second item */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp1, src1, 8); orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, tmp2, src2, 8); orc_arm_emit_smulbb (p, ORC_ARM_COND_AL, tmp1, tmp1, tmp2); /* merge results */ orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, tmp1, ORC_ARM_LSL, 16); } } static void arm_rule_mulswl (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_WL(mulswl, "%s * %s") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; orc_arm_emit_sxth (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_sxth (p, ORC_ARM_COND_AL, dest, src2); orc_arm_emit_mul (p, ORC_ARM_COND_AL, 0, dest, tmp1, dest); } static void arm_rule_muluwl (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_WL(muluwl, "(uint16_t)%s * (uint16_t)%s") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp1 = p->tmpreg; orc_arm_emit_uxth (p, ORC_ARM_COND_AL, tmp1, src1); orc_arm_emit_uxth (p, ORC_ARM_COND_AL, dest, src2); orc_arm_emit_mul (p, ORC_ARM_COND_AL, 0, dest, tmp1, dest); } static void arm_rule_mergewl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, src1, src2, 16); } static void arm_rule_mergebw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* BINARY_BW(mergebw, "((uint8_t)%s) | ((uint8_t)%s << 8)") */ int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = p->tmpreg; int loop = 1; if (loop == 1) { /* 1 word */ orc_arm_emit_uxtb (p, ORC_ARM_COND_AL, dest, src1); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, src2, ORC_ARM_LSL, 8); } else { /* 2 words */ orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, dest, src1, src1, 8); orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, dest); orc_arm_emit_pkhbt_s (p, ORC_ARM_COND_AL, tmp, src2, src2, 8); orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, tmp, tmp); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, tmp, ORC_ARM_LSL, 8); } } static void arm_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn) { /* UNARY_WB(select0wb, "(uint16_t)%s & 0xff") */ int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; if (loop == 1) { /* 1 words */ /* NOP */ } else { /* 2 words */ orc_arm_emit_uxtb16 (p, ORC_ARM_COND_AL, dest, src1); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn) { /* UNARY_WB(select1wb, "((uint16_t)%s >> 8)&0xff") */ int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int loop = 1; if (loop == 1) { /* 1 words */ orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_LSR, 8); } else { /* 2 words */ orc_arm_emit_uxtb16_r8 (p, ORC_ARM_COND_AL, dest, src1, 8); orc_arm_emit_orr_rsi (p, ORC_ARM_COND_AL, 0, dest, dest, dest, ORC_ARM_LSR, 8); } } static void arm_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* UNARY_LW(select0lw, "(orc_uint32)%s & 0xffff") */ /* NOP */ } static void arm_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* UNARY_LW(select1lw, "((orc_uint32)%s >> 16)&0xffff") */ int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_mov_rsi (p, ORC_ARM_COND_AL, 0, dest, src1, ORC_ARM_LSR, 16); } static void arm_rule_swapw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_rev16 (p, ORC_ARM_COND_AL, dest, src1); } static void arm_rule_swapl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); orc_arm_emit_rev (p, ORC_ARM_COND_AL, dest, src1); } #define FAIL if (0) void orc_compiler_orc_arm_register_rules (OrcTarget *target) { OrcRuleSet *rule_set; rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, 0); orc_rule_register (rule_set, "loadpb", arm_rule_loadpX, NULL); orc_rule_register (rule_set, "loadpw", arm_rule_loadpX, NULL); orc_rule_register (rule_set, "loadpl", arm_rule_loadpX, NULL); orc_rule_register (rule_set, "loadb", arm_rule_loadX, NULL); orc_rule_register (rule_set, "loadw", arm_rule_loadX, NULL); orc_rule_register (rule_set, "loadl", arm_rule_loadX, NULL); orc_rule_register (rule_set, "storeb", arm_rule_storeX, NULL); orc_rule_register (rule_set, "storew", arm_rule_storeX, NULL); orc_rule_register (rule_set, "storel", arm_rule_storeX, NULL); orc_rule_register (rule_set, "andb", arm_rule_andX, NULL); orc_rule_register (rule_set, "andnb", arm_rule_andnX, NULL); orc_rule_register (rule_set, "avgsb", arm_rule_avgX, (void *)3); orc_rule_register (rule_set, "avgub", arm_rule_avgX, (void *)0); orc_rule_register (rule_set, "copyb", arm_rule_copyX, NULL); orc_rule_register (rule_set, "orb", arm_rule_orX, NULL); orc_rule_register (rule_set, "xorb", arm_rule_xorX, NULL); orc_rule_register (rule_set, "andw", arm_rule_andX, NULL); orc_rule_register (rule_set, "andnw", arm_rule_andnX, NULL); FAIL orc_rule_register (rule_set, "avgsw", arm_rule_avgX, (void *)2); orc_rule_register (rule_set, "avguw", arm_rule_avgX, (void *)1); orc_rule_register (rule_set, "copyw", arm_rule_copyX, NULL); orc_rule_register (rule_set, "orw", arm_rule_orX, NULL); orc_rule_register (rule_set, "xorw", arm_rule_xorX, NULL); orc_rule_register (rule_set, "mullw", arm_rule_mullw, NULL); FAIL orc_rule_register (rule_set, "absl", arm_rule_absl, NULL); orc_rule_register (rule_set, "addl", arm_rule_addl, NULL); orc_rule_register (rule_set, "addssl", arm_rule_addssl, NULL); orc_rule_register (rule_set, "addusl", arm_rule_addusl, NULL); orc_rule_register (rule_set, "andl", arm_rule_andX, NULL); orc_rule_register (rule_set, "andnl", arm_rule_andnX, NULL); FAIL orc_rule_register (rule_set, "avgul", arm_rule_avgXl, NULL); FAIL orc_rule_register (rule_set, "avgsl", arm_rule_avgXl, NULL); orc_rule_register (rule_set, "copyl", arm_rule_copyX, NULL); orc_rule_register (rule_set, "maxsl", arm_rule_maxsl, NULL); orc_rule_register (rule_set, "maxul", arm_rule_maxul, NULL); orc_rule_register (rule_set, "minsl", arm_rule_minsl, NULL); orc_rule_register (rule_set, "minul", arm_rule_minul, NULL); orc_rule_register (rule_set, "mulll", arm_rule_mulll, NULL); orc_rule_register (rule_set, "mulhsl", arm_rule_mulhsl, NULL); FAIL orc_rule_register (rule_set, "mulhul", arm_rule_mulhul, NULL); orc_rule_register (rule_set, "orl", arm_rule_orX, NULL); FAIL orc_rule_register (rule_set, "signl", arm_rule_signl, NULL); orc_rule_register (rule_set, "subl", arm_rule_subl, NULL); FAIL orc_rule_register (rule_set, "subssl", arm_rule_subssl, NULL); orc_rule_register (rule_set, "subusl", arm_rule_subusl, NULL); orc_rule_register (rule_set, "xorl", arm_rule_xorX, NULL); FAIL orc_rule_register (rule_set, "convubw", arm_rule_convubw, NULL); FAIL orc_rule_register (rule_set, "convswl", arm_rule_convswl, NULL); FAIL orc_rule_register (rule_set, "convuwl", arm_rule_convuwl, NULL); orc_rule_register (rule_set, "convwb", arm_rule_convwb, NULL); orc_rule_register (rule_set, "convlw", arm_rule_convlw, NULL); FAIL orc_rule_register (rule_set, "mulubw", arm_rule_mulubw, NULL); FAIL orc_rule_register (rule_set, "mulswl", arm_rule_mulswl, NULL); FAIL orc_rule_register (rule_set, "muluwl", arm_rule_muluwl, NULL); rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_ARM_EDSP); FAIL orc_rule_register (rule_set, "absb", arm_rule_absX, (void *)0); orc_rule_register (rule_set, "cmpeqb", arm_rule_cmpeqX, (void *)1); orc_rule_register (rule_set, "cmpgtsb", arm_rule_cmpgtsX, (void *)1); FAIL orc_rule_register (rule_set, "maxsb", arm_rule_maxsb, NULL); FAIL orc_rule_register (rule_set, "maxub", arm_rule_maxub, NULL); FAIL orc_rule_register (rule_set, "minsb", arm_rule_minsb, NULL); FAIL orc_rule_register (rule_set, "minub", arm_rule_minub, NULL); orc_rule_register (rule_set, "shlb", arm_rule_shlX, (void *)1); FAIL orc_rule_register (rule_set, "shrsb", arm_rule_shrsX, (void *)1); FAIL orc_rule_register (rule_set, "shrub", arm_rule_shruX, (void *)1); FAIL orc_rule_register (rule_set, "signb", arm_rule_signX, (void *)0); FAIL orc_rule_register (rule_set, "absw", arm_rule_absX, (void *)1); orc_rule_register (rule_set, "cmpeqw", arm_rule_cmpeqX, (void *)2); orc_rule_register (rule_set, "cmpgtsw", arm_rule_cmpgtsX, (void *)2); FAIL orc_rule_register (rule_set, "maxsw", arm_rule_maxsw, NULL); FAIL orc_rule_register (rule_set, "maxuw", arm_rule_maxuw, NULL); FAIL orc_rule_register (rule_set, "minsw", arm_rule_minsw, NULL); FAIL orc_rule_register (rule_set, "minuw", arm_rule_minuw, NULL); orc_rule_register (rule_set, "mulsbw", arm_rule_mulsbw, NULL); orc_rule_register (rule_set, "shlw", arm_rule_shlX, (void *)2); FAIL orc_rule_register (rule_set, "shrsw", arm_rule_shrsX, (void *)2); orc_rule_register (rule_set, "shruw", arm_rule_shruX, (void *)2); FAIL orc_rule_register (rule_set, "signw", arm_rule_signX, (void *)1); orc_rule_register (rule_set, "mulhsw", arm_rule_mulhsw, NULL); FAIL orc_rule_register (rule_set, "mulhuw", arm_rule_mulhuw, NULL); orc_rule_register (rule_set, "cmpeql", arm_rule_cmpeql, NULL); orc_rule_register (rule_set, "cmpgtsl", arm_rule_cmpgtsl, NULL); orc_rule_register (rule_set, "shll", arm_rule_shlX, (void *)4); orc_rule_register (rule_set, "shrsl", arm_rule_shrsX, (void *)4); orc_rule_register (rule_set, "shrul", arm_rule_shruX, (void *)4); orc_rule_register (rule_set, "convsbw", arm_rule_convsbw, NULL); orc_rule_register (rule_set, "mergewl", arm_rule_mergewl, NULL); FAIL orc_rule_register (rule_set, "mergebw", arm_rule_mergebw, NULL); orc_rule_register (rule_set, "select0wb", arm_rule_select0wb, NULL); orc_rule_register (rule_set, "select1wb", arm_rule_select1wb, NULL); orc_rule_register (rule_set, "select0lw", arm_rule_select0lw, NULL); orc_rule_register (rule_set, "select1lw", arm_rule_select1lw, NULL); rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_ARM_ARM6); orc_rule_register (rule_set, "addb", arm_rule_addb, NULL); orc_rule_register (rule_set, "addssb", arm_rule_addssb, NULL); orc_rule_register (rule_set, "addusb", arm_rule_addusb, NULL); orc_rule_register (rule_set, "subb", arm_rule_subb, NULL); orc_rule_register (rule_set, "subssb", arm_rule_subssb, NULL); orc_rule_register (rule_set, "subusb", arm_rule_subusb, NULL); orc_rule_register (rule_set, "addw", arm_rule_addw, NULL); orc_rule_register (rule_set, "addssw", arm_rule_addssw, NULL); orc_rule_register (rule_set, "addusw", arm_rule_addusw, NULL); orc_rule_register (rule_set, "subw", arm_rule_subw, NULL); orc_rule_register (rule_set, "subssw", arm_rule_subssw, NULL); orc_rule_register (rule_set, "subusw", arm_rule_subusw, NULL); orc_rule_register (rule_set, "convsuswb", arm_rule_convsuswb, NULL); orc_rule_register (rule_set, "convssswb", arm_rule_convssswb, NULL); FAIL orc_rule_register (rule_set, "convusswb", arm_rule_convusswb, NULL); FAIL orc_rule_register (rule_set, "convuuswb", arm_rule_convuuswb, NULL); FAIL orc_rule_register (rule_set, "convssslw", arm_rule_convssslw, NULL); orc_rule_register (rule_set, "convsuslw", arm_rule_convsuslw, NULL); FAIL orc_rule_register (rule_set, "convusslw", arm_rule_convusslw, NULL); FAIL orc_rule_register (rule_set, "convuuslw", arm_rule_convuuslw, NULL); orc_rule_register (rule_set, "mullb", arm_rule_mullb, NULL); orc_rule_register (rule_set, "mulhsb", arm_rule_mulhsb, NULL); FAIL orc_rule_register (rule_set, "mulhub", arm_rule_mulhub, NULL); orc_rule_register (rule_set, "swapw", arm_rule_swapw, NULL); orc_rule_register (rule_set, "swapl", arm_rule_swapl, NULL); } orc-0.4.18/orc/orcmips.c0000664000175000017500000010230412111024531011703 00000000000000/* Copyright 2002 - 2009 David A. Schleef Copyright 2012 MIPS Technologies, Inc. Author: Guillaume Emont 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 #include #define MIPS_IMMEDIATE_INSTRUCTION(opcode,rs,rt,immediate) \ (((opcode) & 0x3f) << 26 \ |((rs)-ORC_GP_REG_BASE) << 21 \ |((rt)-ORC_GP_REG_BASE) << 16 \ |((immediate) & 0xffff)) #define REGIMM 01 #define MIPS_IMMEDIATE_REGIMM_INSTRUCTION(operation,rs,immediate) \ (REGIMM << 26 \ |((rs)-ORC_GP_REG_BASE) << 21 \ |((operation) & 0x1f) << 16 \ |((immediate) & 0xffff)) #define MIPS_BINARY_INSTRUCTION(opcode,rs,rt,rd,sa,function) \ (((opcode) & 0x3f) << 26 \ | ((rs)-ORC_GP_REG_BASE) << 21 \ | ((rt)-ORC_GP_REG_BASE) << 16 \ | ((rd)-ORC_GP_REG_BASE) << 11 \ | ((sa) & 0x1f) << 6 \ | ((function) & 0x3f)) #define MIPS_SHLLQB_INSTRUCTION(opcode, source, dest, immediate) \ (037 << 26 /* SPECIAL3 */ \ | (immediate & 0xf) << 21 \ | (source - ORC_GP_REG_BASE) << 16 \ | (dest - ORC_GP_REG_BASE) << 11 \ | (opcode & 0x1f) << 6 \ | 023) /* SHLL.QB */ const char * orc_mips_reg_name (int reg) { static const char *regs[] = { "$0", "$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3", "$t0", "$t1", "$t2", "$t3","$t4", "$t5", "$t6", "$t7", "$s0", "$s1", "$s2", "$s3","$s4", "$s5", "$s6", "$s7", "$t8", "$t9", "$k0", "$k1", "$gp", "$sp", "$fp", "$ra" }; if (reg < ORC_GP_REG_BASE || reg > ORC_GP_REG_BASE + 32) return "ERROR"; return regs[reg-32]; } void orc_mips_emit (OrcCompiler *compiler, orc_uint32 insn) { ORC_WRITE_UINT32_LE (compiler->codeptr, insn); compiler->codeptr+=4; } void orc_mips_emit_label (OrcCompiler *compiler, unsigned int label) { ORC_ASSERT (label < ORC_N_LABELS); ORC_ASM_CODE(compiler,".L%s%d:\n", compiler->program->name, label); compiler->labels[label] = compiler->codeptr; } void orc_mips_add_fixup (OrcCompiler *compiler, int label, int type) { ORC_ASSERT (compiler->n_fixups < ORC_N_FIXUPS); compiler->fixups[compiler->n_fixups].ptr = compiler->codeptr; compiler->fixups[compiler->n_fixups].label = label; compiler->fixups[compiler->n_fixups].type = type; compiler->n_fixups++; } void orc_mips_do_fixups (OrcCompiler *compiler) { int i; for(i=0;in_fixups;i++){ /* Type 0 of fixup is a branch label that could not be resolved at first * pass. We compute the offset, which should be the 16 least significant * bits of the instruction. */ unsigned char *label = compiler->labels[compiler->fixups[i].label]; unsigned char *ptr = compiler->fixups[i].ptr; orc_uint32 code; int offset; ORC_ASSERT (compiler->fixups[i].type == 0); offset = (label - (ptr + 4)) >> 2; code = ORC_READ_UINT32_LE (ptr); code |= offset & 0xffff; ORC_WRITE_UINT32_LE (ptr, code); } } void orc_mips_emit_align (OrcCompiler *compiler, int align_shift) { int diff; diff = (compiler->code - compiler->codeptr)&((1<program->name, label); break; case ORC_MIPS_BLEZ: case ORC_MIPS_BGTZ: ORC_ASSERT (rt == ORC_MIPS_ZERO); ORC_ASM_CODE (compiler, " %s %s, .L%s%d\n", opcode_name[condition], orc_mips_reg_name (rs), compiler->program->name, label); break; default: ORC_PROGRAM_ERROR (compiler, "unknown branch type: 0x%x", condition); } if (compiler->labels[label]) { offset = (compiler->labels[label] - (compiler->codeptr+4)) >> 2; } else { orc_mips_add_fixup (compiler, label, 0); offset = 0; } orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION(condition, rs, rt, offset)); } void orc_mips_emit_conditional_branch_with_offset (OrcCompiler *compiler, int condition, OrcMipsRegister rs, OrcMipsRegister rt, int offset) { char *opcode_name[] = { NULL, NULL, NULL, NULL, "beq ", "bne ", "blez", "bgtz", "bltz", "bgez" }; switch (condition) { case ORC_MIPS_BEQ: case ORC_MIPS_BNE: ORC_ASM_CODE (compiler, " %s %s, %s, %d\n", opcode_name[condition], orc_mips_reg_name (rs), orc_mips_reg_name (rt), offset); break; case ORC_MIPS_BLEZ: case ORC_MIPS_BGTZ: case ORC_MIPS_BLTZ: case ORC_MIPS_BGEZ: ORC_ASSERT (rt == ORC_MIPS_ZERO); ORC_ASM_CODE (compiler, " %s %s, %d\n", opcode_name[condition], orc_mips_reg_name (rs), offset); break; default: ORC_PROGRAM_ERROR (compiler, "unknown branch type: 0x%x", condition); } if (condition >= ORC_MIPS_BLTZ) /* bltz and further are encoded as REGIMM */ orc_mips_emit (compiler, MIPS_IMMEDIATE_REGIMM_INSTRUCTION(condition - ORC_MIPS_BLTZ, rs, offset>>2)); else orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION(condition, rs, rt, offset>>2)); } void orc_mips_emit_addiu (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " addiu %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION(011, source, dest, value)); } void orc_mips_emit_addi (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " addi %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION(010, source, dest, value)); } void orc_mips_emit_add (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " add %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, source1, source2, dest, 0, 040)); } void orc_mips_emit_addu (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " addu %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, source1, source2, dest, 0, 041)); } void orc_mips_emit_addu_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " addu.qb %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 0, 020)); } void orc_mips_emit_addu_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " addu.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 010, 020)); } void orc_mips_emit_addq_s_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " addq_s.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 016, 020)); } void orc_mips_emit_adduh_r_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " adduh_r.qb %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ source1, source2, dest, 02, /* ADDUH_R */ 030 /* ADDUH.QB */)); } void orc_mips_emit_ori (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " ori %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION(015, source, dest, value)); } void orc_mips_emit_or (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " or %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, source1, source2, dest, 0, 045)); } void orc_mips_emit_and (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " and %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, source1, source2, dest, 0, 044)); } void orc_mips_emit_lui (OrcCompiler *compiler, OrcMipsRegister dest, int value) { ORC_ASM_CODE (compiler, " lui %s, %d\n", orc_mips_reg_name (dest), value); orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION (017, /* LUI */ ORC_MIPS_ZERO, dest, value & 0xffff)); } void orc_mips_emit_move (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source) { orc_mips_emit_add (compiler, dest, source, ORC_MIPS_ZERO); } void orc_mips_emit_sub (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " sub %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, source1, source2, dest, 0, 042)); } void orc_mips_emit_subu_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " subu.qb %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 01, 020)); } void orc_mips_emit_subq_s_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " subq_s.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 017, 020)); } void orc_mips_emit_subq_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " subq.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 013, 020)); } void orc_mips_emit_subu_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " subu.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, source1, source2, dest, 011, 020)); } void orc_mips_emit_srl (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " srl %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, ORC_MIPS_ZERO, source, dest, value, 02)); } void orc_mips_emit_sll (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " sll %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, ORC_MIPS_ZERO, source, dest, value, 0)); } void orc_mips_emit_sra (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " sra %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(0, ORC_MIPS_ZERO, source, dest, value, 03)); } void orc_mips_emit_shll_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " shll.ph %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_SHLLQB_INSTRUCTION(010, source, dest, value)); } void orc_mips_emit_shra_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " shra.ph %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_SHLLQB_INSTRUCTION(011, source, dest, value)); } void orc_mips_emit_shrl_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " shrl.ph %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_SHLLQB_INSTRUCTION(031, source, dest, value)); } void orc_mips_emit_andi (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value) { ORC_ASM_CODE (compiler, " andi %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), value); orc_mips_emit (compiler, MIPS_IMMEDIATE_INSTRUCTION(014, source, dest, value)); } void orc_mips_emit_prepend (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int shift_amount) { ORC_ASM_CODE (compiler, " prepend %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), shift_amount); orc_mips_emit (compiler, (037 << 26 | (source-ORC_GP_REG_BASE) << 21 | (dest-ORC_GP_REG_BASE) << 16 | shift_amount << 11 | 01 << 6 /* prepend */ | 061 /* append */)); } void orc_mips_emit_append (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int shift_amount) { ORC_ASM_CODE (compiler, " append %s, %s, %d\n", orc_mips_reg_name (dest), orc_mips_reg_name (source), shift_amount); orc_mips_emit (compiler, (037 << 26 | (source-ORC_GP_REG_BASE) << 21 | (dest-ORC_GP_REG_BASE) << 16 | shift_amount << 11 | 0 << 6 /* append */ | 061 /* append */)); } void orc_mips_emit_mul (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " mul %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(034, source1, source2, dest, 0, 02)); } void orc_mips_emit_mul_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " mul.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, 037 << 26 /* SPECIAL3 */ | (source1 - ORC_GP_REG_BASE) << 21 | (source2 - ORC_GP_REG_BASE) << 16 | (dest - ORC_GP_REG_BASE) << 11 | 014 << 6 /* MUL.PH */ | 030); /* ADDUH.QB */ } void orc_mips_emit_mtlo (OrcCompiler *compiler, OrcMipsRegister source) { ORC_ASM_CODE (compiler, " mtlo %s\n", orc_mips_reg_name (source)); orc_mips_emit (compiler, 0 << 26 /* SPECIAL */ | (source - ORC_GP_REG_BASE) << 21 | 023); /* MTLO */ } void orc_mips_emit_extr_s_h (OrcCompiler *compiler, OrcMipsRegister dest, int accumulator, int shift) { ORC_ASM_CODE (compiler, " extr_s.h %s, $ac%d, %d\n", orc_mips_reg_name (dest), accumulator, shift); orc_mips_emit (compiler, 037 << 26 /* SPECIAL3 */ | (shift & 0x1f) << 21 | (dest - ORC_GP_REG_BASE) << 16 | (accumulator & 0x3) << 11 | 016 << 6 /* EXTR_S.H */ | 070); /* EXTR.W */ } void orc_mips_emit_slt (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src1, OrcMipsRegister src2) { ORC_ASM_CODE (compiler, " slt %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (src1), orc_mips_reg_name (src2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION (0, /* SPECIAL */ src1, src2, dest, 0, 052)); /* SLT */ } void orc_mips_emit_movn (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src, OrcMipsRegister condition) { ORC_ASM_CODE (compiler, " movn %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (src), orc_mips_reg_name (condition)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION (0, /* SPECIAL */ src, condition, dest, 0, 013)); /* MOVN */ } void orc_mips_emit_repl_ph (OrcCompiler *compiler, OrcMipsRegister dest, int value) { ORC_ASM_CODE (compiler, " repl.ph %s, %d\n", orc_mips_reg_name (dest), value); orc_mips_emit (compiler, 037 << 26 /* SPECIAL3 */ | (value & 0x3ff) << 16 | (dest - ORC_GP_REG_BASE) << 11 | 012 << 6 /* REPL.PH */ | 022); /* ABSQ_S.PH */ } void orc_mips_emit_replv_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source) { ORC_ASM_CODE (compiler, " replv.qb %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ ORC_MIPS_ZERO, /* actually no reg here */ source, dest, 03, /* REPLV.QB */ 022 /* ABSQ_S.PH */)); } void orc_mips_emit_replv_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source) { ORC_ASM_CODE (compiler, " replv.ph %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ ORC_MIPS_ZERO, /* actually no reg here */ source, dest, 013, /* REPLV.PH */ 022 /* ABSQ_S.PH */)); } void orc_mips_emit_preceu_ph_qbr (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source) { ORC_ASM_CODE (compiler, " preceu.ph.qbr %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ ORC_MIPS_ZERO, /* actually no reg here */ source, dest, 035, /* PRECEU.PH.QBR */ 022 /* ABSQ_S.PH */)); } void orc_mips_emit_precr_qb_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " precr.qb.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ source1, source2, dest, 015, /* PRECR.QB.PH */ 021 /* CMPU.EQ.QB */)); } void orc_mips_emit_precrq_qb_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " precrq.qb.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ source1, source2, dest, 014, /* PRECRS.QB.PH */ 021 /* CMPU.EQ.QB */)); } void orc_mips_emit_cmp_lt_ph (OrcCompiler *compiler, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " cmp.lt.ph %s, %s\n", orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, 037 << 26 /* SPECIAL3 */ | (source1 - ORC_GP_REG_BASE) << 21 | (source2 - ORC_GP_REG_BASE) << 16 | 0 << 11 | 011 << 6 /* CMP.LT.PH */ | 021); /* CMPU.EQ.QB */ } void orc_mips_emit_pick_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " pick.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, 037 << 26 /* SPECIAL3 */ | (source1 - ORC_GP_REG_BASE) << 21 | (source2 - ORC_GP_REG_BASE) << 16 | (dest - ORC_GP_REG_BASE) << 11 | 013 << 6 /* PICK.PH */ | 021); /* CMPU.EQ.QB */ } void orc_mips_emit_packrl_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2) { ORC_ASM_CODE (compiler, " packrl.ph %s, %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source1), orc_mips_reg_name (source2)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ source1, source2, dest, 016, /* PACKRL.PH */ 021 /* CMPU.EQ.QB */)); } void orc_mips_emit_wsbh (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source) { ORC_ASM_CODE (compiler, " wsbh %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ ORC_MIPS_ZERO, /* actually no reg here */ source, dest, 02, /* WSBH */ 040 /* BSHFL */)); } void orc_mips_emit_seh (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source) { ORC_ASM_CODE (compiler, " seh %s, %s\n", orc_mips_reg_name (dest), orc_mips_reg_name (source)); orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */ ORC_MIPS_ZERO, /* actually no reg here */ source, dest, 030, /* SEH */ 040 /* BSHFL */)); } void orc_mips_emit_pref (OrcCompiler *compiler, int hint, OrcMipsRegister base, int offset) { ORC_ASM_CODE (compiler, " pref %d, %d(%s)\n", hint, offset, orc_mips_reg_name (base)); orc_mips_emit (compiler, 063 << 26 /* PREF */ | (base - ORC_GP_REG_BASE) << 21 | (hint & 0x1f) << 16 | (offset & 0xffff)); } orc-0.4.18/orc/orcsse.c0000664000175000017500000001012612071634360011541 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include /** * SECTION:orcsse * @title: SSE * @short_description: code generation for SSE */ const char * orc_x86_get_regname_sse(int i) { static const char *x86_regs[] = { "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15" }; if (i>=X86_XMM0 && i=X86_MM0 && iexec_reg, 0); orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A4]), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_C1]), compiler->exec_reg); orc_x86_emit_cpuinsn_imm_reg (compiler, ORC_X86_or_imm32_rm, 4, 0x8040, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A4]), compiler->exec_reg); orc_x86_emit_cpuinsn_load_memoffset (compiler, ORC_X86_ldmxcsr, 4, 0, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A4]), compiler->exec_reg, 0); } void orc_sse_restore_mxcsr (OrcCompiler *compiler) { orc_x86_emit_cpuinsn_load_memoffset (compiler, ORC_X86_ldmxcsr, 4, 0, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A4]), compiler->exec_reg, 0); } orc-0.4.18/orc/orcx86.c0000664000175000017500000003703212071634360011401 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include #include /** * SECTION:orcx86 * @title: x86 * @short_description: code generation for x86 */ const char * orc_x86_get_regname(int i) { static const char *x86_regs[] = { "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; if (i>=ORC_GP_REG_BASE && i=ORC_GP_REG_BASE && i=ORC_GP_REG_BASE && i=ORC_GP_REG_BASE && iis_64bit) { return orc_x86_get_regname_64 (i); } else { return orc_x86_get_regname (i); } } const char * orc_x86_get_regname_size(int i, int size) { switch (size) { case 1: return orc_x86_get_regname_8 (i); case 2: return orc_x86_get_regname_16 (i); case 4: return orc_x86_get_regname (i); case 8: return orc_x86_get_regname_64 (i); } return NULL; } void orc_x86_emit_push (OrcCompiler *compiler, int size, int reg) { orc_x86_emit_cpuinsn_size (compiler, ORC_X86_push, 0, reg, reg); } void orc_x86_emit_pop (OrcCompiler *compiler, int size, int reg) { orc_x86_emit_cpuinsn_size (compiler, ORC_X86_pop, 0, reg, reg); } #define X86_MODRM(mod, rm, reg) ((((mod)&3)<<6)|(((rm)&7)<<0)|(((reg)&7)<<3)) #define X86_SIB(ss, ind, reg) ((((ss)&3)<<6)|(((ind)&7)<<3)|((reg)&7)) void orc_x86_emit_modrm_memoffset_old (OrcCompiler *compiler, int reg1, int offset, int reg2) { if (offset == 0 && reg2 != compiler->exec_reg) { if (reg2 == X86_ESP) { *compiler->codeptr++ = X86_MODRM(0, 4, reg1); *compiler->codeptr++ = X86_SIB(0, 4, reg2); } else { *compiler->codeptr++ = X86_MODRM(0, reg2, reg1); } } else if (offset >= -128 && offset < 128) { *compiler->codeptr++ = X86_MODRM(1, reg2, reg1); if (reg2 == X86_ESP) { *compiler->codeptr++ = X86_SIB(0, 4, reg2); } *compiler->codeptr++ = (offset & 0xff); } else { *compiler->codeptr++ = X86_MODRM(2, reg2, reg1); if (reg2 == X86_ESP) { *compiler->codeptr++ = X86_SIB(0, 4, reg2); } *compiler->codeptr++ = (offset & 0xff); *compiler->codeptr++ = ((offset>>8) & 0xff); *compiler->codeptr++ = ((offset>>16) & 0xff); *compiler->codeptr++ = ((offset>>24) & 0xff); } } void orc_x86_emit_modrm_memoffset (OrcCompiler *compiler, int offset, int src, int dest) { if (offset == 0 && src != compiler->exec_reg) { if (src == X86_ESP) { *compiler->codeptr++ = X86_MODRM(0, 4, dest); *compiler->codeptr++ = X86_SIB(0, 4, src); } else { *compiler->codeptr++ = X86_MODRM(0, src, dest); } } else if (offset >= -128 && offset < 128) { *compiler->codeptr++ = X86_MODRM(1, src, dest); if (src == X86_ESP) { *compiler->codeptr++ = X86_SIB(0, 4, src); } *compiler->codeptr++ = (offset & 0xff); } else { *compiler->codeptr++ = X86_MODRM(2, src, dest); if (src == X86_ESP) { *compiler->codeptr++ = X86_SIB(0, 4, src); } *compiler->codeptr++ = (offset & 0xff); *compiler->codeptr++ = ((offset>>8) & 0xff); *compiler->codeptr++ = ((offset>>16) & 0xff); *compiler->codeptr++ = ((offset>>24) & 0xff); } } void orc_x86_emit_modrm_memindex (OrcCompiler *compiler, int reg1, int offset, int reg2, int regindex, int shift) { if (offset == 0) { *compiler->codeptr++ = X86_MODRM(0, 4, reg1); *compiler->codeptr++ = X86_SIB(shift, regindex, reg2); } else if (offset >= -128 && offset < 128) { *compiler->codeptr++ = X86_MODRM(1, 4, reg1); *compiler->codeptr++ = X86_SIB(shift, regindex, reg2); *compiler->codeptr++ = (offset & 0xff); } else { *compiler->codeptr++ = X86_MODRM(2, 4, reg1); *compiler->codeptr++ = X86_SIB(shift, regindex, reg2); *compiler->codeptr++ = (offset & 0xff); *compiler->codeptr++ = ((offset>>8) & 0xff); *compiler->codeptr++ = ((offset>>16) & 0xff); *compiler->codeptr++ = ((offset>>24) & 0xff); } } void orc_x86_emit_modrm_memindex2 (OrcCompiler *compiler, int offset, int src, int src_index, int shift, int dest) { if (offset == 0) { *compiler->codeptr++ = X86_MODRM(0, 4, dest); *compiler->codeptr++ = X86_SIB(shift, src_index, src); } else if (offset >= -128 && offset < 128) { *compiler->codeptr++ = X86_MODRM(1, 4, dest); *compiler->codeptr++ = X86_SIB(shift, src_index, src); *compiler->codeptr++ = (offset & 0xff); } else { *compiler->codeptr++ = X86_MODRM(2, 4, dest); *compiler->codeptr++ = X86_SIB(shift, src_index, src); *compiler->codeptr++ = (offset & 0xff); *compiler->codeptr++ = ((offset>>8) & 0xff); *compiler->codeptr++ = ((offset>>16) & 0xff); *compiler->codeptr++ = ((offset>>24) & 0xff); } } void orc_x86_emit_modrm_reg (OrcCompiler *compiler, int reg1, int reg2) { *compiler->codeptr++ = X86_MODRM(3, reg1, reg2); } void orc_x86_emit_rex (OrcCompiler *compiler, int size, int reg1, int reg2, int reg3) { int rex = 0x40; if (compiler->is_64bit) { if (size >= 8) rex |= 0x08; if (reg1 & 8) rex |= 0x4; if (reg2 & 8) rex |= 0x2; if (reg3 & 8) rex |= 0x1; if (rex != 0x40) *compiler->codeptr++ = rex; } } void orc_x86_emit_mov_memoffset_reg (OrcCompiler *compiler, int size, int offset, int reg1, int reg2) { switch (size) { case 1: orc_x86_emit_cpuinsn_memoffset_reg (compiler, ORC_X86_movzx_rm_r, 4, offset, reg1, reg2); return; case 2: orc_x86_emit_cpuinsn_memoffset_reg (compiler, ORC_X86_movw_rm_r, size, offset, reg1, reg2); break; case 4: orc_x86_emit_cpuinsn_memoffset_reg (compiler, ORC_X86_movl_rm_r, size, offset, reg1, reg2); break; case 8: orc_x86_emit_cpuinsn_memoffset_reg (compiler, ORC_X86_mov_rm_r, size, offset, reg1, reg2); break; default: orc_compiler_error(compiler, "bad size"); break; } } void orc_x86_emit_mov_reg_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2) { switch (size) { case 1: orc_x86_emit_cpuinsn_reg_memoffset (compiler, ORC_X86_movb_r_rm, reg1, offset, reg2); break; case 2: orc_x86_emit_cpuinsn_reg_memoffset (compiler, ORC_X86_movw_r_rm, reg1, offset, reg2); break; case 4: orc_x86_emit_cpuinsn_reg_memoffset (compiler, ORC_X86_movl_r_rm, reg1, offset, reg2); break; case 8: orc_x86_emit_cpuinsn_reg_memoffset_8 (compiler, ORC_X86_mov_r_rm, reg1, offset, reg2); break; default: orc_compiler_error(compiler, "bad size"); break; } } void orc_x86_emit_add_imm_reg (OrcCompiler *compiler, int size, int value, int reg, orc_bool record) { if (!record) { if (size == 4 && !compiler->is_64bit) { orc_x86_emit_cpuinsn_memoffset_reg (compiler, ORC_X86_leal, size, value, reg, reg); return; } if (size == 8 && compiler->is_64bit) { orc_x86_emit_cpuinsn_memoffset_reg (compiler, ORC_X86_leaq, size, value, reg, reg); return; } } if (value >= -128 && value < 128) { orc_x86_emit_cpuinsn_imm_reg (compiler, ORC_X86_add_imm8_rm, size, value, reg); } else { orc_x86_emit_cpuinsn_imm_reg (compiler, ORC_X86_add_imm32_rm, size, value, reg); } } void orc_x86_emit_add_reg_reg_shift (OrcCompiler *compiler, int size, int reg1, int reg2, int shift) { if (size == 4) { orc_x86_emit_cpuinsn_load_memindex (compiler, ORC_X86_leal, size, 0, 0, reg2, reg1, shift, reg2); } else { orc_x86_emit_cpuinsn_load_memindex (compiler, ORC_X86_leaq, size, 0, 0, reg2, reg1, shift, reg2); } } void orc_x86_emit_cmp_imm_reg (OrcCompiler *compiler, int size, int value, int reg) { if (value >= -128 && value < 128) { orc_x86_emit_cpuinsn_imm_reg (compiler, ORC_X86_cmp_imm8_rm, size, value, reg); } else { orc_x86_emit_cpuinsn_imm_reg (compiler, ORC_X86_cmp_imm32_rm, size, value, reg); } } void orc_x86_emit_cmp_imm_memoffset (OrcCompiler *compiler, int size, int value, int offset, int reg) { if (value >= -128 && value < 128) { orc_x86_emit_cpuinsn_imm_memoffset (compiler, ORC_X86_cmp_imm8_rm, size, value, offset, reg); } else { orc_x86_emit_cpuinsn_imm_memoffset (compiler, ORC_X86_cmp_imm32_rm, size, value, offset, reg); } } void orc_x86_emit_dec_memoffset (OrcCompiler *compiler, int size, int offset, int reg) { if (size == 4) { orc_x86_emit_cpuinsn_imm_memoffset (compiler, ORC_X86_add_imm8_rm, size, -1, offset, reg); } else { orc_x86_emit_cpuinsn_load_memoffset (compiler, ORC_X86_dec, size, 0, offset, reg, -1); } } void orc_x86_emit_rep_movs (OrcCompiler *compiler, int size) { switch (size) { case 1: orc_x86_emit_cpuinsn_none (compiler, ORC_X86_rep_movsb); break; case 2: orc_x86_emit_cpuinsn_none (compiler, ORC_X86_rep_movsw); break; case 4: orc_x86_emit_cpuinsn_none (compiler, ORC_X86_rep_movsl); break; } } void x86_add_fixup (OrcCompiler *compiler, unsigned char *ptr, int label, int type) { compiler->fixups[compiler->n_fixups].ptr = ptr; compiler->fixups[compiler->n_fixups].label = label; compiler->fixups[compiler->n_fixups].type = type; compiler->n_fixups++; } void x86_add_label (OrcCompiler *compiler, unsigned char *ptr, int label) { compiler->labels[label] = ptr; } void x86_add_label2 (OrcCompiler *compiler, int index, int label) { compiler->labels_int[label] = index; } void orc_x86_do_fixups (OrcCompiler *compiler) { int i; for(i=0;in_fixups;i++){ if (compiler->fixups[i].type == 0) { unsigned char *label = compiler->labels[compiler->fixups[i].label]; unsigned char *ptr = compiler->fixups[i].ptr; int diff; diff = ((orc_int8)ptr[0]) + (label - ptr); if (diff != (orc_int8)diff) { orc_compiler_error (compiler, "short jump too long %d", diff); } ptr[0] = diff; } else if (compiler->fixups[i].type == 1) { unsigned char *label = compiler->labels[compiler->fixups[i].label]; unsigned char *ptr = compiler->fixups[i].ptr; int diff; diff = ORC_READ_UINT32_LE (ptr) + (label - ptr); ORC_WRITE_UINT32_LE(ptr, diff); } } } void orc_x86_emit_prologue (OrcCompiler *compiler) { orc_compiler_append_code(compiler,".global %s\n", compiler->program->name); orc_compiler_append_code(compiler,".p2align 4\n"); orc_compiler_append_code(compiler,"%s:\n", compiler->program->name); if (compiler->is_64bit) { int i; for(i=0;i<16;i++){ if (compiler->used_regs[ORC_GP_REG_BASE+i] && compiler->save_regs[ORC_GP_REG_BASE+i]) { orc_x86_emit_push (compiler, 8, ORC_GP_REG_BASE+i); } } } else { orc_x86_emit_push (compiler, 4, X86_EBP); if (compiler->use_frame_pointer) { orc_x86_emit_mov_reg_reg (compiler, 4, X86_ESP, X86_EBP); } orc_x86_emit_mov_memoffset_reg (compiler, 4, 8, X86_ESP, compiler->exec_reg); if (compiler->used_regs[X86_EDI]) { orc_x86_emit_push (compiler, 4, X86_EDI); } if (compiler->used_regs[X86_ESI]) { orc_x86_emit_push (compiler, 4, X86_ESI); } if (compiler->used_regs[X86_EBX]) { orc_x86_emit_push (compiler, 4, X86_EBX); } } #if 0 orc_x86_emit_rdtsc(compiler); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A3]), compiler->exec_reg); #endif } void orc_x86_emit_epilogue (OrcCompiler *compiler) { #if 0 orc_x86_emit_rdtsc(compiler); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A4]), compiler->exec_reg); #endif if (compiler->is_64bit) { int i; for(i=15;i>=0;i--){ if (compiler->used_regs[ORC_GP_REG_BASE+i] && compiler->save_regs[ORC_GP_REG_BASE+i]) { orc_x86_emit_pop (compiler, 8, ORC_GP_REG_BASE+i); } } } else { if (compiler->used_regs[X86_EBX]) { orc_x86_emit_pop (compiler, 4, X86_EBX); } if (compiler->used_regs[X86_ESI]) { orc_x86_emit_pop (compiler, 4, X86_ESI); } if (compiler->used_regs[X86_EDI]) { orc_x86_emit_pop (compiler, 4, X86_EDI); } orc_x86_emit_pop (compiler, 4, X86_EBP); } orc_x86_emit_ret (compiler); } /* memcpy implementation based on rep movs */ int orc_x86_assemble_copy_check (OrcCompiler *compiler) { if (compiler->program->n_insns == 1 && compiler->program->is_2d == FALSE && (strcmp (compiler->program->insns[0].opcode->name, "copyb") == 0 || strcmp (compiler->program->insns[0].opcode->name, "copyw") == 0 || strcmp (compiler->program->insns[0].opcode->name, "copyl") == 0)) { return TRUE; } return FALSE; } void orc_x86_assemble_copy (OrcCompiler *compiler) { OrcInstruction *insn; int shift = 0; insn = compiler->program->insns + 0; if (strcmp (insn->opcode->name, "copyw") == 0) { shift = 1; } else if (strcmp (insn->opcode->name, "copyl") == 0) { shift = 2; } compiler->used_regs[X86_EDI] = TRUE; compiler->used_regs[X86_ESI] = TRUE; orc_x86_emit_prologue (compiler); orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,arrays[insn->dest_args[0]]), compiler->exec_reg, X86_EDI); orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,arrays[insn->src_args[0]]), compiler->exec_reg, X86_ESI); orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 2 - shift, compiler->gp_tmpreg); orc_x86_emit_rep_movs (compiler, 4); if (shift == 0) { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 3, compiler->gp_tmpreg); orc_x86_emit_rep_movs (compiler, 1); } if (shift == 1) { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 1, compiler->gp_tmpreg); orc_x86_emit_rep_movs (compiler, 2); } orc_x86_emit_epilogue (compiler); orc_x86_do_fixups (compiler); } orc-0.4.18/orc/orcinternal.h0000664000175000017500000000123512111024531012555 00000000000000 #ifndef _ORC_INTERNAL_H_ #define _ORC_INTERNAL_H_ #include #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API void orc_mmx_init (void); void orc_sse_init (void); void orc_arm_init (void); void orc_powerpc_init (void); void orc_c_init (void); void orc_neon_init (void); void orc_c64x_init (void); void orc_c64x_c_init (void); void orc_mips_init (void); extern int _orc_data_cache_size_level1; extern int _orc_data_cache_size_level2; extern int _orc_data_cache_size_level3; extern int _orc_cpu_family; extern int _orc_cpu_model; extern int _orc_cpu_stepping; extern const char *_orc_cpu_name; #endif ORC_END_DECLS #endif orc-0.4.18/orc/orc.h0000664000175000017500000000041012111024531011012 00000000000000 #ifndef _ORC_ORC_H_ #define _ORC_ORC_H_ #include #include #include #include #include #include #include #include #endif orc-0.4.18/orc/orcprogram-mmx.c0000664000175000017500000007550412177015514013231 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include #define MMX 1 #define SIZE 65536 #define ORC_MMX_ALIGNED_DEST_CUTOFF 64 void orc_mmx_emit_loop (OrcCompiler *compiler, int offset, int update); void orc_compiler_mmx_init (OrcCompiler *compiler); unsigned int orc_compiler_mmx_get_default_flags (void); void orc_compiler_mmx_assemble (OrcCompiler *compiler); void orc_compiler_mmx_register_rules (OrcTarget *target); void orc_mmx_emit_invariants (OrcCompiler *compiler); void orc_compiler_rewrite_vars (OrcCompiler *compiler); void orc_compiler_dump (OrcCompiler *compiler); void mmx_load_constant (OrcCompiler *compiler, int reg, int size, int value); void mmx_load_constant_long (OrcCompiler *compiler, int reg, OrcConstant *constant); static const char * mmx_get_flag_name (int shift); static OrcTarget mmx_target = { "mmx", #if defined(HAVE_I386) || defined(HAVE_AMD64) TRUE, #else FALSE, #endif ORC_VEC_REG_BASE, orc_compiler_mmx_get_default_flags, orc_compiler_mmx_init, orc_compiler_mmx_assemble, { { 0 } }, 0, NULL, mmx_load_constant, mmx_get_flag_name, NULL, mmx_load_constant_long }; extern int orc_x86_mmx_flags; extern int orc_x86_mmx_flags; void orc_mmx_init (void) { #if defined(HAVE_AMD64) || defined(HAVE_I386) /* initializes cache information */ orc_mmx_get_cpu_flags (); #endif #if defined(HAVE_I386) #ifndef MMX if (!(orc_x86_mmx_flags & ORC_TARGET_MMX_MMXEXT)) { mmx_target.executable = FALSE; } #else if (!(orc_x86_mmx_flags & ORC_TARGET_MMX_MMX)) { mmx_target.executable = FALSE; } #endif #endif orc_target_register (&mmx_target); orc_compiler_mmx_register_rules (&mmx_target); } unsigned int orc_compiler_mmx_get_default_flags (void) { unsigned int flags = 0; #ifdef __amd64__ flags |= ORC_TARGET_MMX_64BIT; #endif if (_orc_compiler_flag_debug) { flags |= ORC_TARGET_MMX_FRAME_POINTER; } #if defined(HAVE_AMD64) || defined(HAVE_I386) #ifndef MMX flags |= orc_x86_mmx_flags; #else flags |= orc_x86_mmx_flags; #endif #else #ifndef MMX flags |= ORC_TARGET_MMX_MMXEXT; flags |= ORC_TARGET_MMX_SSE3; flags |= ORC_TARGET_MMX_SSSE3; #else flags |= ORC_TARGET_MMX_MMX; flags |= ORC_TARGET_MMX_3DNOW; #endif #endif return flags; } static const char * mmx_get_flag_name (int shift) { static const char *flags[] = { #ifndef MMX "sse2", "sse3", "ssse3", "sse41", "sse42", "sse4a", "sse5", "frame_pointer", "short_jumps", "64bit" #else "mmx", "mmxext", "3dnow", "3dnowext", "ssse3", "sse41", "", "frame_pointer", "short_jumps", "64bit" #endif }; if (shift >= 0 && shift < sizeof(flags)/sizeof(flags[0])) { return flags[shift]; } return NULL; } void orc_compiler_mmx_init (OrcCompiler *compiler) { int i; if (compiler->target_flags & ORC_TARGET_MMX_64BIT) { compiler->is_64bit = TRUE; } if (compiler->target_flags & ORC_TARGET_MMX_FRAME_POINTER) { compiler->use_frame_pointer = TRUE; } if (!(compiler->target_flags & ORC_TARGET_MMX_SHORT_JUMPS)) { compiler->long_jumps = TRUE; } if (compiler->is_64bit) { for(i=ORC_GP_REG_BASE;ivalid_regs[i] = 1; } compiler->valid_regs[X86_ESP] = 0; #ifndef MMX for(i=X86_MM0;ivalid_regs[i] = 1; } #else for(i=X86_MM0;ivalid_regs[i] = 1; } #endif compiler->save_regs[X86_EBX] = 1; compiler->save_regs[X86_EBP] = 1; compiler->save_regs[X86_R12] = 1; compiler->save_regs[X86_R13] = 1; compiler->save_regs[X86_R14] = 1; compiler->save_regs[X86_R15] = 1; #ifdef HAVE_OS_WIN32 compiler->save_regs[X86_EDI] = 1; compiler->save_regs[X86_ESI] = 1; for(i=X86_MM0+6;isave_regs[i] = 1; } #endif } else { for(i=ORC_GP_REG_BASE;ivalid_regs[i] = 1; } compiler->valid_regs[X86_ESP] = 0; if (compiler->use_frame_pointer) { compiler->valid_regs[X86_EBP] = 0; } for(i=X86_MM0;ivalid_regs[i] = 1; } compiler->save_regs[X86_EBX] = 1; compiler->save_regs[X86_EDI] = 1; compiler->save_regs[X86_EBP] = 1; } for(i=0;i<128;i++){ compiler->alloc_regs[i] = 0; compiler->used_regs[i] = 0; } if (compiler->is_64bit) { #ifdef HAVE_OS_WIN32 compiler->exec_reg = X86_ECX; compiler->gp_tmpreg = X86_EDX; #else compiler->exec_reg = X86_EDI; compiler->gp_tmpreg = X86_ECX; #endif } else { compiler->gp_tmpreg = X86_ECX; if (compiler->use_frame_pointer) { compiler->exec_reg = X86_EBX; } else { compiler->exec_reg = X86_EBP; } } compiler->valid_regs[compiler->gp_tmpreg] = 0; compiler->valid_regs[compiler->exec_reg] = 0; switch (compiler->max_var_size) { case 1: compiler->loop_shift = 4; break; case 2: compiler->loop_shift = 3; break; case 4: compiler->loop_shift = 2; break; case 8: compiler->loop_shift = 1; break; default: ORC_ERROR("unhandled max var size %d", compiler->max_var_size); break; } #ifdef MMX compiler->loop_shift--; #endif /* This limit is arbitrary, but some large functions run slightly slower when unrolled (ginger Core2 6,15,6), and only some small functions run faster when unrolled. Most are the same speed. */ if (compiler->n_insns <= 10) { compiler->unroll_shift = 1; } if (!compiler->long_jumps) { compiler->unroll_shift = 0; } if (compiler->loop_shift == 0) { /* FIXME something is broken with loop_shift=0, unroll_shift=1 */ compiler->unroll_shift = 0; } compiler->alloc_loop_counter = TRUE; compiler->allow_gp_on_stack = TRUE; { for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; if (strcmp (opcode->name, "ldreslinb") == 0 || strcmp (opcode->name, "ldreslinl") == 0 || strcmp (opcode->name, "ldresnearb") == 0 || strcmp (opcode->name, "ldresnearl") == 0) { compiler->vars[insn->src_args[0]].need_offset_reg = TRUE; } } } } void mmx_save_accumulators (OrcCompiler *compiler) { int i; int src; int tmp; for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_ACCUMULATOR: src = var->alloc; tmp = orc_compiler_get_temp_reg (compiler); #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(3,2,3,2), src, tmp); #else orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(3,2,3,2), src, tmp); #endif if (var->size == 2) { orc_mmx_emit_paddw (compiler, tmp, src); } else { orc_mmx_emit_paddd (compiler, tmp, src); } #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(1,1,1,1), src, tmp); if (var->size == 2) { orc_mmx_emit_paddw (compiler, tmp, src); } else { orc_mmx_emit_paddd (compiler, tmp, src); } #endif if (var->size == 2) { #ifndef MMX orc_mmx_emit_pshuflw (compiler, ORC_MMX_SHUF(1,1,1,1), src, tmp); #else orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(1,1,1,1), src, tmp); #endif orc_mmx_emit_paddw (compiler, tmp, src); } if (var->size == 2) { orc_mmx_emit_movd_store_register (compiler, src, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor, accumulators[i-ORC_VAR_A1]), compiler->exec_reg); } else { orc_x86_emit_mov_mmx_memoffset (compiler, 4, src, (int)ORC_STRUCT_OFFSET(OrcExecutor, accumulators[i-ORC_VAR_A1]), compiler->exec_reg, var->is_aligned, var->is_uncached); } break; default: break; } } } void mmx_load_constant (OrcCompiler *compiler, int reg, int size, int value) { orc_mmx_load_constant (compiler, reg, size, value); } void orc_mmx_load_constant (OrcCompiler *compiler, int reg, int size, orc_uint64 value) { int i; if (size == 8) { int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); /* FIXME how ugly and slow! */ orc_x86_emit_mov_imm_reg (compiler, 4, value>>0, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, offset + 0, compiler->exec_reg); orc_x86_emit_mov_imm_reg (compiler, 4, value>>32, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, offset + 4, compiler->exec_reg); orc_x86_emit_mov_memoffset_mmx (compiler, 8, offset, compiler->exec_reg, reg, FALSE); #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); #endif return; } if (size == 1) { value &= 0xff; value |= (value << 8); value |= (value << 16); } if (size == 2) { value &= 0xffff; value |= (value << 16); } ORC_ASM_CODE(compiler, "# loading constant %d 0x%08x\n", (int)value, (int)value); if (value == 0) { orc_mmx_emit_pxor(compiler, reg, reg); return; } if (value == 0xffffffff) { orc_mmx_emit_pcmpeqb (compiler, reg, reg); return; } if (compiler->target_flags & ORC_TARGET_MMX_SSSE3) { if (value == 0x01010101) { orc_mmx_emit_pcmpeqb (compiler, reg, reg); orc_mmx_emit_pabsb (compiler, reg, reg); return; } } for(i=1;i<32;i++){ orc_uint32 v; v = (0xffffffff<>i); if (value == v) { orc_mmx_emit_pcmpeqb (compiler, reg, reg); orc_mmx_emit_psrld_imm (compiler, i, reg); return; } } for(i=1;i<16;i++){ orc_uint32 v; v = (0xffff & (0xffff<>i)) | (0xffff0000 & (0xffff0000>>i)); if (value == v) { orc_mmx_emit_pcmpeqb (compiler, reg, reg); orc_mmx_emit_psrlw_imm (compiler, i, reg); return; } } orc_x86_emit_mov_imm_reg (compiler, 4, value, compiler->gp_tmpreg); orc_mmx_emit_movd_load_register (compiler, compiler->gp_tmpreg, reg); #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(0,0,0,0), reg, reg); #else orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); #endif } void mmx_load_constant_long (OrcCompiler *compiler, int reg, OrcConstant *constant) { int i; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); /* FIXME this is slower than it could be */ ORC_ASM_CODE(compiler, "# loading constant %08x %08x %08x %08x\n", constant->full_value[0], constant->full_value[1], constant->full_value[2], constant->full_value[3]); for(i=0;i<4;i++){ orc_x86_emit_mov_imm_reg (compiler, 4, constant->full_value[i], compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, offset + 4*i, compiler->exec_reg); } orc_x86_emit_mov_memoffset_mmx (compiler, 16, offset, compiler->exec_reg, reg, FALSE); } void mmx_load_constants_outer (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: break; case ORC_VAR_TYPE_ACCUMULATOR: orc_mmx_emit_pxor (compiler, compiler->vars[i].alloc, compiler->vars[i].alloc); break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error(compiler,"bad vartype"); break; } } orc_mmx_emit_invariants (compiler); /* FIXME move to a better place */ for(i=0;in_constants;i++){ compiler->constants[i].alloc_reg = orc_compiler_get_constant_reg (compiler); } for(i=0;in_constants;i++){ if (compiler->constants[i].alloc_reg) { if (compiler->constants[i].is_long) { mmx_load_constant_long (compiler, compiler->constants[i].alloc_reg, compiler->constants + i); } else { mmx_load_constant (compiler, compiler->constants[i].alloc_reg, 4, compiler->constants[i].value); } } } { for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; if (strcmp (opcode->name, "ldreslinb") == 0 || strcmp (opcode->name, "ldreslinl") == 0 || strcmp (opcode->name, "ldresnearb") == 0 || strcmp (opcode->name, "ldresnearl") == 0) { if (compiler->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[1]]), compiler->exec_reg, compiler->vars[insn->src_args[0]].ptr_offset); } else { orc_x86_emit_mov_imm_reg (compiler, 4, compiler->vars[insn->src_args[1]].value.i, compiler->vars[insn->src_args[0]].ptr_offset); } } } } } void mmx_load_constants_inner (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: if (compiler->vars[i].ptr_register) { orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->vars[i].ptr_register); } break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error(compiler,"bad vartype"); break; } } } void mmx_add_strides (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i]), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_add_reg_memoffset (compiler, compiler->is_64bit ? 8 : 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg); if (compiler->vars[i].ptr_register == 0) { orc_compiler_error (compiler, "unimplemented: stride on pointer stored in memory"); } break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error(compiler,"bad vartype"); break; } } } static int get_align_var (OrcCompiler *compiler) { int i; for(i=ORC_VAR_D1;i<=ORC_VAR_S8;i++){ if (compiler->vars[i].size == 0) continue; if ((compiler->vars[i].size << compiler->loop_shift) >= 16) { return i; } } for(i=ORC_VAR_D1;i<=ORC_VAR_S8;i++){ if (compiler->vars[i].size == 0) continue; if ((compiler->vars[i].size << compiler->loop_shift) >= 8) { return i; } } for(i=ORC_VAR_D1;i<=ORC_VAR_S8;i++){ if (compiler->vars[i].size == 0) continue; return i; } orc_compiler_error(compiler, "could not find alignment variable"); return -1; } static int get_shift (int size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: ORC_ERROR("bad size %d", size); } return -1; } static void orc_emit_split_3_regions (OrcCompiler *compiler) { int align_var; int align_shift; int var_size_shift; align_var = get_align_var (compiler); var_size_shift = get_shift (compiler->vars[align_var].size); align_shift = var_size_shift + compiler->loop_shift; /* determine how many iterations until align array is aligned (n1) */ orc_x86_emit_mov_imm_reg (compiler, 4, 16, X86_EAX); orc_x86_emit_sub_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[align_var]), compiler->exec_reg, X86_EAX); orc_x86_emit_and_imm_reg (compiler, 4, (1<exec_reg); orc_x86_emit_jle (compiler, 6); /* If so, we have a standard 3-region split. */ orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1), compiler->exec_reg); /* Calculate n2 */ orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_sub_reg_reg (compiler, 4, X86_EAX, compiler->gp_tmpreg); orc_x86_emit_mov_reg_reg (compiler, 4, compiler->gp_tmpreg, X86_EAX); orc_x86_emit_sar_imm_reg (compiler, 4, compiler->loop_shift + compiler->unroll_shift, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); /* Calculate n3 */ orc_x86_emit_and_imm_reg (compiler, 4, (1<<(compiler->loop_shift + compiler->unroll_shift))-1, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); orc_x86_emit_jmp (compiler, 7); /* else, iterations are all unaligned: n1=n, n2=0, n3=0 */ orc_x86_emit_label (compiler, 6); orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1), compiler->exec_reg); orc_x86_emit_mov_imm_reg (compiler, 4, 0, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); orc_x86_emit_label (compiler, 7); } static void orc_emit_split_2_regions (OrcCompiler *compiler) { int align_var; int align_shift ORC_GNUC_UNUSED; int var_size_shift; align_var = get_align_var (compiler); var_size_shift = get_shift (compiler->vars[align_var].size); align_shift = var_size_shift + compiler->loop_shift; /* Calculate n2 */ orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_mov_reg_reg (compiler, 4, compiler->gp_tmpreg, X86_EAX); orc_x86_emit_sar_imm_reg (compiler, 4, compiler->loop_shift + compiler->unroll_shift, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); /* Calculate n3 */ orc_x86_emit_and_imm_reg (compiler, 4, (1<<(compiler->loop_shift + compiler->unroll_shift))-1, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); } #ifndef MMX static int orc_program_has_float (OrcCompiler *compiler) { int j; for(j=0;jn_insns;j++){ OrcInstruction *insn = compiler->insns + j; OrcStaticOpcode *opcode = insn->opcode; if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) return TRUE; } return FALSE; } #endif #define LABEL_REGION1_SKIP 1 #define LABEL_INNER_LOOP_START 2 #define LABEL_REGION2_SKIP 3 #define LABEL_OUTER_LOOP 4 #define LABEL_OUTER_LOOP_SKIP 5 #define LABEL_STEP_DOWN(x) (8+(x)) #define LABEL_STEP_UP(x) (13+(x)) void orc_compiler_mmx_assemble (OrcCompiler *compiler) { #ifndef MMX int set_mxcsr = FALSE; #endif int align_var; int is_aligned; if (0 && orc_x86_assemble_copy_check (compiler)) { /* The rep movs implementation isn't faster most of the time */ orc_x86_assemble_copy (compiler); return; } align_var = get_align_var (compiler); is_aligned = compiler->vars[align_var].is_aligned; { orc_mmx_emit_loop (compiler, 0, 0); compiler->codeptr = compiler->code; free (compiler->asm_code); compiler->asm_code = NULL; compiler->asm_code_len = 0; memset (compiler->labels, 0, sizeof (compiler->labels)); memset (compiler->labels_int, 0, sizeof (compiler->labels_int)); compiler->n_fixups = 0; compiler->n_output_insns = 0; } if (compiler->error) return; orc_x86_emit_prologue (compiler); #ifndef MMX if (orc_program_has_float (compiler)) { set_mxcsr = TRUE; orc_mmx_set_mxcsr (compiler); } #endif mmx_load_constants_outer (compiler); if (compiler->program->is_2d) { if (compiler->program->constant_m > 0) { orc_x86_emit_mov_imm_reg (compiler, 4, compiler->program->constant_m, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A2]), compiler->exec_reg); } else { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A1]), compiler->exec_reg, X86_EAX); orc_x86_emit_test_reg_reg (compiler, 4, X86_EAX, X86_EAX); orc_x86_emit_jle (compiler, LABEL_OUTER_LOOP_SKIP); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A2]), compiler->exec_reg); } orc_x86_emit_label (compiler, LABEL_OUTER_LOOP); } if (compiler->program->constant_n > 0 && compiler->program->constant_n <= ORC_MMX_ALIGNED_DEST_CUTOFF) { /* don't need to load n */ } else if (compiler->loop_shift > 0) { if (compiler->has_iterator_opcode || is_aligned) { orc_emit_split_2_regions (compiler); } else { /* split n into three regions, with center region being aligned */ orc_emit_split_3_regions (compiler); } } else { /* loop shift is 0, no need to split */ orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); } mmx_load_constants_inner (compiler); if (compiler->program->constant_n > 0 && compiler->program->constant_n <= ORC_MMX_ALIGNED_DEST_CUTOFF) { int n_left = compiler->program->constant_n; int save_loop_shift; int loop_shift; compiler->offset = 0; save_loop_shift = compiler->loop_shift; while (n_left >= (1<loop_shift)) { ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_mmx_emit_loop (compiler, compiler->offset, 0); n_left -= 1<loop_shift; compiler->offset += 1<loop_shift; } for(loop_shift = compiler->loop_shift-1; loop_shift>=0; loop_shift--) { if (n_left >= (1<loop_shift = loop_shift; ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", loop_shift); orc_mmx_emit_loop (compiler, compiler->offset, 0); n_left -= 1<offset += 1<loop_shift = save_loop_shift; } else { int ui, ui_max; int emit_region1 = TRUE; int emit_region3 = TRUE; if (compiler->has_iterator_opcode || is_aligned) { emit_region1 = FALSE; } if (compiler->loop_shift == 0) { emit_region1 = FALSE; emit_region3 = FALSE; } if (emit_region1) { int save_loop_shift; int l; save_loop_shift = compiler->loop_shift; compiler->vars[align_var].is_aligned = FALSE; for (l=0;lloop_shift = l; ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_x86_emit_test_imm_memoffset (compiler, 4, 1<loop_shift, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1), compiler->exec_reg); orc_x86_emit_je (compiler, LABEL_STEP_UP(compiler->loop_shift)); orc_mmx_emit_loop (compiler, 0, 1<loop_shift); orc_x86_emit_label (compiler, LABEL_STEP_UP(compiler->loop_shift)); } compiler->loop_shift = save_loop_shift; compiler->vars[align_var].is_aligned = TRUE; } orc_x86_emit_label (compiler, LABEL_REGION1_SKIP); orc_x86_emit_cmp_imm_memoffset (compiler, 4, 0, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); orc_x86_emit_je (compiler, LABEL_REGION2_SKIP); if (compiler->loop_counter != ORC_REG_INVALID) { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, counter2), compiler->exec_reg, compiler->loop_counter); } ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_x86_emit_align (compiler, 4); orc_x86_emit_label (compiler, LABEL_INNER_LOOP_START); ui_max = 1<unroll_shift; for(ui=0;uioffset = ui<loop_shift; orc_mmx_emit_loop (compiler, compiler->offset, (ui==ui_max-1) << (compiler->loop_shift + compiler->unroll_shift)); } compiler->offset = 0; if (compiler->loop_counter != ORC_REG_INVALID) { orc_x86_emit_add_imm_reg (compiler, 4, -1, compiler->loop_counter, TRUE); } else { orc_x86_emit_dec_memoffset (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); } orc_x86_emit_jne (compiler, LABEL_INNER_LOOP_START); orc_x86_emit_label (compiler, LABEL_REGION2_SKIP); if (emit_region3) { int save_loop_shift; int l; save_loop_shift = compiler->loop_shift + compiler->unroll_shift; compiler->vars[align_var].is_aligned = FALSE; for(l=save_loop_shift - 1; l >= 0; l--) { compiler->loop_shift = l; ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_x86_emit_test_imm_memoffset (compiler, 4, 1<loop_shift, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); orc_x86_emit_je (compiler, LABEL_STEP_DOWN(compiler->loop_shift)); orc_mmx_emit_loop (compiler, 0, 1<loop_shift); orc_x86_emit_label (compiler, LABEL_STEP_DOWN(compiler->loop_shift)); } compiler->loop_shift = save_loop_shift; } } if (compiler->program->is_2d && compiler->program->constant_m != 1) { mmx_add_strides (compiler); orc_x86_emit_add_imm_memoffset (compiler, 4, -1, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2]), compiler->exec_reg); orc_x86_emit_jne (compiler, LABEL_OUTER_LOOP); orc_x86_emit_label (compiler, LABEL_OUTER_LOOP_SKIP); } mmx_save_accumulators (compiler); #ifndef MMX if (set_mxcsr) { orc_mmx_restore_mxcsr (compiler); } #else orc_x86_emit_emms (compiler); #endif orc_x86_emit_epilogue (compiler); orc_x86_calculate_offsets (compiler); orc_x86_output_insns (compiler); orc_x86_do_fixups (compiler); } void orc_mmx_emit_loop (OrcCompiler *compiler, int offset, int update) { int j; int k; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; compiler->insn_index = j; if (insn->flags & ORC_INSN_FLAG_INVARIANT) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name); compiler->min_temp_reg = ORC_VEC_REG_BASE; compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { if (!(insn->opcode->flags & (ORC_STATIC_OPCODE_ACCUMULATOR|ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_STORE)) && compiler->vars[insn->dest_args[0]].alloc != compiler->vars[insn->src_args[0]].alloc) { #ifdef MMX orc_mmx_emit_movq (compiler, compiler->vars[insn->src_args[0]].alloc, compiler->vars[insn->dest_args[0]].alloc); #else orc_mmx_emit_movdqu (compiler, compiler->vars[insn->src_args[0]].alloc, compiler->vars[insn->dest_args[0]].alloc); #endif } rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_error (compiler, "no code generation rule for %s", opcode->name); } } if (update) { for(k=0;kvars + k; if (var->name == NULL) continue; if (var->vartype == ORC_VAR_TYPE_SRC || var->vartype == ORC_VAR_TYPE_DEST) { int offset; if (var->update_type == 0) { offset = 0; } else if (var->update_type == 1) { offset = (var->size * update) >> 1; } else { offset = var->size * update; } if (offset != 0) { if (compiler->vars[k].ptr_register) { orc_x86_emit_add_imm_reg (compiler, compiler->is_64bit ? 8 : 4, offset, compiler->vars[k].ptr_register, FALSE); } else { orc_x86_emit_add_imm_memoffset (compiler, compiler->is_64bit ? 8 : 4, offset, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]), compiler->exec_reg); } } } } } } void orc_mmx_emit_invariants (OrcCompiler *compiler) { int j; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name); compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_error (compiler, "no code generation rule for %s", opcode->name); } } } orc-0.4.18/orc/orccpu-x86.c0000664000175000017500000003552612111024531012160 00000000000000/* * ORC - Library of Optimized Inner Loops * Copyright (c) 2003,2004,2010 David A. Schleef * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "orcinternal.h" #include #include #include #include #include #include #include orc_uint32 orc_x86_vendor; int orc_x86_sse_flags; int orc_x86_mmx_flags; int orc_x86_microarchitecture; #if defined(_MSC_VER) static void get_cpuid (orc_uint32 op, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d) { int tmp[4]; __cpuid(tmp, op); *a = tmp[0]; *b = tmp[1]; *c = tmp[2]; *d = tmp[3]; } static void get_cpuid_ecx (orc_uint32 op, orc_uint32 init_ecx, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d) { #if _MSC_VER >= 1500 int tmp[4]; __cpuidex(tmp, op, init_ecx); *a = tmp[0]; *b = tmp[1]; *c = tmp[2]; *d = tmp[3]; #else *a = 0; *b = 0; *c = 0; *d = 0; #endif } #elif defined(__GNUC__) || defined (__SUNPRO_C) static void get_cpuid_ecx (orc_uint32 op, orc_uint32 init_ecx, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d) { *a = op; *c = init_ecx; #ifdef __i386__ __asm__ ( " pushl %%ebx\n" " cpuid\n" " mov %%ebx, %%esi\n" " popl %%ebx\n" : "+a" (*a), "=S" (*b), "+c" (*c), "=d" (*d)); #elif defined(__amd64__) __asm__ ( " cpuid\n" : "+a" (*a), "=b" (*b), "+c" (*c), "=d" (*d)); #endif } static void get_cpuid (orc_uint32 op, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d) { get_cpuid_ecx (op, 0, a, b, c, d); } #else /* FIXME generate a get_cpuid() function at runtime. */ #error Need get_cpuid() function. #endif struct desc_struct { int desc; int level; int size; }; struct desc_struct cache_descriptors[] = { { 0x0a, 1, 8*1024 }, { 0x0c, 1, 16*1024 }, { 0x0d, 1, 16*1024 }, { 0x0e, 1, 24*1024 }, { 0x21, 2, 256*1024 }, { 0x22, 3, 512*1024 }, { 0x23, 3, 1024*1024 }, { 0x25, 3, 2*1024*1024 }, { 0x29, 3, 4*1024*1024 }, { 0x2c, 1, 32*1024 }, { 0x41, 2, 128*1024 }, { 0x42, 2, 256*1024 }, { 0x43, 2, 512*1024 }, { 0x44, 2, 1*1024*1024 }, { 0x45, 2, 2*1024*1024 }, { 0x46, 3, 4*1024*1024 }, { 0x47, 3, 8*1024*1024 }, { 0x48, 2, 3*1024*1024 }, { 0x49, 2, 4*1024*1024 }, /* special case */ { 0x4a, 3, 6*1024*1024 }, { 0x4b, 3, 8*1024*1024 }, { 0x4c, 3, 12*1024*1024 }, { 0x4d, 3, 16*1024*1024 }, { 0x4e, 2, 6*1024*1024 }, { 0x60, 1, 16*1024 }, { 0x66, 1, 8*1024 }, { 0x67, 1, 16*1024 }, { 0x68, 1, 32*1024 }, { 0x78, 2, 1*1024*1024 }, { 0x79, 2, 128*1024 }, { 0x7a, 2, 256*1024 }, { 0x7b, 2, 512*1024 }, { 0x7c, 2, 1*1024*1024 }, { 0x7d, 2, 2*1024*1024 }, { 0x7f, 2, 512*1024 }, { 0x80, 2, 512*1024 }, { 0x82, 2, 256*1024 }, { 0x83, 2, 512*1024 }, { 0x84, 2, 1*1024*1024 }, { 0x85, 2, 2*1024*1024 }, { 0x86, 2, 512*1024 }, { 0x87, 2, 1*1024*1024 }, { 0xe4, 3, 8*1024*1024 } }; static void handle_cache_descriptor (unsigned int desc) { int i; if (desc == 0) return; /* special case */ if (desc == 0x49 && _orc_cpu_family == 0xf && _orc_cpu_model == 0x6) { ORC_DEBUG("level %d size %d", 3, 4*1024*1024); _orc_data_cache_size_level3 = 4*1024*1024; return; } for(i=0;i>8)&0xf; model_id = (eax>>4)&0xf; ext_family_id = (eax>>20)&0xff; ext_model_id = (eax>>16)&0xf; _orc_cpu_family = family_id + ext_family_id; _orc_cpu_model = (ext_model_id << 4) | model_id; _orc_cpu_stepping = eax&0xf; ORC_INFO ("family_id %d model_id %d stepping %d", _orc_cpu_family, _orc_cpu_model, _orc_cpu_stepping); } static void orc_sse_detect_cpuid_generic (orc_uint32 level) { if (level >= 1) { orc_x86_cpuid_handle_standard_flags (); orc_x86_cpuid_handle_family_model_stepping (); } } static void orc_sse_detect_cpuid_intel (orc_uint32 level) { orc_uint32 eax, ebx, ecx, edx; if (level >= 1) { orc_x86_cpuid_handle_standard_flags (); orc_x86_cpuid_handle_family_model_stepping (); orc_x86_microarchitecture = ORC_X86_UNKNOWN; if (_orc_cpu_family == 6) { switch (_orc_cpu_model) { case 6: /* Mendocino */ case 11: /* Tualatin-256 */ orc_x86_microarchitecture = ORC_X86_P6; break; case 15: case 22: orc_x86_microarchitecture = ORC_X86_CORE; break; case 23: case 29: orc_x86_microarchitecture = ORC_X86_PENRYN; break; case 26: orc_x86_microarchitecture = ORC_X86_NEHALEM; break; case 28: orc_x86_microarchitecture = ORC_X86_BONNELL; break; //orc_x86_microarchitecture = ORC_X86_WESTMERE; //orc_x86_microarchitecture = ORC_X86_SANDY_BRIDGE; } } else if (_orc_cpu_family == 15) { orc_x86_microarchitecture = ORC_X86_NETBURST; } } if (level >= 2) { get_cpuid (0x00000002, &eax, &ebx, &ecx, &edx); if ((eax&0x80000000) == 0) { handle_cache_descriptor ((eax>>8)&0xff); handle_cache_descriptor ((eax>>16)&0xff); handle_cache_descriptor ((eax>>24)&0xff); } if ((ebx&0x80000000) == 0) { handle_cache_descriptor (ebx&0xff); handle_cache_descriptor ((ebx>>8)&0xff); handle_cache_descriptor ((ebx>>16)&0xff); handle_cache_descriptor ((ebx>>24)&0xff); } if ((ecx&0x80000000) == 0) { handle_cache_descriptor (ecx&0xff); handle_cache_descriptor ((ecx>>8)&0xff); handle_cache_descriptor ((ecx>>16)&0xff); handle_cache_descriptor ((ecx>>24)&0xff); } if ((edx&0x80000000) == 0) { handle_cache_descriptor (edx&0xff); handle_cache_descriptor ((edx>>8)&0xff); handle_cache_descriptor ((edx>>16)&0xff); handle_cache_descriptor ((edx>>24)&0xff); } } if (level >= 4) { int i; for(i=0;i<10;i++){ int type; int level; int l; int p; int w; int s; get_cpuid_ecx (0x00000004, i, &eax, &ebx, &ecx, &edx); type = eax&0xf; if (type == 0) break; level = (eax>>5)&0x7; l = ((ebx>>0)&0xfff)+1; p = ((ebx>>12)&0x3ff)+1; w = ((ebx>>22)&0x3ff)+1; s = ecx + 1; ORC_INFO ("type %d level %d line size %d partitions %d ways %d sets %d", type, level, l, p, w, s); if (type == 1 || type == 3) { switch (level) { case 1: _orc_data_cache_size_level1 = l*p*w*s; break; case 2: _orc_data_cache_size_level2 = l*p*w*s; break; case 3: _orc_data_cache_size_level3 = l*p*w*s; break; } } } } get_cpuid (0x80000000, &level, &ebx, &ecx, &edx); if (level >= 4) { orc_x86_cpuid_get_branding_string (); } } static void orc_sse_detect_cpuid_amd (orc_uint32 level) { orc_uint32 eax, ebx, ecx, edx; if (level >= 1) { orc_x86_cpuid_handle_standard_flags (); orc_x86_cpuid_handle_family_model_stepping (); orc_x86_microarchitecture = ORC_X86_UNKNOWN; switch (_orc_cpu_family) { case 5: /* Don't know if 8 is correct */ if (_orc_cpu_model < 8) { orc_x86_microarchitecture = ORC_X86_K5; } else { orc_x86_microarchitecture = ORC_X86_K6; } break; case 6: orc_x86_microarchitecture = ORC_X86_K7; break; case 0xf: orc_x86_microarchitecture = ORC_X86_K8; break; case 0x10: orc_x86_microarchitecture = ORC_X86_K10; break; default: break; } } get_cpuid (0x80000000, &level, &ebx, &ecx, &edx); if (level >= 1) { get_cpuid (0x80000001, &eax, &ebx, &ecx, &edx); /* AMD flags */ if (ecx & (1<<6)) { orc_x86_sse_flags |= ORC_TARGET_SSE_SSE4A; } if (ecx & (1<<11)) { orc_x86_sse_flags |= ORC_TARGET_SSE_SSE5; } if (edx & (1<<22)) { orc_x86_mmx_flags |= ORC_TARGET_MMX_MMXEXT; } if (edx & (1<<31)) { orc_x86_mmx_flags |= ORC_TARGET_MMX_3DNOW; } if (edx & (1<<30)) { orc_x86_mmx_flags |= ORC_TARGET_MMX_3DNOWEXT; } } if (level >= 4) { orc_x86_cpuid_get_branding_string (); } if (level >= 6) { get_cpuid (0x80000005, &eax, &ebx, &ecx, &edx); _orc_data_cache_size_level1 = ((ecx>>24)&0xff) * 1024; ORC_INFO ("L1 D-cache: %d kbytes, %d-way, %d lines/tag, %d line size", (ecx>>24)&0xff, (ecx>>16)&0xff, (ecx>>8)&0xff, ecx&0xff); ORC_INFO ("L1 I-cache: %d kbytes, %d-way, %d lines/tag, %d line size", (edx>>24)&0xff, (edx>>16)&0xff, (edx>>8)&0xff, edx&0xff); get_cpuid (0x80000006, &eax, &ebx, &ecx, &edx); _orc_data_cache_size_level2 = ((ecx>>16)&0xffff) * 1024; ORC_INFO ("L2 cache: %d kbytes, %d assoc, %d lines/tag, %d line size", (ecx>>16)&0xffff, (ecx>>12)&0xf, (ecx>>8)&0xf, ecx&0xff); } } unsigned int orc_sse_get_cpu_flags(void) { orc_x86_detect_cpuid (); return orc_x86_sse_flags; } unsigned int orc_mmx_get_cpu_flags(void) { orc_x86_detect_cpuid (); return orc_x86_mmx_flags; } orc-0.4.18/orc/orcparse.h0000644000175000017500000000047311642141572012071 00000000000000 #ifndef __ORC_PARSE_H__ #define __ORC_PARSE_H__ #include ORC_BEGIN_DECLS int orc_parse (const char *code, OrcProgram ***programs); int orc_parse_full (const char *code, OrcProgram ***programs, char **log); const char * orc_parse_get_init_function (OrcProgram *program); ORC_END_DECLS #endif orc-0.4.18/orc/orccpu-powerpc.c0000664000175000017500000001133112071634360013212 00000000000000/* * LIBORC - Library of Optimized Inner Loops * Copyright (c) 2003,2004 David A. Schleef * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #if defined(__linux__) #include #include #include #include #include #include #ifndef PPC_FEATURE_HAS_ALTIVEC /* From linux-2.6/include/asm-powerpc/cputable.h */ #define PPC_FEATURE_HAS_ALTIVEC 0x10000000 #endif #endif #if defined(__FreeBSD__) || defined(__APPLE__) #include #include #endif #if defined(__OpenBSD__) #include #include #include #endif /***** powerpc *****/ #if 0 static unsigned long orc_profile_stamp_tb(void) { unsigned long ts; __asm__ __volatile__("mftb %0\n" : "=r" (ts)); return ts; } #endif #if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) static void test_altivec (void * ignored) { asm volatile ("vor v0, v0, v0\n"); } #endif #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #if defined(__APPLE__) #define SYSCTL "hw.vectorunit" #else #define SYSCTL "hw.altivec" #endif static unsigned long orc_check_altivec_sysctl_bsd (void) { unsigned long cpu_flags = 0; int ret, vu; size_t len; len = sizeof(vu); ret = sysctlbyname(SYSCTL, &vu, &len, NULL, 0); if (!ret && vu) { cpu_flags |= ORC_TARGET_ALTIVEC_ALTIVEC; } return cpu_flags; } #endif #if defined(__OpenBSD__) static unsigned long orc_check_altivec_sysctl_openbsd (void) { unsigned long cpu_flags = 0; int mib[2], ret, vu; size_t len; mib[0] = CTL_MACHDEP; mib[1] = CPU_ALTIVEC; len = sizeof(vu); ret = sysctl(mib, 2, &vu, &len, NULL, 0); if (!ret && vu) { cpu_flags |= ORC_TARGET_ALTIVEC_ALTIVEC; } return cpu_flags; } #endif #if defined(__linux__) static unsigned long orc_check_altivec_proc_auxv (void) { unsigned long cpu_flags = 0; static int available = -1; int new_avail = 0; unsigned long buf[64]; ssize_t count; int fd, i; /* Flags already set */ if (available != -1) { return 0; } fd = open("/proc/self/auxv", O_RDONLY); if (fd < 0) { goto out; } more: count = read(fd, buf, sizeof(buf)); if (count < 0) { goto out_close; } for (i=0; i < (count / sizeof(unsigned long)); i += 2) { if (buf[i] == AT_HWCAP) { new_avail = !!(buf[i+1] & PPC_FEATURE_HAS_ALTIVEC); goto out_close; } else if (buf[i] == AT_NULL) { goto out_close; } } if (count == sizeof(buf)) { goto more; } out_close: close(fd); out: available = new_avail; if (available) { cpu_flags |= ORC_TARGET_ALTIVEC_ALTIVEC; } return cpu_flags; } #endif #if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) static void orc_check_altivec_fault (void) { orc_fault_check_enable (); if (orc_fault_check_try(test_altivec, NULL)) { ORC_DEBUG ("cpu flag altivec"); orc_cpu_flags |= ORC_IMPL_FLAG_ALTIVEC; } orc_fault_check_disable (); } #endif void orc_cpu_detect_arch(void) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) orc_check_altivec_sysctl_bsd(); #elif defined(__OpenBSD__) orc_check_altivec_sysctl_openbsd(); #elif defined(__linux__) orc_check_altivec_proc_auxv(); #else orc_check_altivec_fault(); #endif //_orc_profile_stamp = orc_profile_stamp_tb; } orc-0.4.18/orc/orcexecutor.c0000664000175000017500000002242712071634360012614 00000000000000 #include "config.h" #include #include #include #include #include /** * SECTION:orcexecutor * @title: OrcExecutor * @short_description: Running Orc programs */ #define CHUNK_SIZE 16 OrcExecutor * orc_executor_new (OrcProgram *program) { OrcExecutor *ex; ex = malloc(sizeof(OrcExecutor)); memset(ex,0,sizeof(OrcExecutor)); ex->program = program; ex->arrays[ORC_VAR_A2] = program->orccode; return ex; } void orc_executor_free (OrcExecutor *ex) { free (ex); } void orc_executor_run (OrcExecutor *ex) { void (*func) (OrcExecutor *); if (ex->program) { func = ex->program->code_exec; } else { OrcCode *code = (OrcCode *)ex->arrays[ORC_VAR_A2]; func = code->exec; } if (func) { func (ex); //ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3); } else { orc_executor_emulate (ex); } } void orc_executor_run_backup (OrcExecutor *ex) { void (*func) (OrcExecutor *); if (ex->program) { func = ex->program->backup_func; } else { OrcCode *code = (OrcCode *)ex->arrays[ORC_VAR_A2]; func = code->exec; } if (func) { func (ex); //ORC_ERROR("counters %d %d %d", ex->counter1, ex->counter2, ex->counter3); } else { orc_executor_emulate (ex); } } void orc_executor_set_program (OrcExecutor *ex, OrcProgram *program) { ex->program = program; if (program->code_exec) { ex->arrays[ORC_VAR_A1] = (void *)program->code_exec; } else { ex->arrays[ORC_VAR_A1] = (void *)orc_executor_emulate; } } void orc_executor_set_array (OrcExecutor *ex, int var, void *ptr) { ex->arrays[var] = ptr; } void orc_executor_set_stride (OrcExecutor *ex, int var, int stride) { ex->params[var] = stride; } void orc_executor_set_array_str (OrcExecutor *ex, const char *name, void *ptr) { int var; var = orc_program_find_var_by_name (ex->program, name); ex->arrays[var] = ptr; } void orc_executor_set_param (OrcExecutor *ex, int var, int value) { ex->params[var] = value; } void orc_executor_set_param_float (OrcExecutor *ex, int var, float value) { orc_union32 u; u.f = value; ex->params[var] = u.i; } void orc_executor_set_param_int64 (OrcExecutor *ex, int var, orc_int64 value) { orc_union64 u; u.i = value; ex->params[var] = u.x2[0]; ex->params[var + (ORC_VAR_T1-ORC_VAR_P1)] = u.x2[1]; } void orc_executor_set_param_double (OrcExecutor *ex, int var, double value) { orc_union64 u; u.f = value; ex->params[var] = u.x2[0]; ex->params[var + (ORC_VAR_T1-ORC_VAR_P1)] = u.x2[1]; } void orc_executor_set_param_str (OrcExecutor *ex, const char *name, int value) { int var; var = orc_program_find_var_by_name (ex->program, name); ex->params[var] = value; } int orc_executor_get_accumulator (OrcExecutor *ex, int var) { return ex->accumulators[var - ORC_VAR_A1]; } int orc_executor_get_accumulator_str (OrcExecutor *ex, const char *name) { int var; var = orc_program_find_var_by_name (ex->program, name); return ex->accumulators[var]; } void orc_executor_set_n (OrcExecutor *ex, int n) { ex->n = n; } void orc_executor_set_m (OrcExecutor *ex, int m) { ORC_EXECUTOR_M(ex) = m; } static void load_constant (void *data, int size, orc_uint64 value) { switch (size) { case 1: { int l; orc_int8 *d = data; for(l=0;lprogram) { code = ex->program->orccode; } else { code = (OrcCode *)ex->arrays[ORC_VAR_A2]; } ex->accumulators[0] = 0; ex->accumulators[1] = 0; ex->accumulators[2] = 0; ex->accumulators[3] = 0; ORC_DEBUG("emulating"); memset (&opcode_ex, 0, sizeof(opcode_ex)); if (code == NULL) { ORC_ERROR("attempt to run program that failed to compile"); ORC_ASSERT(0); } if (code->is_2d) { m = ORC_EXECUTOR_M(ex); } else { m = 1; } for(i=0;ivars + i; if (var->size) { tmpspace[i] = malloc(ORC_MAX_VAR_SIZE * CHUNK_SIZE); } } opcode_ex = malloc(sizeof(OrcOpcodeExecutor)*code->n_insns); for(j=0;jn_insns;j++){ insn = code->insns + j; opcode = insn->opcode; opcode_ex[j].emulateN = opcode->emulateN; opcode_ex[j].shift = 0; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { opcode_ex[j].shift = 1; } else if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { opcode_ex[j].shift = 2; } for(k=0;kvars + insn->src_args[k]; if (opcode->src_size[k] == 0) continue; if (var->vartype == ORC_VAR_TYPE_CONST) { opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]]; /* FIXME hack */ load_constant (tmpspace[insn->src_args[k]], 8, var->value.i); } else if (var->vartype == ORC_VAR_TYPE_PARAM) { opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]]; /* FIXME hack */ load_constant (tmpspace[insn->src_args[k]], 8, (orc_uint64)(orc_uint32)ex->params[insn->src_args[k]] | (((orc_uint64)(orc_uint32)ex->params[insn->src_args[k] + (ORC_VAR_T1 - ORC_VAR_P1)])<<32)); } else if (var->vartype == ORC_VAR_TYPE_TEMP) { opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]]; } else if (var->vartype == ORC_VAR_TYPE_SRC) { if (ORC_PTR_TO_INT(ex->arrays[insn->src_args[k]]) & (var->size - 1)) { ORC_ERROR("Unaligned array for src%d, program %s", (insn->src_args[k]-ORC_VAR_S1), ex->program->name); } opcode_ex[j].src_ptrs[k] = ex->arrays[insn->src_args[k]]; } else if (var->vartype == ORC_VAR_TYPE_DEST) { if (ORC_PTR_TO_INT(ex->arrays[insn->src_args[k]]) & (var->size - 1)) { ORC_ERROR("Unaligned array for dest%d, program %s", (insn->src_args[k]-ORC_VAR_D1), ex->program->name); } opcode_ex[j].src_ptrs[k] = ex->arrays[insn->src_args[k]]; } } for(k=0;kvars + insn->dest_args[k]; if (opcode->dest_size[k] == 0) continue; if (var->vartype == ORC_VAR_TYPE_TEMP) { ORC_DEBUG("dest vartype tmp %d", insn->dest_args[k]); opcode_ex[j].dest_ptrs[k] = tmpspace[insn->dest_args[k]]; } else if (var->vartype == ORC_VAR_TYPE_ACCUMULATOR) { opcode_ex[j].dest_ptrs[k] = &ex->accumulators[insn->dest_args[k] - ORC_VAR_A1]; } else if (var->vartype == ORC_VAR_TYPE_DEST) { if (ORC_PTR_TO_INT(ex->arrays[insn->dest_args[k]]) & (var->size - 1)) { ORC_ERROR("Unaligned array for dest%d, program %s", (insn->dest_args[k]-ORC_VAR_D1), ex->program->name); } opcode_ex[j].dest_ptrs[k] = ex->arrays[insn->dest_args[k]]; } } ORC_DEBUG("opcode %s %p %p %p", opcode->name, opcode_ex[j].dest_ptrs[0], opcode_ex[j].src_ptrs[0], opcode_ex[j].src_ptrs[1]); } ORC_DEBUG("src ptr %p stride %d", ex->arrays[ORC_VAR_S1], ex->params[ORC_VAR_S1]); for(m_index=0;m_indexn_insns;j++){ insn = code->insns + j; opcode = insn->opcode; for(k=0;kvars + insn->src_args[k]; if (opcode->src_size[k] == 0) continue; if (var->vartype == ORC_VAR_TYPE_SRC) { opcode_ex[j].src_ptrs[k] = ORC_PTR_OFFSET(ex->arrays[insn->src_args[k]], ex->params[insn->src_args[k]]*m_index); } else if (var->vartype == ORC_VAR_TYPE_DEST) { opcode_ex[j].src_ptrs[k] = ORC_PTR_OFFSET(ex->arrays[insn->src_args[k]], ex->params[insn->src_args[k]]*m_index); } } for(k=0;kvars + insn->dest_args[k]; if (opcode->dest_size[k] == 0) continue; if (var->vartype == ORC_VAR_TYPE_DEST) { opcode_ex[j].dest_ptrs[k] = ORC_PTR_OFFSET(ex->arrays[insn->dest_args[k]], ex->params[insn->dest_args[k]]*m_index); } } } for(i=0;in;i+=CHUNK_SIZE){ for(j=0;jn_insns;j++){ if (ex->n - i >= CHUNK_SIZE) { opcode_ex[j].emulateN (opcode_ex + j, i, CHUNK_SIZE << opcode_ex[j].shift); } else { opcode_ex[j].emulateN (opcode_ex + j, i, (ex->n - i) << opcode_ex[j].shift); } } } } free (opcode_ex); for(i=0;i= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif #ifndef DISABLE_ORC #include #endif void orc_memcpy (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n); void orc_memset (void * ORC_RESTRICT d1, int p1, int n); /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ /* orc_memcpy */ #ifdef DISABLE_ORC void orc_memcpy (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_memcpy (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void orc_memcpy (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_memcpy"); orc_program_set_backup_function (p, _backup_orc_memcpy); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_memset */ #ifdef DISABLE_ORC void orc_memset (void * ORC_RESTRICT d1, int p1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_memset (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void orc_memset (void * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; p = orc_program_new (); orc_program_set_name (p, "orc_memset"); orc_program_set_backup_function (p, _backup_orc_memset); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif orc-0.4.18/orc/orcopcodes.c0000664000175000017500000004233212071634360012407 00000000000000 #include "config.h" #include #include #include #include #include #include /** * SECTION:orcopcode * @title: OrcOpcode * @short_description: Operations */ static OrcOpcodeSet *opcode_sets; static int n_opcode_sets; static OrcTarget *targets[ORC_N_TARGETS]; static int n_targets; static OrcTarget *default_target; #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX ORC_UINT64_C(4294967295) #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) void orc_target_register (OrcTarget *target) { targets[n_targets] = target; n_targets++; if (target->executable) { default_target = target; } } OrcTarget * orc_target_get_by_name (const char *name) { int i; if (name == NULL) return default_target; for(i=0;iname) == 0) { return targets[i]; } } return NULL; } OrcTarget * orc_target_get_default (void) { return default_target; } const char * orc_target_get_name (OrcTarget *target) { if (target == NULL) return NULL; return target->name; } unsigned int orc_target_get_default_flags (OrcTarget *target) { if (target == NULL) return 0; return target->get_default_flags(); } const char * orc_target_get_preamble (OrcTarget *target) { if (target->get_asm_preamble == NULL) return ""; return target->get_asm_preamble (); } const char * orc_target_get_asm_preamble (const char *target) { OrcTarget *t; t = orc_target_get_by_name (target); if (t == NULL) return ""; return orc_target_get_preamble (t); } const char * orc_target_get_flag_name (OrcTarget *target, int shift) { if (target->get_flag_name == NULL) return ""; return target->get_flag_name (shift); } #if 0 int orc_opcode_get_list (OrcOpcode **list) { (*list) = opcode_list; return n_opcodes; } #endif #if 0 void orc_opcode_register (const char *name, int n_dest, int n_src, OrcOpcodeEmulateFunc emulate, void *user) { OrcOpcode *opcode; if (n_opcodes == n_opcodes_alloc) { n_opcodes_alloc += 100; opcode_list = realloc(opcode_list, sizeof(OrcOpcode) * n_opcodes_alloc); } opcode = opcode_list + n_opcodes; opcode->name = strdup (name); opcode->n_src = n_src; opcode->n_dest = n_dest; opcode->emulate = emulate; opcode->emulate_user = user; n_opcodes++; } #endif OrcRuleSet * orc_rule_set_new (OrcOpcodeSet *opcode_set, OrcTarget *target, unsigned int required_flags) { OrcRuleSet *rule_set; rule_set = target->rule_sets + target->n_rule_sets; target->n_rule_sets++; memset (rule_set, 0, sizeof(OrcRuleSet)); rule_set->opcode_major = opcode_set->opcode_major; rule_set->required_target_flags = required_flags; rule_set->rules = malloc (sizeof(OrcRule) * opcode_set->n_opcodes); memset (rule_set->rules, 0, sizeof(OrcRule) * opcode_set->n_opcodes); return rule_set; } OrcRule * orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode, unsigned int target_flags) { OrcRule *rule; int i; int j; int k; for(k=0;k= opcode_sets[k].n_opcodes) continue; if (opcode_sets[k].opcodes + j != opcode) continue; for(i=target->n_rule_sets-1;i>=0;i--){ if (target->rule_sets[i].opcode_major != opcode_sets[k].opcode_major) continue; if (target->rule_sets[i].required_target_flags & (~target_flags)) continue; rule = target->rule_sets[i].rules + j; if (rule->emit) return rule; } } return NULL; } int orc_opcode_register_static (OrcStaticOpcode *sopcode, char *prefix) { int n; int major; n = 0; while (sopcode[n].name[0]) { n++; } major = n_opcode_sets; n_opcode_sets++; opcode_sets = realloc (opcode_sets, sizeof(OrcOpcodeSet)*n_opcode_sets); memset (opcode_sets + major, 0, sizeof(OrcOpcodeSet)); strncpy(opcode_sets[major].prefix, prefix, sizeof(opcode_sets[major].prefix)-1); opcode_sets[major].n_opcodes = n; opcode_sets[major].opcodes = sopcode; opcode_sets[major].opcode_major = major; return major; } OrcOpcodeSet * orc_opcode_set_get (const char *name) { int i; for(i=0;in_opcodes;j++){ if (strcmp (name, opcode_set->opcodes[j].name) == 0) { return j; } } return -1; } OrcStaticOpcode * orc_opcode_find_by_name (const char *name) { int i; int j; for(i=0;i= 0) { return &opcode_sets[i].opcodes[j]; } } return NULL; } void emulate_null (OrcOpcodeExecutor *ex, int offset, int n) { /* This is a placeholder for adding new opcodes */ ORC_ERROR("emulate_null() called. This is a bug."); } #include "orc/orcemulateopcodes.h" static OrcStaticOpcode opcodes[] = { /* byte ops */ { "absb", 0, { 1 }, { 1 }, emulate_absb }, { "addb", 0, { 1 }, { 1, 1 }, emulate_addb }, { "addssb", 0, { 1 }, { 1, 1 }, emulate_addssb }, { "addusb", 0, { 1 }, { 1, 1 }, emulate_addusb }, { "andb", 0, { 1 }, { 1, 1 }, emulate_andb }, { "andnb", 0, { 1 }, { 1, 1 }, emulate_andnb }, { "avgsb", 0, { 1 }, { 1, 1 }, emulate_avgsb }, { "avgub", 0, { 1 }, { 1, 1 }, emulate_avgub }, { "cmpeqb", 0, { 1 }, { 1, 1 }, emulate_cmpeqb }, { "cmpgtsb", 0, { 1 }, { 1, 1 }, emulate_cmpgtsb }, { "copyb", 0, { 1 }, { 1 }, emulate_copyb }, { "loadb", ORC_STATIC_OPCODE_LOAD, { 1 }, { 1 }, emulate_loadb }, { "loadoffb", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 1 }, { 1, 4 }, emulate_loadoffb }, { "loadupdb", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_ITERATOR, { 1 }, { 1 }, emulate_loadupdb }, { "loadupib", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_ITERATOR, { 1 }, { 1 }, emulate_loadupib }, { "loadpb", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR|ORC_STATIC_OPCODE_INVARIANT, { 1 }, { 1 }, emulate_loadpb }, { "ldresnearb", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 1 }, { 1, 4, 4 }, emulate_ldresnearb }, { "ldresnearl", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 4 }, { 4, 4, 4 }, emulate_ldresnearl }, { "ldreslinb", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 1 }, { 1, 4, 4 }, emulate_ldreslinb }, { "ldreslinl", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 4 }, { 4, 4, 4 }, emulate_ldreslinl }, { "maxsb", 0, { 1 }, { 1, 1 }, emulate_maxsb }, { "maxub", 0, { 1 }, { 1, 1 }, emulate_maxub }, { "minsb", 0, { 1 }, { 1, 1 }, emulate_minsb }, { "minub", 0, { 1 }, { 1, 1 }, emulate_minub }, { "mullb", 0, { 1 }, { 1, 1 }, emulate_mullb }, { "mulhsb", 0, { 1 }, { 1, 1 }, emulate_mulhsb }, { "mulhub", 0, { 1 }, { 1, 1 }, emulate_mulhub }, { "orb", 0, { 1 }, { 1, 1 }, emulate_orb }, { "shlb", ORC_STATIC_OPCODE_SCALAR, { 1 }, { 1, 1 }, emulate_shlb }, { "shrsb", ORC_STATIC_OPCODE_SCALAR, { 1 }, { 1, 1 }, emulate_shrsb }, { "shrub", ORC_STATIC_OPCODE_SCALAR, { 1 }, { 1, 1 }, emulate_shrub }, { "signb", 0, { 1 }, { 1 }, emulate_signb }, { "storeb", ORC_STATIC_OPCODE_STORE, { 1 }, { 1 }, emulate_storeb }, { "subb", 0, { 1 }, { 1, 1 }, emulate_subb }, { "subssb", 0, { 1 }, { 1, 1 }, emulate_subssb }, { "subusb", 0, { 1 }, { 1, 1 }, emulate_subusb }, { "xorb", 0, { 1 }, { 1, 1 }, emulate_xorb }, /* word ops */ { "absw", 0, { 2 }, { 2 }, emulate_absw }, { "addw", 0, { 2 }, { 2, 2 }, emulate_addw }, { "addssw", 0, { 2 }, { 2, 2 }, emulate_addssw }, { "addusw", 0, { 2 }, { 2, 2 }, emulate_addusw }, { "andw", 0, { 2 }, { 2, 2 }, emulate_andw }, { "andnw", 0, { 2 }, { 2, 2 }, emulate_andnw }, { "avgsw", 0, { 2 }, { 2, 2 }, emulate_avgsw }, { "avguw", 0, { 2 }, { 2, 2 }, emulate_avguw }, { "cmpeqw", 0, { 2 }, { 2, 2 }, emulate_cmpeqw }, { "cmpgtsw", 0, { 2 }, { 2, 2 }, emulate_cmpgtsw }, { "copyw", 0, { 2 }, { 2 }, emulate_copyw }, { "div255w", 0, { 2 }, { 2 }, emulate_div255w }, { "divluw", 0, { 2 }, { 2, 2 }, emulate_divluw }, { "loadw", ORC_STATIC_OPCODE_LOAD, { 2 }, { 2 }, emulate_loadw }, { "loadoffw", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 2 }, { 2, 4 }, emulate_loadoffw }, { "loadpw", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR|ORC_STATIC_OPCODE_INVARIANT, { 2 }, { 2 }, emulate_loadpw }, { "maxsw", 0, { 2 }, { 2, 2 }, emulate_maxsw }, { "maxuw", 0, { 2 }, { 2, 2 }, emulate_maxuw }, { "minsw", 0, { 2 }, { 2, 2 }, emulate_minsw }, { "minuw", 0, { 2 }, { 2, 2 }, emulate_minuw }, { "mullw", 0, { 2 }, { 2, 2 }, emulate_mullw }, { "mulhsw", 0, { 2 }, { 2, 2 }, emulate_mulhsw }, { "mulhuw", 0, { 2 }, { 2, 2 }, emulate_mulhuw }, { "orw", 0, { 2 }, { 2, 2 }, emulate_orw }, { "shlw", ORC_STATIC_OPCODE_SCALAR, { 2 }, { 2, 2 }, emulate_shlw }, { "shrsw", ORC_STATIC_OPCODE_SCALAR, { 2 }, { 2, 2 }, emulate_shrsw }, { "shruw", ORC_STATIC_OPCODE_SCALAR, { 2 }, { 2, 2 }, emulate_shruw }, { "signw", 0, { 2 }, { 2 }, emulate_signw }, { "storew", ORC_STATIC_OPCODE_STORE, { 2 }, { 2 }, emulate_storew }, { "subw", 0, { 2 }, { 2, 2 }, emulate_subw }, { "subssw", 0, { 2 }, { 2, 2 }, emulate_subssw }, { "subusw", 0, { 2 }, { 2, 2 }, emulate_subusw }, { "xorw", 0, { 2 }, { 2, 2 }, emulate_xorw }, /* long ops */ { "absl", 0, { 4 }, { 4 }, emulate_absl }, { "addl", 0, { 4 }, { 4, 4 }, emulate_addl }, { "addssl", 0, { 4 }, { 4, 4 }, emulate_addssl }, { "addusl", 0, { 4 }, { 4, 4 }, emulate_addusl }, { "andl", 0, { 4 }, { 4, 4 }, emulate_andl }, { "andnl", 0, { 4 }, { 4, 4 }, emulate_andnl }, { "avgsl", 0, { 4 }, { 4, 4 }, emulate_avgsl }, { "avgul", 0, { 4 }, { 4, 4 }, emulate_avgul }, { "cmpeql", 0, { 4 }, { 4, 4 }, emulate_cmpeql }, { "cmpgtsl", 0, { 4 }, { 4, 4 }, emulate_cmpgtsl }, { "copyl", 0, { 4 }, { 4 }, emulate_copyl }, { "loadl", ORC_STATIC_OPCODE_LOAD, { 4 }, { 4 }, emulate_loadl }, { "loadoffl", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR, { 4 }, { 4, 4 }, emulate_loadoffl }, { "loadpl", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR|ORC_STATIC_OPCODE_INVARIANT, { 4 }, { 4 }, emulate_loadpl }, { "maxsl", 0, { 4 }, { 4, 4 }, emulate_maxsl }, { "maxul", 0, { 4 }, { 4, 4 }, emulate_maxul }, { "minsl", 0, { 4 }, { 4, 4 }, emulate_minsl }, { "minul", 0, { 4 }, { 4, 4 }, emulate_minul }, { "mulll", 0, { 4 }, { 4, 4 }, emulate_mulll }, { "mulhsl", 0, { 4 }, { 4, 4 }, emulate_mulhsl }, { "mulhul", 0, { 4 }, { 4, 4 }, emulate_mulhul }, { "orl", 0, { 4 }, { 4, 4 }, emulate_orl }, { "shll", ORC_STATIC_OPCODE_SCALAR, { 4 }, { 4, 4 }, emulate_shll }, { "shrsl", ORC_STATIC_OPCODE_SCALAR, { 4 }, { 4, 4 }, emulate_shrsl }, { "shrul", ORC_STATIC_OPCODE_SCALAR, { 4 }, { 4, 4 }, emulate_shrul }, { "signl", 0, { 4 }, { 4 }, emulate_signl }, { "storel", ORC_STATIC_OPCODE_STORE, { 4 }, { 4 }, emulate_storel }, { "subl", 0, { 4 }, { 4, 4 }, emulate_subl }, { "subssl", 0, { 4 }, { 4, 4 }, emulate_subssl }, { "subusl", 0, { 4 }, { 4, 4 }, emulate_subusl }, { "xorl", 0, { 4 }, { 4, 4 }, emulate_xorl }, { "loadq", ORC_STATIC_OPCODE_LOAD, { 8 }, { 8 }, emulate_loadq }, { "loadpq", ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_SCALAR|ORC_STATIC_OPCODE_INVARIANT, { 8 }, { 8 }, emulate_loadpq }, { "storeq", ORC_STATIC_OPCODE_STORE, { 8 }, { 8 }, emulate_storeq }, { "splatw3q", 0, { 8 }, { 8 }, emulate_splatw3q }, { "copyq", 0, { 8 }, { 8 }, emulate_copyq }, { "cmpeqq", 0, { 8 }, { 8, 8 }, emulate_cmpeqq }, { "cmpgtsq", 0, { 8 }, { 8, 8 }, emulate_cmpgtsq }, { "andq", 0, { 8 }, { 8, 8 }, emulate_andq }, { "andnq", 0, { 8 }, { 8, 8 }, emulate_andnq }, { "orq", 0, { 8 }, { 8, 8 }, emulate_orq }, { "xorq", 0, { 8 }, { 8, 8 }, emulate_xorq }, { "addq", 0, { 8 }, { 8, 8 }, emulate_addq }, { "subq", 0, { 8 }, { 8, 8 }, emulate_subq }, { "shlq", ORC_STATIC_OPCODE_SCALAR, { 8 }, { 8, 8 }, emulate_shlq }, { "shrsq", ORC_STATIC_OPCODE_SCALAR, { 8 }, { 8, 8 }, emulate_shrsq }, { "shruq", ORC_STATIC_OPCODE_SCALAR, { 8 }, { 8, 8 }, emulate_shruq }, { "convsbw", 0, { 2 }, { 1 }, emulate_convsbw }, { "convubw", 0, { 2 }, { 1 }, emulate_convubw }, { "splatbw", 0, { 2 }, { 1 }, emulate_splatbw }, { "splatbl", 0, { 4 }, { 1 }, emulate_splatbl }, { "convswl", 0, { 4 }, { 2 }, emulate_convswl }, { "convuwl", 0, { 4 }, { 2 }, emulate_convuwl }, { "convslq", 0, { 8 }, { 4 }, emulate_convslq }, { "convulq", 0, { 8 }, { 4 }, emulate_convulq }, { "convwb", 0, { 1 }, { 2 }, emulate_convwb }, { "convhwb", 0, { 1 }, { 2 }, emulate_convhwb }, { "convssswb", 0, { 1 }, { 2 }, emulate_convssswb }, { "convsuswb", 0, { 1 }, { 2 }, emulate_convsuswb }, { "convusswb", 0, { 1 }, { 2 }, emulate_convusswb }, { "convuuswb", 0, { 1 }, { 2 }, emulate_convuuswb }, { "convlw", 0, { 2 }, { 4 }, emulate_convlw }, { "convhlw", 0, { 2 }, { 4 }, emulate_convhlw }, { "convssslw", 0, { 2 }, { 4 }, emulate_convssslw }, { "convsuslw", 0, { 2 }, { 4 }, emulate_convsuslw }, { "convusslw", 0, { 2 }, { 4 }, emulate_convusslw }, { "convuuslw", 0, { 2 }, { 4 }, emulate_convuuslw }, { "convql", 0, { 4 }, { 8 }, emulate_convql }, { "convsssql", 0, { 4 }, { 8 }, emulate_convsssql }, { "convsusql", 0, { 4 }, { 8 }, emulate_convsusql }, { "convussql", 0, { 4 }, { 8 }, emulate_convussql }, { "convuusql", 0, { 4 }, { 8 }, emulate_convuusql }, { "mulsbw", 0, { 2 }, { 1, 1 }, emulate_mulsbw }, { "mulubw", 0, { 2 }, { 1, 1 }, emulate_mulubw }, { "mulswl", 0, { 4 }, { 2, 2 }, emulate_mulswl }, { "muluwl", 0, { 4 }, { 2, 2 }, emulate_muluwl }, { "mulslq", 0, { 8 }, { 4, 4 }, emulate_mulslq }, { "mululq", 0, { 8 }, { 4, 4 }, emulate_mululq }, /* accumulators */ { "accw", ORC_STATIC_OPCODE_ACCUMULATOR, { 2 }, { 2 }, emulate_accw }, { "accl", ORC_STATIC_OPCODE_ACCUMULATOR, { 4 }, { 4 }, emulate_accl }, { "accsadubl", ORC_STATIC_OPCODE_ACCUMULATOR, { 4 }, { 1, 1 }, emulate_accsadubl }, { "swapw", 0, { 2 }, { 2 }, emulate_swapw }, { "swapl", 0, { 4 }, { 4 }, emulate_swapl }, { "swapwl", 0, { 4 }, { 4 }, emulate_swapwl }, { "swapq", 0, { 8 }, { 8 }, emulate_swapq }, { "swaplq", 0, { 8 }, { 8 }, emulate_swaplq }, { "select0wb", 0, { 1 }, { 2 }, emulate_select0wb }, { "select1wb", 0, { 1 }, { 2 }, emulate_select1wb }, { "select0lw", 0, { 2 }, { 4 }, emulate_select0lw }, { "select1lw", 0, { 2 }, { 4 }, emulate_select1lw }, { "select0ql", 0, { 4 }, { 8 }, emulate_select0ql }, { "select1ql", 0, { 4 }, { 8 }, emulate_select1ql }, { "mergelq", 0, { 8 }, { 4, 4 }, emulate_mergelq }, { "mergewl", 0, { 4 }, { 2, 2 }, emulate_mergewl }, { "mergebw", 0, { 2 }, { 1, 1 }, emulate_mergebw }, { "splitql", 0, { 4, 4 }, { 8 }, emulate_splitql }, { "splitlw", 0, { 2, 2 }, { 4 }, emulate_splitlw }, { "splitwb", 0, { 1, 1 }, { 2 }, emulate_splitwb }, /* float ops */ { "addf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4, 4 }, emulate_addf }, { "subf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4, 4 }, emulate_subf }, { "mulf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4, 4 }, emulate_mulf }, { "divf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4, 4 }, emulate_divf }, { "sqrtf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4 }, emulate_sqrtf }, { "maxf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4, 4 }, emulate_maxf }, { "minf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 4, 4 }, emulate_minf }, { "cmpeqf", ORC_STATIC_OPCODE_FLOAT_SRC, { 4 }, { 4, 4 }, emulate_cmpeqf }, { "cmpltf", ORC_STATIC_OPCODE_FLOAT_SRC, { 4 }, { 4, 4 }, emulate_cmpltf }, { "cmplef", ORC_STATIC_OPCODE_FLOAT_SRC, { 4 }, { 4, 4 }, emulate_cmplef }, { "convfl", ORC_STATIC_OPCODE_FLOAT_SRC, { 4 }, { 4 }, emulate_convfl }, { "convlf", ORC_STATIC_OPCODE_FLOAT_DEST, { 4 }, { 4 }, emulate_convlf }, /* double ops */ { "addd", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8, 8 }, emulate_addd }, { "subd", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8, 8 }, emulate_subd }, { "muld", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8, 8 }, emulate_muld }, { "divd", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8, 8 }, emulate_divd }, { "sqrtd", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8 }, emulate_sqrtd }, { "maxd", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8, 8 }, emulate_maxd }, { "mind", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 8, 8 }, emulate_mind }, { "cmpeqd", ORC_STATIC_OPCODE_FLOAT_SRC, { 8 }, { 8, 8 }, emulate_cmpeqd }, { "cmpltd", ORC_STATIC_OPCODE_FLOAT_SRC, { 8 }, { 8, 8 }, emulate_cmpltd }, { "cmpled", ORC_STATIC_OPCODE_FLOAT_SRC, { 8 }, { 8, 8 }, emulate_cmpled }, { "convdl", ORC_STATIC_OPCODE_FLOAT_SRC, { 4 }, { 8 }, emulate_convdl }, { "convld", ORC_STATIC_OPCODE_FLOAT_DEST, { 8 }, { 4 }, emulate_convld }, { "convfd", ORC_STATIC_OPCODE_FLOAT, { 8 }, { 4 }, emulate_convfd }, { "convdf", ORC_STATIC_OPCODE_FLOAT, { 4 }, { 8 }, emulate_convdf }, { "" } }; void orc_opcode_init (void) { orc_opcode_register_static (opcodes, "sys"); } orc-0.4.18/orc/orcdebug.c0000664000175000017500000000732312071634360012042 00000000000000/* * ORC - Library of Optimized Inner Loops * Copyright (c) 2003,2004 David A. Schleef * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include /** * SECTION:orcdebug * @title: OrcDebug * @short_description: Printing and formatting debug information */ static void orc_debug_print_valist (int level, const char *file, const char *func, int line, const char *format, va_list args); static int _orc_debug_level = ORC_DEBUG_ERROR; static OrcDebugPrintFunc _orc_debug_print_func = orc_debug_print_valist; void _orc_debug_init(void) { const char *envvar; envvar = getenv ("ORC_DEBUG"); if (envvar != NULL) { char *end = NULL; int level; level = strtol (envvar, &end, 0); if (end > envvar) { _orc_debug_level = level; } } ORC_INFO ("orc-" VERSION " debug init"); } static void orc_debug_print_valist (int level, const char *file, const char *func, int line, const char *format, va_list args) { static const char *level_names[] = { "NONE", "ERROR", "WARNING", "INFO", "DEBUG", "LOG" }; const char *level_name = "unknown"; if (level > _orc_debug_level) return; if(level>=ORC_DEBUG_NONE && level<=ORC_DEBUG_LOG){ level_name = level_names[level]; } fprintf (stderr, "ORC: %s: %s(%d): %s(): ", level_name, file, line, func); vfprintf (stderr, format, args); fprintf (stderr, "\n"); } void orc_debug_print (int level, const char *file, const char *func, int line, const char *format, ...) { va_list var_args; va_start (var_args, format); _orc_debug_print_func (level, file, func, line, format, var_args); va_end (var_args); } /** * orc_debug_get_level: * * Gets the current debug level. * * Returns: the current debug level */ int orc_debug_get_level (void) { return _orc_debug_level; } /** * orc_debug_set_level: * @level: the new debug level * * Sets the current debug level. */ void orc_debug_set_level (int level) { _orc_debug_level = level; } /** * orc_debug_set_print_function: * @func: the function to call * * Sets the function to call when outputting debugging information. * A value of NULL for @func will restore the default handler, * which prints debugging information to stderr. */ void orc_debug_set_print_function (OrcDebugPrintFunc func) { if (func) { _orc_debug_print_func = func; } else { _orc_debug_print_func = orc_debug_print_valist; } } orc-0.4.18/orc/orcmips.h0000664000175000017500000002506512111024531011720 00000000000000/* Copyright 2002 - 2009 David A. Schleef Copyright 2012 MIPS Technologies, Inc. Author: Guillaume Emont 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 _ORC_MIPS_H_ #define _ORC_MIPS_H_ #include #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API typedef enum { ORC_TARGET_MIPS_FRAME_POINTER = (1<<0), } OrcTargetMipsFlags; typedef enum { ORC_MIPS_ZERO = ORC_GP_REG_BASE+0, ORC_MIPS_AT, ORC_MIPS_V0, ORC_MIPS_V1, ORC_MIPS_A0, ORC_MIPS_A1, ORC_MIPS_A2, ORC_MIPS_A3, ORC_MIPS_T0, ORC_MIPS_T1, ORC_MIPS_T2, ORC_MIPS_T3, ORC_MIPS_T4, ORC_MIPS_T5, ORC_MIPS_T6, ORC_MIPS_T7, ORC_MIPS_S0, ORC_MIPS_S1, ORC_MIPS_S2, ORC_MIPS_S3, ORC_MIPS_S4, ORC_MIPS_S5, ORC_MIPS_S6, ORC_MIPS_S7, ORC_MIPS_T8, ORC_MIPS_T9, ORC_MIPS_K0, ORC_MIPS_K1, ORC_MIPS_GP, ORC_MIPS_SP, ORC_MIPS_FP, ORC_MIPS_RA } OrcMipsRegister; void orc_mips_emit_label (OrcCompiler *compiler, unsigned int label); void orc_mips_emit_nop (OrcCompiler *compiler); void orc_mips_emit_sw (OrcCompiler *compiler, OrcMipsRegister reg, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_swr (OrcCompiler *compiler, OrcMipsRegister reg, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_swl (OrcCompiler *compiler, OrcMipsRegister reg, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_sh (OrcCompiler *compiler, OrcMipsRegister reg, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_sb (OrcCompiler *compiler, OrcMipsRegister reg, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_lw (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_lwr (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_lwl (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_lh (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_lb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_lbu (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister base, unsigned int offset); void orc_mips_emit_jr (OrcCompiler *compiler, OrcMipsRegister address_reg); void orc_mips_emit_conditional_branch (OrcCompiler *compiler, int condition, OrcMipsRegister rs, OrcMipsRegister rt, unsigned int label); void orc_mips_emit_conditional_branch_with_offset (OrcCompiler *compiler, int condition, OrcMipsRegister rs, OrcMipsRegister rt, int offset); enum { ORC_MIPS_BEQ = 04, ORC_MIPS_BNE, ORC_MIPS_BLEZ, ORC_MIPS_BGTZ, /* instructions are encoded differently from here on*/ ORC_MIPS_BLTZ, ORC_MIPS_BGEZ, }; #define orc_mips_emit_beqz(compiler, reg, label) \ orc_mips_emit_conditional_branch(compiler, ORC_MIPS_BEQ, reg, ORC_MIPS_ZERO, label) #define orc_mips_emit_bnez(compiler, reg, label) \ orc_mips_emit_conditional_branch(compiler, ORC_MIPS_BNE, reg, ORC_MIPS_ZERO, label) #define orc_mips_emit_blez(compiler, reg, label) \ orc_mips_emit_conditional_branch(compiler, ORC_MIPS_BLEZ, reg, ORC_MIPS_ZERO, label) #define orc_mips_emit_beq(compiler, reg1, reg2, label) \ orc_mips_emit_conditional_branch(compiler, ORC_MIPS_BEQ, reg1, reg2, label) void orc_mips_emit_addiu (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_addi (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_add (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_addu (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_addu_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_addu_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_addq_s_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_adduh_r_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_move (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source); void orc_mips_emit_sub (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_subu_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_subq_s_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_subq_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_subu_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_srl (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_sll (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_sra (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_shll_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_shra_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_shrl_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_andi (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_or (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_and (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_ori (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int value); void orc_mips_emit_lui (OrcCompiler *compiler, OrcMipsRegister dest, int value); void orc_mips_emit_mul (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_mul_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_append (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int shift_amount); void orc_mips_emit_prepend (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source, int shift_amount); void orc_mips_emit_mtlo (OrcCompiler *compiler, OrcMipsRegister source); void orc_mips_emit_extr_s_h (OrcCompiler *compiler, OrcMipsRegister dest, int accumulator, int shift); void orc_mips_emit_slt (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src1, OrcMipsRegister src2); void orc_mips_emit_movn (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src, OrcMipsRegister condition); void orc_mips_emit_repl_ph (OrcCompiler *compiler, OrcMipsRegister dest, int value); void orc_mips_emit_replv_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source); void orc_mips_emit_replv_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source); void orc_mips_emit_preceu_ph_qbr (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source); void orc_mips_emit_precr_qb_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_precrq_qb_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_cmp_lt_ph (OrcCompiler *compiler, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_pick_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_packrl_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2); void orc_mips_emit_align (OrcCompiler *compiler, int align_shift); void orc_mips_emit_wsbh (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source); void orc_mips_emit_seh (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source); void orc_mips_emit_pref (OrcCompiler *compiler, int hint, OrcMipsRegister base, int offset); void orc_mips_do_fixups (OrcCompiler *compiler); /* ORC_STRUCT_OFFSET doesn't work for cross-compiling, so we use that */ #define ORC_MIPS_EXECUTOR_OFFSET_PROGRAM 0 #define ORC_MIPS_EXECUTOR_OFFSET_N 4 #define ORC_MIPS_EXECUTOR_OFFSET_COUNTER1 8 #define ORC_MIPS_EXECUTOR_OFFSET_COUNTER2 12 #define ORC_MIPS_EXECUTOR_OFFSET_COUNTER3 16 #define ORC_MIPS_EXECUTOR_OFFSET_ARRAYS(i) (20 + 4 * i) #define ORC_MIPS_EXECUTOR_OFFSET_PARAMS(i) (276 + 4 * i) #define ORC_MIPS_EXECUTOR_OFFSET_ACCUMULATORS(i) (532 + 4 * i) #endif /* ORC_ENABLE_UNSTABLE_API */ ORC_END_DECLS #endif /* _ORC_MIPS_H_ */ orc-0.4.18/orc/Makefile.am0000664000175000017500000000620512111042360012122 00000000000000 pkgincludedir = $(includedir)/orc-@ORC_MAJORMINOR@/orc lib_LTLIBRARIES = liborc-@ORC_MAJORMINOR@.la liborc_@ORC_MAJORMINOR@_la_LIBADD = $(LIBM) $(LIBRT) $(PTHREAD_LIBS) liborc_@ORC_MAJORMINOR@_la_LDFLAGS = \ -version-info $(ORC_LIBVERSION) \ -no-undefined -export-symbols-regex 'orc_' liborc_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) \ -DORC_ENABLE_UNSTABLE_API liborc_@ORC_MAJORMINOR@_la_SOURCES = \ orc.c \ orcbytecode.c \ orcemulateopcodes.c \ orcexecutor.c \ orcfunctions.c \ orcutils.c \ orcrule.c \ orccodemem.c \ orcprogram.c \ orccompiler.c \ orcprogram-c.c \ orcprogram.h \ orcopcodes.c \ orcparse.c \ orconce.c \ orcdebug.c \ orccode.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 orcx86insn.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 ENABLE_BACKEND_MIPS liborc_@ORC_MAJORMINOR@_la_SOURCES += orcmips.c orcprogram-mips.c orcrules-mips.c endif if HAVE_I386 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-x86.c endif if HAVE_AMD64 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-x86.c endif if HAVE_POWERPC liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-powerpc.c endif if HAVE_ARM liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-arm.c endif pkginclude_HEADERS = \ orc-stdint.h \ orc.h \ orcarm.h \ orcbytecode.h \ orcbytecodes.h \ orccode.h \ orccompiler.h \ orcconstant.h \ orccpu.h \ orccpuinsn.h \ orcdebug.h \ orcemulateopcodes.h \ orcexecutor.h \ orcfunctions.h \ orcinstruction.h \ orcinternal.h \ orclimits.h \ orcmmx.h \ orcneon.h \ orconce.h \ orcopcode.h \ orcparse.h \ orcpowerpc.h \ orcprogram.h \ orcrule.h \ orcsse.h \ orctarget.h \ orcutils.h \ orcvariable.h \ orcx86.h \ orcx86insn.h \ orcmips.h noinst_HEADERS = \ opcodes.h noinst_PROGRAMS = generate-emulation generate-bytecode generate_emulation_LDADD = $(ORC_LIBS) generate_emulation_CFLAGS = $(ORC_CFLAGS) generate_emulation_DEPENDENCIES = liborc-0.4.la generate_bytecode_LDADD = $(ORC_LIBS) generate_bytecode_CFLAGS = $(ORC_CFLAGS) generate_bytecode_DEPENDENCIES = liborc-0.4.la update: generate-emulation generate-bytecode $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o orcfunctions.c orcfunctions.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o orcfunctions.h orcfunctions.orc ./generate-emulation$(EXEEXT) -o orcemulateopcodes.c ./generate-emulation$(EXEEXT) --header -o orcemulateopcodes.h ./generate-bytecode$(EXEEXT) --header -o orcbytecode.h orc-0.4.18/orc/orcrules-mmx.c0000664000175000017500000026276112071634360012716 00000000000000 #include "config.h" #include #include #include #include #include #include #include #define MMX 1 #define SIZE 65536 /* sse rules */ static void mmx_rule_loadpX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int reg; int size = ORC_PTR_TO_INT(user); if (src->vartype == ORC_VAR_TYPE_PARAM) { reg = dest->alloc; if (size == 8 && src->size == 8) { orc_x86_emit_mov_memoffset_mmx (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]]), compiler->exec_reg, reg, FALSE); #ifndef MMX orc_mmx_emit_movhps_load_memoffset (compiler, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]), compiler->exec_reg, reg); orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(2,0,2,0), reg, reg); #else /* FIXME yes, I understand this is terrible */ orc_mmx_emit_pinsrw_memoffset (compiler, 2, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]) + 0, compiler->exec_reg, reg); orc_mmx_emit_pinsrw_memoffset (compiler, 3, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]) + 2, compiler->exec_reg, reg); #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); #endif #endif } else { orc_x86_emit_mov_memoffset_mmx (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]]), compiler->exec_reg, reg, FALSE); if (size < 8) { if (size == 1) { orc_mmx_emit_punpcklbw (compiler, reg, reg); } #ifndef MMX if (size <= 2) { orc_mmx_emit_pshuflw (compiler, 0, reg, reg); } orc_mmx_emit_pshufd (compiler, 0, reg, reg); #else if (size <= 2) { orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(0,0,0,0), reg, reg); } else { orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); } #endif } else { #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); #endif } } } else if (src->vartype == ORC_VAR_TYPE_CONST) { orc_mmx_load_constant (compiler, dest->alloc, size, src->value.i); } else { ORC_ASSERT(0); } } static void mmx_rule_loadX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; offset = compiler->offset * src->size; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); orc_mmx_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 2: orc_mmx_emit_pxor (compiler, dest->alloc, dest->alloc); orc_mmx_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); break; case 4: orc_x86_emit_mov_memoffset_mmx (compiler, 4, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 8: orc_x86_emit_mov_memoffset_mmx (compiler, 8, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 16: orc_x86_emit_mov_memoffset_mmx (compiler, 16, offset, ptr_reg, dest->alloc, src->is_aligned); break; default: orc_compiler_error (compiler, "bad load size %d", src->size << compiler->loop_shift); break; } src->update_type = 2; } static void mmx_rule_loadoffX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; if (compiler->vars[insn->src_args[1]].vartype != ORC_VAR_TYPE_CONST) { orc_compiler_error (compiler, "code generation rule for %s only works with constant offset", insn->opcode->name); return; } offset = (compiler->offset + compiler->vars[insn->src_args[1]].value.i) * src->size; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); orc_mmx_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 2: orc_mmx_emit_pxor (compiler, dest->alloc, dest->alloc); orc_mmx_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); break; case 4: orc_x86_emit_mov_memoffset_mmx (compiler, 4, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 8: orc_x86_emit_mov_memoffset_mmx (compiler, 8, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 16: orc_x86_emit_mov_memoffset_mmx (compiler, 16, offset, ptr_reg, dest->alloc, src->is_aligned); break; default: orc_compiler_error (compiler,"bad load size %d", src->size << compiler->loop_shift); break; } src->update_type = 2; } static void mmx_rule_loadupib (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; int tmp = orc_compiler_get_temp_reg (compiler); offset = (compiler->offset * src->size) >> 1; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: case 2: orc_mmx_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); orc_mmx_emit_movq (compiler, dest->alloc, tmp); orc_mmx_emit_psrlw_imm (compiler, 8, tmp); break; case 4: orc_mmx_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); orc_mmx_emit_pinsrw_memoffset (compiler, 0, offset + 1, ptr_reg, tmp); break; case 8: orc_x86_emit_mov_memoffset_mmx (compiler, 4, offset, ptr_reg, dest->alloc, FALSE); orc_x86_emit_mov_memoffset_mmx (compiler, 4, offset + 1, ptr_reg, tmp, FALSE); break; case 16: orc_x86_emit_mov_memoffset_mmx (compiler, 8, offset, ptr_reg, dest->alloc, FALSE); orc_x86_emit_mov_memoffset_mmx (compiler, 8, offset + 1, ptr_reg, tmp, FALSE); break; case 32: orc_x86_emit_mov_memoffset_mmx (compiler, 16, offset, ptr_reg, dest->alloc, FALSE); orc_x86_emit_mov_memoffset_mmx (compiler, 16, offset + 1, ptr_reg, tmp, FALSE); break; default: orc_compiler_error(compiler,"bad load size %d", src->size << compiler->loop_shift); break; } orc_mmx_emit_pavgb (compiler, dest->alloc, tmp); orc_mmx_emit_punpcklbw (compiler, tmp, dest->alloc); src->update_type = 1; } static void mmx_rule_loadupdb (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int ptr_reg; int offset = 0; offset = (compiler->offset * src->size) >> 1; if (src->ptr_register == 0) { int i = insn->src_args[0]; orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = src->ptr_register; } switch (src->size << compiler->loop_shift) { case 1: case 2: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); orc_mmx_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 4: orc_mmx_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); break; case 8: orc_x86_emit_mov_memoffset_mmx (compiler, 4, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 16: orc_x86_emit_mov_memoffset_mmx (compiler, 8, offset, ptr_reg, dest->alloc, src->is_aligned); break; case 32: orc_x86_emit_mov_memoffset_mmx (compiler, 16, offset, ptr_reg, dest->alloc, src->is_aligned); break; default: orc_compiler_error(compiler,"bad load size %d", src->size << compiler->loop_shift); break; } switch (src->size) { case 1: orc_mmx_emit_punpcklbw (compiler, dest->alloc, dest->alloc); break; case 2: orc_mmx_emit_punpcklwd (compiler, dest->alloc, dest->alloc); break; case 4: orc_mmx_emit_punpckldq (compiler, dest->alloc, dest->alloc); break; } src->update_type = 1; } static void mmx_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int offset; int ptr_reg; offset = compiler->offset * dest->size; if (dest->ptr_register == 0) { orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, dest->ptr_offset, compiler->exec_reg, compiler->gp_tmpreg); ptr_reg = compiler->gp_tmpreg; } else { ptr_reg = dest->ptr_register; } switch (dest->size << compiler->loop_shift) { case 1: /* FIXME we might be using ecx twice here */ if (ptr_reg == compiler->gp_tmpreg) { orc_compiler_error (compiler, "unimplemented corner case in %s", insn->opcode->name); } orc_mmx_emit_movd_store_register (compiler, src->alloc, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 1, compiler->gp_tmpreg, offset, ptr_reg); break; case 2: if (compiler->target_flags & ORC_TARGET_MMX_SSE4_1) { orc_mmx_emit_pextrw_memoffset (compiler, 0, offset, src->alloc, ptr_reg); } else { /* FIXME we might be using ecx twice here */ if (ptr_reg == compiler->gp_tmpreg) { orc_compiler_error(compiler, "unimplemented corner case in %s", insn->opcode->name); } orc_mmx_emit_movd_store_register (compiler, src->alloc, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 2, compiler->gp_tmpreg, offset, ptr_reg); } break; case 4: orc_x86_emit_mov_mmx_memoffset (compiler, 4, src->alloc, offset, ptr_reg, dest->is_aligned, dest->is_uncached); break; case 8: orc_x86_emit_mov_mmx_memoffset (compiler, 8, src->alloc, offset, ptr_reg, dest->is_aligned, dest->is_uncached); break; case 16: orc_x86_emit_mov_mmx_memoffset (compiler, 16, src->alloc, offset, ptr_reg, dest->is_aligned, dest->is_uncached); break; default: orc_compiler_error (compiler, "bad size"); break; } dest->update_type = 2; } #if try1 static void mmx_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int tmp2 = orc_compiler_get_temp_reg (compiler); int tmpc; orc_mmx_emit_movd_store_register (compiler, X86_MM6, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_mmx_emit_movdqu_load_memindex (compiler, 0, src->ptr_register, compiler->gp_tmpreg, 4, dest->alloc); #if 0 orc_mmx_emit_movq (compiler, X86_MM6, tmp); orc_mmx_emit_pslld_imm (compiler, 10, tmp); orc_mmx_emit_psrld_imm (compiler, 26, tmp); orc_mmx_emit_pslld_imm (compiler, 2, tmp); orc_mmx_emit_movq (compiler, tmp, tmp2); orc_mmx_emit_pslld_imm (compiler, 8, tmp2); orc_mmx_emit_por (compiler, tmp2, tmp); orc_mmx_emit_movq (compiler, tmp, tmp2); orc_mmx_emit_pslld_imm (compiler, 16, tmp2); orc_mmx_emit_por (compiler, tmp2, tmp); #else orc_mmx_emit_movq (compiler, X86_MM6, tmp); tmpc = orc_compiler_get_constant_long (compiler, 0x02020202, 0x06060606, 0x0a0a0a0a, 0x0e0e0e0e); orc_mmx_emit_pshufb (compiler, tmpc, tmp); orc_mmx_emit_paddb (compiler, tmp, tmp); orc_mmx_emit_paddb (compiler, tmp, tmp); #endif orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(0,0,0,0), tmp, tmp2); orc_mmx_emit_psubd (compiler, tmp2, tmp); tmpc = orc_compiler_get_constant (compiler, 4, 0x03020100); orc_mmx_emit_paddd (compiler, tmpc, tmp); orc_mmx_emit_pshufb (compiler, tmp, dest->alloc); orc_mmx_emit_movq (compiler, X86_MM7, tmp); orc_mmx_emit_pslld_imm (compiler, compiler->loop_shift, tmp); orc_mmx_emit_paddd (compiler, tmp, X86_MM6); src->update_type = 0; } #endif static void mmx_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; int increment_var = insn->src_args[2]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int i; for(i=0;i<(1<loop_shift);i++){ if (i == 0) { orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, dest->alloc, FALSE); } else { orc_x86_emit_mov_memindex_mmx (compiler, 4, 0, src->ptr_register, compiler->gp_tmpreg, 2, tmp, FALSE); #ifdef MMX //orc_mmx_emit_punpckldq (compiler, tmp, dest->alloc); orc_mmx_emit_psllq_imm (compiler, 8*4*i, tmp); orc_mmx_emit_por (compiler, tmp, dest->alloc); #else orc_mmx_emit_pslldq_imm (compiler, 4*i, tmp); orc_mmx_emit_por (compiler, tmp, dest->alloc); #endif } if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, 4, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); } orc_x86_emit_add_reg_reg_shift (compiler, compiler->is_64bit ? 8 : 4, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); src->update_type = 0; } #ifndef MMX static void mmx_rule_ldreslinl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; int increment_var = insn->src_args[2]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int tmp2 = orc_compiler_get_temp_reg (compiler); int regsize = compiler->is_64bit ? 8 : 4; int i; if (compiler->loop_shift == 0) { orc_x86_emit_mov_memoffset_mmx (compiler, 8, 0, src->ptr_register, tmp, FALSE); orc_mmx_emit_pxor (compiler, tmp2, tmp2); orc_mmx_emit_punpcklbw (compiler, tmp2, tmp); orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(3,2,3,2), tmp, tmp2); orc_mmx_emit_psubw (compiler, tmp, tmp2); orc_mmx_emit_movd_load_register (compiler, src->ptr_offset, tmp); orc_mmx_emit_pshuflw (compiler, ORC_MMX_SHUF(0,0,0,0), tmp, tmp); orc_mmx_emit_psrlw_imm (compiler, 8, tmp); orc_mmx_emit_pmullw (compiler, tmp2, tmp); orc_mmx_emit_psraw_imm (compiler, 8, tmp); orc_mmx_emit_pxor (compiler, tmp2, tmp2); orc_mmx_emit_packsswb (compiler, tmp2, tmp); orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, dest->alloc, FALSE); orc_mmx_emit_paddb (compiler, tmp, dest->alloc); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, regsize, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_add_reg_reg_shift (compiler, regsize, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); } else { int tmp3 = orc_compiler_get_temp_reg (compiler); int tmp4 = orc_compiler_get_temp_reg (compiler); for(i=0;i<(1<loop_shift);i+=2){ orc_x86_emit_mov_memoffset_mmx (compiler, 8, 0, src->ptr_register, tmp, FALSE); orc_mmx_emit_movd_load_register (compiler, src->ptr_offset, tmp4); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, 4, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_mov_memindex_mmx (compiler, 8, 0, src->ptr_register, compiler->gp_tmpreg, 2, tmp2, FALSE); orc_mmx_emit_punpckldq (compiler, tmp2, tmp); orc_mmx_emit_movq (compiler, tmp, tmp2); if (i == 0) { orc_mmx_emit_movq (compiler, tmp, dest->alloc); } else { orc_mmx_emit_punpcklqdq (compiler, tmp, dest->alloc); } orc_mmx_emit_pxor (compiler, tmp3, tmp3); orc_mmx_emit_punpcklbw (compiler, tmp3, tmp); orc_mmx_emit_punpckhbw (compiler, tmp3, tmp2); orc_mmx_emit_psubw (compiler, tmp, tmp2); orc_mmx_emit_pinsrw_register (compiler, 1, src->ptr_offset, tmp4); #if 0 orc_mmx_emit_punpcklwd (compiler, tmp4, tmp4); orc_mmx_emit_punpckldq (compiler, tmp4, tmp4); #else orc_mmx_emit_pshuflw (compiler, ORC_MMX_SHUF(1,1,0,0), tmp4, tmp4); orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(1,1,0,0), tmp4, tmp4); #endif orc_mmx_emit_psrlw_imm (compiler, 8, tmp4); orc_mmx_emit_pmullw (compiler, tmp4, tmp2); orc_mmx_emit_psraw_imm (compiler, 8, tmp2); orc_mmx_emit_pxor (compiler, tmp, tmp); orc_mmx_emit_packsswb (compiler, tmp, tmp2); if (i != 0) { orc_mmx_emit_pslldq_imm (compiler, 8, tmp2); } orc_mmx_emit_paddb (compiler, tmp2, dest->alloc); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, 4, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_add_reg_reg_shift (compiler, 8, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); } } src->update_type = 0; } #else static void mmx_rule_ldreslinl (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; int increment_var = insn->src_args[2]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int tmp = orc_compiler_get_temp_reg (compiler); int tmp2 = orc_compiler_get_temp_reg (compiler); int zero; int regsize = compiler->is_64bit ? 8 : 4; int i; zero = orc_compiler_get_constant (compiler, 1, 0); for(i=0;i<(1<loop_shift);i++){ orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, tmp, FALSE); orc_x86_emit_mov_memoffset_mmx (compiler, 4, 4, src->ptr_register, tmp2, FALSE); orc_mmx_emit_punpcklbw (compiler, zero, tmp); orc_mmx_emit_punpcklbw (compiler, zero, tmp2); orc_mmx_emit_psubw (compiler, tmp, tmp2); orc_mmx_emit_movd_load_register (compiler, src->ptr_offset, tmp); orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(0,0,0,0), tmp, tmp); orc_mmx_emit_psrlw_imm (compiler, 8, tmp); orc_mmx_emit_pmullw (compiler, tmp2, tmp); orc_mmx_emit_psraw_imm (compiler, 8, tmp); orc_mmx_emit_pxor (compiler, tmp2, tmp2); orc_mmx_emit_packsswb (compiler, tmp2, tmp); if (i == 0) { orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, dest->alloc, FALSE); orc_mmx_emit_paddb (compiler, tmp, dest->alloc); } else { orc_x86_emit_mov_memoffset_mmx (compiler, 4, 0, src->ptr_register, tmp2, FALSE); orc_mmx_emit_paddb (compiler, tmp, tmp2); orc_mmx_emit_psllq_imm (compiler, 32, tmp2); orc_mmx_emit_por (compiler, tmp2, dest->alloc); } if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[increment_var]), compiler->exec_reg, src->ptr_offset); } else { orc_x86_emit_add_imm_reg (compiler, regsize, compiler->vars[increment_var].value.i, src->ptr_offset, FALSE); } orc_x86_emit_mov_reg_reg (compiler, 4, src->ptr_offset, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_x86_emit_add_reg_reg_shift (compiler, regsize, compiler->gp_tmpreg, src->ptr_register, 2); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, src->ptr_offset); } src->update_type = 0; } #endif static void mmx_rule_copyx (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->vars[insn->src_args[0]].alloc == p->vars[insn->dest_args[0]].alloc) { return; } orc_mmx_emit_movq (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } #define UNARY(opcode,insn_name,code) \ static void \ mmx_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } #define BINARY(opcode,insn_name,code) \ static void \ mmx_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[1]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } UNARY(absb,pabsb,0x381c) BINARY(addb,paddb,0xfc) BINARY(addssb,paddsb,0xec) BINARY(addusb,paddusb,0xdc) BINARY(andb,pand,0xdb) BINARY(andnb,pandn,0xdf) BINARY(avgub,pavgb,0xe0) BINARY(cmpeqb,pcmpeqb,0x74) BINARY(cmpgtsb,pcmpgtb,0x64) BINARY(maxsb,pmaxsb,0x383c) BINARY(maxub,pmaxub,0xde) BINARY(minsb,pminsb,0x3838) BINARY(minub,pminub,0xda) //BINARY(mullb,pmullb,0xd5) //BINARY(mulhsb,pmulhb,0xe5) //BINARY(mulhub,pmulhub,0xe4) BINARY(orb,por,0xeb) //UNARY(signb,psignb,0x3808) BINARY(subb,psubb,0xf8) BINARY(subssb,psubsb,0xe8) BINARY(subusb,psubusb,0xd8) BINARY(xorb,pxor,0xef) UNARY(absw,pabsw,0x381d) BINARY(addw,paddw,0xfd) BINARY(addssw,paddsw,0xed) BINARY(addusw,paddusw,0xdd) BINARY(andw,pand,0xdb) BINARY(andnw,pandn,0xdf) BINARY(avguw,pavgw,0xe3) BINARY(cmpeqw,pcmpeqw,0x75) BINARY(cmpgtsw,pcmpgtw,0x65) BINARY(maxsw,pmaxsw,0xee) BINARY(maxuw,pmaxuw,0x383e) BINARY(minsw,pminsw,0xea) BINARY(minuw,pminuw,0x383a) BINARY(mullw,pmullw,0xd5) BINARY(mulhsw,pmulhw,0xe5) BINARY(mulhuw,pmulhuw,0xe4) BINARY(orw,por,0xeb) //UNARY(signw,psignw,0x3809) BINARY(subw,psubw,0xf9) BINARY(subssw,psubsw,0xe9) BINARY(subusw,psubusw,0xd9) BINARY(xorw,pxor,0xef) UNARY(absl,pabsd,0x381e) BINARY(addl,paddd,0xfe) //BINARY(addssl,paddsd,0xed) //BINARY(addusl,paddusd,0xdd) BINARY(andl,pand,0xdb) BINARY(andnl,pandn,0xdf) //BINARY(avgul,pavgd,0xe3) BINARY(cmpeql,pcmpeqd,0x76) BINARY(cmpgtsl,pcmpgtd,0x66) BINARY(maxsl,pmaxsd,0x383d) BINARY(maxul,pmaxud,0x383f) BINARY(minsl,pminsd,0x3839) BINARY(minul,pminud,0x383b) BINARY(mulll,pmulld,0x3840) //BINARY(mulhsl,pmulhd,0xe5) //BINARY(mulhul,pmulhud,0xe4) BINARY(orl,por,0xeb) //UNARY(signl,psignd,0x380a) BINARY(subl,psubd,0xfa) //BINARY(subssl,psubsd,0xe9) //BINARY(subusl,psubusd,0xd9) BINARY(xorl,pxor,0xef) BINARY(andq,pand,0xdb) BINARY(andnq,pandn,0xdf) BINARY(orq,por,0xeb) BINARY(xorq,pxor,0xef) BINARY(cmpeqq,pcmpeqq,0x3829) BINARY(cmpgtsq,pcmpgtq,0x3837) #ifndef MMX BINARY(addq,paddq,0xd4) BINARY(subq,psubq,0xfb) #endif static void mmx_rule_accw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_paddw (p, src, dest); } static void mmx_rule_accl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX if (p->loop_shift == 0) { orc_mmx_emit_pslldq_imm (p, 12, src); } #endif orc_mmx_emit_paddd (p, src, dest); } static void mmx_rule_accsadubl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = p->vars[insn->src_args[0]].alloc; int src2 = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); #ifndef MMX if (p->loop_shift <= 2) { orc_mmx_emit_movq (p, src1, tmp); orc_mmx_emit_pslldq_imm (p, 16 - (1<loop_shift), tmp); orc_mmx_emit_movq (p, src2, tmp2); orc_mmx_emit_pslldq_imm (p, 16 - (1<loop_shift), tmp2); orc_mmx_emit_psadbw (p, tmp2, tmp); } else if (p->loop_shift == 3) { orc_mmx_emit_movq (p, src1, tmp); orc_mmx_emit_psadbw (p, src2, tmp); orc_mmx_emit_pslldq_imm (p, 8, tmp); } else { orc_mmx_emit_movq (p, src1, tmp); orc_mmx_emit_psadbw (p, src2, tmp); } #else if (p->loop_shift <= 2) { orc_mmx_emit_movq (p, src1, tmp); orc_mmx_emit_psllq_imm (p, 8*(8 - (1<loop_shift)), tmp); orc_mmx_emit_movq (p, src2, tmp2); orc_mmx_emit_psllq_imm (p, 8*(8 - (1<loop_shift)), tmp2); orc_mmx_emit_psadbw (p, tmp2, tmp); } else { orc_mmx_emit_movq (p, src1, tmp); orc_mmx_emit_psadbw (p, src2, tmp); } #endif orc_mmx_emit_paddd (p, tmp, dest); } #ifndef MMX static void mmx_rule_signX_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int opcodes[] = { ORC_X86_psignb, ORC_X86_psignw, ORC_X86_psignd }; int type = ORC_PTR_TO_INT(user); int tmpc; tmpc = orc_compiler_get_temp_constant (p, 1<vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 2, 0x0001); orc_mmx_emit_pminsw (p, tmp, dest); tmp = orc_compiler_get_constant (p, 2, 0xffff); orc_mmx_emit_pmaxsw (p, tmp, dest); } static void mmx_rule_absb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_pxor (p, tmp, tmp); orc_mmx_emit_pcmpgtb (p, src, tmp); orc_mmx_emit_pxor (p, tmp, dest); orc_mmx_emit_psubb (p, tmp, dest); } static void mmx_rule_absw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (src == dest) { orc_mmx_emit_movq (p, src, tmp); } else { orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_movq (p, tmp, dest); } orc_mmx_emit_psraw_imm (p, 15, tmp); orc_mmx_emit_pxor (p, tmp, dest); orc_mmx_emit_psubw (p, tmp, dest); } static void mmx_rule_absl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (src == dest) { orc_mmx_emit_movq (p, src, tmp); } else { orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_movq (p, tmp, dest); } orc_mmx_emit_psrad_imm (p, 31, tmp); orc_mmx_emit_pxor (p, tmp, dest); orc_mmx_emit_psubd (p, tmp, dest); } static void mmx_rule_shift (OrcCompiler *p, void *user, OrcInstruction *insn) { int type = ORC_PTR_TO_INT(user); //int imm_code1[] = { 0x71, 0x71, 0x71, 0x72, 0x72, 0x72, 0x73, 0x73 }; //int imm_code2[] = { 6, 2, 4, 6, 2, 4, 6, 2 }; //int reg_code[] = { 0xf1, 0xd1, 0xe1, 0xf2, 0xd2, 0xe2, 0xf3, 0xd3 }; //const char *code[] = { "psllw", "psrlw", "psraw", "pslld", "psrld", "psrad", "psllq", "psrlq" }; const int opcodes[] = { ORC_X86_psllw, ORC_X86_psrlw, ORC_X86_psraw, ORC_X86_pslld, ORC_X86_psrld, ORC_X86_psrad, ORC_X86_psllq, ORC_X86_psrlq }; const int opcodes_imm[] = { ORC_X86_psllw_imm, ORC_X86_psrlw_imm, ORC_X86_psraw_imm, ORC_X86_pslld_imm, ORC_X86_psrld_imm, ORC_X86_psrad_imm, ORC_X86_psllq_imm, ORC_X86_psrlq_imm }; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_x86_emit_cpuinsn_imm (p, opcodes_imm[type], p->vars[insn->src_args[1]].value.i, 16, p->vars[insn->dest_args[0]].alloc); } else if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { int tmp = orc_compiler_get_temp_reg (p); /* FIXME this is a gross hack to reload the register with a * 64-bit version of the parameter. */ orc_x86_emit_mov_memoffset_mmx (p, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[1]]), p->exec_reg, tmp, FALSE); orc_x86_emit_cpuinsn_size (p, opcodes[type], 16, tmp, p->vars[insn->dest_args[0]].alloc); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant or parameter shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void mmx_rule_shlb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_mmx_emit_psllw_imm (p, p->vars[insn->src_args[1]].value.i, dest); tmp = orc_compiler_get_constant (p, 1, 0xff&(0xff<vars[insn->src_args[1]].value.i)); orc_mmx_emit_pand (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void mmx_rule_shrsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_psraw_imm (p, p->vars[insn->src_args[1]].value.i, tmp); orc_mmx_emit_psrlw_imm (p, 8, tmp); orc_mmx_emit_psraw_imm (p, 8 + p->vars[insn->src_args[1]].value.i, dest); orc_mmx_emit_psllw_imm (p, 8, dest); orc_mmx_emit_por (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void mmx_rule_shrub (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { orc_mmx_emit_psrlw_imm (p, p->vars[insn->src_args[1]].value.i, dest); tmp = orc_compiler_get_constant (p, 1, (0xff>>p->vars[insn->src_args[1]].value.i)); orc_mmx_emit_pand (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void mmx_rule_shrsq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { #ifndef MMX orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(3,3,1,1), src, tmp); #else orc_mmx_emit_pshufw (p, ORC_MMX_SHUF(3,2,3,2), src, tmp); #endif orc_mmx_emit_psrad_imm (p, 31, tmp); orc_mmx_emit_psllq_imm (p, 64-p->vars[insn->src_args[1]].value.i, tmp); orc_mmx_emit_psrlq_imm (p, p->vars[insn->src_args[1]].value.i, dest); orc_mmx_emit_por (p, tmp, dest); } else { orc_compiler_error (p, "code generation rule for %s only works with " "constant shifts", insn->opcode->name); p->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } } static void mmx_rule_convsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpcklbw (p, src, dest); orc_mmx_emit_psraw_imm (p, 8, dest); } static void mmx_rule_convubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* FIXME need a zero register */ if (0) { orc_mmx_emit_punpcklbw (p, src, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); } else { orc_mmx_emit_pxor(p, tmp, tmp); orc_mmx_emit_punpcklbw (p, tmp, dest); } } static void mmx_rule_convssswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_packsswb (p, src, dest); } static void mmx_rule_convsuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_packuswb (p, src, dest); } static void mmx_rule_convuuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_movq (p, src, dest); orc_mmx_emit_psrlw_imm (p, 15, tmp); orc_mmx_emit_psllw_imm (p, 14, tmp); orc_mmx_emit_por (p, tmp, dest); orc_mmx_emit_psllw_imm (p, 1, tmp); orc_mmx_emit_pxor (p, tmp, dest); orc_mmx_emit_packuswb (p, dest, dest); } static void mmx_rule_convwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_psllw_imm (p, 8, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_packuswb (p, dest, dest); } static void mmx_rule_convhwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_packuswb (p, dest, dest); } static void mmx_rule_convswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpcklwd (p, src, dest); orc_mmx_emit_psrad_imm (p, 16, dest); } static void mmx_rule_convuwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* FIXME need a zero register */ if (0) { orc_mmx_emit_punpcklwd (p, src, dest); orc_mmx_emit_psrld_imm (p, 16, dest); } else { orc_mmx_emit_pxor(p, tmp, tmp); orc_mmx_emit_punpcklwd (p, tmp, dest); } } static void mmx_rule_convlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_pslld_imm (p, 16, dest); orc_mmx_emit_psrad_imm (p, 16, dest); orc_mmx_emit_packssdw (p, dest, dest); } static void mmx_rule_convhlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_psrad_imm (p, 16, dest); orc_mmx_emit_packssdw (p, dest, dest); } static void mmx_rule_convssslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_packssdw (p, src, dest); } static void mmx_rule_convsuslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_packusdw (p, src, dest); } static void mmx_rule_convslq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_psrad_imm (p, 31, tmp); orc_mmx_emit_punpckldq (p, tmp, dest); } static void mmx_rule_convulq (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 4, 0); orc_mmx_emit_punpckldq (p, tmp, dest); } static void mmx_rule_convql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,2,0), src, dest); #else orc_mmx_emit_movq (p, src, dest); #endif } static void mmx_rule_splatw3q (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX orc_mmx_emit_pshuflw (p, ORC_MMX_SHUF(3,3,3,3), dest, dest); orc_mmx_emit_pshufhw (p, ORC_MMX_SHUF(3,3,3,3), dest, dest); #else orc_mmx_emit_pshufw (p, ORC_MMX_SHUF(3,3,3,3), dest, dest); #endif } static void mmx_rule_splatbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpcklbw (p, dest, dest); } static void mmx_rule_splatbl (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpcklbw (p, dest, dest); orc_mmx_emit_punpcklwd (p, dest, dest); } static void mmx_rule_div255w (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmpc; tmpc = orc_compiler_get_constant (p, 2, 0x0080); orc_mmx_emit_paddw (p, tmpc, dest); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_psrlw_imm (p, 8, tmp); orc_mmx_emit_paddw (p, tmp, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); } #if 1 static void mmx_rule_divluw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* About 5.2 cycles per array member on ginger */ int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int a = orc_compiler_get_temp_reg (p); int j = orc_compiler_get_temp_reg (p); int j2 = orc_compiler_get_temp_reg (p); int l = orc_compiler_get_temp_reg (p); int divisor = orc_compiler_get_temp_reg (p); int tmp; int i; orc_mmx_emit_movq (p, src, divisor); orc_mmx_emit_psllw_imm (p, 8, divisor); orc_mmx_emit_psrlw_imm (p, 1, divisor); orc_mmx_load_constant (p, a, 2, 0x00ff); tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_mmx_emit_movq (p, tmp, j); orc_mmx_emit_psrlw_imm (p, 8, j); orc_mmx_emit_pxor (p, tmp, dest); for(i=0;i<7;i++){ orc_mmx_emit_movq (p, divisor, l); orc_mmx_emit_pxor (p, tmp, l); orc_mmx_emit_pcmpgtw (p, dest, l); orc_mmx_emit_movq (p, l, j2); orc_mmx_emit_pandn (p, divisor, l); orc_mmx_emit_psubw (p, l, dest); orc_mmx_emit_psrlw_imm (p, 1, divisor); orc_mmx_emit_pand (p, j, j2); orc_mmx_emit_pxor (p, j2, a); orc_mmx_emit_psrlw_imm (p, 1, j); } orc_mmx_emit_movq (p, divisor, l); orc_mmx_emit_pxor (p, tmp, l); orc_mmx_emit_pcmpgtw (p, dest, l); orc_mmx_emit_pand (p, j, l); orc_mmx_emit_pxor (p, l, a); orc_mmx_emit_movq (p, a, dest); } #else static void mmx_rule_divluw (OrcCompiler *p, void *user, OrcInstruction *insn) { /* About 8.4 cycles per array member on ginger */ int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int b = orc_compiler_get_temp_reg (p); int a = orc_compiler_get_temp_reg (p); int k = orc_compiler_get_temp_reg (p); int j = orc_compiler_get_temp_reg (p); int tmp; int i; orc_mmx_emit_movq (p, dest, b); tmp = orc_compiler_get_constant (p, 2, 0x00ff); orc_mmx_emit_pand (p, tmp, src); tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_mmx_emit_pxor (p, tmp, b); orc_mmx_emit_pxor (p, a, a); orc_mmx_emit_movq (p, tmp, j); orc_mmx_emit_psrlw_imm (p, 8, j); for(i=0;i<8;i++){ orc_mmx_emit_por (p, j, a); orc_mmx_emit_movq (p, a, k); orc_mmx_emit_pmullw (p, src, k); orc_mmx_emit_pxor (p, tmp, k); orc_mmx_emit_pcmpgtw (p, b, k); orc_mmx_emit_pand (p, j, k); orc_mmx_emit_pxor (p, k, a); orc_mmx_emit_psrlw_imm (p, 1, j); } orc_mmx_emit_movq (p, a, dest); } #endif static void mmx_rule_mulsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_punpcklbw (p, src, tmp); orc_mmx_emit_psraw_imm (p, 8, tmp); orc_mmx_emit_punpcklbw (p, dest, dest); orc_mmx_emit_psraw_imm (p, 8, dest); orc_mmx_emit_pmullw (p, tmp, dest); } static void mmx_rule_mulubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_punpcklbw (p, src, tmp); orc_mmx_emit_psrlw_imm (p, 8, tmp); orc_mmx_emit_punpcklbw (p, dest, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_pmullw (p, tmp, dest); } static void mmx_rule_mullb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pmullw (p, src, dest); orc_mmx_emit_psllw_imm (p, 8, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_movq (p, src, tmp2); orc_mmx_emit_psraw_imm (p, 8, tmp2); orc_mmx_emit_psraw_imm (p, 8, tmp); orc_mmx_emit_pmullw (p, tmp2, tmp); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_mulhsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_movq (p, dest, tmp2); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_psraw_imm (p, 8, tmp); orc_mmx_emit_psllw_imm (p, 8, dest); orc_mmx_emit_psraw_imm (p, 8, dest); orc_mmx_emit_pmullw (p, tmp, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_psraw_imm (p, 8, tmp); orc_mmx_emit_psraw_imm (p, 8, tmp2); orc_mmx_emit_pmullw (p, tmp, tmp2); orc_mmx_emit_psrlw_imm (p, 8, tmp2); orc_mmx_emit_psllw_imm (p, 8, tmp2); orc_mmx_emit_por (p, tmp2, dest); } static void mmx_rule_mulhub (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_movq (p, dest, tmp2); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_psrlw_imm (p, 8, tmp); orc_mmx_emit_psllw_imm (p, 8, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_pmullw (p, tmp, dest); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_psrlw_imm (p, 8, tmp); orc_mmx_emit_psrlw_imm (p, 8, tmp2); orc_mmx_emit_pmullw (p, tmp, tmp2); orc_mmx_emit_psrlw_imm (p, 8, tmp2); orc_mmx_emit_psllw_imm (p, 8, tmp2); orc_mmx_emit_por (p, tmp2, dest); } static void mmx_rule_mulswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pmulhw (p, src, tmp); orc_mmx_emit_pmullw (p, src, dest); orc_mmx_emit_punpcklwd (p, tmp, dest); } static void mmx_rule_muluwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pmulhuw (p, src, tmp); orc_mmx_emit_pmullw (p, src, dest); orc_mmx_emit_punpcklwd (p, tmp, dest); } static void mmx_rule_mulll_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); orc_x86_emit_mov_mmx_memoffset (p, 16, p->vars[insn->src_args[0]].alloc, offset, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_mmx_memoffset (p, 16, p->vars[insn->src_args[1]].alloc, offset + 16, p->exec_reg, FALSE, FALSE); for(i=0;i<(1<insn_shift);i++) { orc_x86_emit_mov_memoffset_reg (p, 4, offset + 4*i, p->exec_reg, p->gp_tmpreg); orc_x86_emit_imul_memoffset_reg (p, 4, offset + 16+4*i, p->exec_reg, p->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (p, 4, p->gp_tmpreg, offset + 4*i, p->exec_reg); } orc_x86_emit_mov_memoffset_mmx (p, 16, offset, p->exec_reg, p->vars[insn->dest_args[0]].alloc, FALSE); } #ifndef MMX static void mmx_rule_mulhsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,3,0,1), dest, tmp); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,3,0,1), src, tmp2); orc_mmx_emit_pmuldq (p, src, dest); orc_mmx_emit_pmuldq (p, tmp, tmp2); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,3,1), dest, dest); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,3,1), tmp2, tmp2); orc_mmx_emit_punpckldq (p, tmp2, dest); } #endif #ifndef MMX static void mmx_rule_mulhsl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; int regsize = p->is_64bit ? 8 : 4; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); orc_x86_emit_mov_mmx_memoffset (p, 16, p->vars[insn->src_args[0]].alloc, offset, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_mmx_memoffset (p, 16, p->vars[insn->src_args[1]].alloc, offset + 16, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EAX, offset + 32, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EDX, offset + 40, p->exec_reg); for(i=0;i<(1<insn_shift);i++) { orc_x86_emit_mov_memoffset_reg (p, 4, offset + 4*i, p->exec_reg, X86_EAX); orc_x86_emit_cpuinsn_memoffset (p, ORC_X86_imul_rm, 4, offset + 16 + 4*i, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, 4, X86_EDX, offset + 4*i, p->exec_reg); } orc_x86_emit_mov_memoffset_mmx (p, 16, offset, p->exec_reg, p->vars[insn->dest_args[0]].alloc, FALSE); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 32, p->exec_reg, X86_EAX); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 40, p->exec_reg, X86_EDX); } #endif #ifndef MMX static void mmx_rule_mulhul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,3,0,1), dest, tmp); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,3,0,1), src, tmp2); orc_mmx_emit_pmuludq (p, src, dest); orc_mmx_emit_pmuludq (p, tmp, tmp2); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,3,1), dest, dest); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,3,1), tmp2, tmp2); orc_mmx_emit_punpckldq (p, tmp2, dest); } #endif static void mmx_rule_mulslq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_punpckldq (p, dest, dest); orc_mmx_emit_punpckldq (p, tmp, tmp); orc_mmx_emit_pmuldq (p, tmp, dest); } #ifndef MMX static void mmx_rule_mulslq_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; int regsize = p->is_64bit ? 8 : 4; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); orc_x86_emit_mov_mmx_memoffset (p, 8, p->vars[insn->src_args[0]].alloc, offset, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_mmx_memoffset (p, 8, p->vars[insn->src_args[1]].alloc, offset + 8, p->exec_reg, FALSE, FALSE); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EAX, offset + 32, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, regsize, X86_EDX, offset + 40, p->exec_reg); for(i=0;i<(1<insn_shift);i++) { orc_x86_emit_mov_memoffset_reg (p, 4, offset + 4*i, p->exec_reg, X86_EAX); orc_x86_emit_cpuinsn_memoffset (p, ORC_X86_imul_rm, 4, offset + 8 + 4*i, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, 4, X86_EAX, offset + 16 + 8*i, p->exec_reg); orc_x86_emit_mov_reg_memoffset (p, 4, X86_EDX, offset + 16 + 8*i + 4, p->exec_reg); } orc_x86_emit_mov_memoffset_mmx (p, 16, offset + 16, p->exec_reg, p->vars[insn->dest_args[0]].alloc, FALSE); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 32, p->exec_reg, X86_EAX); orc_x86_emit_mov_memoffset_reg (p, regsize, offset + 40, p->exec_reg, X86_EDX); } #endif #ifndef MMX static void mmx_rule_mululq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_punpckldq (p, dest, dest); orc_mmx_emit_punpckldq (p, tmp, tmp); orc_mmx_emit_pmuludq (p, tmp, dest); } #endif static void mmx_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ /* same as convlw */ orc_mmx_emit_pslld_imm (p, 16, dest); orc_mmx_emit_psrad_imm (p, 16, dest); orc_mmx_emit_packssdw (p, dest, dest); } static void mmx_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ orc_mmx_emit_psrad_imm (p, 16, dest); orc_mmx_emit_packssdw (p, dest, dest); } static void mmx_rule_select0ql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* same as convql */ #ifndef MMX orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,2,0), src, dest); #else orc_mmx_emit_movq (p, src, dest); #endif } static void mmx_rule_select1ql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_psrlq_imm (p, 32, dest); #ifndef MMX orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,2,0), src, dest); #else orc_mmx_emit_movq (p, src, dest); #endif } static void mmx_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ /* same as convwb */ orc_mmx_emit_psllw_imm (p, 8, dest); orc_mmx_emit_psraw_imm (p, 8, dest); orc_mmx_emit_packsswb (p, dest, dest); } static void mmx_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn) { //int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; /* FIXME slow */ orc_mmx_emit_psraw_imm (p, 8, dest); orc_mmx_emit_packsswb (p, dest, dest); } static void mmx_rule_splitql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest1 = p->vars[insn->dest_args[0]].alloc; int dest2 = p->vars[insn->dest_args[1]].alloc; #ifndef MMX orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,0,2,0), src, dest2); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(3,1,3,1), src, dest1); #else orc_mmx_emit_movq (p, src, dest2); orc_mmx_emit_pshufw (p, ORC_MMX_SHUF(3,2,3,2), src, dest1); #endif } static void mmx_rule_splitlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest1 = p->vars[insn->dest_args[0]].alloc; int dest2 = p->vars[insn->dest_args[1]].alloc; /* FIXME slow */ orc_mmx_emit_psrad_imm (p, 16, dest1); orc_mmx_emit_packssdw (p, dest1, dest1); if (dest2 != src) { orc_mmx_emit_movq (p, src, dest2); } orc_mmx_emit_pslld_imm (p, 16, dest2); orc_mmx_emit_psrad_imm (p, 16, dest2); orc_mmx_emit_packssdw (p, dest2, dest2); } static void mmx_rule_splitwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest1 = p->vars[insn->dest_args[0]].alloc; int dest2 = p->vars[insn->dest_args[1]].alloc; int tmp = orc_compiler_get_constant (p, 2, 0xff); /* FIXME slow */ orc_mmx_emit_psraw_imm (p, 8, dest1); orc_mmx_emit_packsswb (p, dest1, dest1); if (dest2 != src) { orc_mmx_emit_movq (p, src, dest2); } #if 0 orc_mmx_emit_psllw_imm (p, 8, dest2); orc_mmx_emit_psraw_imm (p, 8, dest2); orc_mmx_emit_packsswb (p, dest2, dest2); #else orc_mmx_emit_pand (p, tmp, dest2); orc_mmx_emit_packuswb (p, dest2, dest2); #endif } static void mmx_rule_mergebw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpcklbw (p, src, dest); } static void mmx_rule_mergewl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpcklwd (p, src, dest); } static void mmx_rule_mergelq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; orc_mmx_emit_punpckldq (p, src, dest); } static void mmx_rule_swapw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_swapl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pslld_imm (p, 16, tmp); orc_mmx_emit_psrld_imm (p, 16, dest); orc_mmx_emit_por (p, tmp, dest); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_swapwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pslld_imm (p, 16, tmp); orc_mmx_emit_psrld_imm (p, 16, dest); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_swapq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_psllq_imm (p, 32, tmp); orc_mmx_emit_psrlq_imm (p, 32, dest); orc_mmx_emit_por (p, tmp, dest); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pslld_imm (p, 16, tmp); orc_mmx_emit_psrld_imm (p, 16, dest); orc_mmx_emit_por (p, tmp, dest); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_psllw_imm (p, 8, tmp); orc_mmx_emit_psrlw_imm (p, 8, dest); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_swaplq (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; #ifndef MMX orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(2,3,0,1), dest, dest); #else orc_mmx_emit_pshufw (p, ORC_MMX_SHUF(1,0,3,2), dest, dest); #endif } #ifndef MMX static void mmx_rule_swapw_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x02030001, 0x06070405, 0x0a0b0809, 0x0e0f0c0d); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_swapw (p, user, insn); } } static void mmx_rule_swapl_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_swapl (p, user, insn); } } static void mmx_rule_swapwl_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_swapl (p, user, insn); } } static void mmx_rule_swapq_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x04050607, 0x00010203, 0x0c0d0e0f, 0x08090a0b); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_swapq (p, user, insn); } } static void mmx_rule_select0lw_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x05040100, 0x0d0c0908, 0x05040100, 0x0d0c0908); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_select0lw (p, user, insn); } } static void mmx_rule_select1lw_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x07060302, 0x0f0e0b0a, 0x07060302, 0x0f0e0b0a); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_select1lw (p, user, insn); } } static void mmx_rule_select0wb_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x06040200, 0x0e0c0a08, 0x06040200, 0x0e0c0a08); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_select0wb (p, user, insn); } } static void mmx_rule_select1wb_ssse3 (OrcCompiler *p, void *user, OrcInstruction *insn) { int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_try_get_constant_long (p, 0x07050301, 0x0f0d0b09, 0x07050301, 0x0f0d0b09); if (tmp != ORC_REG_INVALID) { orc_mmx_emit_pshufb (p, tmp, dest); } else { mmx_rule_select1wb (p, user, insn); } } #endif /* slow rules */ static void mmx_rule_maxuw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); orc_mmx_emit_pmaxsw (p, src, dest); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); } static void mmx_rule_minuw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); orc_mmx_emit_pminsw (p, src, dest); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); } static void mmx_rule_avgsb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 1, 0x80); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); orc_mmx_emit_pavgb (p, src, dest); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); } static void mmx_rule_avgsw_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp; tmp = orc_compiler_get_constant (p, 2, 0x8000); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); orc_mmx_emit_pavgw (p, src, dest); orc_mmx_emit_pxor(p, tmp, src); orc_mmx_emit_pxor(p, tmp, dest); } static void mmx_rule_maxsb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pcmpgtb (p, src, tmp); orc_mmx_emit_pand (p, tmp, dest); orc_mmx_emit_pandn (p, src, tmp); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_minsb_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pcmpgtb (p, dest, tmp); orc_mmx_emit_pand (p, tmp, dest); orc_mmx_emit_pandn (p, src, tmp); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_maxsl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pcmpgtd (p, src, tmp); orc_mmx_emit_pand (p, tmp, dest); orc_mmx_emit_pandn (p, src, tmp); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_minsl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pcmpgtd (p, dest, tmp); orc_mmx_emit_pand (p, tmp, dest); orc_mmx_emit_pandn (p, src, tmp); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_maxul_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmpc; tmpc = orc_compiler_get_constant (p, 4, 0x80000000); orc_mmx_emit_pxor(p, tmpc, src); orc_mmx_emit_pxor(p, tmpc, dest); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pcmpgtd (p, src, tmp); orc_mmx_emit_pand (p, tmp, dest); orc_mmx_emit_pandn (p, src, tmp); orc_mmx_emit_por (p, tmp, dest); orc_mmx_emit_pxor(p, tmpc, src); orc_mmx_emit_pxor(p, tmpc, dest); } static void mmx_rule_minul_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmpc; tmpc = orc_compiler_get_constant (p, 4, 0x80000000); orc_mmx_emit_pxor(p, tmpc, src); orc_mmx_emit_pxor(p, tmpc, dest); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pcmpgtd (p, dest, tmp); orc_mmx_emit_pand (p, tmp, dest); orc_mmx_emit_pandn (p, src, tmp); orc_mmx_emit_por (p, tmp, dest); orc_mmx_emit_pxor(p, tmpc, src); orc_mmx_emit_pxor(p, tmpc, dest); } static void mmx_rule_avgsl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* (a+b+1) >> 1 = (a|b) - ((a^b)>>1) */ orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pxor(p, src, tmp); orc_mmx_emit_psrad_imm(p, 1, tmp); orc_mmx_emit_por(p, src, dest); orc_mmx_emit_psubd(p, tmp, dest); } static void mmx_rule_avgul (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); /* (a+b+1) >> 1 = (a|b) - ((a^b)>>1) */ orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_pxor(p, src, tmp); orc_mmx_emit_psrld_imm(p, 1, tmp); orc_mmx_emit_por(p, src, dest); orc_mmx_emit_psubd(p, tmp, dest); } static void mmx_rule_addssl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); #if 0 int tmp2 = orc_compiler_get_temp_reg (p); int tmp3 = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pand (p, dest, tmp); orc_mmx_emit_movq (p, src, tmp2); orc_mmx_emit_pxor (p, dest, tmp2); orc_mmx_emit_psrad_imm (p, 1, tmp2); orc_mmx_emit_paddd (p, tmp2, tmp); orc_mmx_emit_psrad (p, 30, tmp); orc_mmx_emit_pslld (p, 30, tmp); orc_mmx_emit_movq (p, tmp, tmp2); orc_mmx_emit_pslld_imm (p, 1, tmp2); orc_mmx_emit_movq (p, tmp, tmp3); orc_mmx_emit_pxor (p, tmp2, tmp3); orc_mmx_emit_psrad_imm (p, 31, tmp3); orc_mmx_emit_psrad_imm (p, 31, tmp2); tmp = orc_compiler_get_constant (p, 4, 0x80000000); orc_mmx_emit_pxor (p, tmp, tmp2); // clamped value orc_mmx_emit_pand (p, tmp3, tmp2); orc_mmx_emit_paddd (p, src, dest); orc_mmx_emit_pandn (p, dest, tmp3); // tmp is mask: ~0 is for clamping orc_mmx_emit_movq (p, tmp3, dest); orc_mmx_emit_por (p, tmp2, dest); #endif int s = orc_compiler_get_temp_reg (p); int t = orc_compiler_get_temp_reg (p); /* From Tim Terriberry: (slightly faster than above) m=0xFFFFFFFF; s=_a; t=_a; s^=_b; _a+=_b; t^=_a; t^=m; m>>=1; s|=t; t=_b; s>>=31; t>>=31; _a&=s; t^=m; s=~s&t; _a|=s; */ orc_mmx_emit_movq (p, dest, s); orc_mmx_emit_movq (p, dest, t); orc_mmx_emit_pxor (p, src, s); orc_mmx_emit_paddd (p, src, dest); orc_mmx_emit_pxor (p, dest, t); tmp = orc_compiler_get_constant (p, 4, 0xffffffff); orc_mmx_emit_pxor (p, tmp, t); orc_mmx_emit_por (p, t, s); orc_mmx_emit_movq (p, src, t); orc_mmx_emit_psrad_imm (p, 31, s); orc_mmx_emit_psrad_imm (p, 31, t); orc_mmx_emit_pand (p, s, dest); tmp = orc_compiler_get_constant (p, 4, 0x7fffffff); orc_mmx_emit_pxor (p, tmp, t); orc_mmx_emit_pandn (p, t, s); orc_mmx_emit_por (p, s, dest); } static void mmx_rule_subssl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); int tmp3 = orc_compiler_get_temp_reg (p); tmp = orc_compiler_get_temp_constant (p, 4, 0xffffffff); orc_mmx_emit_pxor (p, src, tmp); orc_mmx_emit_movq (p, tmp, tmp2); orc_mmx_emit_por (p, dest, tmp); orc_mmx_emit_pxor (p, dest, tmp2); orc_mmx_emit_psrad_imm (p, 1, tmp2); orc_mmx_emit_psubd (p, tmp2, tmp); orc_mmx_emit_psrad_imm (p, 30, tmp); orc_mmx_emit_pslld_imm (p, 30, tmp); orc_mmx_emit_movq (p, tmp, tmp2); orc_mmx_emit_pslld_imm (p, 1, tmp2); orc_mmx_emit_movq (p, tmp, tmp3); orc_mmx_emit_pxor (p, tmp2, tmp3); orc_mmx_emit_psrad_imm (p, 31, tmp3); // tmp3 is mask: ~0 is for clamping orc_mmx_emit_psrad_imm (p, 31, tmp2); tmp = orc_compiler_get_constant (p, 4, 0x80000000); orc_mmx_emit_pxor (p, tmp, tmp2); // clamped value orc_mmx_emit_pand (p, tmp3, tmp2); orc_mmx_emit_psubd (p, src, dest); orc_mmx_emit_pandn (p, dest, tmp3); orc_mmx_emit_movq (p, tmp3, dest); orc_mmx_emit_por (p, tmp2, dest); } static void mmx_rule_addusl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); #if 0 /* an alternate version. slower. */ /* Compute the bit that gets carried from bit 0 to bit 1 */ orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pand (p, dest, tmp); orc_mmx_emit_pslld_imm (p, 31, tmp); orc_mmx_emit_psrld_imm (p, 31, tmp); /* Add in (src>>1) */ orc_mmx_emit_movq (p, src, tmp2); orc_mmx_emit_psrld_imm (p, 1, tmp2); orc_mmx_emit_paddd (p, tmp2, tmp); /* Add in (dest>>1) */ orc_mmx_emit_movq (p, dest, tmp2); orc_mmx_emit_psrld_imm (p, 1, tmp2); orc_mmx_emit_paddd (p, tmp2, tmp); /* turn overflow bit into mask */ orc_mmx_emit_psrad_imm (p, 31, tmp); /* compute the sum, then or over the mask */ orc_mmx_emit_paddd (p, src, dest); orc_mmx_emit_por (p, tmp, dest); #endif orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_pand (p, dest, tmp); orc_mmx_emit_movq (p, src, tmp2); orc_mmx_emit_pxor (p, dest, tmp2); orc_mmx_emit_psrld_imm (p, 1, tmp2); orc_mmx_emit_paddd (p, tmp2, tmp); orc_mmx_emit_psrad_imm (p, 31, tmp); orc_mmx_emit_paddd (p, src, dest); orc_mmx_emit_por (p, tmp, dest); } static void mmx_rule_subusl_slow (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[1]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, src, tmp2); orc_mmx_emit_psrld_imm (p, 1, tmp2); orc_mmx_emit_movq (p, dest, tmp); orc_mmx_emit_psrld_imm (p, 1, tmp); orc_mmx_emit_psubd (p, tmp, tmp2); /* turn overflow bit into mask */ orc_mmx_emit_psrad_imm (p, 31, tmp2); /* compute the difference, then and over the mask */ orc_mmx_emit_psubd (p, src, dest); orc_mmx_emit_pand (p, tmp2, dest); } #ifndef MMX /* float ops */ #define UNARY_F(opcode,insn_name,code) \ static void \ mmx_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } #define BINARY_F(opcode,insn_name,code) \ static void \ mmx_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[1]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } BINARY_F(addf, addps, 0x58) BINARY_F(subf, subps, 0x5c) BINARY_F(mulf, mulps, 0x59) BINARY_F(divf, divps, 0x5e) UNARY_F(sqrtf, sqrtps, 0x51) #define UNARY_D(opcode,insn_name,code) \ static void \ mmx_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } #define BINARY_D(opcode,insn_name,code) \ static void \ mmx_rule_ ## opcode (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[1]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } BINARY_D(addd, addpd, 0x58) BINARY_D(subd, subpd, 0x5c) BINARY_D(muld, mulpd, 0x59) BINARY_D(divd, divpd, 0x5e) UNARY_D(sqrtd, sqrtpd, 0x51) static void mmx_rule_minf (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_mmx_emit_minps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, p->vars[insn->src_args[1]].alloc, tmp); orc_mmx_emit_minps (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_mmx_emit_minps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_mmx_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void mmx_rule_mind (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_mmx_emit_minpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, p->vars[insn->src_args[1]].alloc, tmp); orc_mmx_emit_minpd (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_mmx_emit_minpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_mmx_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void mmx_rule_maxf (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_mmx_emit_maxps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, p->vars[insn->src_args[1]].alloc, tmp); orc_mmx_emit_maxps (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_mmx_emit_maxps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_mmx_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void mmx_rule_maxd (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_FAST_NAN) { orc_mmx_emit_maxpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } else { int tmp = orc_compiler_get_temp_reg (p); orc_mmx_emit_movq (p, p->vars[insn->src_args[1]].alloc, tmp); orc_mmx_emit_maxpd (p, p->vars[insn->dest_args[0]].alloc, tmp); orc_mmx_emit_maxpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); orc_mmx_emit_por (p, tmp, p->vars[insn->dest_args[0]].alloc); } } static void mmx_rule_cmpeqf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cmpeqps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_cmpeqd (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cmpeqpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_cmpltf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cmpltps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_cmpltd (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cmpltpd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_cmplef (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cmpleps (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_cmpled (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cmplepd (p, p->vars[insn->src_args[1]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_convfl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmpc; int tmp = orc_compiler_get_temp_reg (p); tmpc = orc_compiler_get_temp_constant (p, 4, 0x80000000); orc_mmx_emit_movq (p, src, tmp); orc_mmx_emit_cvttps2dq (p, src, dest); orc_mmx_emit_psrad_imm (p, 31, tmp); orc_mmx_emit_pcmpeqd (p, dest, tmpc); orc_mmx_emit_pandn (p, tmpc, tmp); orc_mmx_emit_paddd (p, tmp, dest); } static void mmx_rule_convdl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src = p->vars[insn->src_args[0]].alloc; int dest = p->vars[insn->dest_args[0]].alloc; int tmpc; int tmp = orc_compiler_get_temp_reg (p); tmpc = orc_compiler_get_temp_constant (p, 4, 0x80000000); orc_mmx_emit_pshufd (p, ORC_MMX_SHUF(3,1,3,1), src, tmp); orc_mmx_emit_cvttpd2dq (p, src, dest); orc_mmx_emit_psrad_imm (p, 31, tmp); orc_mmx_emit_pcmpeqd (p, dest, tmpc); orc_mmx_emit_pandn (p, tmpc, tmp); orc_mmx_emit_paddd (p, tmp, dest); } static void mmx_rule_convlf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cvtdq2ps (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_convld (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cvtdq2pd (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_convfd (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cvtps2pd (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } static void mmx_rule_convdf (OrcCompiler *p, void *user, OrcInstruction *insn) { orc_mmx_emit_cvtpd2ps (p, p->vars[insn->src_args[0]].alloc, p->vars[insn->dest_args[0]].alloc); } #endif #define UNARY_SSE41(opcode,insn_name) \ static void \ mmx_rule_ ## opcode ## _mmx41 (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ orc_mmx_emit_ ## insn_name (p, \ p->vars[insn->src_args[0]].alloc, \ p->vars[insn->dest_args[0]].alloc); \ } UNARY_SSE41(convsbw,pmovsxbw); UNARY_SSE41(convswl,pmovsxwd); UNARY_SSE41(convslq,pmovsxdq); UNARY_SSE41(convubw,pmovzxbw); UNARY_SSE41(convuwl,pmovzxwd); UNARY_SSE41(convulq,pmovzxdq); void orc_compiler_mmx_register_rules (OrcTarget *target) { OrcRuleSet *rule_set; #define REG(x) \ orc_rule_register (rule_set, #x , mmx_rule_ ## x, NULL) /* SSE 2 */ #ifndef MMX rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_MMX_MMXEXT); #else rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_MMX_MMX); #endif orc_rule_register (rule_set, "loadb", mmx_rule_loadX, NULL); orc_rule_register (rule_set, "loadw", mmx_rule_loadX, NULL); orc_rule_register (rule_set, "loadl", mmx_rule_loadX, NULL); orc_rule_register (rule_set, "loadq", mmx_rule_loadX, NULL); orc_rule_register (rule_set, "loadoffb", mmx_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffw", mmx_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffl", mmx_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadupdb", mmx_rule_loadupdb, NULL); orc_rule_register (rule_set, "loadupib", mmx_rule_loadupib, NULL); orc_rule_register (rule_set, "loadpb", mmx_rule_loadpX, (void *)1); orc_rule_register (rule_set, "loadpw", mmx_rule_loadpX, (void *)2); orc_rule_register (rule_set, "loadpl", mmx_rule_loadpX, (void *)4); orc_rule_register (rule_set, "loadpq", mmx_rule_loadpX, (void *)8); orc_rule_register (rule_set, "ldresnearl", mmx_rule_ldresnearl, NULL); orc_rule_register (rule_set, "ldreslinl", mmx_rule_ldreslinl, NULL); orc_rule_register (rule_set, "storeb", mmx_rule_storeX, NULL); orc_rule_register (rule_set, "storew", mmx_rule_storeX, NULL); orc_rule_register (rule_set, "storel", mmx_rule_storeX, NULL); orc_rule_register (rule_set, "storeq", mmx_rule_storeX, NULL); REG(addb); REG(addssb); REG(addusb); REG(andb); REG(andnb); REG(avgub); REG(cmpeqb); REG(cmpgtsb); REG(maxub); REG(minub); REG(orb); REG(subb); REG(subssb); REG(subusb); REG(xorb); REG(addw); REG(addssw); REG(addusw); REG(andw); REG(andnw); REG(avguw); REG(cmpeqw); REG(cmpgtsw); REG(maxsw); REG(minsw); REG(mullw); REG(mulhsw); REG(mulhuw); REG(orw); REG(subw); REG(subssw); REG(subusw); REG(xorw); REG(addl); REG(andl); REG(andnl); REG(cmpeql); REG(cmpgtsl); REG(orl); REG(subl); REG(xorl); REG(andq); REG(andnq); REG(orq); REG(xorq); REG(select0ql); REG(select1ql); REG(select0lw); REG(select1lw); REG(select0wb); REG(select1wb); REG(mergebw); REG(mergewl); REG(mergelq); orc_rule_register (rule_set, "copyb", mmx_rule_copyx, NULL); orc_rule_register (rule_set, "copyw", mmx_rule_copyx, NULL); orc_rule_register (rule_set, "copyl", mmx_rule_copyx, NULL); orc_rule_register (rule_set, "copyq", mmx_rule_copyx, NULL); orc_rule_register (rule_set, "shlw", mmx_rule_shift, (void *)0); orc_rule_register (rule_set, "shruw", mmx_rule_shift, (void *)1); orc_rule_register (rule_set, "shrsw", mmx_rule_shift, (void *)2); orc_rule_register (rule_set, "shll", mmx_rule_shift, (void *)3); orc_rule_register (rule_set, "shrul", mmx_rule_shift, (void *)4); orc_rule_register (rule_set, "shrsl", mmx_rule_shift, (void *)5); orc_rule_register (rule_set, "shlq", mmx_rule_shift, (void *)6); orc_rule_register (rule_set, "shruq", mmx_rule_shift, (void *)7); orc_rule_register (rule_set, "shrsq", mmx_rule_shrsq, NULL); orc_rule_register (rule_set, "convsbw", mmx_rule_convsbw, NULL); orc_rule_register (rule_set, "convubw", mmx_rule_convubw, NULL); orc_rule_register (rule_set, "convssswb", mmx_rule_convssswb, NULL); orc_rule_register (rule_set, "convsuswb", mmx_rule_convsuswb, NULL); orc_rule_register (rule_set, "convuuswb", mmx_rule_convuuswb, NULL); orc_rule_register (rule_set, "convwb", mmx_rule_convwb, NULL); orc_rule_register (rule_set, "convswl", mmx_rule_convswl, NULL); orc_rule_register (rule_set, "convuwl", mmx_rule_convuwl, NULL); orc_rule_register (rule_set, "convssslw", mmx_rule_convssslw, NULL); orc_rule_register (rule_set, "convql", mmx_rule_convql, NULL); orc_rule_register (rule_set, "convslq", mmx_rule_convslq, NULL); orc_rule_register (rule_set, "convulq", mmx_rule_convulq, NULL); //orc_rule_register (rule_set, "convsssql", mmx_rule_convsssql, NULL); orc_rule_register (rule_set, "mulsbw", mmx_rule_mulsbw, NULL); orc_rule_register (rule_set, "mulubw", mmx_rule_mulubw, NULL); orc_rule_register (rule_set, "mulswl", mmx_rule_mulswl, NULL); orc_rule_register (rule_set, "muluwl", mmx_rule_muluwl, NULL); orc_rule_register (rule_set, "accw", mmx_rule_accw, NULL); orc_rule_register (rule_set, "accl", mmx_rule_accl, NULL); orc_rule_register (rule_set, "accsadubl", mmx_rule_accsadubl, NULL); #ifndef MMX /* These require the SSE2 flag, although could be used with MMX. That flag is not yet handled. */ orc_rule_register (rule_set, "mululq", mmx_rule_mululq, NULL); REG(addq); REG(subq); orc_rule_register (rule_set, "addf", mmx_rule_addf, NULL); orc_rule_register (rule_set, "subf", mmx_rule_subf, NULL); orc_rule_register (rule_set, "mulf", mmx_rule_mulf, NULL); orc_rule_register (rule_set, "divf", mmx_rule_divf, NULL); orc_rule_register (rule_set, "minf", mmx_rule_minf, NULL); orc_rule_register (rule_set, "maxf", mmx_rule_maxf, NULL); orc_rule_register (rule_set, "sqrtf", mmx_rule_sqrtf, NULL); orc_rule_register (rule_set, "cmpeqf", mmx_rule_cmpeqf, NULL); orc_rule_register (rule_set, "cmpltf", mmx_rule_cmpltf, NULL); orc_rule_register (rule_set, "cmplef", mmx_rule_cmplef, NULL); orc_rule_register (rule_set, "convfl", mmx_rule_convfl, NULL); orc_rule_register (rule_set, "convlf", mmx_rule_convlf, NULL); orc_rule_register (rule_set, "addd", mmx_rule_addd, NULL); orc_rule_register (rule_set, "subd", mmx_rule_subd, NULL); orc_rule_register (rule_set, "muld", mmx_rule_muld, NULL); orc_rule_register (rule_set, "divd", mmx_rule_divd, NULL); orc_rule_register (rule_set, "mind", mmx_rule_mind, NULL); orc_rule_register (rule_set, "maxd", mmx_rule_maxd, NULL); orc_rule_register (rule_set, "sqrtd", mmx_rule_sqrtd, NULL); orc_rule_register (rule_set, "cmpeqd", mmx_rule_cmpeqd, NULL); orc_rule_register (rule_set, "cmpltd", mmx_rule_cmpltd, NULL); orc_rule_register (rule_set, "cmpled", mmx_rule_cmpled, NULL); orc_rule_register (rule_set, "convdl", mmx_rule_convdl, NULL); orc_rule_register (rule_set, "convld", mmx_rule_convld, NULL); orc_rule_register (rule_set, "convfd", mmx_rule_convfd, NULL); orc_rule_register (rule_set, "convdf", mmx_rule_convdf, NULL); #endif /* slow rules */ orc_rule_register (rule_set, "maxuw", mmx_rule_maxuw_slow, NULL); orc_rule_register (rule_set, "minuw", mmx_rule_minuw_slow, NULL); orc_rule_register (rule_set, "avgsb", mmx_rule_avgsb_slow, NULL); orc_rule_register (rule_set, "avgsw", mmx_rule_avgsw_slow, NULL); orc_rule_register (rule_set, "maxsb", mmx_rule_maxsb_slow, NULL); orc_rule_register (rule_set, "minsb", mmx_rule_minsb_slow, NULL); orc_rule_register (rule_set, "maxsl", mmx_rule_maxsl_slow, NULL); orc_rule_register (rule_set, "minsl", mmx_rule_minsl_slow, NULL); orc_rule_register (rule_set, "maxul", mmx_rule_maxul_slow, NULL); orc_rule_register (rule_set, "minul", mmx_rule_minul_slow, NULL); orc_rule_register (rule_set, "convlw", mmx_rule_convlw, NULL); orc_rule_register (rule_set, "signw", mmx_rule_signw_slow, NULL); orc_rule_register (rule_set, "absb", mmx_rule_absb_slow, NULL); orc_rule_register (rule_set, "absw", mmx_rule_absw_slow, NULL); orc_rule_register (rule_set, "absl", mmx_rule_absl_slow, NULL); orc_rule_register (rule_set, "swapw", mmx_rule_swapw, NULL); orc_rule_register (rule_set, "swapl", mmx_rule_swapl, NULL); orc_rule_register (rule_set, "swapwl", mmx_rule_swapwl, NULL); orc_rule_register (rule_set, "swapq", mmx_rule_swapq, NULL); orc_rule_register (rule_set, "swaplq", mmx_rule_swaplq, NULL); orc_rule_register (rule_set, "splitql", mmx_rule_splitql, NULL); orc_rule_register (rule_set, "splitlw", mmx_rule_splitlw, NULL); orc_rule_register (rule_set, "splitwb", mmx_rule_splitwb, NULL); orc_rule_register (rule_set, "avgsl", mmx_rule_avgsl, NULL); orc_rule_register (rule_set, "avgul", mmx_rule_avgul, NULL); orc_rule_register (rule_set, "shlb", mmx_rule_shlb, NULL); orc_rule_register (rule_set, "shrsb", mmx_rule_shrsb, NULL); orc_rule_register (rule_set, "shrub", mmx_rule_shrub, NULL); orc_rule_register (rule_set, "mulll", mmx_rule_mulll_slow, NULL); #ifndef MMX orc_rule_register (rule_set, "mulhsl", mmx_rule_mulhsl_slow, NULL); orc_rule_register (rule_set, "mulhul", mmx_rule_mulhul, NULL); orc_rule_register (rule_set, "mulslq", mmx_rule_mulslq_slow, NULL); #endif orc_rule_register (rule_set, "mullb", mmx_rule_mullb, NULL); orc_rule_register (rule_set, "mulhsb", mmx_rule_mulhsb, NULL); orc_rule_register (rule_set, "mulhub", mmx_rule_mulhub, NULL); orc_rule_register (rule_set, "addssl", mmx_rule_addssl_slow, NULL); orc_rule_register (rule_set, "subssl", mmx_rule_subssl_slow, NULL); orc_rule_register (rule_set, "addusl", mmx_rule_addusl_slow, NULL); orc_rule_register (rule_set, "subusl", mmx_rule_subusl_slow, NULL); orc_rule_register (rule_set, "convhwb", mmx_rule_convhwb, NULL); orc_rule_register (rule_set, "convhlw", mmx_rule_convhlw, NULL); orc_rule_register (rule_set, "splatw3q", mmx_rule_splatw3q, NULL); orc_rule_register (rule_set, "splatbw", mmx_rule_splatbw, NULL); orc_rule_register (rule_set, "splatbl", mmx_rule_splatbl, NULL); orc_rule_register (rule_set, "div255w", mmx_rule_div255w, NULL); orc_rule_register (rule_set, "divluw", mmx_rule_divluw, NULL); /* SSE 3 -- no rules */ /* SSSE 3 */ rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_MMX_SSSE3); #ifndef MMX orc_rule_register (rule_set, "signb", mmx_rule_signX_ssse3, (void *)0); orc_rule_register (rule_set, "signw", mmx_rule_signX_ssse3, (void *)1); orc_rule_register (rule_set, "signl", mmx_rule_signX_ssse3, (void *)2); #endif REG(absb); REG(absw); REG(absl); #ifndef MMX orc_rule_register (rule_set, "swapw", mmx_rule_swapw_ssse3, NULL); orc_rule_register (rule_set, "swapl", mmx_rule_swapl_ssse3, NULL); orc_rule_register (rule_set, "swapwl", mmx_rule_swapwl_ssse3, NULL); orc_rule_register (rule_set, "swapq", mmx_rule_swapq_ssse3, NULL); orc_rule_register (rule_set, "select0lw", mmx_rule_select0lw_ssse3, NULL); orc_rule_register (rule_set, "select1lw", mmx_rule_select1lw_ssse3, NULL); orc_rule_register (rule_set, "select0wb", mmx_rule_select0wb_ssse3, NULL); orc_rule_register (rule_set, "select1wb", mmx_rule_select1wb_ssse3, NULL); #endif /* SSE 4.1 */ rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_MMX_SSE4_1); REG(maxsb); REG(minsb); REG(maxuw); REG(minuw); REG(maxsl); REG(maxul); REG(minsl); REG(minul); REG(mulll); orc_rule_register (rule_set, "convsbw", mmx_rule_convsbw_mmx41, NULL); orc_rule_register (rule_set, "convswl", mmx_rule_convswl_mmx41, NULL); orc_rule_register (rule_set, "convslq", mmx_rule_convslq_mmx41, NULL); orc_rule_register (rule_set, "convubw", mmx_rule_convubw_mmx41, NULL); orc_rule_register (rule_set, "convuwl", mmx_rule_convuwl_mmx41, NULL); orc_rule_register (rule_set, "convulq", mmx_rule_convulq_mmx41, NULL); orc_rule_register (rule_set, "convsuslw", mmx_rule_convsuslw, NULL); orc_rule_register (rule_set, "mulslq", mmx_rule_mulslq, NULL); #ifndef MMX orc_rule_register (rule_set, "mulhsl", mmx_rule_mulhsl, NULL); #endif REG(cmpeqq); /* SSE 4.2 -- no rules */ rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, ORC_TARGET_MMX_SSE4_2); REG(cmpgtsq); /* SSE 4a -- no rules */ } orc-0.4.18/orc/orctarget.h0000664000175000017500000000514412111024531012232 00000000000000 #ifndef _ORC_TARGET_H_ #define _ORC_TARGET_H_ #include #include #include ORC_BEGIN_DECLS enum { ORC_TARGET_C_C99 = (1<<0), ORC_TARGET_C_BARE = (1<<1), ORC_TARGET_C_NOEXEC = (1<<2), ORC_TARGET_C_OPCODE = (1<<3), ORC_TARGET_CLEAN_COMPILE = (1<<29), ORC_TARGET_FAST_NAN = (1<<30), ORC_TARGET_FAST_DENORMAL = (1<<31) }; enum { ORC_TARGET_ALTIVEC_ALTIVEC = (1<<0) }; enum { ORC_TARGET_NEON_CLEAN_COMPILE = (1<<0), ORC_TARGET_NEON_NEON = (1<<1), ORC_TARGET_NEON_EDSP = (1<<2) }; enum { ORC_TARGET_ARM_EDSP = (1<<2), ORC_TARGET_ARM_ARM6 = (1<<3) }; typedef enum { ORC_TARGET_MMX_MMX = (1<<0), ORC_TARGET_MMX_MMXEXT = (1<<1), ORC_TARGET_MMX_3DNOW = (1<<2), ORC_TARGET_MMX_3DNOWEXT = (1<<3), ORC_TARGET_MMX_SSSE3 = (1<<4), ORC_TARGET_MMX_SSE4_1 = (1<<5), ORC_TARGET_MMX_SSE4_2 = (1<<6), ORC_TARGET_MMX_FRAME_POINTER = (1<<7), ORC_TARGET_MMX_SHORT_JUMPS = (1<<8), ORC_TARGET_MMX_64BIT = (1<<9) } OrcTargetMMXFlags; typedef enum { ORC_TARGET_SSE_SSE2 = (1<<0), ORC_TARGET_SSE_SSE3 = (1<<1), ORC_TARGET_SSE_SSSE3 = (1<<2), ORC_TARGET_SSE_SSE4_1 = (1<<3), ORC_TARGET_SSE_SSE4_2 = (1<<4), ORC_TARGET_SSE_SSE4A = (1<<5), ORC_TARGET_SSE_SSE5 = (1<<6), ORC_TARGET_SSE_FRAME_POINTER = (1<<7), ORC_TARGET_SSE_SHORT_JUMPS = (1<<8), ORC_TARGET_SSE_64BIT = (1<<9) }OrcTargetSSEFlags; /** * OrcTarget: * */ struct _OrcTarget { const char *name; orc_bool executable; int data_register_offset; unsigned int (*get_default_flags)(void); void (*compiler_init)(OrcCompiler *compiler); void (*compile)(OrcCompiler *compiler); OrcRuleSet rule_sets[ORC_N_RULE_SETS]; int n_rule_sets; const char * (*get_asm_preamble)(void); void (*load_constant)(OrcCompiler *compiler, int reg, int size, int value); const char * (*get_flag_name)(int shift); void (*flush_cache) (OrcCode *code); void (*load_constant_long)(OrcCompiler *compiler, int reg, OrcConstant *constant); void *_unused[5]; }; OrcRule * orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode, unsigned int target_flags); OrcTarget * orc_target_get_default (void); unsigned int orc_target_get_default_flags (OrcTarget *target); const char * orc_target_get_name (OrcTarget *target); const char * orc_target_get_flag_name (OrcTarget *target, int shift); const char *orc_target_get_asm_preamble (const char *target); const char * orc_target_get_preamble (OrcTarget *target); const char * orc_target_c_get_typedefs (void); void orc_target_register (OrcTarget *target); OrcTarget *orc_target_get_by_name (const char *target_name); ORC_END_DECLS #endif orc-0.4.18/orc/orccode.h0000664000175000017500000000166012111024531011655 00000000000000 #ifndef _ORC_CODE_H_ #define _ORC_CODE_H_ #include #include #include #include ORC_BEGIN_DECLS typedef struct _OrcCodeChunk OrcCodeChunk; typedef struct _OrcCodeVariable OrcCodeVariable; struct _OrcCodeVariable { /*< private >*/ int vartype; int size; orc_union64 value; }; struct _OrcCode { /*< public >*/ OrcExecutorFunc exec; /*< private >*/ OrcCompileResult result; char *name; /* for execution */ unsigned char *code; int code_size; void *chunk; /* for emulation */ int n_insns; OrcInstruction *insns; OrcCodeVariable *vars; int is_2d; int constant_n; int constant_m; }; void orc_code_allocate_codemem (OrcCode *code, int size); OrcCode * orc_code_new (void); void orc_code_free (OrcCode *code); #ifdef ORC_ENABLE_UNSTABLE_API void orc_code_chunk_free (OrcCodeChunk *chunk); #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcprogram-altivec.c0000664000175000017500000002715612111024531014042 00000000000000 #include "config.h" #include #include #include #include #include #include #include void orc_compiler_powerpc_init (OrcCompiler *compiler); unsigned int orc_compiler_powerpc_get_default_flags (void); void orc_compiler_powerpc_assemble (OrcCompiler *compiler); void orc_compiler_powerpc_register_rules (OrcTarget *target); void powerpc_emit_prologue (OrcCompiler *compiler) { int i; ORC_ASM_CODE (compiler, ".global %s\n", compiler->program->name); ORC_ASM_CODE (compiler, "%s:\n", compiler->program->name); if (compiler->is_64bit) { ORC_ASM_CODE (compiler, " .quad .%s,.TOC.@tocbase,0\n", compiler->program->name); ORC_ASM_CODE (compiler, ".%s:\n", compiler->program->name); powerpc_emit (compiler, 0); powerpc_emit (compiler, 0); powerpc_emit (compiler, 0); powerpc_emit (compiler, 0); powerpc_emit (compiler, 0); powerpc_emit (compiler, 0); powerpc_emit_stdu (compiler, POWERPC_R1, POWERPC_R1, -16); } else { powerpc_emit_stwu (compiler, POWERPC_R1, POWERPC_R1, -16); } for(i=POWERPC_R13;i<=POWERPC_R31;i++){ if (compiler->used_regs[i]) { //powerpc_emit_push (compiler, 4, i); } } } void powerpc_emit_epilogue (OrcCompiler *compiler) { int i; for(i=POWERPC_R31;i>=POWERPC_R31;i--){ if (compiler->used_regs[i]) { //powerpc_emit_pop (compiler, 4, i); } } powerpc_emit_addi (compiler, POWERPC_R1, POWERPC_R1, 16); ORC_ASM_CODE(compiler," blr\n"); powerpc_emit(compiler, 0x4e800020); } static OrcTarget altivec_target = { "altivec", #ifdef HAVE_POWERPC TRUE, #else FALSE, #endif ORC_VEC_REG_BASE, orc_compiler_powerpc_get_default_flags, orc_compiler_powerpc_init, orc_compiler_powerpc_assemble, { { 0 } }, 0, NULL, NULL, NULL, orc_powerpc_flush_cache }; void orc_powerpc_init (void) { orc_target_register (&altivec_target); orc_compiler_powerpc_register_rules (&altivec_target); } unsigned int orc_compiler_powerpc_get_default_flags (void) { unsigned int flags = 0; #ifdef __powerpc64__ flags |= ORC_TARGET_POWERPC_64BIT; #endif return flags; } void orc_compiler_powerpc_init (OrcCompiler *compiler) { int i; if (compiler->target_flags & ORC_TARGET_POWERPC_64BIT) { compiler->is_64bit = TRUE; } for(i=0;i<32;i++){ compiler->valid_regs[POWERPC_R0+i] = 1; compiler->valid_regs[POWERPC_V0+i] = 1; } compiler->valid_regs[POWERPC_R0] = 0; /* used for temp space */ compiler->valid_regs[POWERPC_R1] = 0; /* stack pointer */ compiler->valid_regs[POWERPC_R2] = 0; /* TOC pointer */ compiler->valid_regs[POWERPC_R3] = 0; /* pointer to OrcExecutor */ compiler->valid_regs[POWERPC_R13] = 0; /* reserved */ compiler->tmpreg = POWERPC_V0; compiler->gp_tmpreg = POWERPC_R4; compiler->valid_regs[compiler->tmpreg] = 0; compiler->valid_regs[compiler->gp_tmpreg] = 0; for(i=14;i<32;i++){ compiler->save_regs[POWERPC_R0 + i] = 1; } for(i=20;i<32;i++){ compiler->save_regs[POWERPC_V0 + i] = 1; } compiler->loop_shift = 0; compiler->load_params = TRUE; } void powerpc_load_inner_constants (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: if (compiler->vars[i].ptr_register) { if (compiler->is_64bit) { powerpc_emit_ld (compiler, compiler->vars[i].ptr_register, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); } else { powerpc_emit_lwz (compiler, compiler->vars[i].ptr_register, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i])); } } else { /* FIXME */ ORC_ASM_CODE(compiler,"ERROR"); } break; default: break; } } } static int orc_program_has_float (OrcCompiler *compiler) { int j; for(j=0;jn_insns;j++){ OrcInstruction *insn = compiler->insns + j; OrcStaticOpcode *opcode = insn->opcode; if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) return TRUE; } return FALSE; } void orc_compiler_powerpc_assemble (OrcCompiler *compiler) { int j; int k; OrcInstruction *insn; OrcStaticOpcode *opcode; //OrcVariable *args[10]; OrcRule *rule; int label_outer_loop_start; int label_loop_start; int label_leave; int set_vscr = FALSE; label_outer_loop_start = orc_compiler_label_new (compiler); label_loop_start = orc_compiler_label_new (compiler); label_leave = orc_compiler_label_new (compiler); powerpc_emit_prologue (compiler); if (orc_program_has_float (compiler)) { int tmp = POWERPC_V0; set_vscr = TRUE; ORC_ASM_CODE(compiler," vspltish %s, %d\n", powerpc_get_regname(tmp), 1); powerpc_emit_VX(compiler, 0x1000034c, powerpc_regnum(tmp), 1, 0); powerpc_emit_VX_b(compiler, "mtvscr", 0x10000644, tmp); } if (compiler->program->is_2d) { powerpc_emit_lwz (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutorAlt, m)); powerpc_emit_srawi (compiler, POWERPC_R0, POWERPC_R0, compiler->loop_shift, 1); powerpc_emit_beq (compiler, label_leave); powerpc_emit_stw (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutorAlt, m_index)); } //powerpc_load_constants (compiler); powerpc_load_inner_constants (compiler); for(k=0;k<4;k++){ OrcVariable *var = &compiler->vars[ORC_VAR_A1 + k]; if (compiler->vars[ORC_VAR_A1 + k].name == NULL) continue; //powerpc_emit_VX_2(p, "vxor", 0x100004c4, reg, reg, reg); powerpc_emit_vxor (compiler, var->alloc, var->alloc, var->alloc); } powerpc_emit_label (compiler, label_outer_loop_start); powerpc_emit_lwz (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, n)); powerpc_emit_srawi (compiler, POWERPC_R0, POWERPC_R0, compiler->loop_shift, 1); powerpc_emit_beq (compiler, label_leave); powerpc_emit (compiler, 0x7c0903a6); ORC_ASM_CODE (compiler, " mtctr %s\n", powerpc_get_regname(POWERPC_R0)); powerpc_emit_label (compiler, label_loop_start); for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; compiler->insn_index = j; ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name); #if 0 /* set up args */ for(k=0;kn_src + opcode->n_dest;k++){ args[k] = compiler->vars + insn->args[k]; ORC_ASM_CODE(compiler," %d", args[k]->alloc); if (args[k]->is_chained) { ORC_ASM_CODE(compiler," (chained)"); } } ORC_ASM_CODE(compiler,"\n"); #endif for(k=0;kvars + insn->src_args[k]; if (opcode->src_size[k] == 0) continue; switch (var->vartype) { case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: //powerpc_emit_load_src (compiler, var); break; case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_TEMP: break; default: break; } } compiler->min_temp_reg = ORC_VEC_REG_BASE; rule = insn->rule; if (rule) { rule->emit (compiler, rule->emit_user, insn); } else { ORC_ASM_CODE(compiler,"No rule for: %s\n", opcode->name); } for(k=0;kvars + insn->dest_args[k]; if (opcode->dest_size[k] == 0) continue; switch (var->vartype) { case ORC_VAR_TYPE_DEST: //powerpc_emit_store_dest (compiler, var); break; case ORC_VAR_TYPE_TEMP: break; default: break; } } } for(k=0;kvars[k].name == NULL) continue; if (compiler->vars[k].vartype == ORC_VAR_TYPE_SRC || compiler->vars[k].vartype == ORC_VAR_TYPE_DEST) { if (compiler->vars[k].ptr_register) { powerpc_emit_addi (compiler, compiler->vars[k].ptr_register, compiler->vars[k].ptr_register, compiler->vars[k].size << compiler->loop_shift); } else { ORC_ASM_CODE(compiler,"ERROR\n"); } } } powerpc_emit_bne (compiler, label_loop_start); if (compiler->program->is_2d) { powerpc_emit_lwz (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutorAlt, m_index)); powerpc_emit_addi_rec (compiler, POWERPC_R0, POWERPC_R0, -1); powerpc_emit_beq (compiler, label_leave); powerpc_emit_stw (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutorAlt, m_index)); for(k=0;kvars[k].name == NULL) continue; if (compiler->vars[k].vartype == ORC_VAR_TYPE_SRC || compiler->vars[k].vartype == ORC_VAR_TYPE_DEST) { if (compiler->vars[k].ptr_register) { if (compiler->is_64bit) { powerpc_emit_ld (compiler, compiler->vars[k].ptr_register, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k])); } else { powerpc_emit_lwz (compiler, compiler->vars[k].ptr_register, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k])); } powerpc_emit_lwz (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutorAlt, strides[k])); powerpc_emit_add (compiler, compiler->vars[k].ptr_register, compiler->vars[k].ptr_register, POWERPC_R0); if (compiler->is_64bit) { powerpc_emit_std (compiler, compiler->vars[k].ptr_register, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k])); } else { powerpc_emit_stw (compiler, compiler->vars[k].ptr_register, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k])); } } else { ORC_ASM_CODE(compiler,"ERROR\n"); } } } powerpc_emit_b (compiler, label_outer_loop_start); } powerpc_emit_label (compiler, label_leave); for(k=0;k<4;k++){ OrcVariable *var = &compiler->vars[ORC_VAR_A1 + k]; if (compiler->vars[ORC_VAR_A1 + k].name == NULL) continue; powerpc_emit_addi (compiler, POWERPC_R0, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, accumulators[k])); if (var->size == 2) { powerpc_emit_vxor (compiler, POWERPC_V0, POWERPC_V0, POWERPC_V0); powerpc_emit_vmrghh (compiler, var->alloc, POWERPC_V0, var->alloc); } ORC_ASM_CODE(compiler," lvsr %s, 0, %s\n", powerpc_get_regname (POWERPC_V0), powerpc_get_regname (POWERPC_R0)); powerpc_emit_X (compiler, 0x7c00004c, powerpc_regnum(POWERPC_V0), 0, powerpc_regnum(POWERPC_R0)); powerpc_emit_vperm (compiler, var->alloc, var->alloc, var->alloc, POWERPC_V0); ORC_ASM_CODE(compiler," stvewx %s, 0, %s\n", powerpc_get_regname (var->alloc), powerpc_get_regname (POWERPC_R0)); powerpc_emit_X (compiler, 0x7c00018e, powerpc_regnum(var->alloc), 0, powerpc_regnum(POWERPC_R0)); } if (set_vscr) { int tmp = POWERPC_V0; ORC_ASM_CODE(compiler," vspltisw %s, %d\n", powerpc_get_regname(tmp), 0); powerpc_emit_VX(compiler, 0x1000038c, powerpc_regnum(tmp), 0, 0); powerpc_emit_VX_b(compiler, "mtvscr", 0x10000644, tmp); } powerpc_emit_epilogue (compiler); powerpc_do_fixups (compiler); } orc-0.4.18/orc/orccpu.h0000664000175000017500000000051112111024531011524 00000000000000 #ifndef _ORC_CPU_H_ #define _ORC_CPU_H_ #include #include ORC_BEGIN_DECLS void orc_get_data_cache_sizes (int *level1, int *level2, int *level3); void orc_get_cpu_family_model_stepping (int *family, int *model, int *stepping); const char * orc_get_cpu_name (void); ORC_END_DECLS #endif orc-0.4.18/orc/orcprogram-sse.c0000664000175000017500000007550512177015514013223 00000000000000 #include "config.h" #include #include #include #include #include #include #include #include #include #undef MMX #define SIZE 65536 #define ORC_SSE_ALIGNED_DEST_CUTOFF 64 void orc_sse_emit_loop (OrcCompiler *compiler, int offset, int update); void orc_compiler_sse_init (OrcCompiler *compiler); unsigned int orc_compiler_sse_get_default_flags (void); void orc_compiler_sse_assemble (OrcCompiler *compiler); void orc_compiler_sse_register_rules (OrcTarget *target); void orc_sse_emit_invariants (OrcCompiler *compiler); void orc_compiler_rewrite_vars (OrcCompiler *compiler); void orc_compiler_dump (OrcCompiler *compiler); void sse_load_constant (OrcCompiler *compiler, int reg, int size, int value); void sse_load_constant_long (OrcCompiler *compiler, int reg, OrcConstant *constant); static const char * sse_get_flag_name (int shift); static OrcTarget sse_target = { "sse", #if defined(HAVE_I386) || defined(HAVE_AMD64) TRUE, #else FALSE, #endif ORC_VEC_REG_BASE, orc_compiler_sse_get_default_flags, orc_compiler_sse_init, orc_compiler_sse_assemble, { { 0 } }, 0, NULL, sse_load_constant, sse_get_flag_name, NULL, sse_load_constant_long }; extern int orc_x86_sse_flags; extern int orc_x86_mmx_flags; void orc_sse_init (void) { #if defined(HAVE_AMD64) || defined(HAVE_I386) /* initializes cache information */ orc_sse_get_cpu_flags (); #endif #if defined(HAVE_I386) #ifndef MMX if (!(orc_x86_sse_flags & ORC_TARGET_SSE_SSE2)) { sse_target.executable = FALSE; } #else if (!(orc_x86_mmx_flags & ORC_TARGET_MMX_MMX)) { mmx_target.executable = FALSE; } #endif #endif orc_target_register (&sse_target); orc_compiler_sse_register_rules (&sse_target); } unsigned int orc_compiler_sse_get_default_flags (void) { unsigned int flags = 0; #ifdef __amd64__ flags |= ORC_TARGET_SSE_64BIT; #endif if (_orc_compiler_flag_debug) { flags |= ORC_TARGET_SSE_FRAME_POINTER; } #if defined(HAVE_AMD64) || defined(HAVE_I386) #ifndef MMX flags |= orc_x86_sse_flags; #else flags |= orc_x86_mmx_flags; #endif #else #ifndef MMX flags |= ORC_TARGET_SSE_SSE2; flags |= ORC_TARGET_SSE_SSE3; flags |= ORC_TARGET_SSE_SSSE3; #else flags |= ORC_TARGET_MMX_MMX; flags |= ORC_TARGET_MMX_3DNOW; #endif #endif return flags; } static const char * sse_get_flag_name (int shift) { static const char *flags[] = { #ifndef MMX "sse2", "sse3", "ssse3", "sse41", "sse42", "sse4a", "sse5", "frame_pointer", "short_jumps", "64bit" #else "mmx", "mmxext", "3dnow", "3dnowext", "ssse3", "sse41", "", "frame_pointer", "short_jumps", "64bit" #endif }; if (shift >= 0 && shift < sizeof(flags)/sizeof(flags[0])) { return flags[shift]; } return NULL; } void orc_compiler_sse_init (OrcCompiler *compiler) { int i; if (compiler->target_flags & ORC_TARGET_SSE_64BIT) { compiler->is_64bit = TRUE; } if (compiler->target_flags & ORC_TARGET_SSE_FRAME_POINTER) { compiler->use_frame_pointer = TRUE; } if (!(compiler->target_flags & ORC_TARGET_SSE_SHORT_JUMPS)) { compiler->long_jumps = TRUE; } if (compiler->is_64bit) { for(i=ORC_GP_REG_BASE;ivalid_regs[i] = 1; } compiler->valid_regs[X86_ESP] = 0; #ifndef MMX for(i=X86_XMM0;ivalid_regs[i] = 1; } #else for(i=X86_XMM0;ivalid_regs[i] = 1; } #endif compiler->save_regs[X86_EBX] = 1; compiler->save_regs[X86_EBP] = 1; compiler->save_regs[X86_R12] = 1; compiler->save_regs[X86_R13] = 1; compiler->save_regs[X86_R14] = 1; compiler->save_regs[X86_R15] = 1; #ifdef HAVE_OS_WIN32 compiler->save_regs[X86_EDI] = 1; compiler->save_regs[X86_ESI] = 1; for(i=X86_XMM0+6;isave_regs[i] = 1; } #endif } else { for(i=ORC_GP_REG_BASE;ivalid_regs[i] = 1; } compiler->valid_regs[X86_ESP] = 0; if (compiler->use_frame_pointer) { compiler->valid_regs[X86_EBP] = 0; } for(i=X86_XMM0;ivalid_regs[i] = 1; } compiler->save_regs[X86_EBX] = 1; compiler->save_regs[X86_EDI] = 1; compiler->save_regs[X86_EBP] = 1; } for(i=0;i<128;i++){ compiler->alloc_regs[i] = 0; compiler->used_regs[i] = 0; } if (compiler->is_64bit) { #ifdef HAVE_OS_WIN32 compiler->exec_reg = X86_ECX; compiler->gp_tmpreg = X86_EDX; #else compiler->exec_reg = X86_EDI; compiler->gp_tmpreg = X86_ECX; #endif } else { compiler->gp_tmpreg = X86_ECX; if (compiler->use_frame_pointer) { compiler->exec_reg = X86_EBX; } else { compiler->exec_reg = X86_EBP; } } compiler->valid_regs[compiler->gp_tmpreg] = 0; compiler->valid_regs[compiler->exec_reg] = 0; switch (compiler->max_var_size) { case 1: compiler->loop_shift = 4; break; case 2: compiler->loop_shift = 3; break; case 4: compiler->loop_shift = 2; break; case 8: compiler->loop_shift = 1; break; default: ORC_ERROR("unhandled max var size %d", compiler->max_var_size); break; } #ifdef MMX compiler->loop_shift--; #endif /* This limit is arbitrary, but some large functions run slightly slower when unrolled (ginger Core2 6,15,6), and only some small functions run faster when unrolled. Most are the same speed. */ if (compiler->n_insns <= 10) { compiler->unroll_shift = 1; } if (!compiler->long_jumps) { compiler->unroll_shift = 0; } if (compiler->loop_shift == 0) { /* FIXME something is broken with loop_shift=0, unroll_shift=1 */ compiler->unroll_shift = 0; } compiler->alloc_loop_counter = TRUE; compiler->allow_gp_on_stack = TRUE; { for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; if (strcmp (opcode->name, "ldreslinb") == 0 || strcmp (opcode->name, "ldreslinl") == 0 || strcmp (opcode->name, "ldresnearb") == 0 || strcmp (opcode->name, "ldresnearl") == 0) { compiler->vars[insn->src_args[0]].need_offset_reg = TRUE; } } } } void sse_save_accumulators (OrcCompiler *compiler) { int i; int src; int tmp; for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_ACCUMULATOR: src = var->alloc; tmp = orc_compiler_get_temp_reg (compiler); #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(3,2,3,2), src, tmp); #else orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(3,2,3,2), src, tmp); #endif if (var->size == 2) { orc_sse_emit_paddw (compiler, tmp, src); } else { orc_sse_emit_paddd (compiler, tmp, src); } #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(1,1,1,1), src, tmp); if (var->size == 2) { orc_sse_emit_paddw (compiler, tmp, src); } else { orc_sse_emit_paddd (compiler, tmp, src); } #endif if (var->size == 2) { #ifndef MMX orc_sse_emit_pshuflw (compiler, ORC_SSE_SHUF(1,1,1,1), src, tmp); #else orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(1,1,1,1), src, tmp); #endif orc_sse_emit_paddw (compiler, tmp, src); } if (var->size == 2) { orc_sse_emit_movd_store_register (compiler, src, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor, accumulators[i-ORC_VAR_A1]), compiler->exec_reg); } else { orc_x86_emit_mov_sse_memoffset (compiler, 4, src, (int)ORC_STRUCT_OFFSET(OrcExecutor, accumulators[i-ORC_VAR_A1]), compiler->exec_reg, var->is_aligned, var->is_uncached); } break; default: break; } } } void sse_load_constant (OrcCompiler *compiler, int reg, int size, int value) { orc_sse_load_constant (compiler, reg, size, value); } void orc_sse_load_constant (OrcCompiler *compiler, int reg, int size, orc_uint64 value) { int i; if (size == 8) { int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); /* FIXME how ugly and slow! */ orc_x86_emit_mov_imm_reg (compiler, 4, value>>0, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, offset + 0, compiler->exec_reg); orc_x86_emit_mov_imm_reg (compiler, 4, value>>32, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, offset + 4, compiler->exec_reg); orc_x86_emit_mov_memoffset_sse (compiler, 8, offset, compiler->exec_reg, reg, FALSE); #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(1,0,1,0), reg, reg); #endif return; } if (size == 1) { value &= 0xff; value |= (value << 8); value |= (value << 16); } if (size == 2) { value &= 0xffff; value |= (value << 16); } ORC_ASM_CODE(compiler, "# loading constant %d 0x%08x\n", (int)value, (int)value); if (value == 0) { orc_sse_emit_pxor(compiler, reg, reg); return; } if (value == 0xffffffff) { orc_sse_emit_pcmpeqb (compiler, reg, reg); return; } if (compiler->target_flags & ORC_TARGET_SSE_SSSE3) { if (value == 0x01010101) { orc_sse_emit_pcmpeqb (compiler, reg, reg); orc_sse_emit_pabsb (compiler, reg, reg); return; } } for(i=1;i<32;i++){ orc_uint32 v; v = (0xffffffff<>i); if (value == v) { orc_sse_emit_pcmpeqb (compiler, reg, reg); orc_sse_emit_psrld_imm (compiler, i, reg); return; } } for(i=1;i<16;i++){ orc_uint32 v; v = (0xffff & (0xffff<>i)) | (0xffff0000 & (0xffff0000>>i)); if (value == v) { orc_sse_emit_pcmpeqb (compiler, reg, reg); orc_sse_emit_psrlw_imm (compiler, i, reg); return; } } orc_x86_emit_mov_imm_reg (compiler, 4, value, compiler->gp_tmpreg); orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, reg); #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(0,0,0,0), reg, reg); #else orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(1,0,1,0), reg, reg); #endif } void sse_load_constant_long (OrcCompiler *compiler, int reg, OrcConstant *constant) { int i; int offset = ORC_STRUCT_OFFSET(OrcExecutor,arrays[ORC_VAR_T1]); /* FIXME this is slower than it could be */ ORC_ASM_CODE(compiler, "# loading constant %08x %08x %08x %08x\n", constant->full_value[0], constant->full_value[1], constant->full_value[2], constant->full_value[3]); for(i=0;i<4;i++){ orc_x86_emit_mov_imm_reg (compiler, 4, constant->full_value[i], compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, offset + 4*i, compiler->exec_reg); } orc_x86_emit_mov_memoffset_sse (compiler, 16, offset, compiler->exec_reg, reg, FALSE); } void sse_load_constants_outer (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: break; case ORC_VAR_TYPE_ACCUMULATOR: orc_sse_emit_pxor (compiler, compiler->vars[i].alloc, compiler->vars[i].alloc); break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error(compiler,"bad vartype"); break; } } orc_sse_emit_invariants (compiler); /* FIXME move to a better place */ for(i=0;in_constants;i++){ compiler->constants[i].alloc_reg = orc_compiler_get_constant_reg (compiler); } for(i=0;in_constants;i++){ if (compiler->constants[i].alloc_reg) { if (compiler->constants[i].is_long) { sse_load_constant_long (compiler, compiler->constants[i].alloc_reg, compiler->constants + i); } else { sse_load_constant (compiler, compiler->constants[i].alloc_reg, 4, compiler->constants[i].value); } } } { for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; if (strcmp (opcode->name, "ldreslinb") == 0 || strcmp (opcode->name, "ldreslinl") == 0 || strcmp (opcode->name, "ldresnearb") == 0 || strcmp (opcode->name, "ldresnearl") == 0) { if (compiler->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[1]]), compiler->exec_reg, compiler->vars[insn->src_args[0]].ptr_offset); } else { orc_x86_emit_mov_imm_reg (compiler, 4, compiler->vars[insn->src_args[1]].value.i, compiler->vars[insn->src_args[0]].ptr_offset); } } } } } void sse_load_constants_inner (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: if (compiler->vars[i].ptr_register) { orc_x86_emit_mov_memoffset_reg (compiler, compiler->is_64bit ? 8 : 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg, compiler->vars[i].ptr_register); } break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error(compiler,"bad vartype"); break; } } } void sse_add_strides (OrcCompiler *compiler) { int i; for(i=0;ivars[i].name == NULL) continue; switch (compiler->vars[i].vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[i]), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_add_reg_memoffset (compiler, compiler->is_64bit ? 8 : 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[i]), compiler->exec_reg); if (compiler->vars[i].ptr_register == 0) { orc_compiler_error (compiler, "unimplemented: stride on pointer stored in memory"); } break; case ORC_VAR_TYPE_ACCUMULATOR: break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error(compiler,"bad vartype"); break; } } } static int get_align_var (OrcCompiler *compiler) { int i; for(i=ORC_VAR_D1;i<=ORC_VAR_S8;i++){ if (compiler->vars[i].size == 0) continue; if ((compiler->vars[i].size << compiler->loop_shift) >= 16) { return i; } } for(i=ORC_VAR_D1;i<=ORC_VAR_S8;i++){ if (compiler->vars[i].size == 0) continue; if ((compiler->vars[i].size << compiler->loop_shift) >= 8) { return i; } } for(i=ORC_VAR_D1;i<=ORC_VAR_S8;i++){ if (compiler->vars[i].size == 0) continue; return i; } orc_compiler_error(compiler, "could not find alignment variable"); return -1; } static int get_shift (int size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: ORC_ERROR("bad size %d", size); } return -1; } static void orc_emit_split_3_regions (OrcCompiler *compiler) { int align_var; int align_shift; int var_size_shift; align_var = get_align_var (compiler); var_size_shift = get_shift (compiler->vars[align_var].size); align_shift = var_size_shift + compiler->loop_shift; /* determine how many iterations until align array is aligned (n1) */ orc_x86_emit_mov_imm_reg (compiler, 4, 16, X86_EAX); orc_x86_emit_sub_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[align_var]), compiler->exec_reg, X86_EAX); orc_x86_emit_and_imm_reg (compiler, 4, (1<exec_reg); orc_x86_emit_jle (compiler, 6); /* If so, we have a standard 3-region split. */ orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1), compiler->exec_reg); /* Calculate n2 */ orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_sub_reg_reg (compiler, 4, X86_EAX, compiler->gp_tmpreg); orc_x86_emit_mov_reg_reg (compiler, 4, compiler->gp_tmpreg, X86_EAX); orc_x86_emit_sar_imm_reg (compiler, 4, compiler->loop_shift + compiler->unroll_shift, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); /* Calculate n3 */ orc_x86_emit_and_imm_reg (compiler, 4, (1<<(compiler->loop_shift + compiler->unroll_shift))-1, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); orc_x86_emit_jmp (compiler, 7); /* else, iterations are all unaligned: n1=n, n2=0, n3=0 */ orc_x86_emit_label (compiler, 6); orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1), compiler->exec_reg); orc_x86_emit_mov_imm_reg (compiler, 4, 0, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); orc_x86_emit_label (compiler, 7); } static void orc_emit_split_2_regions (OrcCompiler *compiler) { int align_var; int align_shift ORC_GNUC_UNUSED; int var_size_shift; align_var = get_align_var (compiler); var_size_shift = get_shift (compiler->vars[align_var].size); align_shift = var_size_shift + compiler->loop_shift; /* Calculate n2 */ orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_mov_reg_reg (compiler, 4, compiler->gp_tmpreg, X86_EAX); orc_x86_emit_sar_imm_reg (compiler, 4, compiler->loop_shift + compiler->unroll_shift, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); /* Calculate n3 */ orc_x86_emit_and_imm_reg (compiler, 4, (1<<(compiler->loop_shift + compiler->unroll_shift))-1, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); } #ifndef MMX static int orc_program_has_float (OrcCompiler *compiler) { int j; for(j=0;jn_insns;j++){ OrcInstruction *insn = compiler->insns + j; OrcStaticOpcode *opcode = insn->opcode; if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) return TRUE; } return FALSE; } #endif #define LABEL_REGION1_SKIP 1 #define LABEL_INNER_LOOP_START 2 #define LABEL_REGION2_SKIP 3 #define LABEL_OUTER_LOOP 4 #define LABEL_OUTER_LOOP_SKIP 5 #define LABEL_STEP_DOWN(x) (8+(x)) #define LABEL_STEP_UP(x) (13+(x)) void orc_compiler_sse_assemble (OrcCompiler *compiler) { #ifndef MMX int set_mxcsr = FALSE; #endif int align_var; int is_aligned; if (0 && orc_x86_assemble_copy_check (compiler)) { /* The rep movs implementation isn't faster most of the time */ orc_x86_assemble_copy (compiler); return; } align_var = get_align_var (compiler); is_aligned = compiler->vars[align_var].is_aligned; { orc_sse_emit_loop (compiler, 0, 0); compiler->codeptr = compiler->code; free (compiler->asm_code); compiler->asm_code = NULL; compiler->asm_code_len = 0; memset (compiler->labels, 0, sizeof (compiler->labels)); memset (compiler->labels_int, 0, sizeof (compiler->labels_int)); compiler->n_fixups = 0; compiler->n_output_insns = 0; } if (compiler->error) return; orc_x86_emit_prologue (compiler); #ifndef MMX if (orc_program_has_float (compiler)) { set_mxcsr = TRUE; orc_sse_set_mxcsr (compiler); } #endif sse_load_constants_outer (compiler); if (compiler->program->is_2d) { if (compiler->program->constant_m > 0) { orc_x86_emit_mov_imm_reg (compiler, 4, compiler->program->constant_m, X86_EAX); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A2]), compiler->exec_reg); } else { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A1]), compiler->exec_reg, X86_EAX); orc_x86_emit_test_reg_reg (compiler, 4, X86_EAX, X86_EAX); orc_x86_emit_jle (compiler, LABEL_OUTER_LOOP_SKIP); orc_x86_emit_mov_reg_memoffset (compiler, 4, X86_EAX, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[ORC_VAR_A2]), compiler->exec_reg); } orc_x86_emit_label (compiler, LABEL_OUTER_LOOP); } if (compiler->program->constant_n > 0 && compiler->program->constant_n <= ORC_SSE_ALIGNED_DEST_CUTOFF) { /* don't need to load n */ } else if (compiler->loop_shift > 0) { if (compiler->has_iterator_opcode || is_aligned) { orc_emit_split_2_regions (compiler); } else { /* split n into three regions, with center region being aligned */ orc_emit_split_3_regions (compiler); } } else { /* loop shift is 0, no need to split */ orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,n), compiler->exec_reg, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); } sse_load_constants_inner (compiler); if (compiler->program->constant_n > 0 && compiler->program->constant_n <= ORC_SSE_ALIGNED_DEST_CUTOFF) { int n_left = compiler->program->constant_n; int save_loop_shift; int loop_shift; compiler->offset = 0; save_loop_shift = compiler->loop_shift; while (n_left >= (1<loop_shift)) { ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_sse_emit_loop (compiler, compiler->offset, 0); n_left -= 1<loop_shift; compiler->offset += 1<loop_shift; } for(loop_shift = compiler->loop_shift-1; loop_shift>=0; loop_shift--) { if (n_left >= (1<loop_shift = loop_shift; ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", loop_shift); orc_sse_emit_loop (compiler, compiler->offset, 0); n_left -= 1<offset += 1<loop_shift = save_loop_shift; } else { int ui, ui_max; int emit_region1 = TRUE; int emit_region3 = TRUE; if (compiler->has_iterator_opcode || is_aligned) { emit_region1 = FALSE; } if (compiler->loop_shift == 0) { emit_region1 = FALSE; emit_region3 = FALSE; } if (emit_region1) { int save_loop_shift; int l; save_loop_shift = compiler->loop_shift; compiler->vars[align_var].is_aligned = FALSE; for (l=0;lloop_shift = l; ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_x86_emit_test_imm_memoffset (compiler, 4, 1<loop_shift, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter1), compiler->exec_reg); orc_x86_emit_je (compiler, LABEL_STEP_UP(compiler->loop_shift)); orc_sse_emit_loop (compiler, 0, 1<loop_shift); orc_x86_emit_label (compiler, LABEL_STEP_UP(compiler->loop_shift)); } compiler->loop_shift = save_loop_shift; compiler->vars[align_var].is_aligned = TRUE; } orc_x86_emit_label (compiler, LABEL_REGION1_SKIP); orc_x86_emit_cmp_imm_memoffset (compiler, 4, 0, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); orc_x86_emit_je (compiler, LABEL_REGION2_SKIP); if (compiler->loop_counter != ORC_REG_INVALID) { orc_x86_emit_mov_memoffset_reg (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor, counter2), compiler->exec_reg, compiler->loop_counter); } ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_x86_emit_align (compiler, 4); orc_x86_emit_label (compiler, LABEL_INNER_LOOP_START); ui_max = 1<unroll_shift; for(ui=0;uioffset = ui<loop_shift; orc_sse_emit_loop (compiler, compiler->offset, (ui==ui_max-1) << (compiler->loop_shift + compiler->unroll_shift)); } compiler->offset = 0; if (compiler->loop_counter != ORC_REG_INVALID) { orc_x86_emit_add_imm_reg (compiler, 4, -1, compiler->loop_counter, TRUE); } else { orc_x86_emit_dec_memoffset (compiler, 4, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg); } orc_x86_emit_jne (compiler, LABEL_INNER_LOOP_START); orc_x86_emit_label (compiler, LABEL_REGION2_SKIP); if (emit_region3) { int save_loop_shift; int l; save_loop_shift = compiler->loop_shift + compiler->unroll_shift; compiler->vars[align_var].is_aligned = FALSE; for(l=save_loop_shift - 1; l >= 0; l--) { compiler->loop_shift = l; ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift); orc_x86_emit_test_imm_memoffset (compiler, 4, 1<loop_shift, (int)ORC_STRUCT_OFFSET(OrcExecutor,counter3), compiler->exec_reg); orc_x86_emit_je (compiler, LABEL_STEP_DOWN(compiler->loop_shift)); orc_sse_emit_loop (compiler, 0, 1<loop_shift); orc_x86_emit_label (compiler, LABEL_STEP_DOWN(compiler->loop_shift)); } compiler->loop_shift = save_loop_shift; } } if (compiler->program->is_2d && compiler->program->constant_m != 1) { sse_add_strides (compiler); orc_x86_emit_add_imm_memoffset (compiler, 4, -1, (int)ORC_STRUCT_OFFSET(OrcExecutor,params[ORC_VAR_A2]), compiler->exec_reg); orc_x86_emit_jne (compiler, LABEL_OUTER_LOOP); orc_x86_emit_label (compiler, LABEL_OUTER_LOOP_SKIP); } sse_save_accumulators (compiler); #ifndef MMX if (set_mxcsr) { orc_sse_restore_mxcsr (compiler); } #else orc_x86_emit_emms (compiler); #endif orc_x86_emit_epilogue (compiler); orc_x86_calculate_offsets (compiler); orc_x86_output_insns (compiler); orc_x86_do_fixups (compiler); } void orc_sse_emit_loop (OrcCompiler *compiler, int offset, int update) { int j; int k; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; compiler->insn_index = j; if (insn->flags & ORC_INSN_FLAG_INVARIANT) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name); compiler->min_temp_reg = ORC_VEC_REG_BASE; compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { if (!(insn->opcode->flags & (ORC_STATIC_OPCODE_ACCUMULATOR|ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_STORE)) && compiler->vars[insn->dest_args[0]].alloc != compiler->vars[insn->src_args[0]].alloc) { #ifdef MMX orc_sse_emit_movq (compiler, compiler->vars[insn->src_args[0]].alloc, compiler->vars[insn->dest_args[0]].alloc); #else orc_sse_emit_movdqu (compiler, compiler->vars[insn->src_args[0]].alloc, compiler->vars[insn->dest_args[0]].alloc); #endif } rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_error (compiler, "no code generation rule for %s", opcode->name); } } if (update) { for(k=0;kvars + k; if (var->name == NULL) continue; if (var->vartype == ORC_VAR_TYPE_SRC || var->vartype == ORC_VAR_TYPE_DEST) { int offset; if (var->update_type == 0) { offset = 0; } else if (var->update_type == 1) { offset = (var->size * update) >> 1; } else { offset = var->size * update; } if (offset != 0) { if (compiler->vars[k].ptr_register) { orc_x86_emit_add_imm_reg (compiler, compiler->is_64bit ? 8 : 4, offset, compiler->vars[k].ptr_register, FALSE); } else { orc_x86_emit_add_imm_memoffset (compiler, compiler->is_64bit ? 8 : 4, offset, (int)ORC_STRUCT_OFFSET(OrcExecutor, arrays[k]), compiler->exec_reg); } } } } } } void orc_sse_emit_invariants (OrcCompiler *compiler) { int j; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue; ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name); compiler->insn_shift = compiler->loop_shift; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { compiler->insn_shift += 1; } if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { compiler->insn_shift += 2; } rule = insn->rule; if (rule && rule->emit) { rule->emit (compiler, rule->emit_user, insn); } else { orc_compiler_error (compiler, "no code generation rule for %s", opcode->name); } } } orc-0.4.18/orc/orcmmx.c0000664000175000017500000001137212071634360011554 00000000000000 #include "config.h" #include #include #include #include #include #include #include /** * SECTION:orcmmx * @title: MMX * @short_description: code generation for MMX */ const char * orc_x86_get_regname_mmx(int i) { static const char *x86_regs[] = { "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", "mm8", "mm9", "mm10", "mm11", "mm12", "mm13", "mm14", "mm15" }; if (i>=X86_MM0 && icodeptr++ = 0x0f; *compiler->codeptr++ = 0x6e; break; case 8: ORC_ASM_CODE(compiler," movq %d(%%%s,%%%s,%d), %%%s\n", offset, orc_x86_get_regname_ptr(compiler, reg1), orc_x86_get_regname_ptr(compiler, regindex), 1<codeptr++ = 0x0f; *compiler->codeptr++ = 0x7e; break; default: ORC_COMPILER_ERROR(compiler, "bad size"); break; } orc_x86_emit_modrm_memindex (compiler, reg2, offset, reg1, regindex, shift); } void orc_x86_emit_mov_memoffset_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int reg2, int is_aligned) { switch (size) { case 4: ORC_ASM_CODE(compiler," movd %d(%%%s), %%%s\n", offset, orc_x86_get_regname_ptr(compiler, reg1), orc_x86_get_regname_mmx(reg2)); orc_x86_emit_rex(compiler, 0, reg2, 0, reg1); *compiler->codeptr++ = 0x0f; *compiler->codeptr++ = 0x6e; break; case 8: ORC_ASM_CODE(compiler," movq %d(%%%s), %%%s\n", offset, orc_x86_get_regname_ptr(compiler, reg1), orc_x86_get_regname_mmx(reg2)); orc_x86_emit_rex(compiler, 0, reg2, 0, reg1); *compiler->codeptr++ = 0x0f; *compiler->codeptr++ = 0x6f; break; default: ORC_COMPILER_ERROR(compiler, "bad size"); break; } orc_x86_emit_modrm_memoffset (compiler, offset, reg1, reg2); } void orc_x86_emit_mov_mmx_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2, int aligned, int uncached) { switch (size) { case 4: ORC_ASM_CODE(compiler," movd %%%s, %d(%%%s)\n", orc_x86_get_regname_mmx(reg1), offset, orc_x86_get_regname_ptr(compiler, reg2)); orc_x86_emit_rex(compiler, 0, reg1, 0, reg2); *compiler->codeptr++ = 0x0f; *compiler->codeptr++ = 0x7e; break; case 8: ORC_ASM_CODE(compiler," movq %%%s, %d(%%%s)\n", orc_x86_get_regname_mmx(reg1), offset, orc_x86_get_regname_ptr(compiler, reg2)); orc_x86_emit_rex(compiler, 0, reg1, 0, reg2); *compiler->codeptr++ = 0x0f; *compiler->codeptr++ = 0x7f; break; default: ORC_COMPILER_ERROR(compiler, "bad size"); break; } orc_x86_emit_modrm_memoffset (compiler, offset, reg2, reg1); } #endif void orc_x86_emit_mov_memoffset_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int reg2, int is_aligned) { switch (size) { case 4: orc_mmx_emit_movd_load_memoffset (compiler, offset, reg1, reg2); break; case 8: orc_mmx_emit_movq_load_memoffset (compiler, offset, reg1, reg2); break; default: ORC_COMPILER_ERROR(compiler, "bad size"); break; } } void orc_x86_emit_mov_memindex_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int regindex, int shift, int reg2, int is_aligned) { switch (size) { case 4: orc_mmx_emit_movd_load_memindex (compiler, offset, reg1, regindex, shift, reg2); break; case 8: orc_mmx_emit_movq_load_memindex (compiler, offset, reg1, regindex, shift, reg2); break; default: ORC_COMPILER_ERROR(compiler, "bad size"); break; } } void orc_x86_emit_mov_mmx_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2, int aligned, int uncached) { switch (size) { case 4: orc_mmx_emit_movd_store_memoffset (compiler, offset, reg1, reg2); break; case 8: orc_mmx_emit_movq_store_memoffset (compiler, offset, reg1, reg2); break; default: ORC_COMPILER_ERROR(compiler, "bad size"); break; } } orc-0.4.18/orc/orccompiler.c0000664000175000017500000010534012117155734012570 00000000000000 #include "config.h" #include #include #include #include #include #include #ifdef HAVE_VALGRIND_VALGRIND_H #include #endif /** * SECTION:orccompiler * @title: OrcCompiler * @short_description: Compile Orc programs * * OrcCompiler is the object used to convert Orc programs contained * in an OrcProgram object into assembly code and object code. * * The OrcCompileResult enum is used to indicate whether or not * a compilation attempt was successful or not. The macros * ORC_COMPILE_RESULT_IS_SUCCESSFUL() and ORC_COMPILE_RESULT_IS_FATAL() * should be used instead of checking values directly. * * When a program is compiled, the compiler calls the functions * contained in various OrcRule structures. These functions generate * assembly and object instructions by calling ORC_ASM_CODE() * or functions that use ORC_ASM_CODE() internally. */ void orc_compiler_assign_rules (OrcCompiler *compiler); void orc_compiler_global_reg_alloc (OrcCompiler *compiler); void orc_compiler_rewrite_insns (OrcCompiler *compiler); void orc_compiler_rewrite_vars (OrcCompiler *compiler); void orc_compiler_rewrite_vars2 (OrcCompiler *compiler); int orc_compiler_dup_temporary (OrcCompiler *compiler, int var, int j); int orc_compiler_new_temporary (OrcCompiler *compiler, int size); void orc_compiler_check_sizes (OrcCompiler *compiler); static char **_orc_compiler_flag_list; int _orc_compiler_flag_backup; int _orc_compiler_flag_emulate; int _orc_compiler_flag_debug; int _orc_compiler_flag_randomize; void _orc_compiler_init (void) { const char *envvar; envvar = getenv ("ORC_CODE"); if (envvar != NULL) { _orc_compiler_flag_list = strsplit (envvar, ','); } _orc_compiler_flag_backup = orc_compiler_flag_check ("backup"); _orc_compiler_flag_emulate = orc_compiler_flag_check ("emulate"); _orc_compiler_flag_debug = orc_compiler_flag_check ("debug"); _orc_compiler_flag_randomize = orc_compiler_flag_check ("randomize"); } int orc_compiler_flag_check (const char *flag) { int i; if (_orc_compiler_flag_list == NULL) return FALSE; for (i=0;_orc_compiler_flag_list[i];i++){ if (strcmp (_orc_compiler_flag_list[i], flag) == 0) return TRUE; } return FALSE; } int orc_compiler_allocate_register (OrcCompiler *compiler, int data_reg) { int i; int roff; int reg; int offset; if (data_reg) { offset = compiler->target->data_register_offset; } else { offset = ORC_GP_REG_BASE; } roff = 0; if (_orc_compiler_flag_randomize) { /* for testing */ roff = rand()&0x1f; } for(i=0;i<32;i++){ reg = offset + ((roff + i)&0x1f); if (compiler->valid_regs[reg] && !compiler->save_regs[reg] && compiler->alloc_regs[reg] == 0) { compiler->alloc_regs[reg]++; compiler->used_regs[reg] = 1; return reg; } } for(i=0;i<32;i++){ reg = offset + ((roff + i)&0x1f); if (compiler->valid_regs[reg] && compiler->alloc_regs[reg] == 0) { compiler->alloc_regs[reg]++; compiler->used_regs[reg] = 1; return reg; } } if (data_reg || !compiler->allow_gp_on_stack) { orc_compiler_error (compiler, "register overflow for %s reg", data_reg ? "vector" : "gp"); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } return 0; } /** * orc_program_compile: * @program: the OrcProgram to compile * * Compiles an Orc program for the current CPU. If successful, * executable code for the program was generated and can be * executed. * * The return value indicates various levels of success or failure. * Success can be determined by checking for a true value of the * macro ORC_COMPILE_RESULT_IS_SUCCESSFUL() on the return value. This * indicates that executable code was generated. If the macro * ORC_COMPILE_RESULT_IS_FATAL() on the return value evaluates to * true, then there was a syntactical error in the program. If the * result is neither successful nor fatal, the program can still be * emulated. * * Returns: an OrcCompileResult */ OrcCompileResult orc_program_compile (OrcProgram *program) { return orc_program_compile_for_target (program, orc_target_get_default ()); } /** * orc_program_compile_for_target: * @program: the OrcProgram to compile * * Compiles an Orc program for the given target, using the * default target flags for that target. * * Returns: an OrcCompileResult */ OrcCompileResult orc_program_compile_for_target (OrcProgram *program, OrcTarget *target) { unsigned int flags; if (target) { flags = target->get_default_flags (); } else { flags = 0; } return orc_program_compile_full (program, target, flags); } /** * orc_program_compile_full: * @program: the OrcProgram to compile * * Compiles an Orc program for the given target, using the * given target flags. * * Returns: an OrcCompileResult */ OrcCompileResult orc_program_compile_full (OrcProgram *program, OrcTarget *target, unsigned int flags) { OrcCompiler *compiler; int i; OrcCompileResult result; ORC_INFO("initializing compiler for program \"%s\"", program->name); compiler = malloc (sizeof(OrcCompiler)); memset (compiler, 0, sizeof(OrcCompiler)); if (program->backup_func) { program->code_exec = program->backup_func; } else { program->code_exec = (void *)orc_executor_emulate; } compiler->program = program; compiler->target = target; compiler->target_flags = flags; { ORC_LOG("variables"); for(i=0;ivars[i].size > 0) { ORC_LOG("%d: %s size %d type %d alloc %d", i, program->vars[i].name, program->vars[i].size, program->vars[i].vartype, program->vars[i].alloc); } } ORC_LOG("instructions"); for(i=0;in_insns;i++){ ORC_LOG("%d: %s %d %d %d %d", i, program->insns[i].opcode->name, program->insns[i].dest_args[0], program->insns[i].dest_args[1], program->insns[i].src_args[0], program->insns[i].src_args[1]); } } memcpy (compiler->insns, program->insns, program->n_insns * sizeof(OrcInstruction)); compiler->n_insns = program->n_insns; memcpy (compiler->vars, program->vars, ORC_N_VARIABLES * sizeof(OrcVariable)); memset (compiler->vars + ORC_N_VARIABLES, 0, (ORC_N_COMPILER_VARIABLES - ORC_N_VARIABLES) * sizeof(OrcVariable)); compiler->n_temp_vars = program->n_temp_vars; compiler->n_dup_vars = 0; for(i=0;i<32;i++) { compiler->valid_regs[i] = 1; } orc_compiler_check_sizes (compiler); if (compiler->error) goto error; if (compiler->target) { compiler->target->compiler_init (compiler); } orc_compiler_rewrite_insns (compiler); if (compiler->error) goto error; orc_compiler_rewrite_vars (compiler); if (compiler->error) goto error; #if 0 { ORC_ERROR("variables"); for(i=0;ivars[i].size > 0) { ORC_ERROR("%d: %s size %d type %d alloc %d [%d,%d]", i, compiler->vars[i].name, compiler->vars[i].size, compiler->vars[i].vartype, compiler->vars[i].alloc, compiler->vars[i].first_use, compiler->vars[i].last_use); } } ORC_ERROR("instructions"); for(i=0;in_insns;i++){ ORC_ERROR("%d: %s %d %d %d %d", i, compiler->insns[i].opcode->name, compiler->insns[i].dest_args[0], compiler->insns[i].dest_args[1], compiler->insns[i].src_args[0], compiler->insns[i].src_args[1]); } } #endif program->orccode = orc_code_new (); program->orccode->is_2d = program->is_2d; program->orccode->constant_n = program->constant_n; program->orccode->constant_m = program->constant_m; program->orccode->exec = program->code_exec; program->orccode->n_insns = compiler->n_insns; program->orccode->insns = malloc(sizeof(OrcInstruction) * compiler->n_insns); memcpy (program->orccode->insns, compiler->insns, sizeof(OrcInstruction) * compiler->n_insns); program->orccode->vars = malloc (sizeof(OrcCodeVariable) * ORC_N_COMPILER_VARIABLES); memset (program->orccode->vars, 0, sizeof(OrcCodeVariable) * ORC_N_COMPILER_VARIABLES); for(i=0;iorccode->vars[i].vartype = compiler->vars[i].vartype; program->orccode->vars[i].size = compiler->vars[i].size; program->orccode->vars[i].value = compiler->vars[i].value; } if (program->backup_func && _orc_compiler_flag_backup) { orc_compiler_error (compiler, "Compilation disabled, using backup"); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; goto error; } if (_orc_compiler_flag_emulate || target == NULL) { program->code_exec = (void *)orc_executor_emulate; program->orccode->exec = (void *)orc_executor_emulate; orc_compiler_error (compiler, "Compilation disabled, using emulation"); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; goto error; } if (compiler->target) { orc_compiler_global_reg_alloc (compiler); orc_compiler_rewrite_vars2 (compiler); } if (compiler->error) goto error; orc_compiler_assign_rules (compiler); if (compiler->error) goto error; ORC_INFO("allocating code memory"); compiler->code = malloc(65536); compiler->codeptr = compiler->code; if (compiler->error) goto error; ORC_INFO("compiling for target \"%s\"", compiler->target->name); compiler->target->compile (compiler); if (compiler->error) { compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; goto error; } program->orccode->code_size = compiler->codeptr - compiler->code; orc_code_allocate_codemem (program->orccode, program->orccode->code_size); memcpy (program->orccode->code, compiler->code, program->orccode->code_size); #ifdef VALGRIND_DISCARD_TRANSLATIONS VALGRIND_DISCARD_TRANSLATIONS (program->orccode->exec, program->orccode->code_size); #endif if (compiler->target->flush_cache) { compiler->target->flush_cache (program->orccode); } program->code_exec = program->orccode->exec; program->asm_code = compiler->asm_code; result = compiler->result; for (i=0;in_dup_vars;i++){ free(compiler->vars[ORC_VAR_T1 + compiler->n_temp_vars + i].name); compiler->vars[ORC_VAR_T1 + compiler->n_temp_vars + i].name = NULL; } free (compiler->code); compiler->code = NULL; if (compiler->output_insns) free (compiler->output_insns); free (compiler); ORC_INFO("finished compiling (success)"); return result; error: if (compiler->error_msg) { ORC_WARNING ("program %s failed to compile, reason: %s", program->name, compiler->error_msg); } else { ORC_WARNING("program %s failed to compile, reason %d", program->name, compiler->result); } result = compiler->result; if (program->error_msg) free (program->error_msg); program->error_msg = compiler->error_msg; if (result == 0) { result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } if (compiler->asm_code) { free (compiler->asm_code); compiler->asm_code = NULL; } for (i=0;in_dup_vars;i++){ free(compiler->vars[ORC_VAR_T1 + compiler->n_temp_vars + i].name); compiler->vars[ORC_VAR_T1 + compiler->n_temp_vars + i].name = NULL; } free (compiler->code); compiler->code = NULL; if (compiler->output_insns) free (compiler->output_insns); free (compiler); ORC_INFO("finished compiling (fail)"); return result; } void orc_compiler_check_sizes (OrcCompiler *compiler) { int i; int j; int max_size = 1; for(i=0;in_insns;i++) { OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; int multiplier = 1; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { multiplier = 2; } else if (insn->flags & ORC_INSTRUCTION_FLAG_X4) { multiplier = 4; } for(j=0;jdest_size[j] == 0) continue; if (multiplier * opcode->dest_size[j] != compiler->vars[insn->dest_args[j]].size) { ORC_COMPILER_ERROR (compiler, "size mismatch, opcode %s dest[%d] is %d should be %d", opcode->name, j, compiler->vars[insn->dest_args[j]].size, multiplier * opcode->dest_size[j]); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; return; } max_size = MAX(max_size, multiplier * opcode->dest_size[j]); } for(j=0;jsrc_size[j] == 0) continue; if (multiplier * opcode->src_size[j] != compiler->vars[insn->src_args[j]].size && compiler->vars[insn->src_args[j]].vartype != ORC_VAR_TYPE_PARAM && compiler->vars[insn->src_args[j]].vartype != ORC_VAR_TYPE_CONST) { ORC_COMPILER_ERROR(compiler, "size mismatch, opcode %s src[%d] is %d should be %d", opcode->name, j, compiler->vars[insn->src_args[j]].size, multiplier * opcode->src_size[j]); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; return; } if (opcode->flags & ORC_STATIC_OPCODE_SCALAR && j >= 1 && compiler->vars[insn->src_args[j]].vartype != ORC_VAR_TYPE_PARAM && compiler->vars[insn->src_args[j]].vartype != ORC_VAR_TYPE_CONST) { ORC_COMPILER_ERROR(compiler, "opcode %s requires const or param source", opcode->name); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; return; } max_size = MAX(max_size, multiplier * opcode->src_size[j]); } if (opcode->flags & ORC_STATIC_OPCODE_SCALAR && opcode->src_size[1] == 0 && compiler->vars[insn->src_args[0]].vartype != ORC_VAR_TYPE_PARAM && compiler->vars[insn->src_args[0]].vartype != ORC_VAR_TYPE_CONST) { ORC_COMPILER_ERROR(compiler, "opcode %s requires const or param source", opcode->name); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; return; } } compiler->max_var_size = max_size; } static OrcStaticOpcode * get_load_opcode_for_size (int size) { switch (size) { case 1: return orc_opcode_find_by_name ("loadb"); case 2: return orc_opcode_find_by_name ("loadw"); case 4: return orc_opcode_find_by_name ("loadl"); case 8: return orc_opcode_find_by_name ("loadq"); default: ORC_ASSERT(0); } return NULL; } static OrcStaticOpcode * get_loadp_opcode_for_size (int size) { switch (size) { case 1: return orc_opcode_find_by_name ("loadpb"); case 2: return orc_opcode_find_by_name ("loadpw"); case 4: return orc_opcode_find_by_name ("loadpl"); case 8: return orc_opcode_find_by_name ("loadpq"); default: ORC_ASSERT(0); } return NULL; } static OrcStaticOpcode * get_store_opcode_for_size (int size) { switch (size) { case 1: return orc_opcode_find_by_name ("storeb"); case 2: return orc_opcode_find_by_name ("storew"); case 4: return orc_opcode_find_by_name ("storel"); case 8: return orc_opcode_find_by_name ("storeq"); default: ORC_ASSERT(0); } return NULL; } void orc_compiler_rewrite_insns (OrcCompiler *compiler) { int i; int j; OrcStaticOpcode *opcode; OrcProgram *program = compiler->program; compiler->n_insns = 0; for(j=0;jn_insns;j++){ OrcInstruction insn; OrcInstruction *xinsn; memcpy (&insn, program->insns + j, sizeof(OrcInstruction)); opcode = insn.opcode; if (!(opcode->flags & ORC_STATIC_OPCODE_LOAD)) { for(i=0;isrc_size[i] == 0) continue; var = compiler->vars + insn.src_args[i]; if (i > 0 && (opcode->flags & ORC_STATIC_OPCODE_SCALAR) && (!compiler->load_params || var->vartype != ORC_VAR_TYPE_PARAM)) continue; if (var->vartype == ORC_VAR_TYPE_SRC || var->vartype == ORC_VAR_TYPE_DEST) { OrcInstruction *cinsn; cinsn = compiler->insns + compiler->n_insns; compiler->n_insns++; cinsn->flags = insn.flags; cinsn->flags |= ORC_INSN_FLAG_ADDED; cinsn->flags &= ~(ORC_INSTRUCTION_FLAG_X2|ORC_INSTRUCTION_FLAG_X4); cinsn->opcode = get_load_opcode_for_size (var->size); cinsn->dest_args[0] = orc_compiler_new_temporary (compiler, var->size); cinsn->src_args[0] = insn.src_args[i]; insn.src_args[i] = cinsn->dest_args[0]; } else if (var->vartype == ORC_VAR_TYPE_CONST || var->vartype == ORC_VAR_TYPE_PARAM) { OrcInstruction *cinsn; int multiplier; cinsn = compiler->insns + compiler->n_insns; compiler->n_insns++; multiplier = 1; if (insn.flags & ORC_INSTRUCTION_FLAG_X2) { multiplier = 2; } if (insn.flags & ORC_INSTRUCTION_FLAG_X4) { multiplier = 4; } cinsn->flags = insn.flags; cinsn->flags |= ORC_INSN_FLAG_ADDED; cinsn->opcode = get_loadp_opcode_for_size (opcode->src_size[i]); cinsn->dest_args[0] = orc_compiler_new_temporary (compiler, opcode->src_size[i] * multiplier); if (var->vartype == ORC_VAR_TYPE_CONST) { compiler->vars[cinsn->dest_args[0]].flags |= ORC_VAR_FLAG_VOLATILE_WORKAROUND; } cinsn->src_args[0] = insn.src_args[i]; insn.src_args[i] = cinsn->dest_args[0]; } } } xinsn = compiler->insns + compiler->n_insns; memcpy (xinsn, &insn, sizeof(OrcInstruction)); compiler->n_insns++; if (!(opcode->flags & ORC_STATIC_OPCODE_STORE)) { for(i=0;idest_size[i] == 0) continue; var = compiler->vars + insn.dest_args[i]; if (var->vartype == ORC_VAR_TYPE_DEST) { OrcInstruction *cinsn; cinsn = compiler->insns + compiler->n_insns; compiler->n_insns++; cinsn->flags = xinsn->flags; cinsn->flags |= ORC_INSN_FLAG_ADDED; cinsn->flags &= ~(ORC_INSTRUCTION_FLAG_X2|ORC_INSTRUCTION_FLAG_X4); cinsn->opcode = get_store_opcode_for_size (var->size); cinsn->src_args[0] = orc_compiler_new_temporary (compiler, var->size); cinsn->dest_args[0] = xinsn->dest_args[i]; xinsn->dest_args[i] = cinsn->src_args[0]; } } } } } void orc_compiler_assign_rules (OrcCompiler *compiler) { int i; for(i=0;in_insns;i++) { OrcInstruction *insn = compiler->insns + i; insn->rule = orc_target_get_rule (compiler->target, insn->opcode, compiler->target_flags); if (insn->rule == NULL || insn->rule->emit == NULL) { orc_compiler_error (compiler, "no code generation rule for %s on " "target %s", insn->opcode->name, compiler->target->name); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; return; } } } int orc_compiler_get_temp_reg (OrcCompiler *compiler) { int j; for(j=0;jalloc_regs[j] = 0; } for(j=0;jvars[j].alloc) continue; ORC_DEBUG("var %d: %d %d %d", j, compiler->vars[j].alloc, compiler->vars[j].first_use, compiler->vars[j].last_use); if (compiler->vars[j].first_use == -1) { compiler->alloc_regs[compiler->vars[j].alloc] = 1; } else if (compiler->vars[j].first_use <= compiler->insn_index && compiler->vars[j].last_use >= compiler->insn_index) { compiler->alloc_regs[compiler->vars[j].alloc] = 1; } } for(j=0;jn_constants;j++){ if (compiler->constants[j].alloc_reg) { compiler->alloc_regs[compiler->constants[j].alloc_reg] = 1; } } ORC_DEBUG("at insn %d %s", compiler->insn_index, compiler->insns[compiler->insn_index].opcode->name); for(j=compiler->min_temp_reg;jvalid_regs[j] && !compiler->alloc_regs[j]) { compiler->min_temp_reg = j+1; if (compiler->max_used_temp_reg < j) compiler->max_used_temp_reg = j; return j; } } orc_compiler_error (compiler, "no temporary register available"); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; return 0; } void orc_compiler_rewrite_vars (OrcCompiler *compiler) { int j; int k; OrcInstruction *insn; OrcStaticOpcode *opcode; int var; int actual_var; for(j=0;jvars[j].alloc) continue; compiler->vars[j].last_use = -1; } for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; /* set up args */ for(k=0;ksrc_size[k] == 0) continue; var = insn->src_args[k]; if (compiler->vars[var].vartype == ORC_VAR_TYPE_DEST) { compiler->vars[var].load_dest = TRUE; } if (compiler->vars[var].vartype == ORC_VAR_TYPE_SRC || compiler->vars[var].vartype == ORC_VAR_TYPE_DEST || compiler->vars[var].vartype == ORC_VAR_TYPE_CONST || compiler->vars[var].vartype == ORC_VAR_TYPE_PARAM) { continue; } actual_var = var; if (compiler->vars[var].replaced) { actual_var = compiler->vars[var].replacement; insn->src_args[k] = actual_var; } if (!compiler->vars[var].used) { if (compiler->vars[var].vartype == ORC_VAR_TYPE_TEMP) { ORC_COMPILER_ERROR(compiler, "using uninitialized temp var at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } compiler->vars[var].used = TRUE; compiler->vars[var].first_use = j; } compiler->vars[actual_var].last_use = j; } for(k=0;kdest_size[k] == 0) continue; var = insn->dest_args[k]; if (compiler->vars[var].vartype == ORC_VAR_TYPE_DEST) { continue; } if (compiler->vars[var].vartype == ORC_VAR_TYPE_SRC) { ORC_COMPILER_ERROR(compiler,"using src var as dest at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } if (compiler->vars[var].vartype == ORC_VAR_TYPE_CONST) { ORC_COMPILER_ERROR(compiler,"using const var as dest at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } if (compiler->vars[var].vartype == ORC_VAR_TYPE_PARAM) { ORC_COMPILER_ERROR(compiler,"using param var as dest at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { if (compiler->vars[var].vartype != ORC_VAR_TYPE_ACCUMULATOR) { ORC_COMPILER_ERROR(compiler,"accumulating opcode to non-accumulator dest at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } } else { if (compiler->vars[var].vartype == ORC_VAR_TYPE_ACCUMULATOR) { ORC_COMPILER_ERROR(compiler,"non-accumulating opcode to accumulator dest at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } } actual_var = var; if (compiler->vars[var].replaced) { actual_var = compiler->vars[var].replacement; insn->dest_args[k] = actual_var; } if (!compiler->vars[var].used) { compiler->vars[actual_var].used = TRUE; compiler->vars[actual_var].first_use = j; } else { #if 0 if (compiler->vars[var].vartype == ORC_VAR_TYPE_DEST) { ORC_COMPILER_ERROR(compiler,"writing dest more than once at line %d", insn->line); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; } #endif if (compiler->vars[var].vartype == ORC_VAR_TYPE_TEMP) { actual_var = orc_compiler_dup_temporary (compiler, var, j); compiler->vars[var].replaced = TRUE; compiler->vars[var].replacement = actual_var; insn->dest_args[k] = actual_var; compiler->vars[actual_var].used = TRUE; compiler->vars[actual_var].first_use = j; } } compiler->vars[actual_var].last_use = j; } } } void orc_compiler_global_reg_alloc (OrcCompiler *compiler) { int i; OrcVariable *var; for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_PARAM: break; case ORC_VAR_TYPE_SRC: var->ptr_register = orc_compiler_allocate_register (compiler, FALSE); if (compiler->need_mask_regs) { var->mask_alloc = orc_compiler_allocate_register (compiler, TRUE); var->ptr_offset = orc_compiler_allocate_register (compiler, FALSE); var->aligned_data = orc_compiler_allocate_register (compiler, TRUE); } if (var->need_offset_reg) { var->ptr_offset = orc_compiler_allocate_register (compiler, FALSE); } break; case ORC_VAR_TYPE_DEST: var->ptr_register = orc_compiler_allocate_register (compiler, FALSE); break; case ORC_VAR_TYPE_ACCUMULATOR: var->first_use = -1; var->last_use = -1; var->alloc = orc_compiler_allocate_register (compiler, TRUE); break; case ORC_VAR_TYPE_TEMP: break; default: orc_compiler_error (compiler, "bad vartype"); compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; break; } if (compiler->error) break; } for(i=0;in_insns;i++){ OrcInstruction *insn = compiler->insns + i; OrcStaticOpcode *opcode = insn->opcode; if (opcode->flags & ORC_STATIC_OPCODE_INVARIANT) { var = compiler->vars + insn->dest_args[0]; var->first_use = -1; var->last_use = -1; var->alloc = orc_compiler_allocate_register (compiler, TRUE); insn->flags |= ORC_INSN_FLAG_INVARIANT; } if (opcode->flags & ORC_STATIC_OPCODE_ITERATOR) { compiler->has_iterator_opcode = TRUE; } } if (compiler->alloc_loop_counter && !compiler->error) { compiler->loop_counter = orc_compiler_allocate_register (compiler, FALSE); /* FIXME massive hack */ if (compiler->loop_counter == 0) { compiler->error = FALSE; compiler->result = ORC_COMPILE_RESULT_OK; } } } void orc_compiler_rewrite_vars2 (OrcCompiler *compiler) { int i; int j; int k; for(j=0;jn_insns;j++){ #if 1 /* must be true to chain src1 to dest: * - rule must handle it * - src1 must be last_use * - only one dest */ if (compiler->insns[j].flags & ORC_INSN_FLAG_INVARIANT) continue; if (!(compiler->insns[j].opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) && compiler->insns[j].opcode->dest_size[1] == 0) { int src1 = compiler->insns[j].src_args[0]; int dest = compiler->insns[j].dest_args[0]; if (compiler->vars[src1].last_use == j) { if (compiler->vars[src1].first_use == j) { k = orc_compiler_allocate_register (compiler, TRUE); compiler->vars[src1].alloc = k; } compiler->alloc_regs[compiler->vars[src1].alloc]++; compiler->vars[dest].alloc = compiler->vars[src1].alloc; } } #endif if (0) { /* immediate operand, don't load */ int src2 = compiler->insns[j].src_args[1]; compiler->vars[src2].alloc = 1; } else { int src2 = compiler->insns[j].src_args[1]; if (compiler->vars[src2].alloc == 1) { compiler->vars[src2].alloc = 0; } } for(i=0;ivars[i].name == NULL) continue; if (compiler->vars[i].last_use == -1) continue; if (compiler->vars[i].first_use == j) { if (compiler->vars[i].alloc) continue; k = orc_compiler_allocate_register (compiler, TRUE); compiler->vars[i].alloc = k; } } for(i=0;ivars[i].name == NULL) continue; if (compiler->vars[i].last_use == j) { compiler->alloc_regs[compiler->vars[i].alloc]--; } } } } int orc_compiler_dup_temporary (OrcCompiler *compiler, int var, int j) { int i = ORC_VAR_T1 + compiler->n_temp_vars + compiler->n_dup_vars; compiler->vars[i].vartype = ORC_VAR_TYPE_TEMP; compiler->vars[i].size = compiler->vars[var].size; compiler->vars[i].name = malloc (strlen(compiler->vars[var].name) + 10); sprintf(compiler->vars[i].name, "%s.dup%d", compiler->vars[var].name, j); compiler->n_dup_vars++; return i; } int orc_compiler_new_temporary (OrcCompiler *compiler, int size) { int i = ORC_VAR_T1 + compiler->n_temp_vars + compiler->n_dup_vars; compiler->vars[i].vartype = ORC_VAR_TYPE_TEMP; compiler->vars[i].size = size; compiler->vars[i].name = malloc (10); sprintf(compiler->vars[i].name, "tmp%d", i); compiler->n_dup_vars++; return i; } void orc_compiler_dump_asm (OrcCompiler *compiler) { printf("%s", compiler->asm_code); } /** * orc_compiler_append_code: * @p: an OrcCompiler object * @fmt: a printf-style format string * @...: optional printf-style arguments * * Generates a string using sprintf() on the given format and * arguments, and appends that string to the generated assembly * code for the compiler. * * This function is used by the ORC_ASM_CODE() macro. * * This function is useful in a function implementing an OrcRule * or implementing a target. */ void orc_compiler_append_code (OrcCompiler *p, const char *fmt, ...) { char tmp[200]; va_list varargs; int n; va_start (varargs, fmt); vsnprintf(tmp, 200 - 1, fmt, varargs); va_end (varargs); n = strlen (tmp); p->asm_code = realloc (p->asm_code, p->asm_code_len + n + 1); memcpy (p->asm_code + p->asm_code_len, tmp, n + 1); p->asm_code_len += n; } int orc_compiler_label_new (OrcCompiler *compiler) { return compiler->n_labels++; } void orc_compiler_load_constant (OrcCompiler *compiler, int reg, int size, int value) { compiler->target->load_constant (compiler, reg, size, value); } void orc_compiler_load_constant_long (OrcCompiler *compiler, int reg, OrcConstant *constant) { compiler->target->load_constant_long (compiler, reg, constant); } int orc_compiler_get_temp_constant (OrcCompiler *compiler, int size, int value) { int tmp; tmp = orc_compiler_get_temp_reg (compiler); orc_compiler_load_constant (compiler, tmp, size, value); return tmp; } int orc_compiler_get_constant (OrcCompiler *compiler, int size, int value) { int i; int tmp; if (size < 4) { if (size < 2) { value &= 0xff; value |= (value<<8); } value &= 0xffff; value |= (value<<16); } for(i=0;in_constants;i++){ if (compiler->constants[i].is_long == FALSE && compiler->constants[i].value == value) { break; } } if (i == compiler->n_constants) { compiler->n_constants++; compiler->constants[i].value = value; compiler->constants[i].alloc_reg = 0; compiler->constants[i].use_count = 0; compiler->constants[i].is_long = FALSE; } compiler->constants[i].use_count++; if (compiler->constants[i].alloc_reg != 0) {; return compiler->constants[i].alloc_reg; } tmp = orc_compiler_get_temp_reg (compiler); orc_compiler_load_constant (compiler, tmp, size, value); return tmp; } int orc_compiler_get_constant_long (OrcCompiler *compiler, orc_uint32 a, orc_uint32 b, orc_uint32 c, orc_uint32 d) { int i; int tmp; for(i=0;in_constants;i++){ if (compiler->constants[i].is_long == TRUE && compiler->constants[i].full_value[0] == a && compiler->constants[i].full_value[1] == b && compiler->constants[i].full_value[2] == c && compiler->constants[i].full_value[3] == d) { break; } } if (i == compiler->n_constants) { compiler->n_constants++; compiler->constants[i].full_value[0] = a; compiler->constants[i].full_value[1] = b; compiler->constants[i].full_value[2] = c; compiler->constants[i].full_value[3] = d; compiler->constants[i].is_long = TRUE; compiler->constants[i].alloc_reg = 0; compiler->constants[i].use_count = 0; } compiler->constants[i].use_count++; if (compiler->constants[i].alloc_reg != 0) {; return compiler->constants[i].alloc_reg; } tmp = orc_compiler_get_temp_reg (compiler); orc_compiler_load_constant_long (compiler, tmp, &compiler->constants[i]); return tmp; } int orc_compiler_try_get_constant_long (OrcCompiler *compiler, orc_uint32 a, orc_uint32 b, orc_uint32 c, orc_uint32 d) { int i; for(i=0;in_constants;i++){ if (compiler->constants[i].is_long == TRUE && compiler->constants[i].full_value[0] == a && compiler->constants[i].full_value[1] == b && compiler->constants[i].full_value[2] == c && compiler->constants[i].full_value[3] == d) { break; } } if (i == compiler->n_constants) { compiler->n_constants++; compiler->constants[i].full_value[0] = a; compiler->constants[i].full_value[1] = b; compiler->constants[i].full_value[2] = c; compiler->constants[i].full_value[3] = d; compiler->constants[i].is_long = TRUE; compiler->constants[i].alloc_reg = 0; compiler->constants[i].use_count = 0; } compiler->constants[i].use_count++; if (compiler->constants[i].alloc_reg != 0) {; return compiler->constants[i].alloc_reg; } return ORC_REG_INVALID; } int orc_compiler_get_constant_reg (OrcCompiler *compiler) { int j; for(j=0;jalloc_regs[j] = 0; } for(j=0;jvars[j].alloc) continue; ORC_DEBUG("var %d: %d %d %d", j, compiler->vars[j].alloc, compiler->vars[j].first_use, compiler->vars[j].last_use); if (compiler->vars[j].first_use == -1) { compiler->alloc_regs[compiler->vars[j].alloc] = 1; } else if (compiler->vars[j].last_use != -1) { compiler->alloc_regs[compiler->vars[j].alloc] = 1; } } for(j=0;jn_constants;j++){ if (compiler->constants[j].alloc_reg) { compiler->alloc_regs[compiler->constants[j].alloc_reg] = 1; } } for(j=ORC_VEC_REG_BASE;j<=compiler->max_used_temp_reg;j++) { compiler->alloc_regs[j] = 1; } for(j=compiler->max_used_temp_reg;jvalid_regs[j] && !compiler->alloc_regs[j]) { return j; } } return 0; } #define ORC_COMPILER_ERROR_BUFFER_SIZE 200 void orc_compiler_error_valist (OrcCompiler *compiler, const char *fmt, va_list args) { char *s; if (compiler->error_msg) return; s = malloc (ORC_COMPILER_ERROR_BUFFER_SIZE); vsprintf (s, fmt, args); compiler->error_msg = s; compiler->error = TRUE; compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE; } void orc_compiler_error (OrcCompiler *compiler, const char *fmt, ...) { va_list var_args; va_start (var_args, fmt); orc_compiler_error_valist (compiler, fmt, var_args); va_end (var_args); } orc-0.4.18/orc/orcinstruction.h0000664000175000017500000000130312111024531013316 00000000000000 #ifndef _ORC_INSTRUCTION_H_ #define _ORC_INSTRUCTION_H_ #include #include #include #include ORC_BEGIN_DECLS /** * OrcInstruction: * * The OrcInstruction structure has no public members */ struct _OrcInstruction { /*< private >*/ OrcStaticOpcode *opcode; int dest_args[ORC_STATIC_OPCODE_N_DEST]; int src_args[ORC_STATIC_OPCODE_N_SRC]; OrcRule *rule; unsigned int flags; /* Source line number this instruction came from */ int line; }; #define ORC_INSTRUCTION_FLAG_X2 (1<<0) #define ORC_INSTRUCTION_FLAG_X4 (1<<1) #define ORC_INSN_FLAG_INVARIANT (1<<2) #define ORC_INSN_FLAG_ADDED (1<<3) ORC_END_DECLS #endif orc-0.4.18/orc/orcrules-altivec.c0000664000175000017500000011632212111024531013517 00000000000000 #include "config.h" #include #include #include #include #include #include #include /* rules */ static void powerpc_rule_loadpX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int size = ORC_PTR_TO_INT(user); if (src->vartype == ORC_VAR_TYPE_PARAM) { int greg = compiler->gp_tmpreg; powerpc_emit_addi (compiler, greg, POWERPC_R3, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]])); ORC_ASM_CODE(compiler," lvewx %s, 0, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (greg)); powerpc_emit_X (compiler, 0x7c00008e, powerpc_regnum(dest->alloc), 0, powerpc_regnum(greg)); ORC_ASM_CODE(compiler," lvsl %s, 0, %s\n", powerpc_get_regname (POWERPC_V0), powerpc_get_regname (greg)); powerpc_emit_X (compiler, 0x7c00000c, powerpc_regnum(POWERPC_V0), 0, powerpc_regnum(greg)); powerpc_emit_vperm (compiler, dest->alloc, dest->alloc, dest->alloc, POWERPC_V0); switch (size) { case 1: ORC_ASM_CODE(compiler," vspltb %s, %s, 3\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (dest->alloc)); powerpc_emit_VX (compiler, 0x1000020c, powerpc_regnum(dest->alloc), 3, powerpc_regnum(dest->alloc)); break; case 2: ORC_ASM_CODE(compiler," vsplth %s, %s, 1\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (dest->alloc)); powerpc_emit_VX (compiler, 0x1000024c, powerpc_regnum(dest->alloc), 1, powerpc_regnum(dest->alloc)); break; case 4: ORC_ASM_CODE(compiler," vspltw %s, %s, 0\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (dest->alloc)); powerpc_emit_VX (compiler, 0x1000028c, powerpc_regnum(dest->alloc), 0, powerpc_regnum(dest->alloc)); break; } } else { int value = src->value.i; switch (size) { case 1: if (value < 16 && value >= -16) { ORC_ASM_CODE(compiler," vspltisb %s, %d\n", powerpc_get_regname(dest->alloc), value&0x1f); powerpc_emit_VX(compiler, 0x1000030c, powerpc_regnum(dest->alloc), value & 0x1f, 0); } else { value &= 0xff; value |= value << 8; value |= value << 16; powerpc_load_long_constant (compiler, dest->alloc, value, value, value, value); } break; case 2: if (value < 16 && value >= -16) { ORC_ASM_CODE(compiler," vspltish %s, %d\n", powerpc_get_regname(dest->alloc), value&0x1f); powerpc_emit_VX(compiler, 0x1000034c, powerpc_regnum(dest->alloc), value & 0x1f, 0); } else { value &= 0xffff; value |= value << 16; powerpc_load_long_constant (compiler, dest->alloc, value, value, value, value); } break; case 4: if (value < 16 && value >= -16) { ORC_ASM_CODE(compiler," vspltisw %s, %d\n", powerpc_get_regname(dest->alloc), value&0x1f); powerpc_emit_VX(compiler, 0x1000038c, powerpc_regnum(dest->alloc), value & 0x1f, 0); } else { powerpc_load_long_constant (compiler, dest->alloc, value, value, value, value); } break; } } } static void powerpc_rule_loadX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int size = src->size << compiler->loop_shift; int perm = orc_compiler_get_temp_reg (compiler); switch (size) { case 1: ORC_ASM_CODE(compiler," lvebx %s, 0, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00000e, powerpc_regnum(dest->alloc), 0, powerpc_regnum(src->ptr_register)); break; case 2: ORC_ASM_CODE(compiler," lvehx %s, 0, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00004e, powerpc_regnum(dest->alloc), 0, powerpc_regnum(src->ptr_register)); break; case 4: ORC_ASM_CODE(compiler," lvewx %s, 0, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00008e, powerpc_regnum(dest->alloc), 0, powerpc_regnum(src->ptr_register)); break; case 8: case 16: ORC_ASM_CODE(compiler," lvx %s, 0, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c0000ce, powerpc_regnum(dest->alloc), 0, powerpc_regnum(src->ptr_register)); break; default: ORC_COMPILER_ERROR(compiler,"bad load size %d", src->size << compiler->loop_shift); break; } ORC_ASM_CODE(compiler," lvsl %s, 0, %s\n", powerpc_get_regname (perm), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00000c, powerpc_regnum(perm), 0, powerpc_regnum(src->ptr_register)); powerpc_emit_vperm (compiler, dest->alloc, dest->alloc, dest->alloc, perm); } static void powerpc_rule_loadoffX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int size = src->size << compiler->loop_shift; int perm = orc_compiler_get_temp_reg (compiler); int offset; if (compiler->vars[insn->src_args[1]].vartype != ORC_VAR_TYPE_CONST) { ORC_COMPILER_ERROR(compiler, "Rule only works with consts"); return; } offset = compiler->vars[insn->src_args[1]].value.i * src->size; powerpc_emit_addi (compiler, compiler->gp_tmpreg, POWERPC_R0, offset); switch (size) { case 1: ORC_ASM_CODE(compiler," lvebx %s, %s, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (compiler->gp_tmpreg), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00000e, powerpc_regnum(dest->alloc), powerpc_regnum(compiler->gp_tmpreg), powerpc_regnum(src->ptr_register)); break; case 2: ORC_ASM_CODE(compiler," lvehx %s, %s, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (compiler->gp_tmpreg), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00004e, powerpc_regnum(dest->alloc), powerpc_regnum(compiler->gp_tmpreg), powerpc_regnum(src->ptr_register)); break; case 4: ORC_ASM_CODE(compiler," lvewx %s, %s, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (compiler->gp_tmpreg), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00008e, powerpc_regnum(dest->alloc), powerpc_regnum(compiler->gp_tmpreg), powerpc_regnum(src->ptr_register)); break; case 8: case 16: ORC_ASM_CODE(compiler," lvx %s, %s, %s\n", powerpc_get_regname (dest->alloc), powerpc_get_regname (compiler->gp_tmpreg), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c0000ce, powerpc_regnum(dest->alloc), powerpc_regnum(compiler->gp_tmpreg), powerpc_regnum(src->ptr_register)); break; default: ORC_COMPILER_ERROR(compiler,"bad load size %d", src->size << compiler->loop_shift); break; } ORC_ASM_CODE(compiler," lvsl %s, %s, %s\n", powerpc_get_regname (perm), powerpc_get_regname (compiler->gp_tmpreg), powerpc_get_regname (src->ptr_register)); powerpc_emit_X (compiler, 0x7c00000c, powerpc_regnum(perm), powerpc_regnum(compiler->gp_tmpreg), powerpc_regnum(src->ptr_register)); powerpc_emit_vperm (compiler, dest->alloc, dest->alloc, dest->alloc, perm); } static void powerpc_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) { OrcVariable *src = compiler->vars + insn->src_args[0]; OrcVariable *dest = compiler->vars + insn->dest_args[0]; int size = dest->size << compiler->loop_shift; int perm = orc_compiler_get_temp_reg (compiler); int tmp = orc_compiler_get_temp_reg (compiler); ORC_ASM_CODE(compiler," lvsr %s, 0, %s\n", powerpc_get_regname (perm), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c00004c, powerpc_regnum(perm), 0, powerpc_regnum(dest->ptr_register)); powerpc_emit_vperm (compiler, tmp, src->alloc, src->alloc, perm); switch (size) { case 1: ORC_ASM_CODE(compiler," stvebx %s, 0, %s\n", powerpc_get_regname (tmp), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c00010e, powerpc_regnum(tmp), 0, powerpc_regnum(dest->ptr_register)); break; case 2: ORC_ASM_CODE(compiler," stvehx %s, 0, %s\n", powerpc_get_regname (tmp), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c00014e, powerpc_regnum(tmp), 0, powerpc_regnum(dest->ptr_register)); break; case 4: ORC_ASM_CODE(compiler," stvewx %s, 0, %s\n", powerpc_get_regname (tmp), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c00018e, powerpc_regnum(tmp), 0, powerpc_regnum(dest->ptr_register)); break; case 8: ORC_ASM_CODE(compiler," stvewx %s, 0, %s\n", powerpc_get_regname (tmp), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c00018e, powerpc_regnum(tmp), 0, powerpc_regnum(dest->ptr_register)); powerpc_emit_D (compiler, "addi", 0x38000000, compiler->gp_tmpreg, POWERPC_R0, 4); ORC_ASM_CODE(compiler," stvewx %s, %s, %s\n", powerpc_get_regname (tmp), powerpc_get_regname (compiler->gp_tmpreg), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c00018e, powerpc_regnum(tmp), powerpc_regnum(compiler->gp_tmpreg), powerpc_regnum(dest->ptr_register)); break; case 16: ORC_ASM_CODE(compiler," stvx %s, 0, %s\n", powerpc_get_regname (tmp), powerpc_get_regname (dest->ptr_register)); powerpc_emit_X (compiler, 0x7c0001ce, powerpc_regnum(tmp), 0, powerpc_regnum(dest->ptr_register)); break; default: ORC_COMPILER_ERROR(compiler,"bad store size %d", dest->size << compiler->loop_shift); break; } } #define RULE(name, opcode, code) \ static void \ powerpc_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ int src1 = ORC_SRC_ARG (p, insn, 0); \ int src2 = ORC_SRC_ARG (p, insn, 1); \ int dest = ORC_DEST_ARG (p, insn, 0); \ powerpc_emit_VX_2 (p, opcode, code , dest, src1, src2);\ } #define RULE_SHIFT(name, opcode, code) \ static void \ powerpc_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ int src1 = ORC_SRC_ARG (p, insn, 0); \ int src2 = ORC_SRC_ARG (p, insn, 1); \ int dest = ORC_DEST_ARG (p, insn, 0); \ if (p->vars[insn->src_args[1]].vartype == ORC_VAR_TYPE_CONST) { \ ORC_ASM_CODE(p," vspltisb %s, %d\n", \ powerpc_get_regname(p->tmpreg), (int)p->vars[insn->src_args[1]].value.i); \ powerpc_emit_VX(p, 0x1000030c, \ powerpc_regnum(p->tmpreg), (int)p->vars[insn->src_args[1]].value.i, 0); \ powerpc_emit_VX_2 (p, opcode, code , dest, src1, p->tmpreg);\ } else { \ powerpc_emit_VX_2 (p, opcode, code , dest, src1, src2);\ } \ } RULE(addb, "vaddubm", 0x10000000) RULE(addssb, "vaddsbs", 0x10000300) RULE(addusb, "vaddubs", 0x10000200) RULE(andb, "vand", 0x10000404) //RULE(andnb, "vandc", 0x10000444) RULE(avgsb, "vavgsb", 0x10000502) RULE(avgub, "vavgub", 0x10000402) RULE(cmpeqb, "vcmpequb", 0x10000006) RULE(cmpgtsb, "vcmpgtsb", 0x10000306) RULE(maxsb, "vmaxsb", 0x10000102) RULE(maxub, "vmaxub", 0x10000002) RULE(minsb, "vminsb", 0x10000302) RULE(minub, "vminub", 0x10000202) RULE(orb, "vor", 0x10000484) RULE_SHIFT(shlb, "vslb", 0x10000104) RULE_SHIFT(shrsb, "vsrab", 0x10000304) RULE_SHIFT(shrub, "vsrb", 0x10000204) RULE(subb, "vsububm", 0x10000400) RULE(subssb, "vsubsbs", 0x10000700) RULE(subusb, "vsububs", 0x10000600) RULE(xorb, "vxor", 0x100004c4) RULE(addw, "vadduhm", 0x10000040) RULE(addssw, "vaddshs", 0x10000340) RULE(addusw, "vadduhs", 0x10000240) RULE(andw, "vand", 0x10000404) //RULE(andnw, "vandc", 0x10000444) RULE(avgsw, "vavgsh", 0x10000542) RULE(avguw, "vavguh", 0x10000442) RULE(cmpeqw, "vcmpequh", 0x10000046) RULE(cmpgtsw, "vcmpgtsh", 0x10000346) RULE(maxsw, "vmaxsh", 0x10000142) RULE(maxuw, "vmaxuh", 0x10000042) RULE(minsw, "vminsh", 0x10000342) RULE(minuw, "vminuh", 0x10000242) RULE(orw, "vor", 0x10000484) RULE_SHIFT(shlw, "vslh", 0x10000144) RULE_SHIFT(shrsw, "vsrah", 0x10000344) RULE_SHIFT(shruw, "vsrh", 0x10000244) RULE(subw, "vsubuhm", 0x10000440) RULE(subssw, "vsubshs", 0x10000740) RULE(subusw, "vsubuhs", 0x10000640) RULE(xorw, "vxor", 0x100004c4) RULE(addl, "vadduwm", 0x10000080) RULE(addssl, "vaddsws", 0x10000380) RULE(addusl, "vadduws", 0x10000280) RULE(andl, "vand", 0x10000404) //RULE(andnl, "vandc", 0x10000444) RULE(avgsl, "vavgsw", 0x10000582) RULE(avgul, "vavguw", 0x10000482) RULE(cmpeql, "vcmpequw", 0x10000086) RULE(cmpgtsl, "vcmpgtsw", 0x10000386) RULE(maxsl, "vmaxsw", 0x10000182) RULE(maxul, "vmaxuw", 0x10000082) RULE(minsl, "vminsw", 0x10000382) RULE(minul, "vminuw", 0x10000282) RULE(orl, "vor", 0x10000484) RULE_SHIFT(shll, "vslw", 0x10000184) RULE_SHIFT(shrsl, "vsraw", 0x10000384) RULE_SHIFT(shrul, "vsrw", 0x10000284) RULE(subl, "vsubuwm", 0x10000480) RULE(subssl, "vsubsws", 0x10000780) RULE(subusl, "vsubuws", 0x10000680) RULE(xorl, "vxor", 0x100004c4) RULE(andq, "vand", 0x10000404) RULE(orq, "vor", 0x10000484) RULE(xorq, "vxor", 0x100004c4) RULE(addf, "vaddfp", 0x1000000a) RULE(subf, "vsubfp", 0x1000004a) RULE(maxf, "vmaxfp", 0x1000040a) RULE(minf, "vminfp", 0x1000044a) RULE(cmpeqf, "vcmpeqfp", 0x100000c6) static void powerpc_rule_andnX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vandc (p, dest, src2, src1); } static void powerpc_rule_copyX (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vor (p, dest, src1, src1); } static void powerpc_rule_mullb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmulesb (p, dest, src1, src2); powerpc_emit_vsldoi (p, dest, dest, dest, 1); } static void powerpc_rule_mulhsb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmulesb (p, dest, src1, src2); } static void powerpc_rule_mulhub (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmuleub (p, dest, src1, src2); } static void powerpc_rule_mulhsw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmulesh (p, dest, src1, src2); } static void powerpc_rule_mulhuw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmuleuh (p, dest, src1, src2); } static void powerpc_rule_mullw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = POWERPC_V0; powerpc_emit_vxor (p, tmp, tmp, tmp); powerpc_emit_vmladduhm (p, dest, src1, src2, POWERPC_V0); } static void powerpc_rule_convsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vupkhsb (p, dest, src1); } static void powerpc_rule_convswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vupkhsh (p, dest, src1); } static void powerpc_rule_convubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int reg = powerpc_get_constant (p, ORC_CONST_ZERO, 0); int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmrghb (p, dest, reg, src1); } static void powerpc_rule_convuwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int reg = powerpc_get_constant (p, ORC_CONST_ZERO, 0); int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmrghh (p, dest, reg, src1); } static void powerpc_rule_convssswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkshss (p, dest, src1, src1); } static void powerpc_rule_convssslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkswss (p, dest, src1, src1); } static void powerpc_rule_convsuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkshus (p, dest, src1, src1); } static void powerpc_rule_convsuslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkswus (p, dest, src1, src1); } static void powerpc_rule_convuuswb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkuhus (p, dest, src1, src1); } static void powerpc_rule_convuuslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkuwus (p, dest, src1, src1); } static void powerpc_rule_convwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkuhum (p, dest, src1, src1); } static void powerpc_rule_convlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkuwum (p, dest, src1, src1); } static void powerpc_rule_mulsbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmulesb (p, dest, src1, src2); } static void powerpc_rule_mulubw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmuleub (p, dest, src1, src2); } static void powerpc_rule_mulswl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmulesh (p, dest, src1, src2); } static void powerpc_rule_muluwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmuleuh (p, dest, src1, src2); } static void powerpc_rule_accw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vadduhm (p, dest, dest, src1); } static void powerpc_rule_accl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vadduwm (p, dest, dest, src1); } static void powerpc_rule_accsadubl (OrcCompiler *p, void *user, OrcInstruction *insn) { int tmp1 = p->tmpreg; int tmp2 = POWERPC_V31; int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vmaxub (p, tmp1, src1, src2); powerpc_emit_vminub (p, tmp2, src1, src2); powerpc_emit_vsububm (p, tmp1, tmp1, tmp2); if (p->loop_shift == 0) { powerpc_emit_vxor (p, tmp2, tmp2, tmp2); powerpc_emit_vmrghb (p, tmp1, tmp2, tmp1); powerpc_emit_vmrghh (p, tmp1, tmp2, tmp1); powerpc_emit_vadduwm (p, dest, dest, tmp1); } else if (p->loop_shift == 1) { powerpc_emit_vxor (p, tmp2, tmp2, tmp2); powerpc_emit_vmrghh (p, tmp1, tmp2, tmp1); powerpc_emit_vsum4ubs (p, dest, dest, tmp1); } else { powerpc_emit_vsum4ubs (p, dest, dest, tmp1); } } static void powerpc_rule_signb (OrcCompiler *p, void *user, OrcInstruction *insn) { int reg; int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); reg = powerpc_get_constant (p, ORC_CONST_SPLAT_B, 1); powerpc_emit_vminsb (p, dest, src1, reg); reg = powerpc_get_constant (p, ORC_CONST_SPLAT_B, -1); powerpc_emit_vmaxsb (p, dest, dest, reg); } static void powerpc_rule_signw (OrcCompiler *p, void *user, OrcInstruction *insn) { int reg; int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); reg = powerpc_get_constant (p, ORC_CONST_SPLAT_W, 1); powerpc_emit_vminsh(p, dest, src1, reg); reg = powerpc_get_constant (p, ORC_CONST_SPLAT_W, -1); powerpc_emit_vmaxsh(p, dest, dest, reg); } static void powerpc_rule_signl (OrcCompiler *p, void *user, OrcInstruction *insn) { int reg; int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); reg = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 1); powerpc_emit_vminsw (p, dest, src1, reg); reg = powerpc_get_constant (p, ORC_CONST_SPLAT_L, -1); powerpc_emit_vmaxsw (p, dest, dest, reg); } static void powerpc_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkuhum (p, dest, src1, src1); } static void powerpc_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00020406, 0x080a0c0e, 0x00020406, 0x080a0c0e); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_vpkuwum (p, dest, src1, src1); } static void powerpc_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00010405, 0x08090c0d, 0x10111415, 0x18191c1d); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_select1ql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x04050607, 0x0c0d0e0f, 0x14151617, 0x1c1d1e1f); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_select0ql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00010203, 0x08090a0b, 0x10111213, 0x18191a1b); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_mergebw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00100111, 0x02120313, 0x04140515, 0x06160717); powerpc_emit_vperm (p, dest, src1, src2, perm); } static void powerpc_rule_mergewl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00011011, 0x02031213, 0x04051415, 0x06071617); powerpc_emit_vperm (p, dest, src1, src2, perm); } static void powerpc_rule_mergelq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00010203, 0x10111213, 0x04050607, 0x14151617); powerpc_emit_vperm (p, dest, src1, src2, perm); } static void powerpc_rule_absb (OrcCompiler *p, void *user, OrcInstruction *insn) { int tmpc; int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int tmp; tmpc = powerpc_get_constant (p, ORC_CONST_SPLAT_B, 0); if (src1 != dest) { tmp = dest; } else { tmp = orc_compiler_get_temp_reg (p); } powerpc_emit_VX_2 (p, "vsububm", 0x10000400, tmp, tmpc, src1); powerpc_emit_vminub (p, dest, tmp, src1); } static void powerpc_rule_absw (OrcCompiler *p, void *user, OrcInstruction *insn) { int tmp; int tmpc; int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); tmpc = powerpc_get_constant (p, ORC_CONST_SPLAT_W, 0); if (src1 != dest) { tmp = dest; } else { tmp = orc_compiler_get_temp_reg (p); } powerpc_emit_VX_2 (p, "vsubuhm", 0x10000440, tmp, tmpc, src1); powerpc_emit_VX_2 (p, "vminuh", 0x10000242, dest, tmp, src1); } static void powerpc_rule_absl (OrcCompiler *p, void *user, OrcInstruction *insn) { int tmp; int tmpc; int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); tmpc = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 0); if (src1 != dest) { tmp = dest; } else { tmp = orc_compiler_get_temp_reg (p); } powerpc_emit_VX_2 (p, "vsubuwm", 0x10000480, tmp, tmpc, src1); powerpc_emit_VX_2 (p, "vminuw", 0x10000282, dest, tmp, src1); } static void powerpc_rule_splatw3q (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00010001, 0x00010001, 0x08090809, 0x08090809); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_splatbw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_VX_2 (p, "vmrghb", 0x1000000c, dest, src1, src1); } static void powerpc_rule_splatbl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); #if 0 int perm; perm = powerpc_get_constant_full (p, 0x00000000, 0x01010101, 0x02020202, 0x03030303); powerpc_emit_vperm (p, dest, src1, src1, perm); #else powerpc_emit_VX_2 (p, "vmrghb", 0x1000000c, dest, src1, src1); powerpc_emit_VX_2 (p, "vmrghh", 0x1000004c, dest, dest, dest); #endif } static void powerpc_rule_convulq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; int zero; zero = powerpc_get_constant (p, ORC_CONST_SPLAT_B, 0); perm = powerpc_get_constant_full (p, 0x10101010, 0x00010203, 0x10101010, 0x04050607); powerpc_emit_vperm (p, dest, src1, zero, perm); } static void powerpc_rule_convslq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; int tmp = orc_compiler_get_temp_reg (p); ORC_ASM_CODE(p," vspltisb %s, -1\n", powerpc_get_regname(tmp)); powerpc_emit_VX(p, 0x1000030c, powerpc_regnum(tmp), 0x1f, 0); powerpc_emit_VX_2 (p, "vsraw", 0x10000384, tmp, src1, tmp); perm = powerpc_get_constant_full (p, 0x10101010, 0x00010203, 0x10101010, 0x04050607); powerpc_emit_vperm (p, dest, src1, tmp, perm); } static void powerpc_rule_convhwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00020406, 0x080a0c0e, 0x10121416, 0x181a1c1e); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_convhlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x00010405, 0x08090c0d, 0x10111415, 0x18191c1d); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_convql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x04050607, 0x0c0d0e0f, 0x14151617, 0x1c1d1e1f); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_swapw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_swapl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_swapwl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x02030001, 0x06070405, 0x0a0b0809, 0x0e0f0c0d); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_swaplq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x04050607, 0x00010203, 0x0c0d0e0f, 0x08090a0b); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_swapq (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int perm; perm = powerpc_get_constant_full (p, 0x07060504, 0x03020100, 0x0f0e0d0c, 0x0b0a0908); powerpc_emit_vperm (p, dest, src1, src1, perm); } static void powerpc_rule_splitql (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest1 = ORC_DEST_ARG (p, insn, 0); int dest2 = ORC_DEST_ARG (p, insn, 1); int perm; perm = powerpc_get_constant_full (p, 0x04050607, 0x0c0d0e0f, 0x14151617, 0x1c1d1e1f); powerpc_emit_vperm (p, dest1, src1, src1, perm); perm = powerpc_get_constant_full (p, 0x00010203, 0x08090a0b, 0x10111213, 0x18191a1b); powerpc_emit_vperm (p, dest2, src1, src1, perm); } static void powerpc_rule_splitlw (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest1 = ORC_DEST_ARG (p, insn, 0); int dest2 = ORC_DEST_ARG (p, insn, 1); int perm; powerpc_emit_vpkuwum (p, dest1, src1, src1); perm = powerpc_get_constant_full (p, 0x00010405, 0x08090c0d, 0x10111415, 0x18191c1d); powerpc_emit_vperm (p, dest2, src1, src1, perm); } static void powerpc_rule_splitwb (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest1 = ORC_DEST_ARG (p, insn, 0); int dest2 = ORC_DEST_ARG (p, insn, 1); int perm; powerpc_emit_vpkuhum (p, dest1, src1, src1); perm = powerpc_get_constant_full (p, 0x00020406, 0x080a0c0e, 0x10121416, 0x181a1c1e); powerpc_emit_vperm (p, dest2, src1, src1, perm); } static void powerpc_rule_mulf (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int tmp; tmp = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 0x80000000); powerpc_emit_VA_acb (p, "vmaddfp", 0x1000002e, dest, src1, tmp, src2); } static void powerpc_rule_divf (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); int y = orc_compiler_get_temp_reg (p); int t = orc_compiler_get_temp_reg (p); int c1; int c0; c1 = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 0x3f800000); /* 1.0 */ powerpc_emit_VX_db (p, "vrefp", 0x1000010a, y, src2); powerpc_emit_VA_acb (p, "vnmsubfp", 0x1000002f, t, y, c1, src2); powerpc_emit_VA_acb (p, "vmaddfp", 0x1000002e, y, y, y, t); c0 = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 0x00000000); /* 0.0 */ powerpc_emit_VA_acb (p, "vmaddfp", 0x1000002e, dest, y, c0, src1); } static void powerpc_rule_cmpltf (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_VXR (p, "vcmpgtfp", 0x100002c6, dest, src2, src1, FALSE); } static void powerpc_rule_cmplef (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_VXR (p, "vcmpgefp", 0x100001c6, dest, src2, src1, FALSE); } static void powerpc_rule_convfl (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = orc_compiler_get_temp_reg (p); int tmpc; int tmpc2; if (p->target_flags & ORC_TARGET_FAST_NAN) { powerpc_emit_VX_dbi (p, "vctsxs", 0x100003ca, dest, src1, 0); } else { /* This changes NANs into infinities of the same sign */ tmpc = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 0x7f800000); tmpc2 = powerpc_get_constant (p, ORC_CONST_SPLAT_L, 0x007fffff); powerpc_emit_VX_2 (p, "vand", 0x10000404, tmp, tmpc, src1); powerpc_emit_VX_2 (p, "vcmpequw", 0x10000086, tmp, tmp, tmpc); powerpc_emit_VX_2 (p, "vand", 0x10000404, tmp, tmp, tmpc2); powerpc_emit_vandc (p, tmp, src1, tmp); powerpc_emit_VX_dbi (p, "vctsxs", 0x100003ca, dest, tmp, 0); } } static void powerpc_rule_convlf (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); powerpc_emit_VX_dbi (p, "vcfsx", 0x1000034a, dest, src1, 0); } static void powerpc_rule_div255w (OrcCompiler *p, void *user, OrcInstruction *insn) { int src1 = ORC_SRC_ARG (p, insn, 0); int dest = ORC_DEST_ARG (p, insn, 0); int tmp = orc_compiler_get_temp_reg (p); int tmp2 = orc_compiler_get_temp_reg (p); int tmpc; tmpc = powerpc_get_constant (p, ORC_CONST_SPLAT_W, 0x0080); powerpc_emit_VX_2 (p, "vadduhm", 0x10000040, dest, src1, tmpc); ORC_ASM_CODE(p," vspltish %s, 8\n", powerpc_get_regname(tmp2)); powerpc_emit_VX(p, 0x1000034c, powerpc_regnum(tmp2), 8, 0); powerpc_emit_VX_2 (p, "vsrh", 0x10000244, tmp, dest, tmp2); powerpc_emit_VX_2 (p, "vadduhm", 0x10000040, dest, dest, tmp); powerpc_emit_VX_2 (p, "vsrh", 0x10000244, dest, dest, tmp2); } void orc_compiler_powerpc_register_rules (OrcTarget *target) { OrcRuleSet *rule_set; rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), target, 0); #define REG(name) \ orc_rule_register (rule_set, #name , powerpc_rule_ ## name , NULL); REG(addb); REG(addssb); REG(addusb); REG(andb); REG(avgsb); REG(avgub); REG(cmpeqb); REG(cmpgtsb); REG(maxsb); REG(maxub); REG(minsb); REG(minub); REG(orb); REG(shlb); REG(shrsb); REG(shrub); REG(subb); REG(subssb); REG(subusb); REG(xorb); REG(addw); REG(addssw); REG(addusw); REG(andw); REG(avgsw); REG(avguw); REG(cmpeqw); REG(cmpgtsw); REG(maxsw); REG(maxuw); REG(minsw); REG(minuw); REG(orw); REG(shlw); REG(shrsw); REG(shruw); REG(subw); REG(subssw); REG(subusw); REG(xorw); REG(addl); REG(addssl); REG(addusl); REG(andl); REG(avgsl); REG(avgul); REG(cmpeql); REG(cmpgtsl); REG(maxsl); REG(maxul); REG(minsl); REG(minul); REG(orl); REG(shll); REG(shrsl); REG(shrul); REG(subl); REG(subssl); REG(subusl); REG(xorl); REG(andq); REG(orq); REG(xorq); REG(mullb); REG(mulhsb); REG(mulhub); REG(mullw); REG(mulhsw); REG(mulhuw); REG(convsbw); REG(convswl); REG(convubw); REG(convuwl); REG(convssswb); REG(convssslw); REG(convsuswb); REG(convsuslw); REG(convuuswb); REG(convuuslw); REG(convwb); REG(convlw); REG(mulsbw); REG(mulubw); REG(mulswl); REG(muluwl); REG(accw); REG(accl); REG(accsadubl); REG(signb); REG(signw); REG(signl); REG(select0wb); REG(select1wb); REG(select0lw); REG(select1lw); REG(select0ql); REG(select1ql); REG(mergebw); REG(mergewl); REG(mergelq); REG(absb); REG(absw); REG(absl); REG(splatw3q); REG(splatbw); REG(splatbl); REG(convslq); REG(convulq); REG(convhwb); REG(convhlw); REG(convql); REG(swapw); REG(swapl); REG(swapwl); REG(swapq); REG(swaplq); if (0) REG(splitql); REG(splitlw); REG(splitwb); REG(div255w); REG(addf); REG(subf); REG(minf); REG(maxf); REG(cmpeqf); REG(cmplef); REG(cmpltf); REG(mulf); if (0) REG(divf); /* not accurate enough */ REG(convfl); REG(convlf); orc_rule_register (rule_set, "loadpb", powerpc_rule_loadpX, (void *)1); orc_rule_register (rule_set, "loadpw", powerpc_rule_loadpX, (void *)2); orc_rule_register (rule_set, "loadpl", powerpc_rule_loadpX, (void *)4); orc_rule_register (rule_set, "loadb", powerpc_rule_loadX, NULL); orc_rule_register (rule_set, "loadw", powerpc_rule_loadX, NULL); orc_rule_register (rule_set, "loadl", powerpc_rule_loadX, NULL); orc_rule_register (rule_set, "loadq", powerpc_rule_loadX, NULL); orc_rule_register (rule_set, "loadoffb", powerpc_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffw", powerpc_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffl", powerpc_rule_loadoffX, NULL); orc_rule_register (rule_set, "storeb", powerpc_rule_storeX, NULL); orc_rule_register (rule_set, "storew", powerpc_rule_storeX, NULL); orc_rule_register (rule_set, "storel", powerpc_rule_storeX, NULL); orc_rule_register (rule_set, "storeq", powerpc_rule_storeX, NULL); orc_rule_register (rule_set, "andnb", powerpc_rule_andnX, NULL); orc_rule_register (rule_set, "andnw", powerpc_rule_andnX, NULL); orc_rule_register (rule_set, "andnl", powerpc_rule_andnX, NULL); orc_rule_register (rule_set, "andnq", powerpc_rule_andnX, NULL); orc_rule_register (rule_set, "copyb", powerpc_rule_copyX, NULL); orc_rule_register (rule_set, "copyw", powerpc_rule_copyX, NULL); orc_rule_register (rule_set, "copyl", powerpc_rule_copyX, NULL); orc_rule_register (rule_set, "copyq", powerpc_rule_copyX, NULL); } orc-0.4.18/orc/orcx86insn.h0000644000175000017500000011402211565023105012263 00000000000000 #ifndef ORC_ORC_X86_INSN_H_ #define ORC_ORC_X86_INSN_H_ #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API typedef enum { ORC_X86_INSN_TYPE_MMXM_MMX, /* mem/mmx, mmx */ ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, /* $shift, mmx. opcode in src */ ORC_X86_INSN_TYPE_SSEM_SSE, /* mem/mmx, sse */ ORC_X86_INSN_TYPE_IMM8_MMXM_MMX, ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV, ORC_X86_INSN_TYPE_MMXM_MMX_REV, ORC_X86_INSN_TYPE_SSEM_SSE_REV, ORC_X86_INSN_TYPE_REGM_MMX, ORC_X86_INSN_TYPE_MMX_REGM_REV, ORC_X86_INSN_TYPE_REGM, ORC_X86_INSN_TYPE_MEM, ORC_X86_INSN_TYPE_IMM8_REGM, ORC_X86_INSN_TYPE_IMM32_REGM, ORC_X86_INSN_TYPE_REGM_REG, ORC_X86_INSN_TYPE_REG_REGM, ORC_X86_INSN_TYPE_LABEL, ORC_X86_INSN_TYPE_ALIGN, ORC_X86_INSN_TYPE_BRANCH, ORC_X86_INSN_TYPE_NONE, ORC_X86_INSN_TYPE_STACK, ORC_X86_INSN_TYPE_IMM32_REGM_MOV, ORC_X86_INSN_TYPE_REG8_REGM, ORC_X86_INSN_TYPE_REG16_REGM, ORC_X86_INSN_TYPE_IMM32_A, ORC_X86_INSN_TYPE_IMM8_REGM_MMX, } OrcX86InsnType; typedef enum { ORC_X86_punpcklbw, ORC_X86_punpcklwd, ORC_X86_punpckldq, ORC_X86_packsswb, ORC_X86_pcmpgtb, ORC_X86_pcmpgtw, ORC_X86_pcmpgtd, ORC_X86_packuswb, ORC_X86_punpckhbw, ORC_X86_punpckhwd, ORC_X86_punpckhdq, ORC_X86_packssdw, ORC_X86_punpcklqdq, ORC_X86_punpckhqdq, ORC_X86_movdqa, ORC_X86_psraw, ORC_X86_psrlw, ORC_X86_psllw, ORC_X86_psrad, ORC_X86_psrld, ORC_X86_pslld, ORC_X86_psrlq, ORC_X86_psllq, ORC_X86_psrldq, ORC_X86_pslldq, ORC_X86_psrlq_reg, ORC_X86_pcmpeqb, ORC_X86_pcmpeqw, ORC_X86_pcmpeqd, ORC_X86_paddq, ORC_X86_pmullw, ORC_X86_psubusb, ORC_X86_psubusw, ORC_X86_pminub, ORC_X86_pand, ORC_X86_paddusb, ORC_X86_paddusw, ORC_X86_pmaxub, ORC_X86_pandn, ORC_X86_pavgb, ORC_X86_pavgw, ORC_X86_pmulhuw, ORC_X86_pmulhw, ORC_X86_psubsb, ORC_X86_psubsw, ORC_X86_pminsw, ORC_X86_por, ORC_X86_paddsb, ORC_X86_paddsw, ORC_X86_pmaxsw, ORC_X86_pxor, ORC_X86_pmuludq, ORC_X86_pmaddwd, ORC_X86_psadbw, ORC_X86_psubb, ORC_X86_psubw, ORC_X86_psubd, ORC_X86_psubq, ORC_X86_paddb, ORC_X86_paddw, ORC_X86_paddd, ORC_X86_pshufb, ORC_X86_phaddw, ORC_X86_phaddd, ORC_X86_phaddsw, ORC_X86_pmaddubsw, ORC_X86_phsubw, ORC_X86_phsubd, ORC_X86_phsubsw, ORC_X86_psignb, ORC_X86_psignw, ORC_X86_psignd, ORC_X86_pmulhrsw, ORC_X86_pabsb, ORC_X86_pabsw, ORC_X86_pabsd, ORC_X86_pmovsxbw, ORC_X86_pmovsxbd, ORC_X86_pmovsxbq, ORC_X86_pmovsxwd, ORC_X86_pmovsxwq, ORC_X86_pmovsxdq, ORC_X86_pmuldq, ORC_X86_pcmpeqq, ORC_X86_packusdw, ORC_X86_pmovzxbw, ORC_X86_pmovzxbd, ORC_X86_pmovzxbq, ORC_X86_pmovzxwd, ORC_X86_pmovzxwq, ORC_X86_pmovzxdq, ORC_X86_pmulld, ORC_X86_phminposuw, ORC_X86_pminsb, ORC_X86_pminsd, ORC_X86_pminuw, ORC_X86_pminud, ORC_X86_pmaxsb, ORC_X86_pmaxsd, ORC_X86_pmaxuw, ORC_X86_pmaxud, ORC_X86_pcmpgtq, ORC_X86_addps, ORC_X86_subps, ORC_X86_mulps, ORC_X86_divps, ORC_X86_sqrtps, ORC_X86_addpd, ORC_X86_subpd, ORC_X86_mulpd, ORC_X86_divpd, ORC_X86_sqrtpd, ORC_X86_cmpeqps, ORC_X86_cmpeqpd, ORC_X86_cmpltps, ORC_X86_cmpltpd, ORC_X86_cmpleps, ORC_X86_cmplepd, ORC_X86_cvttps2dq, ORC_X86_cvttpd2dq, ORC_X86_cvtdq2ps, ORC_X86_cvtdq2pd, ORC_X86_cvtps2pd, ORC_X86_cvtpd2ps, ORC_X86_minps, ORC_X86_minpd, ORC_X86_maxps, ORC_X86_maxpd, ORC_X86_psraw_imm, ORC_X86_psrlw_imm, ORC_X86_psllw_imm, ORC_X86_psrad_imm, ORC_X86_psrld_imm, ORC_X86_pslld_imm, ORC_X86_psrlq_imm, ORC_X86_psllq_imm, ORC_X86_psrldq_imm, ORC_X86_pslldq_imm, ORC_X86_pshufd, ORC_X86_pshuflw, ORC_X86_pshufhw, ORC_X86_palignr, ORC_X86_pinsrw, ORC_X86_movd_load, ORC_X86_movq_sse_load, ORC_X86_movdqa_load, ORC_X86_movdqu_load, ORC_X86_movhps_load, ORC_X86_pextrw, ORC_X86_movd_store, ORC_X86_movq_sse_store, ORC_X86_movdqa_store, ORC_X86_movdqu_store, ORC_X86_movntdq_store, ORC_X86_ldmxcsr, ORC_X86_stmxcsr, ORC_X86_add_imm8_rm, ORC_X86_add_imm32_rm, ORC_X86_add_rm_r, ORC_X86_add_r_rm, ORC_X86_or_imm8_rm, ORC_X86_or_imm32_rm, ORC_X86_or_rm_r, ORC_X86_or_r_rm, ORC_X86_adc_imm8_rm, ORC_X86_adc_imm32_rm, ORC_X86_adc_rm_r, ORC_X86_adc_r_rm, ORC_X86_sbb_imm8_rm, ORC_X86_sbb_imm32_rm, ORC_X86_sbb_rm_r, ORC_X86_sbb_r_rm, ORC_X86_and_imm8_rm, ORC_X86_and_imm32_rm, ORC_X86_and_rm_r, ORC_X86_and_r_rm, ORC_X86_sub_imm8_rm, ORC_X86_sub_imm32_rm, ORC_X86_sub_rm_r, ORC_X86_sub_r_rm, ORC_X86_xor_imm8_rm, ORC_X86_xor_imm32_rm, ORC_X86_xor_rm_r, ORC_X86_xor_r_rm, ORC_X86_cmp_imm8_rm, ORC_X86_cmp_imm32_rm, ORC_X86_cmp_rm_r, ORC_X86_cmp_r_rm, ORC_X86_jo, ORC_X86_jno, ORC_X86_jc, ORC_X86_jnc, ORC_X86_jz, ORC_X86_jnz, ORC_X86_jbe, ORC_X86_ja, ORC_X86_js, ORC_X86_jns, ORC_X86_jp, ORC_X86_jnp, ORC_X86_jl, ORC_X86_jge, ORC_X86_jle, ORC_X86_jg, ORC_X86_jmp, ORC_X86_LABEL, ORC_X86_ret, ORC_X86_retq, ORC_X86_emms, ORC_X86_rdtsc, ORC_X86_nop, ORC_X86_rep_movsb, ORC_X86_rep_movsw, ORC_X86_rep_movsl, ORC_X86_push, ORC_X86_pop, ORC_X86_movzx_rm_r, ORC_X86_movw_rm_r, ORC_X86_movl_rm_r, ORC_X86_mov_rm_r, ORC_X86_mov_imm32_r, ORC_X86_movb_r_rm, ORC_X86_movw_r_rm, ORC_X86_movl_r_rm, ORC_X86_mov_r_rm, ORC_X86_test, ORC_X86_test_imm, ORC_X86_leal, ORC_X86_leaq, ORC_X86_imul_rm_r, ORC_X86_imul_rm, ORC_X86_inc, ORC_X86_dec, ORC_X86_sar_imm, ORC_X86_sar, ORC_X86_and_imm32_a, ORC_X86_ALIGN, ORC_X86_pshufw, ORC_X86_movq_mmx_load, ORC_X86_movq_mmx_store, } OrcX86Opcode; enum { ORC_X86_RM_REG, ORC_X86_RM_MEMOFFSET, ORC_X86_RM_MEMINDEX }; typedef struct _OrcX86Insn OrcX86Insn; struct _OrcX86Insn { OrcX86Opcode opcode_index; const OrcSysOpcode *opcode; int imm; int src; int dest; int size; int label; int type; int offset; int index_reg; int shift; int code_offset; }; OrcX86Insn * orc_x86_get_output_insn (OrcCompiler *p); void orc_x86_output_insns (OrcCompiler *p); void orc_x86_calculate_offsets (OrcCompiler *p); #define orc_sse_emit_punpcklbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpcklbw, 16, a, b) #define orc_sse_emit_punpcklwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpcklwd, 16, a, b) #define orc_sse_emit_punpckldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckldq, 16, a, b) #define orc_sse_emit_packsswb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packsswb, 16, a, b) #define orc_sse_emit_pcmpgtb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtb, 16, a, b) #define orc_sse_emit_pcmpgtw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtw, 16, a, b) #define orc_sse_emit_pcmpgtd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtd, 16, a, b) #define orc_sse_emit_packuswb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packuswb, 16, a, b) #define orc_sse_emit_punpckhbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhbw, 16, a, b) #define orc_sse_emit_punpckhwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhwd, 16, a, b) #define orc_sse_emit_punpckhdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhdq, 16, a, b) #define orc_sse_emit_packssdw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packssdw, 16, a, b) #define orc_sse_emit_punpcklqdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpcklqdq, 16, a, b) #define orc_sse_emit_punpckhqdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhqdq, 16, a, b) #define orc_sse_emit_movdqa(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movdqa, 16, a, b) #define orc_sse_emit_psraw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psraw, 16, a, b) #define orc_sse_emit_psrlw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrlw, 16, a, b) #define orc_sse_emit_psllw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psllw, 16, a, b) #define orc_sse_emit_psrad(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrad, 16, a, b) #define orc_sse_emit_psrld(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrld, 16, a, b) #define orc_sse_emit_pslld(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pslld, 16, a, b) #define orc_sse_emit_psrlq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrlq, 16, a, b) #define orc_sse_emit_psllq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psllq, 16, a, b) #define orc_sse_emit_psrldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrldq, 16, a, b) #define orc_sse_emit_pslldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pslldq, 16, a, b) #define orc_sse_emit_psrlq_reg(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrlq_reg, 16, a, b) #define orc_sse_emit_pcmpeqb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqb, 16, a, b) #define orc_sse_emit_pcmpeqw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqw, 16, a, b) #define orc_sse_emit_pcmpeqd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqd, 16, a, b) #define orc_sse_emit_paddq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddq, 16, a, b) #define orc_sse_emit_pmullw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmullw, 16, a, b) #define orc_sse_emit_psubusb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubusb, 16, a, b) #define orc_sse_emit_psubusw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubusw, 16, a, b) #define orc_sse_emit_pminub(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminub, 16, a, b) #define orc_sse_emit_pand(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pand, 16, a, b) #define orc_sse_emit_paddusb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddusb, 16, a, b) #define orc_sse_emit_paddusw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddusw, 16, a, b) #define orc_sse_emit_pmaxub(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxub, 16, a, b) #define orc_sse_emit_pandn(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pandn, 16, a, b) #define orc_sse_emit_pavgb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pavgb, 16, a, b) #define orc_sse_emit_pavgw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pavgw, 16, a, b) #define orc_sse_emit_pmulhuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulhuw, 16, a, b) #define orc_sse_emit_pmulhw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulhw, 16, a, b) #define orc_sse_emit_psubsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubsb, 16, a, b) #define orc_sse_emit_psubsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubsw, 16, a, b) #define orc_sse_emit_pminsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminsw, 16, a, b) #define orc_sse_emit_por(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_por, 16, a, b) #define orc_sse_emit_paddsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddsb, 16, a, b) #define orc_sse_emit_paddsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddsw, 16, a, b) #define orc_sse_emit_pmaxsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxsw, 16, a, b) #define orc_sse_emit_pxor(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pxor, 16, a, b) #define orc_sse_emit_pmuludq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmuludq, 16, a, b) #define orc_sse_emit_pmaddwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaddwd, 16, a, b) #define orc_sse_emit_psadbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psadbw, 16, a, b) #define orc_sse_emit_psubb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubb, 16, a, b) #define orc_sse_emit_psubw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubw, 16, a, b) #define orc_sse_emit_psubd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubd, 16, a, b) #define orc_sse_emit_psubq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubq, 16, a, b) #define orc_sse_emit_paddb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddb, 16, a, b) #define orc_sse_emit_paddw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddw, 16, a, b) #define orc_sse_emit_paddd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddd, 16, a, b) #define orc_sse_emit_pshufb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pshufb, 16, a, b) #define orc_sse_emit_phaddw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phaddw, 16, a, b) #define orc_sse_emit_phaddd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phaddd, 16, a, b) #define orc_sse_emit_phaddsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phaddsw, 16, a, b) #define orc_sse_emit_pmaddubsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaddubsw, 16, a, b) #define orc_sse_emit_phsubw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phsubw, 16, a, b) #define orc_sse_emit_phsubd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phsubd, 16, a, b) #define orc_sse_emit_phsubsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phsubsw, 16, a, b) #define orc_sse_emit_psignb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psignb, 16, a, b) #define orc_sse_emit_psignw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psignw, 16, a, b) #define orc_sse_emit_psignd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psignd, 16, a, b) #define orc_sse_emit_pmulhrsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulhrsw, 16, a, b) #define orc_sse_emit_pabsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pabsb, 16, a, b) #define orc_sse_emit_pabsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pabsw, 16, a, b) #define orc_sse_emit_pabsd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pabsd, 16, a, b) #define orc_sse_emit_pmovsxbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxbw, 16, a, b) #define orc_sse_emit_pmovsxbd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxbd, 16, a, b) #define orc_sse_emit_pmovsxbq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxbq, 16, a, b) #define orc_sse_emit_pmovsxwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxwd, 16, a, b) #define orc_sse_emit_pmovsxwq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxwq, 16, a, b) #define orc_sse_emit_pmovsxdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxdq, 16, a, b) #define orc_sse_emit_pmuldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmuldq, 16, a, b) #define orc_sse_emit_pcmpeqq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqq, 16, a, b) #define orc_sse_emit_packusdw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packusdw, 16, a, b) #define orc_sse_emit_pmovzxbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxbw, 16, a, b) #define orc_sse_emit_pmovzxbd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxbd, 16, a, b) #define orc_sse_emit_pmovzxbq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxbq, 16, a, b) #define orc_sse_emit_pmovzxwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxwd, 16, a, b) #define orc_sse_emit_pmovzxwq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxwq, 16, a, b) #define orc_sse_emit_pmovzxdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxdq, 16, a, b) #define orc_sse_emit_pmulld(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulld, 16, a, b) #define orc_sse_emit_phminposuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phminposuw, 16, a, b) #define orc_sse_emit_pminsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminsb, 16, a, b) #define orc_sse_emit_pminsd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminsd, 16, a, b) #define orc_sse_emit_pminuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminuw, 16, a, b) #define orc_sse_emit_pminud(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminud, 16, a, b) #define orc_sse_emit_pmaxsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxsb, 16, a, b) #define orc_sse_emit_pmaxsd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxsd, 16, a, b) #define orc_sse_emit_pmaxuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxuw, 16, a, b) #define orc_sse_emit_pmaxud(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxud, 16, a, b) #define orc_sse_emit_pcmpgtq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtq, 16, a, b) #define orc_sse_emit_addps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_addps, 16, a, b) #define orc_sse_emit_subps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_subps, 16, a, b) #define orc_sse_emit_mulps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_mulps, 16, a, b) #define orc_sse_emit_divps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_divps, 16, a, b) #define orc_sse_emit_sqrtps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_sqrtps, 16, a, b) #define orc_sse_emit_addpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_addpd, 16, a, b) #define orc_sse_emit_subpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_subpd, 16, a, b) #define orc_sse_emit_mulpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_mulpd, 16, a, b) #define orc_sse_emit_divpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_divpd, 16, a, b) #define orc_sse_emit_sqrtpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_sqrtpd, 16, a, b) #define orc_sse_emit_cmpeqps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpeqps, 16, a, b) #define orc_sse_emit_cmpeqpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpeqpd, 16, a, b) #define orc_sse_emit_cmpltps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpltps, 16, a, b) #define orc_sse_emit_cmpltpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpltpd, 16, a, b) #define orc_sse_emit_cmpleps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpleps, 16, a, b) #define orc_sse_emit_cmplepd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmplepd, 16, a, b) #define orc_sse_emit_cvttps2dq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvttps2dq, 16, a, b) #define orc_sse_emit_cvttpd2dq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvttpd2dq, 16, a, b) #define orc_sse_emit_cvtdq2ps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtdq2ps, 16, a, b) #define orc_sse_emit_cvtdq2pd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtdq2pd, 16, a, b) #define orc_sse_emit_cvtps2pd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtps2pd, 16, a, b) #define orc_sse_emit_cvtpd2ps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtpd2ps, 16, a, b) #define orc_sse_emit_minps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_minps, 16, a, b) #define orc_sse_emit_minpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_minpd, 16, a, b) #define orc_sse_emit_maxps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_maxps, 16, a, b) #define orc_sse_emit_maxpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_maxpd, 16, a, b) #define orc_sse_emit_psraw_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psraw_imm, imm, 0, b) #define orc_sse_emit_psrlw_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrlw_imm, imm, 0, b) #define orc_sse_emit_psllw_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psllw_imm, imm, 0, b) #define orc_sse_emit_psrad_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrad_imm, imm, 0, b) #define orc_sse_emit_psrld_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrld_imm, imm, 0, b) #define orc_sse_emit_pslld_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pslld_imm, imm, 0, b) #define orc_sse_emit_psrlq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrlq_imm, imm, 0, b) #define orc_sse_emit_psllq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psllq_imm, imm, 0, b) #define orc_sse_emit_psrldq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrldq_imm, imm, 0, b) #define orc_sse_emit_pslldq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pslldq_imm, imm, 0, b) #define orc_sse_emit_pshufd(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufd, imm, a, b) #define orc_sse_emit_pshuflw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshuflw, imm, a, b) #define orc_sse_emit_pshufhw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufhw, imm, a, b) #define orc_sse_emit_palignr(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psalignr, imm, a, b) #define orc_sse_emit_movdqu(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movdqu_load, 16, a, b) #define orc_sse_emit_pinsrw_memoffset(p,imm,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_pinsrw, 4, imm, offset, a, b) #define orc_sse_emit_movd_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movd_load, 4, 0, offset, a, b) #define orc_sse_emit_movq_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movq_sse_load, 4, 0, offset, a, b) #define orc_sse_emit_movdqa_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movdqa_load, 4, 0, offset, a, b) #define orc_sse_emit_movdqu_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movdqu_load, 4, 0, offset, a, b) #define orc_sse_emit_movhps_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movhps_load, 4, 0, offset, a, b) #define orc_sse_emit_pextrw_memoffset(p,imm,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_pextrw, 16, imm, a, offset, b) #define orc_sse_emit_movd_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movd_store, 16, 0, a, offset, b) #define orc_sse_emit_movq_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movq_sse_store, 16, 0, a, offset, b) #define orc_sse_emit_movdqa_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movdqa_store, 16, 0, a, offset, b) #define orc_sse_emit_movdqu_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movdqu_store, 16, 0, a, offset, b) #define orc_sse_emit_movntdq_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movntdq_store, 16, 0, a, offset, b) #define orc_sse_emit_pinsrw_memindex(p,imm,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_pinsrw, 4, imm, offset, a, a_index, shift, b) #define orc_sse_emit_movd_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movd_load, 4, 0, offset, a, a_index, shift, b) #define orc_sse_emit_movq_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movq_sse_load, 4, 0, offset, a, a_index, shift, b) #define orc_sse_emit_movdqa_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movdqa_load, 4, 0, offset, a, a_index, shift, b) #define orc_sse_emit_movdqu_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movdqu_load, 4, 0, offset, a, a_index, shift, b) #define orc_sse_emit_movhps_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movhps_load, 4, 0, offset, a, a_index, shift, b) #define orc_sse_emit_pextrw_memindex(p,imm,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_pextrw, imm, a, offset, b, b_index, shift) #define orc_sse_emit_movd_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movd_store, 0, a, offset, b, b_index, shift) #define orc_sse_emit_movq_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movq_sse_store, 0, a, offset, b, b_index, shift) #define orc_sse_emit_movdqa_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movdqa_store, 0, a, offset, b, b_index, shift) #define orc_sse_emit_movdqu_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movdqu_store, 0, a, offset, b, b_index, shift) #define orc_sse_emit_movntdq_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movntdq_store, 0, a, offset, b, b_index, shift) #define orc_sse_emit_pinsrw_register(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pinsrw, imm, a, b) #define orc_sse_emit_movd_load_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movd_load, 4, a, b) #define orc_sse_emit_movq_load_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movq_sse_load, 4, a, b) #define orc_sse_emit_pextrw_register(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pextrw, imm, a, b) #define orc_sse_emit_movd_store_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movd_store, 4, a, b) #define orc_sse_emit_movq_store_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movq_sse_store, 4, a, b) #define orc_mmx_emit_punpcklbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpcklbw, 8, a, b) #define orc_mmx_emit_punpcklwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpcklwd, 8, a, b) #define orc_mmx_emit_punpckldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckldq, 8, a, b) #define orc_mmx_emit_packsswb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packsswb, 8, a, b) #define orc_mmx_emit_pcmpgtb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtb, 8, a, b) #define orc_mmx_emit_pcmpgtw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtw, 8, a, b) #define orc_mmx_emit_pcmpgtd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtd, 8, a, b) #define orc_mmx_emit_packuswb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packuswb, 8, a, b) #define orc_mmx_emit_punpckhbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhbw, 8, a, b) #define orc_mmx_emit_punpckhwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhwd, 8, a, b) #define orc_mmx_emit_punpckhdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhdq, 8, a, b) #define orc_mmx_emit_packssdw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packssdw, 8, a, b) #define orc_mmx_emit_punpcklqdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpcklqdq, 8, a, b) #define orc_mmx_emit_punpckhqdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_punpckhqdq, 8, a, b) #define orc_mmx_emit_psraw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psraw, 8, a, b) #define orc_mmx_emit_psrlw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrlw, 8, a, b) #define orc_mmx_emit_psllw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psllw, 8, a, b) #define orc_mmx_emit_psrad(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrad, 8, a, b) #define orc_mmx_emit_psrld(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrld, 8, a, b) #define orc_mmx_emit_pslld(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pslld, 8, a, b) #define orc_mmx_emit_psrlq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrlq, 8, a, b) #define orc_mmx_emit_psllq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psllq, 8, a, b) #define orc_mmx_emit_psrldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrldq, 8, a, b) #define orc_mmx_emit_pslldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pslldq, 8, a, b) #define orc_mmx_emit_psrlq_reg(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psrlq_reg, 8, a, b) #define orc_mmx_emit_pcmpeqb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqb, 8, a, b) #define orc_mmx_emit_pcmpeqw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqw, 8, a, b) #define orc_mmx_emit_pcmpeqd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqd, 8, a, b) #define orc_mmx_emit_paddq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddq, 8, a, b) #define orc_mmx_emit_pmullw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmullw, 8, a, b) #define orc_mmx_emit_psubusb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubusb, 8, a, b) #define orc_mmx_emit_psubusw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubusw, 8, a, b) #define orc_mmx_emit_pminub(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminub, 8, a, b) #define orc_mmx_emit_pand(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pand, 8, a, b) #define orc_mmx_emit_paddusb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddusb, 8, a, b) #define orc_mmx_emit_paddusw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddusw, 8, a, b) #define orc_mmx_emit_pmaxub(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxub, 8, a, b) #define orc_mmx_emit_pandn(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pandn, 8, a, b) #define orc_mmx_emit_pavgb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pavgb, 8, a, b) #define orc_mmx_emit_pavgw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pavgw, 8, a, b) #define orc_mmx_emit_pmulhuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulhuw, 8, a, b) #define orc_mmx_emit_pmulhw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulhw, 8, a, b) #define orc_mmx_emit_psubsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubsb, 8, a, b) #define orc_mmx_emit_psubsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubsw, 8, a, b) #define orc_mmx_emit_pminsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminsw, 8, a, b) #define orc_mmx_emit_por(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_por, 8, a, b) #define orc_mmx_emit_paddsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddsb, 8, a, b) #define orc_mmx_emit_paddsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddsw, 8, a, b) #define orc_mmx_emit_pmaxsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxsw, 8, a, b) #define orc_mmx_emit_pxor(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pxor, 8, a, b) #define orc_mmx_emit_pmuludq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmuludq, 8, a, b) #define orc_mmx_emit_pmaddwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaddwd, 8, a, b) #define orc_mmx_emit_psadbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psadbw, 8, a, b) #define orc_mmx_emit_psubb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubb, 8, a, b) #define orc_mmx_emit_psubw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubw, 8, a, b) #define orc_mmx_emit_psubd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubd, 8, a, b) #define orc_mmx_emit_psubq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psubq, 8, a, b) #define orc_mmx_emit_paddb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddb, 8, a, b) #define orc_mmx_emit_paddw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddw, 8, a, b) #define orc_mmx_emit_paddd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_paddd, 8, a, b) #define orc_mmx_emit_pshufb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pshufb, 8, a, b) #define orc_mmx_emit_phaddw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phaddw, 8, a, b) #define orc_mmx_emit_phaddd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phaddd, 8, a, b) #define orc_mmx_emit_phaddsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phaddsw, 8, a, b) #define orc_mmx_emit_pmaddubsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaddubsw, 8, a, b) #define orc_mmx_emit_phsubw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phsubw, 8, a, b) #define orc_mmx_emit_phsubd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phsubd, 8, a, b) #define orc_mmx_emit_phsubsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phsubsw, 8, a, b) #define orc_mmx_emit_psignb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psignb, 8, a, b) #define orc_mmx_emit_psignw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psignw, 8, a, b) #define orc_mmx_emit_psignd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_psignd, 8, a, b) #define orc_mmx_emit_pmulhrsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulhrsw, 8, a, b) #define orc_mmx_emit_pabsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pabsb, 8, a, b) #define orc_mmx_emit_pabsw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pabsw, 8, a, b) #define orc_mmx_emit_pabsd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pabsd, 8, a, b) #define orc_mmx_emit_pmovsxbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxbw, 8, a, b) #define orc_mmx_emit_pmovsxbd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxbd, 8, a, b) #define orc_mmx_emit_pmovsxbq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxbq, 8, a, b) #define orc_mmx_emit_pmovsxwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxwd, 8, a, b) #define orc_mmx_emit_pmovsxwq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxwq, 8, a, b) #define orc_mmx_emit_pmovsxdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovsxdq, 8, a, b) #define orc_mmx_emit_pmuldq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmuldq, 8, a, b) #define orc_mmx_emit_pcmpeqq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpeqq, 8, a, b) #define orc_mmx_emit_packusdw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_packusdw, 8, a, b) #define orc_mmx_emit_pmovzxbw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxbw, 8, a, b) #define orc_mmx_emit_pmovzxbd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxbd, 8, a, b) #define orc_mmx_emit_pmovzxbq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxbq, 8, a, b) #define orc_mmx_emit_pmovzxwd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxwd, 8, a, b) #define orc_mmx_emit_pmovzxwq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxwq, 8, a, b) #define orc_mmx_emit_pmovzxdq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmovzxdq, 8, a, b) #define orc_mmx_emit_pmulld(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmulld, 8, a, b) #define orc_mmx_emit_phminposuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_phminposuw, 8, a, b) #define orc_mmx_emit_pminsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminsb, 8, a, b) #define orc_mmx_emit_pminsd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminsd, 8, a, b) #define orc_mmx_emit_pminuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminuw, 8, a, b) #define orc_mmx_emit_pminud(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pminud, 8, a, b) #define orc_mmx_emit_pmaxsb(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxsb, 8, a, b) #define orc_mmx_emit_pmaxsd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxsd, 8, a, b) #define orc_mmx_emit_pmaxuw(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxuw, 8, a, b) #define orc_mmx_emit_pmaxud(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pmaxud, 8, a, b) #define orc_mmx_emit_pcmpgtq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_pcmpgtq, 8, a, b) #define orc_mmx_emit_addps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_addps, 8, a, b) #define orc_mmx_emit_subps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_subps, 8, a, b) #define orc_mmx_emit_mulps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_mulps, 8, a, b) #define orc_mmx_emit_divps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_divps, 8, a, b) #define orc_mmx_emit_sqrtps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_sqrtps, 8, a, b) #define orc_mmx_emit_addpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_addpd, 8, a, b) #define orc_mmx_emit_subpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_subpd, 8, a, b) #define orc_mmx_emit_mulpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_mulpd, 8, a, b) #define orc_mmx_emit_divpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_divpd, 8, a, b) #define orc_mmx_emit_sqrtpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_sqrtpd, 8, a, b) #define orc_mmx_emit_cmpeqps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpeqps, 8, a, b) #define orc_mmx_emit_cmpeqpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpeqpd, 8, a, b) #define orc_mmx_emit_cmpltps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpltps, 8, a, b) #define orc_mmx_emit_cmpltpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpltpd, 8, a, b) #define orc_mmx_emit_cmpleps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmpleps, 8, a, b) #define orc_mmx_emit_cmplepd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cmplepd, 8, a, b) #define orc_mmx_emit_cvttps2dq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvttps2dq, 8, a, b) #define orc_mmx_emit_cvttpd2dq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvttpd2dq, 8, a, b) #define orc_mmx_emit_cvtdq2ps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtdq2ps, 8, a, b) #define orc_mmx_emit_cvtdq2pd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtdq2pd, 8, a, b) #define orc_mmx_emit_cvtps2pd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtps2pd, 8, a, b) #define orc_mmx_emit_cvtpd2ps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_cvtpd2ps, 8, a, b) #define orc_mmx_emit_minps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_minps, 8, a, b) #define orc_mmx_emit_minpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_minpd, 8, a, b) #define orc_mmx_emit_maxps(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_maxps, 8, a, b) #define orc_mmx_emit_maxpd(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_maxpd, 8, a, b) #define orc_mmx_emit_psraw_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psraw_imm, imm, 0, b) #define orc_mmx_emit_psrlw_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrlw_imm, imm, 0, b) #define orc_mmx_emit_psllw_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psllw_imm, imm, 0, b) #define orc_mmx_emit_psrad_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrad_imm, imm, 0, b) #define orc_mmx_emit_psrld_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrld_imm, imm, 0, b) #define orc_mmx_emit_pslld_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pslld_imm, imm, 0, b) #define orc_mmx_emit_psrlq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrlq_imm, imm, 0, b) #define orc_mmx_emit_psllq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psllq_imm, imm, 0, b) #define orc_mmx_emit_psrldq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psrldq_imm, imm, 0, b) #define orc_mmx_emit_pslldq_imm(p,imm,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pslldq_imm, imm, 0, b) #define orc_mmx_emit_pshufd(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufd, imm, a, b) #define orc_mmx_emit_pshuflw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshuflw, imm, a, b) #define orc_mmx_emit_pshufhw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufhw, imm, a, b) #define orc_mmx_emit_palignr(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psalignr, imm, a, b) #define orc_mmx_emit_pinsrw_memoffset(p,imm,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_pinsrw, 4, imm, offset, a, b) #define orc_mmx_emit_movd_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movd_load, 4, 0, offset, a, b) #define orc_mmx_emit_movq_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movq_mmx_load, 4, 0, offset, a, b) #define orc_mmx_emit_pextrw_memoffset(p,imm,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_pextrw, 8, imm, a, offset, b) #define orc_mmx_emit_movd_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movd_store, 8, 0, a, offset, b) #define orc_mmx_emit_movq_store_memoffset(p,a,offset,b) orc_x86_emit_cpuinsn_store_memoffset(p, ORC_X86_movq_mmx_store, 8, 0, a, offset, b) #define orc_mmx_emit_pinsrw_memindex(p,imm,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_pinsrw, 4, imm, offset, a, a_index, shift, b) #define orc_mmx_emit_movd_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movd_load, 4, 0, offset, a, a_index, shift, b) #define orc_mmx_emit_movq_load_memindex(p,offset,a,a_index,shift,b) orc_x86_emit_cpuinsn_load_memindex(p, ORC_X86_movq_mmx_load, 4, 0, offset, a, a_index, shift, b) #define orc_mmx_emit_pextrw_memindex(p,imm,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_pextrw, imm, a, offset, b, b_index, shift) #define orc_mmx_emit_movd_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movd_store, 0, a, offset, b, b_index, shift) #define orc_mmx_emit_movq_store_memindex(p,a,offset,b,b_index,shift) orc_x86_emit_cpuinsn_store_memindex(p, ORC_X86_movq_mmx_store, 0, a, offset, b, b_index, shift) #define orc_mmx_emit_pinsrw_register(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pinsrw, imm, a, b) #define orc_mmx_emit_movd_load_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movd_load, 4, a, b) #define orc_mmx_emit_movq_load_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movq_mmx_load, 4, a, b) #define orc_mmx_emit_pextrw_register(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pextrw, imm, a, b) #define orc_mmx_emit_movd_store_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movd_store, 4, a, b) #define orc_mmx_emit_movq_store_register(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movq_mmx_store, 4, a, b) #define orc_mmx_emit_pshufw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufw, imm, a, b) #define orc_mmx_emit_movq(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movq_mmx_load, 8, a, b) #endif ORC_END_DECLS #endif orc-0.4.18/orc/orclimits.h0000664000175000017500000000245512111024531012247 00000000000000 #ifndef _ORC_LIMITS_H_ #define _ORC_LIMITS_H_ #include ORC_BEGIN_DECLS #define ORC_N_REGS (32*4) #define ORC_N_INSNS 100 #define ORC_N_VARIABLES 64 #define ORC_N_ARRAYS 12 #define ORC_N_REGISTERS 20 #define ORC_N_FIXUPS 100 #define ORC_N_CONSTANTS 20 #define ORC_N_LABELS 40 #define ORC_N_COMPILER_VARIABLES (ORC_N_VARIABLES+32) #define ORC_GP_REG_BASE 32 #define ORC_VEC_REG_BASE 64 #define ORC_REG_INVALID 0 #define ORC_STATIC_OPCODE_N_SRC 4 #define ORC_STATIC_OPCODE_N_DEST 2 #define ORC_OPCODE_N_ARGS 4 #define ORC_N_TARGETS 10 #define ORC_N_RULE_SETS 10 #define ORC_MAX_VAR_SIZE 8 enum { ORC_VAR_D1, ORC_VAR_D2, ORC_VAR_D3, ORC_VAR_D4, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_S5, ORC_VAR_S6, ORC_VAR_S7, ORC_VAR_S8, ORC_VAR_A1, ORC_VAR_A2, ORC_VAR_A3, ORC_VAR_A4, ORC_VAR_C1, ORC_VAR_C2, ORC_VAR_C3, ORC_VAR_C4, ORC_VAR_C5, ORC_VAR_C6, ORC_VAR_C7, ORC_VAR_C8, ORC_VAR_P1, ORC_VAR_P2, ORC_VAR_P3, ORC_VAR_P4, ORC_VAR_P5, ORC_VAR_P6, ORC_VAR_P7, ORC_VAR_P8, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_T6, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_T9, ORC_VAR_T10, ORC_VAR_T11, ORC_VAR_T12, ORC_VAR_T13, ORC_VAR_T14, ORC_VAR_T15, ORC_VAR_T16 }; ORC_END_DECLS #endif orc-0.4.18/orc/orcrule.c0000664000175000017500000000127612071634360011724 00000000000000 #include "config.h" #include #include #include #include #include /** * SECTION:orcrule * @title: OrcRule * @short_description: Creating rules for code generation */ void orc_rule_register (OrcRuleSet *rule_set, const char *opcode_name, OrcRuleEmitFunc emit, void *emit_user) { int i; OrcOpcodeSet *opcode_set; opcode_set = orc_opcode_set_get_nth (rule_set->opcode_major); i = orc_opcode_set_find_by_name (opcode_set, opcode_name); if (i == -1) { ORC_ERROR("failed to find opcode \"%s\"", opcode_name); return; } rule_set->rules[i].emit = emit; rule_set->rules[i].emit_user = emit_user; } orc-0.4.18/orc/orcx86insn.c0000664000175000017500000012236612111024531012262 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include static const OrcSysOpcode orc_x86_opcodes[] = { { "punpcklbw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f60 }, { "punpcklwd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f61 }, { "punpckldq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f62 }, { "packsswb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f63 }, { "pcmpgtb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f64 }, { "pcmpgtw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f65 }, { "pcmpgtd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f66 }, { "packuswb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f67 }, { "punpckhbw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f68 }, { "punpckhwd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f69 }, { "punpckhdq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f6a }, { "packssdw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f6b }, { "punpcklqdq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f6c }, { "punpckhqdq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f6d }, { "movdqa", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f6f }, { "psraw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe1 }, { "psrlw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd1 }, { "psllw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff1 }, { "psrad", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe2 }, { "psrld", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd2 }, { "pslld", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff2 }, { "psrlq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd3 }, { "psllq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff3 }, { "psrldq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f73 }, { "pslldq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f73 }, { "psrlq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd3 }, { "pcmpeqb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f74 }, { "pcmpeqw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f75 }, { "pcmpeqd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f76 }, { "paddq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd4 }, { "pmullw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd5 }, { "psubusb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd8 }, { "psubusw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fd9 }, { "pminub", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fda }, { "pand", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fdb }, { "paddusb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fdc }, { "paddusw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fdd }, { "pmaxub", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fde }, { "pandn", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fdf }, { "pavgb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe0 }, { "pavgw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe3 }, { "pmulhuw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe4 }, { "pmulhw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe5 }, { "psubsb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe8 }, { "psubsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fe9 }, { "pminsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fea }, { "por", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0feb }, { "paddsb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fec }, { "paddsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fed }, { "pmaxsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fee }, { "pxor", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0fef }, { "pmuludq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff4 }, { "pmaddwd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff5 }, { "psadbw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff6 }, { "psubb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff8 }, { "psubw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ff9 }, { "psubd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ffa }, { "psubq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ffb }, { "paddb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ffc }, { "paddw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ffd }, { "paddd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0ffe }, { "pshufb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3800 }, { "phaddw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3801 }, { "phaddd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3802 }, { "phaddsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3803 }, { "pmaddubsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3804 }, { "phsubw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3805 }, { "phsubd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3806 }, { "phsubsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3807 }, { "psignb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3808 }, { "psignw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3809 }, { "psignd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f380a }, { "pmulhrsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f380b }, { "pabsb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f381c }, { "pabsw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f381d }, { "pabsd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f381e }, { "pmovsxbw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3820 }, { "pmovsxbd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3821 }, { "pmovsxbq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3822 }, { "pmovsxwd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3823 }, { "pmovsxwq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3824 }, { "pmovsxdq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3825 }, { "pmuldq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3828 }, { "pcmpeqq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3829 }, { "packusdw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f382b }, { "pmovzxbw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3830 }, { "pmovzxbd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3831 }, { "pmovzxbq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3832 }, { "pmovzxwd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3833 }, { "pmovzxwq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3834 }, { "pmovzxdq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3835 }, { "pmulld", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3840 }, { "phminposuw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3841 }, { "pminsb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3838 }, { "pminsd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3839 }, { "pminuw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f383a }, { "pminud", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f383b }, { "pmaxsb", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f383c }, { "pmaxsd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f383d }, { "pmaxuw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f383e }, { "pmaxud", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f383f }, { "pcmpgtq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x01, 0x0f3837 }, { "addps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f58 }, { "subps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f5c }, { "mulps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f59 }, { "divps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f5e }, { "sqrtps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f51 }, { "addpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f58 }, { "subpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f5c }, { "mulpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f59 }, { "divpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f5e }, { "sqrtpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f51 }, { "cmpeqps", ORC_X86_INSN_TYPE_SSEM_SSE, 0, 0x00, 0x0fc2, 0 }, { "cmpeqpd", ORC_X86_INSN_TYPE_SSEM_SSE, 0, 0x66, 0x0fc2, 0 }, { "cmpltps", ORC_X86_INSN_TYPE_SSEM_SSE, 0, 0x00, 0x0fc2, 1 }, { "cmpltpd", ORC_X86_INSN_TYPE_SSEM_SSE, 0, 0x66, 0x0fc2, 1 }, { "cmpleps", ORC_X86_INSN_TYPE_SSEM_SSE, 0, 0x00, 0x0fc2, 2 }, { "cmplepd", ORC_X86_INSN_TYPE_SSEM_SSE, 0, 0x66, 0x0fc2, 2 }, { "cvttps2dq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0xf3, 0x0f5b }, { "cvttpd2dq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0fe6 }, { "cvtdq2ps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f5b }, { "cvtdq2pd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0xf3, 0x0fe6 }, { "cvtps2pd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f5a }, { "cvtpd2ps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f5a }, { "minps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f5d }, { "minpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f5d }, { "maxps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f5f }, { "maxpd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f5f }, { "psraw", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f71, 4 }, { "psrlw", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f71, 2 }, { "psllw", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f71, 6 }, { "psrad", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f72, 4 }, { "psrld", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f72, 2 }, { "pslld", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f72, 6 }, { "psrlq", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f73, 2 }, { "psllq", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f73, 6 }, { "psrldq", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f73, 3 }, { "pslldq", ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT, 0, 0x01, 0x0f73, 7 }, { "pshufd", ORC_X86_INSN_TYPE_IMM8_MMXM_MMX, 0, 0x66, 0x0f70 }, { "pshuflw", ORC_X86_INSN_TYPE_IMM8_MMXM_MMX, 0, 0xf2, 0x0f70 }, { "pshufhw", ORC_X86_INSN_TYPE_IMM8_MMXM_MMX, 0, 0xf3, 0x0f70 }, { "palignr", ORC_X86_INSN_TYPE_IMM8_MMXM_MMX, 0, 0x66, 0x0f3a0f }, { "pinsrw", ORC_X86_INSN_TYPE_IMM8_REGM_MMX, 0, 0x01, 0x0fc4 }, { "movd", ORC_X86_INSN_TYPE_REGM_MMX, 0, 0x01, 0x0f6e }, { "movq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0xf3, 0x0f7e }, { "movdqa", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x66, 0x0f6f }, { "movdqu", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0xf3, 0x0f6f }, { "movhps", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f16 }, { "pextrw", ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV, 0, 0x01, 0x0f3a15 }, { "movd", ORC_X86_INSN_TYPE_MMX_REGM_REV, 0, 0x01, 0x0f7e }, { "movq", ORC_X86_INSN_TYPE_MMXM_MMX_REV, 0, 0x66, 0x0fd6 }, { "movdqa", ORC_X86_INSN_TYPE_MMXM_MMX_REV, 0, 0x66, 0x0f7f }, { "movdqu", ORC_X86_INSN_TYPE_MMXM_MMX_REV, 0, 0xf3, 0x0f7f }, { "movntdq", ORC_X86_INSN_TYPE_MMXM_MMX_REV, 0, 0x66, 0x0fe7 }, { "ldmxcsr", ORC_X86_INSN_TYPE_MEM, 0, 0x00, 0x0fae, 2 }, { "stmxcsr", ORC_X86_INSN_TYPE_MEM, 0, 0x00, 0x0fae, 3 }, { "add", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 0 }, { "add", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 0 }, { "add", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x03 }, { "add", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x01 }, { "or", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 1 }, { "or", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 1 }, { "or", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x0b }, { "or", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x09 }, { "adc", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 2 }, { "adc", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 2 }, { "adc", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x13 }, { "adc", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x11 }, { "sbb", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 3 }, { "sbb", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 3 }, { "sbb", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x1b }, { "sbb", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x19 }, { "and", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 4 }, { "and", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 4 }, { "and", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x23 }, { "and", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x21 }, { "sub", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 5 }, { "sub", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 5 }, { "sub", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x2b }, { "sub", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x29 }, { "xor", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 6 }, { "xor", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 6 }, { "xor", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x33 }, { "xor", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x31 }, { "cmp", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0x83, 7 }, { "cmp", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0x81, 7 }, { "cmp", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x3b }, { "cmp", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x39 }, { "jo", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x70 }, { "jno", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x71 }, { "jc", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x72 }, { "jnc", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x73 }, { "jz", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x74 }, { "jnz", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x75 }, { "jbe", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x76 }, { "ja", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x77 }, { "js", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x78 }, { "jns", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x79 }, { "jp", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x7a }, { "jnp", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x7b }, { "jl", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x7c }, { "jge", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x7d }, { "jle", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x7e }, { "jg", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0x7f }, { "jmp", ORC_X86_INSN_TYPE_BRANCH, 0, 0x00, 0xeb }, { "", ORC_X86_INSN_TYPE_LABEL, 0, 0x00, 0x00 }, { "ret", ORC_X86_INSN_TYPE_NONE, 0, 0x00, 0xc3 }, { "retq", ORC_X86_INSN_TYPE_NONE, 0, 0x00, 0xc3 }, { "emms", ORC_X86_INSN_TYPE_NONE, 0, 0x00, 0x0f77 }, { "rdtsc", ORC_X86_INSN_TYPE_NONE, 0, 0x00, 0x0f31 }, { "nop", ORC_X86_INSN_TYPE_NONE, 0, 0x00, 0x90 }, { "rep movsb", ORC_X86_INSN_TYPE_NONE, 0, 0xf3, 0xa4 }, { "rep movsw", ORC_X86_INSN_TYPE_NONE, 0, 0x66, 0xf3a5 }, { "rep movsl", ORC_X86_INSN_TYPE_NONE, 0, 0xf3, 0xa5 }, { "push", ORC_X86_INSN_TYPE_STACK, 0, 0x00, 0x50 }, { "pop", ORC_X86_INSN_TYPE_STACK, 0, 0x00, 0x58 }, { "movzx", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x0fb6 }, { "movw", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x66, 0x8b }, { "movl", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x8b }, { "mov", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x8b }, { "mov", ORC_X86_INSN_TYPE_IMM32_REGM_MOV, 0, 0x00, 0xb8 }, { "movb", ORC_X86_INSN_TYPE_REG8_REGM, 0, 0x00, 0x88 }, { "movw", ORC_X86_INSN_TYPE_REG16_REGM, 0, 0x66, 0x89 }, { "movl", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x89 }, { "mov", ORC_X86_INSN_TYPE_REG_REGM, 0, 0x00, 0x89 }, { "test", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x85 }, { "testl", ORC_X86_INSN_TYPE_IMM32_REGM, 0, 0x00, 0xf7, 0 }, { "leal", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x8d }, { "leaq", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x8d }, { "imul", ORC_X86_INSN_TYPE_REGM_REG, 0, 0x00, 0x0faf }, { "imull", ORC_X86_INSN_TYPE_REGM, 0, 0x00, 0xf7, 5 }, { "incl", ORC_X86_INSN_TYPE_REGM, 0, 0x00, 0xff, 0 }, { "decl", ORC_X86_INSN_TYPE_REGM, 0, 0x00, 0xff, 1 }, { "sar", ORC_X86_INSN_TYPE_IMM8_REGM, 0, 0x00, 0xc1, 7 }, { "sar", ORC_X86_INSN_TYPE_REGM, 0, 0x00, 0xd1, 7 }, { "and", ORC_X86_INSN_TYPE_IMM32_A, 0, 0x00, 0x25, 4 }, { "", ORC_X86_INSN_TYPE_ALIGN, 0, 0x00, 0x00 }, { "pshufw", ORC_X86_INSN_TYPE_IMM8_MMXM_MMX, 0, 0x00, 0x0f70 }, { "movq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, 0x00, 0x0f6f }, { "movq", ORC_X86_INSN_TYPE_MMXM_MMX_REV, 0, 0x00, 0x0f7f }, }; static void output_opcode (OrcCompiler *p, const OrcSysOpcode *opcode, int size, int src, int dest, int is_sse) { ORC_ASSERT(opcode->code != 0); if (opcode->prefix != 0) { if (opcode->prefix == 0x01) { if (is_sse) { *p->codeptr++ = 0x66; } } else { *p->codeptr++ = opcode->prefix; } } orc_x86_emit_rex (p, size, dest, 0, src); if (opcode->code & 0xff0000) { *p->codeptr++ = (opcode->code >> 16) & 0xff; } if (opcode->code & 0xff00) { *p->codeptr++ = (opcode->code >> 8) & 0xff; } *p->codeptr++ = (opcode->code >> 0) & 0xff; } const char * orc_x86_get_regname_mmxsse (int reg, int is_sse) { if (is_sse) { return orc_x86_get_regname_sse (reg); } else { return orc_x86_get_regname_mmx (reg); } } int is_sse_reg (int reg) { return (reg >= X86_XMM0) && (reg <= X86_XMM15); } void orc_x86_insn_output_asm (OrcCompiler *p, OrcX86Insn *xinsn) { char imm_str[40] = { 0 }; char op1_str[40] = { 0 }; char op2_str[40] = { 0 }; int is_sse; if (xinsn->opcode->type == ORC_X86_INSN_TYPE_ALIGN) { if (xinsn->size > 0) ORC_ASM_CODE(p,".p2align %d\n", xinsn->size); return; } if (xinsn->opcode->type == ORC_X86_INSN_TYPE_LABEL) { ORC_ASM_CODE(p,"%d:\n", xinsn->label); return; } is_sse = FALSE; if (is_sse_reg (xinsn->src) || is_sse_reg (xinsn->dest)) { is_sse = TRUE; } switch (xinsn->opcode->type) { case ORC_X86_INSN_TYPE_MMXM_MMX: case ORC_X86_INSN_TYPE_SSEM_SSE: case ORC_X86_INSN_TYPE_MMXM_MMX_REV: case ORC_X86_INSN_TYPE_SSEM_SSE_REV: case ORC_X86_INSN_TYPE_REGM_MMX: case ORC_X86_INSN_TYPE_MMX_REGM_REV: case ORC_X86_INSN_TYPE_REGM_REG: case ORC_X86_INSN_TYPE_REG_REGM: case ORC_X86_INSN_TYPE_STACK: case ORC_X86_INSN_TYPE_MEM: case ORC_X86_INSN_TYPE_REGM: case ORC_X86_INSN_TYPE_REG8_REGM: case ORC_X86_INSN_TYPE_REG16_REGM: case ORC_X86_INSN_TYPE_BRANCH: case ORC_X86_INSN_TYPE_LABEL: case ORC_X86_INSN_TYPE_ALIGN: case ORC_X86_INSN_TYPE_NONE: imm_str[0] = 0; break; case ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT: case ORC_X86_INSN_TYPE_IMM8_MMXM_MMX: case ORC_X86_INSN_TYPE_IMM8_REGM_MMX: case ORC_X86_INSN_TYPE_IMM8_REGM: case ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV: case ORC_X86_INSN_TYPE_IMM32_REGM: case ORC_X86_INSN_TYPE_IMM32_REGM_MOV: case ORC_X86_INSN_TYPE_IMM32_A: sprintf(imm_str, "$%d, ", xinsn->imm); break; default: ORC_ERROR("%d", xinsn->opcode->type); ORC_ASSERT(0); break; } switch (xinsn->opcode->type) { case ORC_X86_INSN_TYPE_MMXM_MMX: case ORC_X86_INSN_TYPE_SSEM_SSE: case ORC_X86_INSN_TYPE_IMM8_MMXM_MMX: if (xinsn->type == ORC_X86_RM_REG) { sprintf(op1_str, "%%%s, ", orc_x86_get_regname_mmxsse (xinsn->src, is_sse)); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { sprintf(op1_str, "%d(%%%s), ", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->src)); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { sprintf(op1_str, "%d(%%%s,%%%s,%d), ", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->src), orc_x86_get_regname_ptr (p, xinsn->index_reg), 1<shift); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_MMXM_MMX_REV: /* FIXME misnamed */ case ORC_X86_INSN_TYPE_SSEM_SSE_REV: case ORC_X86_INSN_TYPE_MMX_REGM_REV: case ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV: sprintf(op1_str, "%%%s, ", orc_x86_get_regname_mmxsse (xinsn->src, is_sse)); break; case ORC_X86_INSN_TYPE_REGM_MMX: case ORC_X86_INSN_TYPE_REGM_REG: case ORC_X86_INSN_TYPE_IMM8_REGM_MMX: if (xinsn->type == ORC_X86_RM_REG) { sprintf(op1_str, "%%%s, ", orc_x86_get_regname_size (xinsn->src, xinsn->size)); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { sprintf(op1_str, "%d(%%%s), ", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->src)); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { sprintf(op1_str, "%d(%%%s,%%%s,%d), ", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->src), orc_x86_get_regname_ptr (p, xinsn->index_reg), 1<shift); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_MEM: case ORC_X86_INSN_TYPE_REGM: case ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT: case ORC_X86_INSN_TYPE_STACK: case ORC_X86_INSN_TYPE_IMM32_REGM_MOV: case ORC_X86_INSN_TYPE_IMM8_REGM: case ORC_X86_INSN_TYPE_IMM32_REGM: case ORC_X86_INSN_TYPE_BRANCH: case ORC_X86_INSN_TYPE_NONE: case ORC_X86_INSN_TYPE_LABEL: case ORC_X86_INSN_TYPE_ALIGN: case ORC_X86_INSN_TYPE_IMM32_A: op1_str[0] = 0; break; case ORC_X86_INSN_TYPE_REG_REGM: sprintf(op1_str, "%%%s, ", orc_x86_get_regname (xinsn->src)); break; case ORC_X86_INSN_TYPE_REG8_REGM: sprintf(op1_str, "%%%s, ", orc_x86_get_regname_8 (xinsn->src)); break; case ORC_X86_INSN_TYPE_REG16_REGM: sprintf(op1_str, "%%%s, ", orc_x86_get_regname_16 (xinsn->src)); break; default: ORC_ERROR("%d", xinsn->opcode->type); ORC_ASSERT(0); break; } switch (xinsn->opcode->type) { case ORC_X86_INSN_TYPE_MMXM_MMX: case ORC_X86_INSN_TYPE_SSEM_SSE: case ORC_X86_INSN_TYPE_IMM8_MMXM_MMX: case ORC_X86_INSN_TYPE_IMM8_REGM_MMX: case ORC_X86_INSN_TYPE_REGM_MMX: case ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT: sprintf(op2_str, "%%%s", orc_x86_get_regname_mmxsse (xinsn->dest, is_sse)); break; case ORC_X86_INSN_TYPE_MMXM_MMX_REV: case ORC_X86_INSN_TYPE_SSEM_SSE_REV: if (xinsn->type == ORC_X86_RM_REG) { sprintf(op2_str, "%%%s", orc_x86_get_regname_mmxsse (xinsn->dest, is_sse)); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { sprintf(op2_str, "%d(%%%s)", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->dest)); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { sprintf(op1_str, "%d(%%%s,%%%s,%d), ", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->dest), orc_x86_get_regname_ptr (p, xinsn->index_reg), 1<shift); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_MMX_REGM_REV: case ORC_X86_INSN_TYPE_IMM32_REGM_MOV: case ORC_X86_INSN_TYPE_IMM8_REGM: case ORC_X86_INSN_TYPE_IMM32_REGM: case ORC_X86_INSN_TYPE_REGM: case ORC_X86_INSN_TYPE_REG8_REGM: case ORC_X86_INSN_TYPE_REG16_REGM: case ORC_X86_INSN_TYPE_REG_REGM: case ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV: if (xinsn->type == ORC_X86_RM_REG) { sprintf(op2_str, "%%%s", orc_x86_get_regname (xinsn->dest)); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { sprintf(op2_str, "%d(%%%s)", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->dest)); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { sprintf(op1_str, "%d(%%%s,%%%s,%d), ", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->dest), orc_x86_get_regname_ptr (p, xinsn->index_reg), 1<shift); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_REGM_REG: case ORC_X86_INSN_TYPE_STACK: sprintf(op2_str, "%%%s", orc_x86_get_regname_size (xinsn->dest, xinsn->size)); break; case ORC_X86_INSN_TYPE_MEM: if (xinsn->type == ORC_X86_RM_REG) { ORC_ERROR("register operand on memory instruction"); sprintf(op2_str, "ERROR"); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { /* FIXME: this uses xinsn->src */ sprintf(op2_str, "%d(%%%s)", xinsn->offset, orc_x86_get_regname_ptr (p, xinsn->src)); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_BRANCH: sprintf (op2_str, "%d%c", xinsn->label, (p->labels_int[xinsn->label] < xinsn - ((OrcX86Insn *)p->output_insns)) ? 'b' : 'f'); break; case ORC_X86_INSN_TYPE_LABEL: case ORC_X86_INSN_TYPE_ALIGN: case ORC_X86_INSN_TYPE_NONE: op2_str[0] = 0; break; case ORC_X86_INSN_TYPE_IMM32_A: sprintf(op2_str, "%%%s", orc_x86_get_regname_size (X86_EAX, xinsn->size)); break; default: ORC_ERROR("%d", xinsn->opcode->type); ORC_ASSERT(0); break; } ORC_ASM_CODE(p," %s %s%s%s\n", xinsn->opcode->name, imm_str, op1_str, op2_str); } orc_uint8 nop_codes[][16] = { { 0 /* MSVC wants something here */ }, { 0x90 }, { 0x66, 0x90 }, /* xchg %ax,%ax */ #if 0 { 0x0f, 0x1f, 0x00 }, /* nopl (%rax) */ { 0x0f, 0x1f, 0x40, 0x00 }, /* nopl 0x0(%rax) */ { 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */ { 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */ { 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax) */ { 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopl 0x0(%rax,%rax,1) */ { 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* nopw 0x0(%rax,%rax,1) */ /* Forms of nopw %cs:0x0(%rax,%rax,1) */ { 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x66, 0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, { 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 }, #else { 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, }, { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, }, #endif }; void orc_x86_insn_output_opcode (OrcCompiler *p, OrcX86Insn *xinsn) { int is_sse; is_sse = FALSE; if (is_sse_reg (xinsn->src) || is_sse_reg (xinsn->dest)) { is_sse = TRUE; } switch (xinsn->opcode->type) { case ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT: output_opcode (p, xinsn->opcode, 4, xinsn->dest, 0, is_sse); break; case ORC_X86_INSN_TYPE_MMX_REGM_REV: case ORC_X86_INSN_TYPE_MMXM_MMX_REV: case ORC_X86_INSN_TYPE_SSEM_SSE_REV: output_opcode (p, xinsn->opcode, 4, xinsn->dest, xinsn->src, is_sse); break; case ORC_X86_INSN_TYPE_REG_REGM: case ORC_X86_INSN_TYPE_IMM8_REGM: case ORC_X86_INSN_TYPE_IMM32_REGM: case ORC_X86_INSN_TYPE_REG8_REGM: case ORC_X86_INSN_TYPE_REG16_REGM: output_opcode (p, xinsn->opcode, xinsn->size, xinsn->dest, xinsn->src, FALSE); break; case ORC_X86_INSN_TYPE_IMM8_MMXM_MMX: case ORC_X86_INSN_TYPE_MMXM_MMX: case ORC_X86_INSN_TYPE_SSEM_SSE: case ORC_X86_INSN_TYPE_REGM_MMX: output_opcode (p, xinsn->opcode, 4, xinsn->src, xinsn->dest, is_sse); break; case ORC_X86_INSN_TYPE_IMM8_REGM_MMX: output_opcode (p, xinsn->opcode, xinsn->size, xinsn->src, xinsn->dest, is_sse); break; case ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV: output_opcode (p, xinsn->opcode, 4, xinsn->dest, xinsn->src, is_sse); break; case ORC_X86_INSN_TYPE_MEM: case ORC_X86_INSN_TYPE_REGM_REG: output_opcode (p, xinsn->opcode, xinsn->size, xinsn->src, xinsn->dest, FALSE); break; case ORC_X86_INSN_TYPE_REGM: output_opcode (p, xinsn->opcode, xinsn->size, xinsn->src, xinsn->dest, FALSE); break; case ORC_X86_INSN_TYPE_IMM32_REGM_MOV: orc_x86_emit_rex (p, xinsn->size, 0, 0, xinsn->dest); *p->codeptr++ = xinsn->opcode->code + (xinsn->dest&7); break; case ORC_X86_INSN_TYPE_NONE: output_opcode (p, xinsn->opcode, 4, 0, 0, FALSE); break; case ORC_X86_INSN_TYPE_IMM32_A: output_opcode (p, xinsn->opcode, xinsn->size, 0, 0, FALSE); break; case ORC_X86_INSN_TYPE_ALIGN: { int diff; int i; diff = (p->code - p->codeptr)&((1<size) - 1); for(i=0;icodeptr++ = nop_codes[diff][i]; } } break; case ORC_X86_INSN_TYPE_LABEL: case ORC_X86_INSN_TYPE_BRANCH: case ORC_X86_INSN_TYPE_STACK: break; default: ORC_ERROR("%d", xinsn->opcode->type); ORC_ASSERT(0); break; } } void orc_x86_insn_output_modrm (OrcCompiler *p, OrcX86Insn *xinsn) { switch (xinsn->opcode->type) { case ORC_X86_INSN_TYPE_REGM_REG: case ORC_X86_INSN_TYPE_REGM_MMX: case ORC_X86_INSN_TYPE_MMXM_MMX: case ORC_X86_INSN_TYPE_IMM8_REGM_MMX: case ORC_X86_INSN_TYPE_IMM8_MMXM_MMX: if (xinsn->type == ORC_X86_RM_REG) { orc_x86_emit_modrm_reg (p, xinsn->src, xinsn->dest); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { orc_x86_emit_modrm_memoffset (p, xinsn->offset, xinsn->src, xinsn->dest); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { orc_x86_emit_modrm_memindex2 (p, xinsn->offset, xinsn->src, xinsn->index_reg, xinsn->shift, xinsn->dest); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_REG_REGM: case ORC_X86_INSN_TYPE_MMXM_MMX_REV: case ORC_X86_INSN_TYPE_SSEM_SSE_REV: case ORC_X86_INSN_TYPE_MMX_REGM_REV: case ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV: case ORC_X86_INSN_TYPE_REG8_REGM: case ORC_X86_INSN_TYPE_REG16_REGM: if (xinsn->type == ORC_X86_RM_REG) { orc_x86_emit_modrm_reg (p, xinsn->dest, xinsn->src); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { orc_x86_emit_modrm_memoffset (p, xinsn->offset, xinsn->dest, xinsn->src); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { orc_x86_emit_modrm_memindex2 (p, xinsn->offset, xinsn->dest, xinsn->index_reg, xinsn->shift, xinsn->src); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_MEM: if (xinsn->type == ORC_X86_RM_REG) { orc_x86_emit_modrm_reg (p, xinsn->src, xinsn->opcode->code2); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { orc_x86_emit_modrm_memoffset (p, xinsn->offset, xinsn->src, xinsn->opcode->code2); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { orc_x86_emit_modrm_memindex2 (p, xinsn->offset, xinsn->src, xinsn->index_reg, xinsn->shift, xinsn->opcode->code2); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_IMM32_REGM_MOV: case ORC_X86_INSN_TYPE_IMM32_A: case ORC_X86_INSN_TYPE_NONE: case ORC_X86_INSN_TYPE_ALIGN: break; case ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT: case ORC_X86_INSN_TYPE_IMM8_REGM: case ORC_X86_INSN_TYPE_IMM32_REGM: case ORC_X86_INSN_TYPE_REGM: if (xinsn->type == ORC_X86_RM_REG) { orc_x86_emit_modrm_reg (p, xinsn->dest, xinsn->opcode->code2); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { orc_x86_emit_modrm_memoffset (p, xinsn->offset, xinsn->dest, xinsn->opcode->code2); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { orc_x86_emit_modrm_memindex2 (p, xinsn->offset, xinsn->dest, xinsn->index_reg, xinsn->shift, xinsn->opcode->code2); } else { ORC_ASSERT(0); } break; case ORC_X86_INSN_TYPE_SSEM_SSE: if (xinsn->type == ORC_X86_RM_REG) { orc_x86_emit_modrm_reg (p, xinsn->src, xinsn->dest); } else if (xinsn->type == ORC_X86_RM_MEMOFFSET) { orc_x86_emit_modrm_memoffset (p, xinsn->offset, xinsn->src, xinsn->dest); } else if (xinsn->type == ORC_X86_RM_MEMINDEX) { orc_x86_emit_modrm_memindex2 (p, xinsn->offset, xinsn->src, xinsn->index_reg, xinsn->shift, xinsn->dest); } else { ORC_ASSERT(0); } *p->codeptr++ = xinsn->opcode->code2; break; case ORC_X86_INSN_TYPE_STACK: *p->codeptr++ = xinsn->opcode->code + (xinsn->dest&0x7); break; case ORC_X86_INSN_TYPE_BRANCH: if (xinsn->size == 4) { if (xinsn->opcode_index == ORC_X86_jmp) { *p->codeptr++ = 0xe9; } else { *p->codeptr++ = 0x0f; *p->codeptr++ = xinsn->opcode->code + 0x10; } } else { *p->codeptr++ = xinsn->opcode->code; } if (xinsn->size == 4) { x86_add_fixup (p, p->codeptr, xinsn->label, 1); *p->codeptr++ = 0xfc; *p->codeptr++ = 0xff; *p->codeptr++ = 0xff; *p->codeptr++ = 0xff; } else { x86_add_fixup (p, p->codeptr, xinsn->label, 0); *p->codeptr++ = 0xff; } break; case ORC_X86_INSN_TYPE_LABEL: x86_add_label (p, p->codeptr, xinsn->label); break; default: ORC_ERROR("%d", xinsn->opcode->type); ORC_ASSERT(0); break; } } void orc_x86_insn_output_immediate (OrcCompiler *p, OrcX86Insn *xinsn) { switch (xinsn->opcode->type) { case ORC_X86_INSN_TYPE_REGM_REG: case ORC_X86_INSN_TYPE_REGM_MMX: case ORC_X86_INSN_TYPE_MMXM_MMX: case ORC_X86_INSN_TYPE_REG_REGM: case ORC_X86_INSN_TYPE_MMXM_MMX_REV: case ORC_X86_INSN_TYPE_SSEM_SSE_REV: case ORC_X86_INSN_TYPE_MMX_REGM_REV: case ORC_X86_INSN_TYPE_REG8_REGM: case ORC_X86_INSN_TYPE_REG16_REGM: break; case ORC_X86_INSN_TYPE_IMM8_MMX_SHIFT: case ORC_X86_INSN_TYPE_IMM8_REGM_MMX: case ORC_X86_INSN_TYPE_IMM8_MMX_REG_REV: case ORC_X86_INSN_TYPE_IMM8_MMXM_MMX: case ORC_X86_INSN_TYPE_IMM8_REGM: *p->codeptr++ = xinsn->imm; break; case ORC_X86_INSN_TYPE_IMM32_REGM_MOV: case ORC_X86_INSN_TYPE_IMM32_REGM: case ORC_X86_INSN_TYPE_IMM32_A: *p->codeptr++ = xinsn->imm&0xff; *p->codeptr++ = (xinsn->imm>>8)&0xff; *p->codeptr++ = (xinsn->imm>>16)&0xff; *p->codeptr++ = (xinsn->imm>>24)&0xff; break; case ORC_X86_INSN_TYPE_SSEM_SSE: case ORC_X86_INSN_TYPE_STACK: case ORC_X86_INSN_TYPE_REGM: case ORC_X86_INSN_TYPE_MEM: case ORC_X86_INSN_TYPE_BRANCH: case ORC_X86_INSN_TYPE_LABEL: case ORC_X86_INSN_TYPE_ALIGN: case ORC_X86_INSN_TYPE_NONE: break; default: ORC_ERROR("%d", xinsn->opcode->type); ORC_ASSERT(0); break; } } OrcX86Insn * orc_x86_get_output_insn (OrcCompiler *p) { OrcX86Insn *xinsn; if (p->n_output_insns >= p->n_output_insns_alloc) { p->n_output_insns_alloc += 10; p->output_insns = realloc (p->output_insns, sizeof(OrcX86Insn) * p->n_output_insns_alloc); } xinsn = ((OrcX86Insn *)p->output_insns) + p->n_output_insns; memset (xinsn, 0, sizeof(OrcX86Insn)); p->n_output_insns++; return xinsn; } void orc_x86_recalc_offsets (OrcCompiler *p) { OrcX86Insn *xinsn; int i; unsigned char *minptr; minptr = p->code; p->codeptr = p->code; for(i=0;in_output_insns;i++){ unsigned char *ptr; xinsn = ((OrcX86Insn *)p->output_insns) + i; xinsn->code_offset = p->codeptr - p->code; ptr = p->codeptr; orc_x86_insn_output_opcode (p, xinsn); orc_x86_insn_output_modrm (p, xinsn); orc_x86_insn_output_immediate (p, xinsn); if (xinsn->opcode->type == ORC_X86_INSN_TYPE_ALIGN) { if (xinsn->size > 0) { minptr += ((p->code - minptr)&((1<size) - 1)); } } else { minptr += p->codeptr - ptr; if (xinsn->opcode->type == ORC_X86_INSN_TYPE_BRANCH) { if (xinsn->size == 4) minptr -= 4; } } } p->codeptr = p->code; p->n_fixups = 0; } void orc_x86_calculate_offsets (OrcCompiler *p) { OrcX86Insn *xinsn; int i; int j; orc_x86_recalc_offsets (p); for(j=0;j<3;j++){ int change = FALSE; for(i=0;in_output_insns;i++){ OrcX86Insn *dinsn; int diff; xinsn = ((OrcX86Insn *)p->output_insns) + i; if (xinsn->opcode->type != ORC_X86_INSN_TYPE_BRANCH) { continue; } dinsn = ((OrcX86Insn *)p->output_insns) + p->labels_int[xinsn->label]; if (xinsn->size == 1) { diff = dinsn->code_offset - (xinsn->code_offset + 2); if (diff < -128 || diff > 127) { xinsn->size = 4; ORC_DEBUG("%d: relaxing at %d,%04x diff %d", j, i, xinsn->code_offset, diff); change = TRUE; } else { } } else { diff = dinsn->code_offset - (xinsn->code_offset + 2); if (diff >= -128 && diff <= 127) { ORC_DEBUG("%d: unrelaxing at %d,%04x diff %d", j, i, xinsn->code_offset, diff); xinsn->size = 1; change = TRUE; } } } if (!change) break; orc_x86_recalc_offsets (p); } } void orc_x86_output_insns (OrcCompiler *p) { OrcX86Insn *xinsn; int i; for(i=0;in_output_insns;i++){ xinsn = ((OrcX86Insn *)p->output_insns) + i; orc_x86_insn_output_asm (p, xinsn); orc_x86_insn_output_opcode (p, xinsn); orc_x86_insn_output_modrm (p, xinsn); orc_x86_insn_output_immediate (p, xinsn); } } void orc_x86_emit_cpuinsn_size (OrcCompiler *p, int index, int size, int src, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_REG; xinsn->size = size; } void orc_x86_emit_cpuinsn_imm (OrcCompiler *p, int index, int imm, int src, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->imm = imm; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_REG; xinsn->size = 4; } void orc_x86_emit_cpuinsn_load_memoffset (OrcCompiler *p, int index, int size, int imm, int offset, int src, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->imm = imm; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } void orc_x86_emit_cpuinsn_store_memoffset (OrcCompiler *p, int index, int size, int imm, int offset, int src, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->imm = imm; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } void orc_x86_emit_cpuinsn_load_memindex (OrcCompiler *p, int index, int size, int imm, int offset, int src, int src_index, int shift, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->imm = imm; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMINDEX; xinsn->offset = offset; xinsn->index_reg = src_index; xinsn->shift = shift; xinsn->size = size; } void orc_x86_emit_cpuinsn_imm_reg (OrcCompiler *p, int index, int size, int imm, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->imm = imm; xinsn->src = 0; xinsn->dest = dest; xinsn->type = ORC_X86_RM_REG; xinsn->size = size; } void orc_x86_emit_cpuinsn_imm_memoffset (OrcCompiler *p, int index, int size, int imm, int offset, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->imm = imm; xinsn->src = 0; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } void orc_x86_emit_cpuinsn_reg_memoffset (OrcCompiler *p, int index, int src, int offset, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; int size = 4; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } void orc_x86_emit_cpuinsn_reg_memoffset_8 (OrcCompiler *p, int index, int src, int offset, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; int size = 8; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } void orc_x86_emit_cpuinsn_memoffset_reg (OrcCompiler *p, int index, int size, int offset, int src, int dest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->src = src; xinsn->dest = dest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } void orc_x86_emit_cpuinsn_branch (OrcCompiler *p, int index, int label) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->label = label; xinsn->size = 1; } void orc_x86_emit_cpuinsn_align (OrcCompiler *p, int index, int align_shift) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->size = align_shift; } void orc_x86_emit_cpuinsn_label (OrcCompiler *p, int index, int label) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->label = label; x86_add_label2 (p, p->n_output_insns - 1, label); } void orc_x86_emit_cpuinsn_none (OrcCompiler *p, int index) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; int size = 4; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->size = size; } void orc_x86_emit_cpuinsn_memoffset (OrcCompiler *p, int index, int size, int offset, int srcdest) { OrcX86Insn *xinsn = orc_x86_get_output_insn (p); const OrcSysOpcode *opcode = orc_x86_opcodes + index; xinsn->opcode_index = index; xinsn->opcode = opcode; xinsn->src = srcdest; xinsn->dest = srcdest; xinsn->type = ORC_X86_RM_MEMOFFSET; xinsn->offset = offset; xinsn->size = size; } orc-0.4.18/orc/orccpuinsn.h0000644000175000017500000000102411565023105012422 00000000000000 #ifndef _ORC_ORC_CPUINSN_H_ #define _ORC_ORC_CPUINSN_H_ #ifdef ORC_ENABLE_UNSTABLE_API typedef struct _OrcSysInsn OrcSysInsn; typedef struct _OrcSysOpcode OrcSysOpcode; struct _OrcSysInsn { int opcode; int dest_reg; int src1_reg; int src2_reg; int immediate; int mem_reg; int memoffset; int indexreg; int shift; int size; }; struct _OrcSysOpcode { char name[16]; int type; int flags; orc_uint8 prefix; orc_uint32 code; int code2; }; #define ORC_SYS_OPCODE_FLAG_FIXED (1<<0) #endif #endif orc-0.4.18/orc/orcprogram-c64x-c.c0000664000175000017500000007360612071634360013434 00000000000000 #include "config.h" #include #include #include #include #include //static const char *c_get_type_name (int size); void orc_c_init (void); static void emit_loop (OrcCompiler *compiler, int prefix); void orc_compiler_c64x_c_init (OrcCompiler *compiler) { int i; for(i=ORC_GP_REG_BASE;ivalid_regs[i] = 1; } compiler->loop_shift = 0; } const char * orc_target_c64x_c_get_asm_preamble (void) { return "\n" "/* begin Orc C target preamble */\n" "typedef signed char int8_t;\n" "typedef unsigned char uint8_t;\n" "typedef signed short int16_t;\n" "typedef unsigned short uint16_t;\n" "typedef signed int int32_t;\n" "typedef unsigned int uint32_t;\n" "typedef signed long long int64_t;\n" "typedef unsigned long long uint64_t;\n" "#define ORC_RESTRICT restrict\n" "typedef struct _OrcProgram OrcProgram;\n" "typedef struct _OrcExecutor OrcExecutor;\n" "#define ORC_N_VARIABLES 20\n" "#define ORC_N_REGISTERS 20\n" "#define ORC_OPCODE_N_ARGS 4\n" "struct _OrcExecutor {\n" " OrcProgram *program;\n" " int n;\n" " int counter1;\n" " int counter2;\n" " int counter3;\n" " void *arrays[ORC_N_VARIABLES];\n" " int params[ORC_N_VARIABLES];\n" " //OrcVariable vars[ORC_N_VARIABLES];\n" " //OrcVariable *args[ORC_OPCODE_N_ARGS];\n" "};\n" "#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))\n" "#define ORC_ABS(a) ((a)<0 ? -(a) : (a))\n" "#define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))\n" "#define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))\n" "#define ORC_SB_MAX 127\n" "#define ORC_SB_MIN (-1-ORC_SB_MAX)\n" "#define ORC_UB_MAX 255\n" "#define ORC_UB_MIN 0\n" "#define ORC_SW_MAX 32767\n" "#define ORC_SW_MIN (-1-ORC_SW_MAX)\n" "#define ORC_UW_MAX 65535\n" "#define ORC_UW_MIN 0\n" "#define ORC_SL_MAX 2147483647\n" "#define ORC_SL_MIN (-1-ORC_SL_MAX)\n" "#define ORC_UL_MAX 4294967295U\n" "#define ORC_UL_MIN 0\n" "#define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)\n" "#define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)\n" "#define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)\n" "#define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)\n" "#define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)\n" "#define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)\n" "#define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))\n" "#define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24))\n" "#define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))\n" "/* end Orc C target preamble */\n\n"; } unsigned int orc_compiler_c64x_c_get_default_flags (void) { return ORC_TARGET_C_NOEXEC; } static const char *varnames[] = { "d1", "d2", "d3", "d4", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "a1", "a2", "a3", "d4", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "t14", "t15", "t16" }; static void output_prototype (OrcCompiler *compiler) { OrcProgram *p = compiler->program; OrcVariable *var; int i; int need_comma; ORC_ASM_CODE(compiler, "%s (", p->name); need_comma = FALSE; for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { if (need_comma) ORC_ASM_CODE(compiler, ", "); if (var->type_name) { ORC_ASM_CODE(compiler, "%s * %s", var->type_name, varnames[ORC_VAR_D1 + i]); } else { ORC_ASM_CODE(compiler, "uint%d_t * %s", var->size*8, varnames[ORC_VAR_D1 + i]); } if (p->is_2d) { ORC_ASM_CODE(compiler, ", int %s_stride", varnames[ORC_VAR_D1 + i]); } need_comma = TRUE; } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { if (need_comma) ORC_ASM_CODE(compiler, ", "); if (var->type_name) { ORC_ASM_CODE(compiler, "%s * %s", var->type_name, varnames[ORC_VAR_A1 + i]); } else { ORC_ASM_CODE(compiler, "uint%d_t * %s", var->size*8, varnames[ORC_VAR_A1 + i]); } need_comma = TRUE; } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { if (need_comma) ORC_ASM_CODE(compiler, ", "); if (var->type_name) { ORC_ASM_CODE(compiler, "%s * %s", var->type_name, varnames[ORC_VAR_S1 + i]); } else { ORC_ASM_CODE(compiler, "uint%d_t * %s", var->size*8, varnames[ORC_VAR_S1 + i]); } if (p->is_2d) { ORC_ASM_CODE(compiler, ", int %s_stride", varnames[ORC_VAR_S1 + i]); } need_comma = TRUE; } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { if (need_comma) ORC_ASM_CODE(compiler, ", "); ORC_ASM_CODE(compiler, "int %s", varnames[ORC_VAR_P1 + i]); need_comma = TRUE; } } if (p->constant_n == 0) { if (need_comma) ORC_ASM_CODE(compiler, ", "); ORC_ASM_CODE(compiler, "int n"); need_comma = TRUE; } if (p->is_2d && p->constant_m == 0) { if (need_comma) ORC_ASM_CODE(compiler, ", "); ORC_ASM_CODE(compiler, "int m"); } ORC_ASM_CODE(compiler, ")"); } static int get_align_var (OrcCompiler *compiler) { if (compiler->vars[ORC_VAR_D1].size) return ORC_VAR_D1; if (compiler->vars[ORC_VAR_S1].size) return ORC_VAR_S1; ORC_COMPILER_ERROR(compiler, "could not find alignment variable"); return -1; } static int get_shift (int size) { switch (size) { case 1: return 0; case 2: return 1; case 4: return 2; case 8: return 3; default: ORC_ERROR("bad size %d", size); } return -1; } void orc_compiler_c64x_c_assemble (OrcCompiler *compiler) { int i; int prefix = 0; int loop_shift = 0; int align_var; align_var = get_align_var (compiler); switch (compiler->max_var_size) { case 1: loop_shift = 2; break; case 2: loop_shift = 1; break; case 4: loop_shift = 0; break; default: ORC_ERROR("unhandled max var size %d", compiler->max_var_size); break; } compiler->target_flags |= ORC_TARGET_C_NOEXEC; if (!(compiler->target_flags & ORC_TARGET_C_BARE)) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler,"void\n"); ORC_ASM_CODE(compiler,"%s (OrcExecutor *ex)\n", compiler->program->name); } else{ ORC_ASM_CODE(compiler,"void\n"); output_prototype (compiler); ORC_ASM_CODE(compiler,"\n"); } ORC_ASM_CODE(compiler,"{\n"); } ORC_ASM_CODE(compiler,"%*s int i;\n", prefix, ""); if (compiler->program->is_2d) { ORC_ASM_CODE(compiler," int j;\n"); } for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_CONST: { int value = var->value.i; if (var->size == 1) { value = (value&0xff); value |= (value<<8); value |= (value<<16); } if (var->size == 2) { value = (value&0xffff); value |= (value<<16); } if (value == 0x80000000) { ORC_ASM_CODE(compiler," const int var%d = 0x80000000;\n", i); } else { ORC_ASM_CODE(compiler," const int var%d = %d;\n", i, value); } } break; case ORC_VAR_TYPE_TEMP: ORC_ASM_CODE(compiler," int var%d;\n", i); break; case ORC_VAR_TYPE_SRC: ORC_ASM_CODE(compiler," const unsigned char * restrict ptr%d;\n", i); break; case ORC_VAR_TYPE_DEST: ORC_ASM_CODE(compiler," unsigned char * restrict ptr%d;\n", i); break; case ORC_VAR_TYPE_ACCUMULATOR: ORC_ASM_CODE(compiler," int var%d = 0;\n", i); break; case ORC_VAR_TYPE_PARAM: if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," const int var%d = ex->params[%d];\n", i, i); } else { ORC_ASM_CODE(compiler," const int var%d = %s;\n", i, varnames[i]); } break; default: ORC_COMPILER_ERROR(compiler, "bad vartype"); break; } } if (compiler->program->constant_n == 0) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler,"%*s int n;\n", prefix, ""); } } if (loop_shift > 0) { ORC_ASM_CODE(compiler,"%*s int n1, n2, n3;\n", prefix, ""); } ORC_ASM_CODE(compiler,"\n"); if (compiler->program->is_2d) { if (compiler->program->constant_m == 0) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," for (j = 0; j < ex->params[ORC_VAR_A1]; j++) {\n"); } else { ORC_ASM_CODE(compiler," for (j = 0; j < m; j++) {\n"); } } else { ORC_ASM_CODE(compiler," for (j = 0; j < %d; j++) {\n", compiler->program->constant_m); } prefix = 2; for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_SRC: if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," ptr%d = ORC_PTR_OFFSET(ex->arrays[%d], ex->params[%d] * j);\n", i, i, i); } else { ORC_ASM_CODE(compiler," ptr%d = ORC_PTR_OFFSET(%s, %s_stride * j);\n", i, varnames[i], varnames[i]); } break; case ORC_VAR_TYPE_DEST: if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," ptr%d = ORC_PTR_OFFSET(ex->arrays[%d], ex->params[%d] * j);\n", i, i, i); } else { ORC_ASM_CODE(compiler," ptr%d = ORC_PTR_OFFSET(%s, %s_stride * j);\n", i, varnames[i], varnames[i]); } break; default: break; } } } else { for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_SRC: if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," ptr%d = ex->arrays[%d];\n", i, i); } else { ORC_ASM_CODE(compiler," ptr%d = (void *)%s;\n", i, varnames[i]); } break; case ORC_VAR_TYPE_DEST: if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," ptr%d = ex->arrays[%d];\n", i, i); } else { ORC_ASM_CODE(compiler," ptr%d = (void *)%s;\n", i, varnames[i]); } break; default: break; } } } if (compiler->program->constant_n == 0) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler,"%*s n = ex->n;\n", prefix, ""); } } if (loop_shift > 0) { ORC_ASM_CODE(compiler,"%*s n1 = ((4 - (int)ptr%d)&0x3) >> %d;\n", prefix, "", align_var, get_shift(compiler->vars[align_var].size)); ORC_ASM_CODE(compiler,"%*s n2 = (n - n1) >> %d;\n", prefix, "", loop_shift); ORC_ASM_CODE(compiler,"%*s n3 = n & ((1 << %d) - 1);\n", prefix, "", loop_shift); ORC_ASM_CODE(compiler,"\n"); ORC_ASM_CODE(compiler,"#pragma MUST_ITERATE(0,%d)\n", (1<loop_shift = 0; emit_loop (compiler, prefix); ORC_ASM_CODE(compiler,"%*s }\n", prefix, ""); ORC_ASM_CODE(compiler,"%*s for (i = 0; i < n2; i++) {\n", prefix, ""); compiler->vars[align_var].is_aligned = TRUE; compiler->loop_shift = loop_shift; emit_loop (compiler, prefix); compiler->vars[align_var].is_aligned = FALSE; ORC_ASM_CODE(compiler,"%*s }\n", prefix, ""); ORC_ASM_CODE(compiler,"#pragma MUST_ITERATE(0,%d)\n", (1<loop_shift = 0; emit_loop (compiler, prefix); ORC_ASM_CODE(compiler,"%*s }\n", prefix, ""); } else { ORC_ASM_CODE(compiler,"%*s for (i = 0; i < n; i++) {\n", prefix, ""); compiler->loop_shift = loop_shift; emit_loop (compiler, prefix); ORC_ASM_CODE(compiler,"%*s }\n", prefix, ""); } if (compiler->program->is_2d) { ORC_ASM_CODE(compiler," }\n"); } for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_ACCUMULATOR: if (var->size == 2) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," ex->accumulators[%d] = (var%d & 0xffff);\n", i - ORC_VAR_A1, i); } else { ORC_ASM_CODE(compiler," *%s = (var%d & 0xffff);\n", varnames[i], i); } } else { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," ex->accumulators[%d] = var%d;\n", i - ORC_VAR_A1, i); } else { ORC_ASM_CODE(compiler," *%s = var%d;\n", varnames[i], i); } } break; default: break; } } if (!(compiler->target_flags & ORC_TARGET_C_BARE)) { ORC_ASM_CODE(compiler,"}\n"); ORC_ASM_CODE(compiler,"\n"); } } static void emit_loop (OrcCompiler *compiler, int prefix) { int j; int i; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; ORC_ASM_CODE(compiler,"%*s /* %d: %s */\n", prefix, "", j, insn->opcode->name); rule = insn->rule; if (rule) { ORC_ASM_CODE(compiler,"%*s", prefix, ""); rule->emit (compiler, rule->emit_user, insn); } else { ORC_COMPILER_ERROR(compiler, "No rule for: %s on target %s", opcode->name, compiler->target->name); compiler->error = TRUE; } } ORC_ASM_CODE(compiler,"\n"); for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: ORC_ASM_CODE(compiler,"%*s ptr%d += %d;\n", prefix, "", i, var->size << compiler->loop_shift); break; default: break; } } } /* rules */ static void c_get_name (char *name, OrcCompiler *p, int var) { int size; size = p->vars[var].size << p->loop_shift; switch (p->vars[var].vartype) { case ORC_VAR_TYPE_CONST: case ORC_VAR_TYPE_PARAM: case ORC_VAR_TYPE_TEMP: case ORC_VAR_TYPE_ACCUMULATOR: sprintf(name, "var%d", var); break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: if (size == 1) { sprintf(name, "(*(%sint8_t *)var%d)", (p->vars[var].vartype == ORC_VAR_TYPE_SRC) ? "const " : "", var); } else { sprintf(name, "_%smem%d%s(var%d)", (p->vars[var].is_aligned) ? "a" : "", size, (p->vars[var].vartype == ORC_VAR_TYPE_SRC) ? "_const" : "", var); } break; default: ORC_COMPILER_ERROR(p, "bad vartype"); sprintf(name, "ERROR"); break; } } static void c_get_name_float (char *name, OrcCompiler *p, int var) { switch (p->vars[var].vartype) { case ORC_VAR_TYPE_CONST: case ORC_VAR_TYPE_PARAM: case ORC_VAR_TYPE_TEMP: case ORC_VAR_TYPE_ACCUMULATOR: sprintf(name, "(*(float *)(&var%d))", var); break; case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: sprintf(name, "((float *)var%d)[i]", var); break; default: ORC_COMPILER_ERROR(p, "bad vartype"); sprintf(name, "ERROR"); break; } } #if 0 static const char * c_get_type_name (int size) { switch (size) { case 1: return "int8_t"; case 2: return "int16_t"; case 4: return "int32_t"; case 8: return "int64_t"; default: return "ERROR"; } } #endif #define UNARY(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name (dest, p, insn->dest_args[0]); \ c_get_name (src1, p, insn->src_args[0]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1); \ } #define BINARY(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name (dest, p, insn->dest_args[0]); \ c_get_name (src1, p, insn->src_args[0]); \ c_get_name (src2, p, insn->src_args[1]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1, src2); \ } #define UNARYF(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name_float (dest, p, insn->dest_args[0]); \ c_get_name_float (src1, p, insn->src_args[0]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1); \ } #define BINARYF(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name_float (dest, p, insn->dest_args[0]); \ c_get_name_float (src1, p, insn->src_args[0]); \ c_get_name_float (src2, p, insn->src_args[1]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1, src2); \ } #define BINARYFL(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name (dest, p, insn->dest_args[0]); \ c_get_name_float (src1, p, insn->src_args[0]); \ c_get_name_float (src2, p, insn->src_args[1]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1, src2); \ } #define UNARYFL(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name (dest, p, insn->dest_args[0]); \ c_get_name_float (src1, p, insn->src_args[0]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1); \ } #define UNARYLF(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name_float (dest, p, insn->dest_args[0]); \ c_get_name (src1, p, insn->src_args[0]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1); \ } #define BINARY_SB(a,b) BINARY(a,b) #define BINARY_UB(a,b) BINARY(a,b) #define BINARY_SW(a,b) BINARY(a,b) #define BINARY_UW(a,b) BINARY(a,b) #define BINARY_SL(a,b) BINARY(a,b) #define BINARY_UL(a,b) BINARY(a,b) #define UNARY_SB(a,b) UNARY(a,b) #define UNARY_UB(a,b) UNARY(a,b) #define UNARY_SW(a,b) UNARY(a,b) #define UNARY_UW(a,b) UNARY(a,b) #define UNARY_SL(a,b) UNARY(a,b) #define UNARY_UL(a,b) UNARY(a,b) #define BINARY_BW(a,b) BINARY(a,b) #define BINARY_WL(a,b) BINARY(a,b) #define BINARY_LW(a,b) BINARY(a,b) #define BINARY_WB(a,b) BINARY(a,b) #define UNARY_BW(a,b) UNARY(a,b) #define UNARY_WL(a,b) UNARY(a,b) #define UNARY_LW(a,b) UNARY(a,b) #define UNARY_WB(a,b) UNARY(a,b) #define BINARY_F(a,b) BINARYF(a,b) #define BINARY_FL(a,b) BINARYFL(a,b) #define UNARY_F(a,b) UNARYF(a,b) #define UNARY_FL(a,b) UNARYFL(a,b) #define UNARY_LF(a,b) UNARYLF(a,b) BINARY_SB(addb, "_add4(%s,%s)") BINARY_SB(addssb, "0x80808080^_saddu4(0x80808080^%s,0x80808080^%s)") BINARY_SB(addusb, "_saddu4(%s,%s)") BINARY_SB(andb, "%s & %s") BINARY_SB(andnb, "(~%s) & %s") BINARY_SB(avgsb, "0x7f7f7f7f^_avgu4(0x7f7f7f7f^%s,0x7f7f7f7f^%s)") BINARY_UB(avgub, "_avgu4(%s,%s)") BINARY_SB(cmpeqb, "_cmpeq4(%s,%s)") BINARY_SB(cmpgtsb, "_cmpgtu4(0x80808080^%s,0x80808080^%s)") UNARY_SB(copyb, "%s") BINARY_SB(maxsb, "0x80808080^_maxu4(0x80808080^%s,0x80808080^%s)") BINARY_UB(maxub, "_maxu4(%s,%s)") BINARY_SB(minsb, "0x80808080^_minu4(0x80808080^%s,0x80808080^%s)") BINARY_UB(minub, "_minu4(%s,%s)") BINARY_SB(orb, "%s | %s") UNARY_SB(signb, "0x80808080^_maxu4(0x7f7f7f7f,_minu4(0x81818181,0x80808080^%s))") BINARY_SB(subb, "_sub4(%s,%s)") BINARY_SB(xorb, "%s ^ %s") UNARY_SW(absw, "_abs2(%s)") BINARY_SW(addw, "_add2(%s,%s)") BINARY_SW(addssw, "_sadd2(%s,%s)") BINARY_SW(addusw, "0x80008000^_sadd2(0x80008000^%s,0x80008000^%s)") BINARY_SW(andw, "%s & %s") BINARY_SW(andnw, "(~%s) & %s") BINARY_SW(avgsw, "_avg2(%s,%s)") BINARY_UW(avguw, "0x7fff7fff^_avg2(0x7fff7fff^%s,0x7fff7fff^%s)") BINARY_SW(cmpeqw, "_cmpeq2(%s,%s)") BINARY_SW(cmpgtsw, "_cmpgt2(%s,%s)") UNARY_SW(copyw, "%s") BINARY_SW(maxsw, "_max2(%s,%s)") BINARY_SW(maxuw, "_max2(0x80008000^%s,0x80008000^%s)") BINARY_SW(minsw, "_min2(%s,%s)") BINARY_SW(minuw, "_min2(0x80008000^%s,0x80008000^%s)") BINARY_SW(orw, "%s | %s") BINARY_SW(shrsw, "_shr2(%s,%s)") BINARY_UW(shruw, "_shru2(%s,%s)") UNARY_SW(signw, "_max2(-1,_min2(1,%s))") BINARY_SW(subw, "_sub2(%s,%s)") BINARY_SW(subssw, "_ssub2(%s,%s)") BINARY_SW(subusw, "0x80008000^_ssub2(0x80008000^%s,0x80008000^%s)") BINARY_SW(xorw, "%s ^ %s") UNARY_SL(absl, "_abs(%s)") BINARY_SL(addl, "%s + %s") BINARY_SL(addssl, "_sadd(%s,%s)") BINARY_UL(addusl, "ORC_CLAMP_UL((int64_t)(uint32_t)%s + (int64_t)(uint32_t)%s)") BINARY_SL(andl, "%s & %s") BINARY_SL(andnl, "(~%s) & %s") BINARY_SL(avgsl, "((int64_t)%s + (int64_t)%s + 1)>>1") BINARY_UL(avgul, "((uint64_t)(uint32_t)%s + (uint64_t)(uint32_t)%s + 1)>>1") BINARY_SL(cmpeql, "(%s == %s) ? (~0) : 0") BINARY_SL(cmpgtsl, "(%s > %s) ? (~0) : 0") UNARY_SL(copyl, "%s") BINARY_SL(maxsl, "ORC_MAX(%s, %s)") BINARY_UL(maxul, "ORC_MAX((uint32_t)%s, (uint32_t)%s)") BINARY_SL(minsl, "ORC_MIN(%s, %s)") BINARY_UL(minul, "ORC_MIN((uint32_t)%s, (uint32_t)%s)") BINARY_SL(mulll, "_loll(_mpy32ll(%s,%s))") BINARY_SL(mulhsl, "_hill(_mpy32ll(%s,%s))") BINARY_UL(mulhul, "_hill(_mpy32u(%s,%s))") BINARY_SL(orl, "%s | %s") BINARY_SL(shll, "%s << %s") BINARY_SL(shrsl, "%s >> %s") BINARY_UL(shrul, "((uint32_t)%s) >> %s") UNARY_SL(signl, "ORC_CLAMP((int)%s,-1,1)") BINARY_SL(subl, "%s - %s") BINARY_SL(subssl, "_ssub(%s,%s)") BINARY_UL(subusl, "ORC_CLAMP_UL((int64_t)(uint32_t)%s - (int64_t)(uint32_t)%s)") BINARY_SL(xorl, "%s ^ %s") UNARY_BW(convsbw, "%s") UNARY_BW(convubw, "_unpklu4(%s)") UNARY_WL(convswl, "(int16_t)%s") UNARY_WL(convuwl, "(uint16_t)%s") UNARY_WB(convwb, "_packl4(0,%s)") UNARY_WB(convsuswb, "_spacku4(0,%s)") UNARY_LW(convlw, "_pack2(0,%s)") UNARY_LW(convssslw, "_spack2(0,%s)") BINARY_BW(mulsbw, "%s * %s") BINARY_BW(mulubw, "(uint8_t)%s * (uint8_t)%s") BINARY_WL(mulswl, "%s * %s") BINARY_WL(muluwl, "(uint16_t)%s * (uint16_t)%s") BINARY_WL(mergewl, "_pack2(%s, %s)") BINARY_BW(mergebw, "_packl4(%s, %s)") UNARY_WB(select0wb, "_packl4(0,%s)") UNARY_WB(select1wb, "_packh4(0,%s)") UNARY_LW(select0lw, "_pack2(0,%s)") UNARY_LW(select1lw, "_packh2(0,%s)") UNARY_UW(swapw, "_swap4(%s)") #if 0 BINARY_F(addf, "%s + %s") BINARY_F(subf, "%s - %s") BINARY_F(mulf, "%s * %s") BINARY_F(divf, "%s / %s") UNARY_F(sqrtf, "sqrt(%s)") BINARY_F(maxf, "ORC_MAX(%s,%s)") BINARY_F(minf, "ORC_MIN(%s,%s)") BINARY_FL(cmpeqf, "(%s == %s) ? (~0) : 0") BINARY_FL(cmpltf, "(%s < %s) ? (~0) : 0") BINARY_FL(cmplef, "(%s <= %s) ? (~0) : 0") UNARY_FL(convfl, "rintf(%s)") UNARY_LF(convlf, "%s") #else BINARY_F(addf, "0 /* float disabled %s %s */") BINARY_F(subf, "0 /* float disabled %s %s */") BINARY_F(mulf, "0 /* float disabled %s %s */") BINARY_F(divf, "0 /* float disabled %s %s */") UNARY_F(sqrtf, "0 /* float disabled %s */") BINARY_F(maxf, "0 /* float disabled %s %s */") BINARY_F(minf, "0 /* float disabled %s %s */") BINARY_FL(cmpeqf, "0 /* float disabled %s %s */") BINARY_FL(cmpltf, "0 /* float disabled %s %s */") BINARY_FL(cmplef, "0 /* float disabled %s %s */") UNARY_FL(convfl, "0 /* float disabled %s */") UNARY_LF(convlf, "0 /* float disabled %s */") #endif static void c_rule_absb (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); ORC_ASM_CODE(p," %s = _subabs4(0x80808080,0x80808080^%s);\n", dest, src1); } static void c_rule_mullw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); c_get_name (src2, p, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," long long x = _mpy2ll(%s,%s);\n", src1, src2); ORC_ASM_CODE(p," %s = _pack2(_hill(x),_loll(x));\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_mulhsw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); c_get_name (src2, p, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," long long x = _mpy2ll(%s,%s);\n", src1, src2); ORC_ASM_CODE(p," %s = _packh2(_hill(x),_loll(x));\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_mulhuw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); c_get_name (src2, p, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," long long x = _mpy2ll(%s,%s);\n", src1, src2); ORC_ASM_CODE(p," %s = _packh2(_hill(x),_loll(x));\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_shlw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); c_get_name (src2, p, insn->src_args[1]); ORC_ASM_CODE(p," %s = (%s<<%s) & (~(((1<<%s)-1)<<16 | ((1<<%s)-1)));\n", dest, src1, src2, src2, src2); } static void c_rule_convssswb (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); ORC_ASM_CODE(p," %s = _packl4(0,_max2(0xff80ff80,_min2(0x007f007f,%s)));\n", dest, src1); } static void c_rule_swapl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); c_get_name (src2, p, insn->src_args[1]); ORC_ASM_CODE(p," %s = _packlh2(_swap4(%s),_swap4(%s));\n", dest, src1, src2); } static void c_rule_accw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); ORC_ASM_CODE(p," %s = %s + %s;\n", dest, dest, src1); } static void c_rule_accl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); ORC_ASM_CODE(p," %s = %s + %s;\n", dest, dest, src1); } static void c_rule_accsadubl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name (dest, p, insn->dest_args[0]); c_get_name (src1, p, insn->src_args[0]); c_get_name (src2, p, insn->src_args[1]); ORC_ASM_CODE(p, " %s = %s + ORC_ABS((int32_t)(uint8_t)%s - (int32_t)(uint8_t)%s);\n", dest, dest, src1, src2); } static void c_rule_loadX (OrcCompiler *p, void *user, OrcInstruction *insn) { ORC_ASM_CODE(p," var%d = ptr%d[i];\n", insn->dest_args[0], insn->src_args[0]); } static void c_rule_storeX (OrcCompiler *p, void *user, OrcInstruction *insn) { ORC_ASM_CODE(p," ptr%d[i] = var%d;\n", insn->dest_args[0], insn->src_args[0]); } static OrcTarget c64x_c_target = { "c64x-c", FALSE, ORC_GP_REG_BASE, orc_compiler_c64x_c_get_default_flags, orc_compiler_c64x_c_init, orc_compiler_c64x_c_assemble, { { 0 } }, 0, orc_target_c64x_c_get_asm_preamble, }; void orc_c64x_c_init (void) { OrcRuleSet *rule_set; orc_target_register (&c64x_c_target); rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), &c64x_c_target, 0); #define REG(a) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); orc_rule_register (rule_set, "loadb", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadw", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadl", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadq", c_rule_loadX, NULL); orc_rule_register (rule_set, "storeb", c_rule_storeX, NULL); orc_rule_register (rule_set, "storew", c_rule_storeX, NULL); orc_rule_register (rule_set, "storel", c_rule_storeX, NULL); orc_rule_register (rule_set, "storeq", c_rule_storeX, NULL); REG(absb); REG(addb); REG(addssb); REG(addusb); REG(andb); REG(andnb); REG(avgsb); REG(avgub); REG(cmpeqb); REG(cmpgtsb); REG(copyb); REG(maxsb); REG(maxub); REG(minsb); REG(minub); REG(orb); REG(signb); REG(subb); REG(xorb); REG(absw); REG(addw); REG(addssw); REG(addusw); REG(andw); REG(andnw); REG(avgsw); REG(avguw); REG(cmpeqw); REG(cmpgtsw); REG(copyw); REG(maxsw); REG(maxuw); REG(minsw); REG(minuw); REG(mullw); REG(mulhsw); REG(mulhuw); REG(orw); REG(shlw); REG(shrsw); REG(shruw); REG(signw); REG(subssw); REG(subusw); REG(subw); REG(xorw); REG(absl); REG(addl); REG(addssl); REG(addusl); REG(andl); REG(andnl); REG(avgsl); REG(avgul); REG(cmpeql); REG(cmpgtsl); REG(copyl); REG(maxsl); REG(maxul); REG(minsl); REG(minul); REG(mulll); REG(mulhsl); REG(mulhul); REG(orl); REG(shll); REG(shrsl); REG(shrul); REG(signl); REG(subl); REG(subssl); REG(subusl); REG(xorl); REG(convsbw); REG(convubw); REG(convswl); REG(convuwl); REG(convwb); REG(convssswb); REG(convsuswb); REG(convlw); REG(convssslw); REG(mulsbw); REG(mulubw); REG(mulswl); REG(muluwl); REG(mergewl); REG(mergebw); REG(select0wb); REG(select1wb); REG(select0lw); REG(select1lw); REG(swapw); REG(swapl); REG(addf); REG(subf); REG(mulf); REG(divf); REG(sqrtf); REG(maxf); REG(minf); REG(cmpeqf); REG(cmpltf); REG(cmplef); REG(convfl); REG(convlf); REG(accw); REG(accl); REG(accsadubl); } orc-0.4.18/orc/orcmmx.h0000664000175000017500000000472312111024531011547 00000000000000 #ifndef _ORC_MMX_H_ #define _ORC_MMX_H_ #include #include ORC_BEGIN_DECLS #ifdef ORC_ENABLE_UNSTABLE_API typedef enum { X86_MM0 = ORC_VEC_REG_BASE, X86_MM1, X86_MM2, X86_MM3, X86_MM4, X86_MM5, X86_MM6, X86_MM7 } OrcMMXRegister; #define ORC_MMX_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0)) const char * orc_x86_get_regname_mmx(int i); void orc_x86_emit_mov_memoffset_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int reg2, int is_aligned); void orc_x86_emit_mov_memindex_mmx (OrcCompiler *compiler, int size, int offset, int reg1, int regindex, int shift, int reg2, int is_aligned); void orc_x86_emit_mov_mmx_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2, int aligned, int uncached); #if 0 void orc_x86_emit_mov_mmx_reg_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_mov_reg_mmx (OrcCompiler *compiler, int reg1, int reg2); void orc_x86_emit_mov_mmx_reg (OrcCompiler *compiler, int reg1, int reg2); void orc_mmx_emit_loadib (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadiw (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadil (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpb (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpw (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpl (OrcCompiler *p, int reg, int value); void orc_mmx_emit_loadpq (OrcCompiler *p, int reg, int value); void orc_mmx_emit_660f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_f20f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_f30f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_0f (OrcCompiler *p, const char *insn_name, int code, int src, int dest); void orc_mmx_emit_pshufw (OrcCompiler *p, int shuf, int src, int dest); void orc_mmx_emit_palignr (OrcCompiler *p, int align, int src, int dest); void orc_mmx_emit_pinsrw_memoffset (OrcCompiler *p, int imm, int offset, int src, int dest); void orc_mmx_emit_pextrw_memoffset (OrcCompiler *p, int imm, int src, int offset, int dest); void orc_mmx_emit_shiftimm (OrcCompiler *p, const char *insn_name, int code, int modrm_code, int shift, int reg); #endif unsigned int orc_mmx_get_cpu_flags (void); void orc_mmx_load_constant (OrcCompiler *compiler, int reg, int size, orc_uint64 value); #endif ORC_END_DECLS #endif orc-0.4.18/orc/orcprogram-c.c0000664000175000017500000015147312177015514012652 00000000000000 #include "config.h" #include #include #include #include #include #include static const char *c_get_type_name (int size); static void c_get_name_int (char *name, OrcCompiler *p, OrcInstruction *insn, int var); void orc_c_init (void); void orc_compiler_c_init (OrcCompiler *compiler) { int i; for(i=ORC_GP_REG_BASE;ivalid_regs[i] = 1; } compiler->loop_shift = 0; } const char * orc_target_c_get_typedefs (void) { return "#ifndef _ORC_INTEGER_TYPEDEFS_\n" "#define _ORC_INTEGER_TYPEDEFS_\n" "#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n" "#include \n" "typedef int8_t orc_int8;\n" "typedef int16_t orc_int16;\n" "typedef int32_t orc_int32;\n" "typedef int64_t orc_int64;\n" "typedef uint8_t orc_uint8;\n" "typedef uint16_t orc_uint16;\n" "typedef uint32_t orc_uint32;\n" "typedef uint64_t orc_uint64;\n" "#define ORC_UINT64_C(x) UINT64_C(x)\n" "#elif defined(_MSC_VER)\n" "typedef signed __int8 orc_int8;\n" "typedef signed __int16 orc_int16;\n" "typedef signed __int32 orc_int32;\n" "typedef signed __int64 orc_int64;\n" "typedef unsigned __int8 orc_uint8;\n" "typedef unsigned __int16 orc_uint16;\n" "typedef unsigned __int32 orc_uint32;\n" "typedef unsigned __int64 orc_uint64;\n" "#define ORC_UINT64_C(x) (x##Ui64)\n" "#define inline __inline\n" "#else\n" "#include \n" "typedef signed char orc_int8;\n" "typedef short orc_int16;\n" "typedef int orc_int32;\n" "typedef unsigned char orc_uint8;\n" "typedef unsigned short orc_uint16;\n" "typedef unsigned int orc_uint32;\n" "#if INT_MAX == LONG_MAX\n" "typedef long long orc_int64;\n" "typedef unsigned long long orc_uint64;\n" "#define ORC_UINT64_C(x) (x##ULL)\n" "#else\n" "typedef long orc_int64;\n" "typedef unsigned long orc_uint64;\n" "#define ORC_UINT64_C(x) (x##UL)\n" "#endif\n" "#endif\n" "typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;\n" "typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32;\n" "typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;\n" "#endif\n" "#ifndef ORC_RESTRICT\n" "#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n" "#define ORC_RESTRICT restrict\n" "#elif defined(__GNUC__) && __GNUC__ >= 4\n" "#define ORC_RESTRICT __restrict__\n" "#else\n" "#define ORC_RESTRICT\n" "#endif\n" "#endif\n" "\n" "#ifndef ORC_INTERNAL\n" "#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)\n" "#define ORC_INTERNAL __attribute__((visibility(\"hidden\")))\n" "#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)\n" "#define ORC_INTERNAL __hidden\n" "#elif defined (__GNUC__)\n" "#define ORC_INTERNAL __attribute__((visibility(\"hidden\")))\n" "#else\n" "#define ORC_INTERNAL\n" "#endif\n" "#endif\n" "\n"; } const char * orc_target_c_get_asm_preamble (void) { return "\n" "/* begin Orc C target preamble */\n" "#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))\n" "#define ORC_ABS(a) ((a)<0 ? -(a) : (a))\n" "#define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))\n" "#define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))\n" "#define ORC_SB_MAX 127\n" "#define ORC_SB_MIN (-1-ORC_SB_MAX)\n" "#define ORC_UB_MAX 255\n" "#define ORC_UB_MIN 0\n" "#define ORC_SW_MAX 32767\n" "#define ORC_SW_MIN (-1-ORC_SW_MAX)\n" "#define ORC_UW_MAX 65535\n" "#define ORC_UW_MIN 0\n" "#define ORC_SL_MAX 2147483647\n" "#define ORC_SL_MIN (-1-ORC_SL_MAX)\n" "#define ORC_UL_MAX 4294967295U\n" "#define ORC_UL_MIN 0\n" "#define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)\n" "#define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)\n" "#define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)\n" "#define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)\n" "#define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)\n" "#define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)\n" "#define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))\n" "#define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24))\n" "#define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56))\n" "#define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))\n" "#define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))\n" "#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))\n" "#define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))\n" "#define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))\n" "#ifndef ORC_RESTRICT\n" "#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n" "#define ORC_RESTRICT restrict\n" "#elif defined(__GNUC__) && __GNUC__ >= 4\n" "#define ORC_RESTRICT __restrict__\n" "#else\n" "#define ORC_RESTRICT\n" "#endif\n" "#endif\n" "/* end Orc C target preamble */\n\n"; } unsigned int orc_compiler_c_get_default_flags (void) { return 0; } static const char *varnames[] = { "d1", "d2", "d3", "d4", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "a1", "a2", "a3", "d4", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9", "t10", "t11", "t12", "t13", "t14", "t15", "t16", }; static void get_varname (char *s, OrcCompiler *compiler, int var) { if (compiler->target_flags & ORC_TARGET_C_NOEXEC) { if (var < 48) { strcpy (s, varnames[var]); } else { sprintf(s, "t%d", var-32); } } else if (compiler->target_flags & ORC_TARGET_C_OPCODE) { if (var < ORC_VAR_S1) { sprintf(s, "ex->dest_ptrs[%d]", var-ORC_VAR_D1); } else { sprintf(s, "ex->src_ptrs[%d]", var-ORC_VAR_S1); } } else { sprintf(s, "ex->arrays[%d]", var); } } static void get_varname_stride (char *s, OrcCompiler *compiler, int var) { if (compiler->target_flags & ORC_TARGET_C_NOEXEC) { sprintf(s, "%s_stride", varnames[var]); } else { sprintf(s, "ex->params[%d]", var); } } void orc_compiler_c_assemble (OrcCompiler *compiler) { int i; int j; OrcInstruction *insn; OrcStaticOpcode *opcode; OrcRule *rule; int prefix = 0; if (!(compiler->target_flags & ORC_TARGET_C_BARE)) { ORC_ASM_CODE(compiler,"void\n"); ORC_ASM_CODE(compiler,"%s (OrcExecutor *ex)\n", compiler->program->name); ORC_ASM_CODE(compiler,"{\n"); } ORC_ASM_CODE(compiler,"%*s int i;\n", prefix, ""); if (compiler->program->is_2d) { ORC_ASM_CODE(compiler," int j;\n"); } if (compiler->program->constant_n == 0) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC) && !(compiler->target_flags & ORC_TARGET_C_OPCODE)) { ORC_ASM_CODE(compiler," int n = ex->n;\n"); } } else { ORC_ASM_CODE(compiler," int n = %d;\n", compiler->program->constant_n); } if (compiler->program->is_2d) { if (compiler->program->constant_m == 0) { if (!(compiler->target_flags & ORC_TARGET_C_NOEXEC)) { ORC_ASM_CODE(compiler," int m = ex->params[ORC_VAR_A1];\n"); } } else { ORC_ASM_CODE(compiler," int m = %d;\n", compiler->program->constant_m); } } for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_CONST: break; case ORC_VAR_TYPE_TEMP: if (!(var->last_use == -1 && var->first_use == 0)) { if (var->flags & ORC_VAR_FLAG_VOLATILE_WORKAROUND) { ORC_ASM_CODE(compiler,"#if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) \n"); ORC_ASM_CODE(compiler," volatile %s var%d;\n", c_get_type_name(var->size), i); ORC_ASM_CODE(compiler,"#else\n"); ORC_ASM_CODE(compiler," %s var%d;\n", c_get_type_name(var->size), i); ORC_ASM_CODE(compiler,"#endif\n"); } else { ORC_ASM_CODE(compiler," %s var%d;\n", c_get_type_name(var->size), i); } } break; case ORC_VAR_TYPE_SRC: ORC_ASM_CODE(compiler," const %s * ORC_RESTRICT ptr%d;\n", c_get_type_name (var->size), i); break; case ORC_VAR_TYPE_DEST: ORC_ASM_CODE(compiler," %s * ORC_RESTRICT ptr%d;\n", c_get_type_name (var->size), i); break; case ORC_VAR_TYPE_ACCUMULATOR: if (var->size >= 2) { ORC_ASM_CODE(compiler," %s var%d = { 0 };\n", c_get_type_name (var->size), i); } else { ORC_ASM_CODE(compiler," %s var%d = 0;\n", c_get_type_name (var->size), i); } break; case ORC_VAR_TYPE_PARAM: break; default: ORC_COMPILER_ERROR(compiler, "bad vartype"); break; } } ORC_ASM_CODE(compiler,"\n"); if (compiler->program->is_2d) { ORC_ASM_CODE(compiler," for (j = 0; j < m; j++) {\n"); prefix = 2; for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_SRC: { char s1[40], s2[40]; get_varname(s1, compiler, i); get_varname_stride(s2, compiler, i); ORC_ASM_CODE(compiler, " ptr%d = ORC_PTR_OFFSET(%s, %s * j);\n", i, s1, s2); } break; case ORC_VAR_TYPE_DEST: { char s1[40], s2[40]; get_varname(s1, compiler, i), get_varname_stride(s2, compiler, i), ORC_ASM_CODE(compiler, " ptr%d = ORC_PTR_OFFSET(%s, %s * j);\n", i, s1, s2); } break; default: break; } } } else { for(i=0;ivars + i; char s[40]; if (var->name == NULL) continue; get_varname(s, compiler, i); switch (var->vartype) { case ORC_VAR_TYPE_SRC: ORC_ASM_CODE(compiler," ptr%d = (%s *)%s;\n", i, c_get_type_name (var->size), s); break; case ORC_VAR_TYPE_DEST: ORC_ASM_CODE(compiler," ptr%d = (%s *)%s;\n", i, c_get_type_name (var->size), s); break; default: break; } } } ORC_ASM_CODE(compiler,"\n"); for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue; ORC_ASM_CODE(compiler,"%*s /* %d: %s */\n", prefix, "", j, insn->opcode->name); rule = insn->rule; if (!rule) { ORC_COMPILER_ERROR(compiler, "No rule for: %s on target %s", opcode->name, compiler->target->name); continue; } ORC_ASM_CODE(compiler,"%*s", prefix, ""); if (insn->flags & (ORC_INSTRUCTION_FLAG_X2|ORC_INSTRUCTION_FLAG_X4)) { int n; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { n = 2; } else { n = 4; } for(i=0;iunroll_index = i; ORC_ASM_CODE(compiler,"%*s", prefix, ""); rule->emit (compiler, rule->emit_user, insn); } } else { ORC_ASM_CODE(compiler,"%*s", prefix, ""); rule->emit (compiler, rule->emit_user, insn); } } ORC_ASM_CODE(compiler,"\n"); ORC_ASM_CODE(compiler,"%*s for (i = 0; i < n; i++) {\n", prefix, ""); /* Emit instructions */ for(j=0;jn_insns;j++){ insn = compiler->insns + j; opcode = insn->opcode; if (insn->flags & ORC_INSN_FLAG_INVARIANT) continue; ORC_ASM_CODE(compiler,"%*s /* %d: %s */\n", prefix, "", j, insn->opcode->name); rule = insn->rule; if (!rule) { ORC_COMPILER_ERROR(compiler, "No rule for: %s on target %s", opcode->name, compiler->target->name); continue; } if (insn->flags & (ORC_INSTRUCTION_FLAG_X2|ORC_INSTRUCTION_FLAG_X4)) { int n; if (insn->flags & ORC_INSTRUCTION_FLAG_X2) { n = 2; } else { n = 4; } for(i=0;iunroll_index = i; ORC_ASM_CODE(compiler,"%*s", prefix, ""); rule->emit (compiler, rule->emit_user, insn); } } else { ORC_ASM_CODE(compiler,"%*s", prefix, ""); rule->emit (compiler, rule->emit_user, insn); } } ORC_ASM_CODE(compiler,"%*s }\n", prefix, ""); if (compiler->program->is_2d) { ORC_ASM_CODE(compiler," }\n"); } for(i=0;ivars + i; if (var->name == NULL) continue; switch (var->vartype) { case ORC_VAR_TYPE_ACCUMULATOR: c_get_name_int (varname, compiler, NULL, i); if (var->size == 2) { if (compiler->target_flags & ORC_TARGET_C_NOEXEC) { ORC_ASM_CODE(compiler," *%s = (%s & 0xffff);\n", varnames[i], varname); } else if (compiler->target_flags & ORC_TARGET_C_OPCODE) { ORC_ASM_CODE(compiler," ((orc_union32 *)ex->dest_ptrs[%d])->i = " "(%s + ((orc_union32 *)ex->dest_ptrs[%d])->i) & 0xffff;\n", i - ORC_VAR_A1, varname, i - ORC_VAR_A1); } else { ORC_ASM_CODE(compiler," ex->accumulators[%d] = (%s & 0xffff);\n", i - ORC_VAR_A1, varname); } } else { if (compiler->target_flags & ORC_TARGET_C_NOEXEC) { ORC_ASM_CODE(compiler," *%s = %s;\n", varnames[i], varname); } else if (compiler->target_flags & ORC_TARGET_C_OPCODE) { ORC_ASM_CODE(compiler," ((orc_union32 *)ex->dest_ptrs[%d])->i += %s;\n", i - ORC_VAR_A1, varname); } else { ORC_ASM_CODE(compiler," ex->accumulators[%d] = %s;\n", i - ORC_VAR_A1, varname); } } break; default: break; } } if (!(compiler->target_flags & ORC_TARGET_C_BARE)) { ORC_ASM_CODE(compiler,"}\n"); ORC_ASM_CODE(compiler,"\n"); } } /* rules */ static void c_get_name_int (char *name, OrcCompiler *p, OrcInstruction *insn, int var) { if (p->vars[var].vartype == ORC_VAR_TYPE_PARAM) { if (p->target_flags & ORC_TARGET_C_NOEXEC) { sprintf(name,"%s", varnames[var]); } else if (p->target_flags & ORC_TARGET_C_OPCODE) { sprintf(name,"((orc_union64 *)(ex->src_ptrs[%d]))->i", var - ORC_VAR_P1 + p->program->n_src_vars); } else { switch (p->vars[var].param_type) { case ORC_PARAM_TYPE_INT: sprintf(name,"ex->params[%d]", var); break; case ORC_PARAM_TYPE_FLOAT: sprintf(name,"((orc_union32 *)(ex->params+%d))->i", var); break; case ORC_PARAM_TYPE_INT64: /* FIXME */ sprintf(name,"((orc_union32 *)(ex->params+%d))->i", var); break; case ORC_PARAM_TYPE_DOUBLE: /* FIXME */ sprintf(name,"((orc_union32 *)(ex->params+%d))->i", var); break; default: ORC_ASSERT(0); } } } else if (p->vars[var].vartype == ORC_VAR_TYPE_CONST) { if (p->vars[var].value.i == 0x80000000) { sprintf(name,"0x80000000"); } else { if (p->vars[var].value.i == (int)p->vars[var].value.i) { sprintf(name, "%d", (int)p->vars[var].value.i); } else { ORC_ASSERT(0); } } } else { if (insn && (insn->flags & ORC_INSTRUCTION_FLAG_X2)) { sprintf(name, "var%d.x2[%d]", var, p->unroll_index); } else if (insn && (insn->flags & ORC_INSTRUCTION_FLAG_X4)) { sprintf(name, "var%d.x4[%d]", var, p->unroll_index); } else { if (p->vars[var].size >= 2) { sprintf(name, "var%d.i", var); } else { sprintf(name, "var%d", var); } } } } static void c_get_name_float (char *name, OrcCompiler *p, OrcInstruction *insn, int var) { if (insn && (insn->flags & ORC_INSTRUCTION_FLAG_X2)) { sprintf(name, "var%d.x2f[%d]", var, p->unroll_index); } else if (insn && (insn->flags & ORC_INSTRUCTION_FLAG_X4)) { sprintf(name, "var%d.x4f[%d]", var, p->unroll_index); } else { switch (p->vars[var].vartype) { case ORC_VAR_TYPE_CONST: case ORC_VAR_TYPE_TEMP: case ORC_VAR_TYPE_ACCUMULATOR: case ORC_VAR_TYPE_SRC: case ORC_VAR_TYPE_DEST: sprintf(name, "var%d.f", var); break; case ORC_VAR_TYPE_PARAM: sprintf(name, "var%d", var); break; default: ORC_COMPILER_ERROR(p, "bad vartype"); sprintf(name, "ERROR"); break; } } } static const char * c_get_type_name (int size) { switch (size) { case 1: return "orc_int8"; case 2: return "orc_union16"; case 4: return "orc_union32"; case 8: return "orc_union64"; default: return "ERROR"; } } #define UNARY(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1); \ } #define BINARY(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ c_get_name_int (src2, p, insn, insn->src_args[1]); \ \ ORC_ASM_CODE(p," %s = " op ";\n", dest, src1, src2); \ } #define UNARYF(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ \ ORC_ASM_CODE(p, " {\n"); \ ORC_ASM_CODE(p," orc_union32 _src1;\n"); \ ORC_ASM_CODE(p," orc_union32 _dest1;\n"); \ ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL(%s);\n", src1); \ ORC_ASM_CODE(p," _dest1.f = " op ";\n", "_src1.f"); \ ORC_ASM_CODE(p," %s = ORC_DENORMAL(_dest1.i);\n", dest); \ ORC_ASM_CODE(p, " }\n"); \ } #define BINARYF(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ c_get_name_int (src2, p, insn, insn->src_args[1]); \ \ ORC_ASM_CODE(p, " {\n"); \ ORC_ASM_CODE(p," orc_union32 _src1;\n"); \ ORC_ASM_CODE(p," orc_union32 _src2;\n"); \ ORC_ASM_CODE(p," orc_union32 _dest1;\n"); \ ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL(%s);\n", src1); \ ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL(%s);\n", src2); \ ORC_ASM_CODE(p," _dest1.f = " op ";\n", "_src1.f", "_src2.f"); \ ORC_ASM_CODE(p," %s = ORC_DENORMAL(_dest1.i);\n", dest); \ ORC_ASM_CODE(p, " }\n"); \ } #define BINARYFL(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ c_get_name_int (src2, p, insn, insn->src_args[1]); \ \ ORC_ASM_CODE(p, " {\n"); \ ORC_ASM_CODE(p," orc_union32 _src1;\n"); \ ORC_ASM_CODE(p," orc_union32 _src2;\n"); \ ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL(%s);\n", src1); \ ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL(%s);\n", src2); \ ORC_ASM_CODE(p," %s = " op ";\n", dest, "_src1.f", "_src2.f"); \ ORC_ASM_CODE(p, " }\n"); \ } #define UNARYD(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ \ ORC_ASM_CODE(p, " {\n"); \ ORC_ASM_CODE(p," orc_union64 _src1;\n"); \ ORC_ASM_CODE(p," orc_union64 _dest1;\n"); \ ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); \ ORC_ASM_CODE(p," _dest1.f = " op ";\n", "_src1.f"); \ ORC_ASM_CODE(p," %s = ORC_DENORMAL_DOUBLE(_dest1.i);\n", dest); \ ORC_ASM_CODE(p, " }\n"); \ } #define BINARYD(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ c_get_name_int (src2, p, insn, insn->src_args[1]); \ \ ORC_ASM_CODE(p, " {\n"); \ ORC_ASM_CODE(p," orc_union64 _src1;\n"); \ ORC_ASM_CODE(p," orc_union64 _src2;\n"); \ ORC_ASM_CODE(p," orc_union64 _dest1;\n"); \ ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); \ ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL_DOUBLE(%s);\n", src2); \ ORC_ASM_CODE(p," _dest1.f = " op ";\n", "_src1.f", "_src2.f"); \ ORC_ASM_CODE(p," %s = ORC_DENORMAL_DOUBLE(_dest1.i);\n", dest); \ ORC_ASM_CODE(p, " }\n"); \ } #define BINARYDQ(name,op) \ static void \ c_rule_ ## name (OrcCompiler *p, void *user, OrcInstruction *insn) \ { \ char dest[40], src1[40], src2[40]; \ \ c_get_name_int (dest, p, insn, insn->dest_args[0]); \ c_get_name_int (src1, p, insn, insn->src_args[0]); \ c_get_name_int (src2, p, insn, insn->src_args[1]); \ \ ORC_ASM_CODE(p, " {\n"); \ ORC_ASM_CODE(p," orc_union64 _src1;\n"); \ ORC_ASM_CODE(p," orc_union64 _src2;\n"); \ ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); \ ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL_DOUBLE(%s);\n", src2); \ ORC_ASM_CODE(p," %s = " op ";\n", dest, "_src1.f", "_src2.f"); \ ORC_ASM_CODE(p, " }\n"); \ } #define BINARY_SB(a,b) BINARY(a,b) #define BINARY_UB(a,b) BINARY(a,b) #define BINARY_SW(a,b) BINARY(a,b) #define BINARY_UW(a,b) BINARY(a,b) #define BINARY_SL(a,b) BINARY(a,b) #define BINARY_UL(a,b) BINARY(a,b) #define BINARY_SQ(a,b) BINARY(a,b) #define BINARY_UQ(a,b) BINARY(a,b) #define UNARY_SB(a,b) UNARY(a,b) #define UNARY_UB(a,b) UNARY(a,b) #define UNARY_SW(a,b) UNARY(a,b) #define UNARY_UW(a,b) UNARY(a,b) #define UNARY_SL(a,b) UNARY(a,b) #define UNARY_UL(a,b) UNARY(a,b) #define UNARY_SQ(a,b) UNARY(a,b) #define UNARY_UQ(a,b) UNARY(a,b) #define BINARY_BW(a,b) BINARY(a,b) #define BINARY_WL(a,b) BINARY(a,b) #define BINARY_LQ(a,b) BINARY(a,b) #define BINARY_QL(a,b) BINARY(a,b) #define BINARY_LW(a,b) BINARY(a,b) #define BINARY_WB(a,b) BINARY(a,b) #define UNARY_BW(a,b) UNARY(a,b) #define UNARY_WL(a,b) UNARY(a,b) #define UNARY_LQ(a,b) UNARY(a,b) #define UNARY_QL(a,b) UNARY(a,b) #define UNARY_LW(a,b) UNARY(a,b) #define UNARY_WB(a,b) UNARY(a,b) #define BINARY_F(a,b) BINARYF(a,b) #define BINARY_FL(a,b) BINARYFL(a,b) #define UNARY_F(a,b) UNARYF(a,b) #define UNARY_FL(a,b) UNARYFL(a,b) #define UNARY_LF(a,b) UNARYLF(a,b) #define BINARY_D(a,b) BINARYD(a,b) #define BINARY_DQ(a,b) BINARYDQ(a,b) #define UNARY_D(a,b) UNARYD(a,b) #define UNARY_DL(a,b) UNARYFL(a,b) #define UNARY_LD(a,b) UNARYLF(a,b) #define UNARY_DF(a,b) UNARYF(a,b) #define UNARY_FD(a,b) UNARYF(a,b) #include "opcodes.h" #undef BINARY_SB #undef BINARY_UB #undef BINARY_SW #undef BINARY_UW #undef BINARY_SL #undef BINARY_UL #undef BINARY_SQ #undef BINARY_UQ #undef BINARY_F #undef BINARY_D #undef UNARY_SB #undef UNARY_UB #undef UNARY_SW #undef UNARY_UW #undef UNARY_SL #undef UNARY_UL #undef UNARY_SQ #undef UNARY_UQ #undef UNARY_F #undef UNARY_D #undef BINARY_BW #undef BINARY_WL #undef BINARY_LQ #undef BINARY_QL #undef BINARY_LW #undef BINARY_WB #undef UNARY_BW #undef UNARY_WL #undef UNARY_LQ #undef UNARY_QL #undef UNARY_LW #undef UNARY_WB #undef UNARY_FL #undef UNARY_DL #undef UNARY_LF #undef UNARY_LD #undef BINARY_FL #undef BINARY_DQ #undef UNARY_FD #undef UNARY_DF static void c_rule_loadpX (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40]; int size = ORC_PTR_TO_INT(user); if ((p->target_flags & ORC_TARGET_C_NOEXEC) && (p->vars[insn->src_args[0]].param_type == ORC_PARAM_TYPE_FLOAT || p->vars[insn->src_args[0]].param_type == ORC_PARAM_TYPE_DOUBLE)) c_get_name_float (dest, p, insn, insn->dest_args[0]); else c_get_name_int (dest, p, insn, insn->dest_args[0]); if (p->vars[insn->src_args[0]].vartype == ORC_VAR_TYPE_PARAM) { if (p->target_flags & ORC_TARGET_C_NOEXEC) { ORC_ASM_CODE(p," %s = %s;\n", dest, varnames[insn->src_args[0]]); } else if (p->target_flags & ORC_TARGET_C_OPCODE) { ORC_ASM_CODE(p," %s = ((orc_union64 *)(ex->src_ptrs[%d]))->i;\n", dest, insn->src_args[0] - ORC_VAR_P1 + p->program->n_src_vars); } else { if (size == 8) { ORC_ASM_CODE(p," %s = (ex->params[%d] & 0xffffffff) | ((orc_uint64)(ex->params[%d + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32);\n", dest, insn->src_args[0], insn->src_args[0]); } else { ORC_ASM_CODE(p," %s = ex->params[%d];\n", dest, insn->src_args[0]); } } } else if (p->vars[insn->src_args[0]].vartype == ORC_VAR_TYPE_CONST) { if (p->vars[insn->src_args[0]].size <= 4) { ORC_ASM_CODE(p," %s = (int)0x%08x; /* %d or %gf */\n", dest, (unsigned int)p->vars[insn->src_args[0]].value.i, (int)p->vars[insn->src_args[0]].value.i, p->vars[insn->src_args[0]].value.f); } else { ORC_ASM_CODE(p," %s = ORC_UINT64_C(0x%08x%08x); /* %gf */\n", dest, (orc_uint32)(((orc_uint64)p->vars[insn->src_args[0]].value.i)>>32), ((orc_uint32)p->vars[insn->src_args[0]].value.i), p->vars[insn->src_args[0]].value.f); } } else { ORC_COMPILER_ERROR(p, "expected param or constant"); } } #if 0 static void c_rule_loadpX (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40]; char src[40]; OrcVariable *var; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); var = &p->vars[insn->src_args[0]]; ORC_ASM_CODE(p," %s = %s;\n", dest, src); } #endif static void c_rule_loadX (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," var%d = ptr%d[offset + i];\n", insn->dest_args[0], insn->src_args[0]); } else { ORC_ASM_CODE(p," var%d = ptr%d[i];\n", insn->dest_args[0], insn->src_args[0]); } } static void c_rule_loadoffX (OrcCompiler *p, void *user, OrcInstruction *insn) { char src[40]; c_get_name_int (src, p, insn, insn->src_args[1]); if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," var%d = ptr%d[offset + i + %s];\n", insn->dest_args[0], insn->src_args[0], src); } else { ORC_ASM_CODE(p," var%d = ptr%d[i + %s];\n", insn->dest_args[0], insn->src_args[0], src); } } static void c_rule_loadupdb (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," var%d = ptr%d[(offset + i)>>1];\n", insn->dest_args[0], insn->src_args[0]); } else { ORC_ASM_CODE(p," var%d = ptr%d[i>>1];\n", insn->dest_args[0], insn->src_args[0]); } } static void c_rule_loadupib (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," var%d = ((offset + i)&1) ? ((orc_uint8)ptr%d[(offset + i)>>1] + (orc_uint8)ptr%d[((offset + i)>>1)+1] + 1)>>1 : ptr%d[(offset + i)>>1];\n", insn->dest_args[0], insn->src_args[0], insn->src_args[0], insn->src_args[0]); } else { ORC_ASM_CODE(p," var%d = (i&1) ? ((orc_uint8)ptr%d[i>>1] + (orc_uint8)ptr%d[(i>>1)+1] + 1)>>1 : ptr%d[i>>1];\n", insn->dest_args[0], insn->src_args[0], insn->src_args[0], insn->src_args[0]); } } static void c_rule_ldresnearX (OrcCompiler *p, void *user, OrcInstruction *insn) { char src1[40]; char src2[40]; c_get_name_int (src1, p, insn, insn->src_args[1]); c_get_name_int (src2, p, insn, insn->src_args[2]); if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," var%d = ptr%d[(%s + (offset + i)*%s)>>16];\n", insn->dest_args[0], insn->src_args[0], src1, src2); } else { ORC_ASM_CODE(p," var%d = ptr%d[(%s + i*%s)>>16];\n", insn->dest_args[0], insn->src_args[0], src1, src2); } } static void c_rule_ldreslinb (OrcCompiler *p, void *user, OrcInstruction *insn) { char src1[40]; char src2[40]; c_get_name_int (src1, p, insn, insn->src_args[1]); c_get_name_int (src2, p, insn, insn->src_args[2]); ORC_ASM_CODE(p," {\n"); if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," int tmp = %s + (offset + i) * %s;\n", src1, src2); } else { ORC_ASM_CODE(p," int tmp = %s + i * %s;\n", src1, src2); } ORC_ASM_CODE(p," var%d = ((orc_uint8)ptr%d[tmp>>16] * (256-((tmp>>8)&0xff)) + (orc_uint8)ptr%d[(tmp>>16)+1] * ((tmp>>8)&0xff))>>8;\n", insn->dest_args[0], insn->src_args[0], insn->src_args[0]); ORC_ASM_CODE(p," }\n"); } static void c_rule_ldreslinl (OrcCompiler *p, void *user, OrcInstruction *insn) { int i; char src1[40]; char src2[40]; c_get_name_int (src1, p, insn, insn->src_args[1]); c_get_name_int (src2, p, insn, insn->src_args[2]); ORC_ASM_CODE(p," {\n"); if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," int tmp = %s + (offset + i) * %s;\n", src1, src2); } else { ORC_ASM_CODE(p," int tmp = %s + i * %s;\n", src1, src2); } ORC_ASM_CODE(p," orc_union32 a = ptr%d[tmp>>16];\n", insn->src_args[0]); ORC_ASM_CODE(p," orc_union32 b = ptr%d[(tmp>>16)+1];\n", insn->src_args[0]); for (i=0;i<4;i++){ ORC_ASM_CODE(p," var%d.x4[%d] = ((orc_uint8)a.x4[%d] * (256-((tmp>>8)&0xff)) + (orc_uint8)b.x4[%d] * ((tmp>>8)&0xff))>>8;\n", insn->dest_args[0], i, i, i); } ORC_ASM_CODE(p," }\n"); } static void c_rule_storeX (OrcCompiler *p, void *user, OrcInstruction *insn) { if (p->target_flags & ORC_TARGET_C_OPCODE && !(insn->flags & ORC_INSN_FLAG_ADDED)) { ORC_ASM_CODE(p," ptr%d[offset + i] = var%d;\n", insn->dest_args[0], insn->src_args[0]); } else { ORC_ASM_CODE(p," ptr%d[i] = var%d;\n", insn->dest_args[0], insn->src_args[0]); } } static void c_rule_accw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = %s + %s;\n", dest, dest, src1); } static void c_rule_accl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = %s + %s;\n", dest, dest, src1); } static void c_rule_accsadubl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p, " %s = %s + ORC_ABS((orc_int32)(orc_uint8)%s - (orc_int32)(orc_uint8)%s);\n", dest, dest, src1, src2); } static void c_rule_splitql (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest1[40], dest2[40], src[40]; c_get_name_int (dest1, p, insn, insn->dest_args[0]); c_get_name_int (dest2, p, insn, insn->dest_args[1]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union64 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[1];\n", dest1); ORC_ASM_CODE(p," %s = _src.x2[0];\n", dest2); ORC_ASM_CODE(p, " }\n"); } static void c_rule_splitlw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest1[40], dest2[40], src[40]; c_get_name_int (dest1, p, insn, insn->dest_args[0]); c_get_name_int (dest2, p, insn, insn->dest_args[1]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union32 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[1];\n", dest1); ORC_ASM_CODE(p," %s = _src.x2[0];\n", dest2); ORC_ASM_CODE(p, " }\n"); } static void c_rule_splitwb (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest1[40], dest2[40], src[40]; c_get_name_int (dest1, p, insn, insn->dest_args[0]); c_get_name_int (dest2, p, insn, insn->dest_args[1]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union16 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[1];\n", dest1); ORC_ASM_CODE(p," %s = _src.x2[0];\n", dest2); ORC_ASM_CODE(p, " }\n"); } static void c_rule_select0ql (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union64 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[0];\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_select1ql (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union64 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[1];\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_select0lw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union32 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[0];\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_select1lw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union32 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[1];\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_select0wb (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union16 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[0];\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_select1wb (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union16 _src;\n"); ORC_ASM_CODE(p," _src.i = %s;\n", src); ORC_ASM_CODE(p," %s = _src.x2[1];\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_splatbw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = ((%s&0xff) << 8) | (%s&0xff);\n", dest, src, src); } static void c_rule_splatbl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " %s = ((%s&0xff) << 24) | ((%s&0xff)<<16) | ((%s&0xff) << 8) | (%s&0xff);\n", dest, src, src, src, src); } static void c_rule_splatw3q (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " %s = ((((orc_uint64)%s)>>48) << 48) | " "((((orc_uint64)%s)>>48)<<32) | " "((((orc_uint64)%s)>>48) << 16) | " "((((orc_uint64)%s)>>48));\n", dest, src, src, src, src); } static void c_rule_div255w (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " %s = ((orc_uint16)(((orc_uint16)(%s+128)) + (((orc_uint16)(%s+128))>>8)))>>8;\n", dest, src, src); } static void c_rule_divluw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p, " %s = ((%s&0xff) == 0) ? 255 : ORC_CLAMP_UB(((orc_uint16)%s)/((orc_uint16)%s&0xff));\n", dest, src2, src1, src2); } static void c_rule_convlf (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name_float (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = %s;\n", dest, src1); } static void c_rule_convld (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name_float (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = %s;\n", dest, src1); } static void c_rule_convfd (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name_float (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union32 _src1;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL(%s);\n", src1); ORC_ASM_CODE(p," %s = _src1.f;\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_convdf (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union64 _src1;\n"); ORC_ASM_CODE(p," orc_union32 _dest;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); ORC_ASM_CODE(p," _dest.f = _src1.f;\n"); ORC_ASM_CODE(p," %s = ORC_DENORMAL(_dest.i);\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_convfl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40], src_i[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_float (src, p, insn, insn->src_args[0]); c_get_name_int (src_i, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," int tmp;\n"); ORC_ASM_CODE(p," tmp = (int)%s;\n", src); ORC_ASM_CODE(p," if (tmp == 0x80000000 && !(%s&0x80000000)) tmp = 0x7fffffff;\n", src_i); ORC_ASM_CODE(p," %s = tmp;\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_convdl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40], src_i[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_float (src, p, insn, insn->src_args[0]); c_get_name_int (src_i, p, insn, insn->src_args[0]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," int tmp;\n"); ORC_ASM_CODE(p," tmp = %s;\n", src); ORC_ASM_CODE(p," if (tmp == 0x80000000 && !(%s & ORC_UINT64_C(0x8000000000000000))) tmp = 0x7fffffff;\n", src_i); ORC_ASM_CODE(p," %s = tmp;\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_minf (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," orc_union32 _src1;\n"); ORC_ASM_CODE(p," orc_union32 _src2;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL(%s);\n", src1); ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL(%s);\n", src2); ORC_ASM_CODE(p," if (ORC_ISNAN(_src1.i)) %s = _src1.i;\n", dest); ORC_ASM_CODE(p," else if (ORC_ISNAN(_src2.i)) %s = _src2.i;\n", dest); ORC_ASM_CODE(p," else %s = (_src1.f < _src2.f) ? _src1.i : _src2.i;\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_maxf (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," orc_union32 _src1;\n"); ORC_ASM_CODE(p," orc_union32 _src2;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL(%s);\n", src1); ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL(%s);\n", src2); ORC_ASM_CODE(p," if (ORC_ISNAN(_src1.i)) %s = _src1.i;\n", dest); ORC_ASM_CODE(p," else if (ORC_ISNAN(_src2.i)) %s = _src2.i;\n", dest); ORC_ASM_CODE(p," else %s = (_src1.f > _src2.f) ? _src1.i : _src2.i;\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_mind (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," orc_union64 _src1;\n"); ORC_ASM_CODE(p," orc_union64 _src2;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL_DOUBLE(%s);\n", src2); ORC_ASM_CODE(p," if (ORC_ISNAN_DOUBLE(_src1.i)) %s = _src1.i;\n", dest); ORC_ASM_CODE(p," else if (ORC_ISNAN_DOUBLE(_src2.i)) %s = _src2.i;\n", dest); ORC_ASM_CODE(p," else %s = (_src1.f < _src2.f) ? _src1.i : _src2.i;\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_maxd (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p," {\n"); ORC_ASM_CODE(p," orc_union64 _src1;\n"); ORC_ASM_CODE(p," orc_union64 _src2;\n"); ORC_ASM_CODE(p," _src1.i = ORC_DENORMAL_DOUBLE(%s);\n", src1); ORC_ASM_CODE(p," _src2.i = ORC_DENORMAL_DOUBLE(%s);\n", src2); ORC_ASM_CODE(p," if (ORC_ISNAN_DOUBLE(_src1.i)) %s = _src1.i;\n", dest); ORC_ASM_CODE(p," else if (ORC_ISNAN_DOUBLE(_src2.i)) %s = _src2.i;\n", dest); ORC_ASM_CODE(p," else %s = (_src1.f > _src2.f) ? _src1.i : _src2.i;\n", dest); ORC_ASM_CODE(p," }\n"); } static void c_rule_swapwl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = ((%s&0x0000ffff) << 16) | ((%s&0xffff0000) >> 16);\n", dest, src, src); } static void c_rule_swaplq (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src, p, insn, insn->src_args[0]); ORC_ASM_CODE(p," %s = (ORC_UINT64_C(%s&0x00000000ffffffff) << 32) | (ORC_UINT64_C(%s&0xffffffff00000000) >> 32);\n", dest, src, src); } static void c_rule_mergelq (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union64 _dest;\n"); ORC_ASM_CODE(p," _dest.x2[0] = %s;\n", src1); ORC_ASM_CODE(p," _dest.x2[1] = %s;\n", src2); ORC_ASM_CODE(p," %s = _dest.i;\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_mergewl (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union32 _dest;\n"); ORC_ASM_CODE(p," _dest.x2[0] = %s;\n", src1); ORC_ASM_CODE(p," _dest.x2[1] = %s;\n", src2); ORC_ASM_CODE(p," %s = _dest.i;\n", dest); ORC_ASM_CODE(p, " }\n"); } static void c_rule_mergebw (OrcCompiler *p, void *user, OrcInstruction *insn) { char dest[40], src1[40], src2[40]; c_get_name_int (dest, p, insn, insn->dest_args[0]); c_get_name_int (src1, p, insn, insn->src_args[0]); c_get_name_int (src2, p, insn, insn->src_args[1]); ORC_ASM_CODE(p, " {\n"); ORC_ASM_CODE(p," orc_union16 _dest;\n"); ORC_ASM_CODE(p," _dest.x2[0] = %s;\n", src1); ORC_ASM_CODE(p," _dest.x2[1] = %s;\n", src2); ORC_ASM_CODE(p," %s = _dest.i;\n", dest); ORC_ASM_CODE(p, " }\n"); } static OrcTarget c_target = { "c", FALSE, ORC_GP_REG_BASE, orc_compiler_c_get_default_flags, orc_compiler_c_init, orc_compiler_c_assemble, { { 0 } }, 0, orc_target_c_get_asm_preamble, }; void orc_c_init (void) { OrcRuleSet *rule_set; orc_target_register (&c_target); rule_set = orc_rule_set_new (orc_opcode_set_get("sys"), &c_target, 0); #define BINARY_SB(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_UB(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_SW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_UW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_SL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_UL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_SQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_UQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_F(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_D(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_SB(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_UB(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_SW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_UW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_SL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_UL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_SQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_UQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_F(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_D(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_BW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_WL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_LQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_QL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_LW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_WB(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_BW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_WL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_LQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_QL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_LW(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_WB(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_FL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_DL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_FL(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define BINARY_DQ(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_LF(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_LD(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_DF(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #define UNARY_FD(a,b) orc_rule_register (rule_set, #a , c_rule_ ## a, NULL); #include "opcodes.h" orc_rule_register (rule_set, "loadpb", c_rule_loadpX, (void *)1); orc_rule_register (rule_set, "loadpw", c_rule_loadpX, (void *)2); orc_rule_register (rule_set, "loadpl", c_rule_loadpX, (void *)4); orc_rule_register (rule_set, "loadpq", c_rule_loadpX, (void *)8); orc_rule_register (rule_set, "loadb", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadw", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadl", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadq", c_rule_loadX, NULL); orc_rule_register (rule_set, "loadoffb", c_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffw", c_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadoffl", c_rule_loadoffX, NULL); orc_rule_register (rule_set, "loadupdb", c_rule_loadupdb, NULL); orc_rule_register (rule_set, "loadupib", c_rule_loadupib, NULL); orc_rule_register (rule_set, "ldresnearb", c_rule_ldresnearX, NULL); orc_rule_register (rule_set, "ldresnearl", c_rule_ldresnearX, NULL); orc_rule_register (rule_set, "ldreslinb", c_rule_ldreslinb, NULL); orc_rule_register (rule_set, "ldreslinl", c_rule_ldreslinl, NULL); orc_rule_register (rule_set, "storeb", c_rule_storeX, NULL); orc_rule_register (rule_set, "storew", c_rule_storeX, NULL); orc_rule_register (rule_set, "storel", c_rule_storeX, NULL); orc_rule_register (rule_set, "storeq", c_rule_storeX, NULL); orc_rule_register (rule_set, "accw", c_rule_accw, NULL); orc_rule_register (rule_set, "accl", c_rule_accl, NULL); orc_rule_register (rule_set, "accsadubl", c_rule_accsadubl, NULL); orc_rule_register (rule_set, "splitql", c_rule_splitql, NULL); orc_rule_register (rule_set, "splitlw", c_rule_splitlw, NULL); orc_rule_register (rule_set, "splitwb", c_rule_splitwb, NULL); orc_rule_register (rule_set, "select0ql", c_rule_select0ql, NULL); orc_rule_register (rule_set, "select1ql", c_rule_select1ql, NULL); orc_rule_register (rule_set, "select0lw", c_rule_select0lw, NULL); orc_rule_register (rule_set, "select1lw", c_rule_select1lw, NULL); orc_rule_register (rule_set, "select0wb", c_rule_select0wb, NULL); orc_rule_register (rule_set, "select1wb", c_rule_select1wb, NULL); orc_rule_register (rule_set, "splatbw", c_rule_splatbw, NULL); orc_rule_register (rule_set, "splatbl", c_rule_splatbl, NULL); orc_rule_register (rule_set, "splatw3q", c_rule_splatw3q, NULL); orc_rule_register (rule_set, "div255w", c_rule_div255w, NULL); orc_rule_register (rule_set, "divluw", c_rule_divluw, NULL); orc_rule_register (rule_set, "convlf", c_rule_convlf, NULL); orc_rule_register (rule_set, "convld", c_rule_convld, NULL); orc_rule_register (rule_set, "convfl", c_rule_convfl, NULL); orc_rule_register (rule_set, "convdl", c_rule_convdl, NULL); orc_rule_register (rule_set, "convfd", c_rule_convfd, NULL); orc_rule_register (rule_set, "convdf", c_rule_convdf, NULL); orc_rule_register (rule_set, "minf", c_rule_minf, NULL); orc_rule_register (rule_set, "maxf", c_rule_maxf, NULL); orc_rule_register (rule_set, "mind", c_rule_mind, NULL); orc_rule_register (rule_set, "maxd", c_rule_maxd, NULL); orc_rule_register (rule_set, "swapwl", c_rule_swapwl, NULL); orc_rule_register (rule_set, "swaplq", c_rule_swaplq, NULL); orc_rule_register (rule_set, "mergebw", c_rule_mergebw, NULL); orc_rule_register (rule_set, "mergewl", c_rule_mergewl, NULL); orc_rule_register (rule_set, "mergelq", c_rule_mergelq, NULL); } orc-0.4.18/orc/orcprogram.h0000664000175000017500000001503712111024531012415 00000000000000 #ifndef _ORC_PROGRAM_H_ #define _ORC_PROGRAM_H_ #include #include #include #include #include #include #include #include ORC_BEGIN_DECLS #define ORC_PROGRAM_ERROR(program, ...) do { \ program->error = TRUE; \ orc_debug_print(ORC_DEBUG_WARNING, __FILE__, ORC_FUNCTION, __LINE__, __VA_ARGS__); \ } while (0) /** * OrcProgram: * * The OrcProgram structure has no public members */ struct _OrcProgram { /*< private >*/ struct { OrcStaticOpcode *opcode; int dest_args[ORC_STATIC_OPCODE_N_DEST]; int src_args[ORC_STATIC_OPCODE_N_SRC]; OrcRule *rule; } _unused[ORC_N_INSNS]; /* needed for ABI compatibility */ int n_insns; struct { char *name; char *type_name; int size; OrcVarType vartype; int used; int first_use; int last_use; int replaced; int replacement; int alloc; int is_chained; int is_aligned; int is_uncached; int value; int ptr_register; int ptr_offset; int mask_alloc; int aligned_data; int param_type; int load_dest; } _unused3[ORC_N_VARIABLES]; /* needed for ABI compatibility */ int n_src_vars; int n_dest_vars; int n_param_vars; int n_const_vars; int n_temp_vars; int n_accum_vars; char *name; char *asm_code; unsigned char *_unused2; /* The offset of code_exec in this structure is part of the ABI */ void *code_exec; OrcInstruction insns[ORC_N_INSNS]; OrcVariable vars[ORC_N_VARIABLES]; void *backup_func; int is_2d; int constant_n; int n_multiple; int n_minimum; int n_maximum; int constant_m; OrcCode *orccode; /* Hide this here. Belongs in a Parser object */ char *init_function; char *error_msg; unsigned int current_line; }; #define ORC_SRC_ARG(p,i,n) ((p)->vars[(i)->src_args[(n)]].alloc) #define ORC_DEST_ARG(p,i,n) ((p)->vars[(i)->dest_args[(n)]].alloc) #define ORC_SRC_TYPE(p,i,n) ((p)->vars[(i)->src_args[(n)]].vartype) #define ORC_DEST_TYPE(p,i,n) ((p)->vars[(i)->dest_args[(n)]].vartype) #define ORC_SRC_VAL(p,insn,n) ((p)->vars[(insn)->src_args[(n)]].value.i) #define ORC_DEST_VAL(p,insn,n) ((p)->vars[(insn)->dest_args[(n)]].value.i) void orc_init (void); OrcProgram * orc_program_new (void); OrcProgram * orc_program_new_ds (int size1, int size2); OrcProgram * orc_program_new_dss (int size1, int size2, int size3); OrcProgram * orc_program_new_as (int size1, int size2); OrcProgram * orc_program_new_ass (int size1, int size2, int size3); OrcProgram * orc_program_new_from_static_bytecode (const orc_uint8 *bytecode); const char * orc_program_get_name (OrcProgram *program); void orc_program_set_name (OrcProgram *program, const char *name); void orc_program_set_line (OrcProgram *program, unsigned int line); void orc_program_set_2d (OrcProgram *program); void orc_program_set_constant_n (OrcProgram *program, int n); void orc_program_set_n_multiple (OrcProgram *ex, int n); void orc_program_set_n_minimum (OrcProgram *ex, int n); void orc_program_set_n_maximum (OrcProgram *ex, int n); void orc_program_set_constant_m (OrcProgram *program, int m); void orc_program_append (OrcProgram *p, const char *opcode, int arg0, int arg1, int arg2); void orc_program_append_2 (OrcProgram *program, const char *name, unsigned int flags, int arg0, int arg1, int arg2, int arg3); void orc_program_append_str (OrcProgram *p, const char *opcode, const char * arg0, const char * arg1, const char * arg2); void orc_program_append_str_2 (OrcProgram *program, const char *name, unsigned int flags, const char *arg1, const char *arg2, const char *arg3, const char *arg4); void orc_program_append_ds (OrcProgram *program, const char *opcode, int arg0, int arg1); void orc_program_append_ds_str (OrcProgram *p, const char *opcode, const char * arg0, const char * arg1); void orc_program_append_dds_str (OrcProgram *program, const char *name, const char *arg1, const char *arg2, const char *arg3); OrcCompileResult orc_program_compile (OrcProgram *p); OrcCompileResult orc_program_compile_for_target (OrcProgram *p, OrcTarget *target); OrcCompileResult orc_program_compile_full (OrcProgram *p, OrcTarget *target, unsigned int flags); void orc_program_set_backup_function (OrcProgram *p, OrcExecutorFunc func); void orc_program_free (OrcProgram *program); int orc_program_find_var_by_name (OrcProgram *program, const char *name); int orc_program_add_temporary (OrcProgram *program, int size, const char *name); int orc_program_dup_temporary (OrcProgram *program, int i, int j); int orc_program_add_source (OrcProgram *program, int size, const char *name); int orc_program_add_source_full (OrcProgram *program, int size, const char *name, const char *type_name, int alignment); int orc_program_add_destination (OrcProgram *program, int size, const char *name); int orc_program_add_destination_full (OrcProgram *program, int size, const char *name, const char *type_name, int alignment); int orc_program_add_constant (OrcProgram *program, int size, int value, const char *name); int orc_program_add_constant_int64 (OrcProgram *program, int size, orc_int64 value, const char *name); int orc_program_add_constant_float (OrcProgram *program, int size, float value, const char *name); int orc_program_add_constant_double (OrcProgram *program, int size, double value, const char *name); int orc_program_add_constant_str (OrcProgram *program, int size, const char *value, const char *name); int orc_program_add_parameter (OrcProgram *program, int size, const char *name); int orc_program_add_parameter_float (OrcProgram *program, int size, const char *name); int orc_program_add_parameter_double (OrcProgram *program, int size, const char *name); int orc_program_add_parameter_int64 (OrcProgram *program, int size, const char *name); int orc_program_add_accumulator (OrcProgram *program, int size, const char *name); void orc_program_set_type_name (OrcProgram *program, int var, const char *type_name); void orc_program_set_var_alignment (OrcProgram *program, int var, int alignment); void orc_program_set_sampling_type (OrcProgram *program, int var, int sampling_type); int orc_program_allocate_register (OrcProgram *program, int is_data); void orc_program_reset (OrcProgram *program); OrcCode *orc_program_take_code (OrcProgram *program); const char *orc_program_get_asm_code (OrcProgram *program); const char * orc_program_get_error (OrcProgram *program); int orc_program_get_max_array_size (OrcProgram *program); int orc_program_get_max_accumulator_size (OrcProgram *program); ORC_END_DECLS #endif orc-0.4.18/ltmain.sh0000644000175000017500000105204012206165324011133 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu2" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 orc-0.4.18/TODO0000644000175000017500000000065311551076052010006 00000000000000 sse: Handle cache information and small n neon: constant n aligned source checks new opcodes: - sampling: video scaling, fir filtering, fir filtering with downsampling, upsampling/downsampling - composite opcodes float parameters compiler: inline orc calls compiler: initialization function instruction scheduler improve emulation 0.5 === Remove orc-stdint.h. Remove lots of stuff from the public API. orc-0.4.18/gtk-doc.make0000644000175000017500000001540611551076053011510 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) EXTRA_DIST = \ $(content_files) \ $(HTML_IMAGES) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ pdf-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ $(srcdir)/pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) @cp version.entities $(srcdir)/xml/ @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/html @mkdir $(srcdir)/html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options=--path="$(srcdir)"; \ fi; \ cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building PDF' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/$(DOC_MODULE).pdf @mkpdf_imgdirs=""; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ fi; \ done; \ fi; \ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: @installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ mv -f $${installdir}/$(DOC_MODULE).devhelp \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl cp $(srcdir)/html/* $(distdir)/html -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs orc-0.4.18/examples/0000775000175000017500000000000012206165373011215 500000000000000orc-0.4.18/examples/example3.c0000664000175000017500000000066012053776470013027 00000000000000#include #include "example3orc.h" #define N 10 unsigned char input_y[640*480]; unsigned char input_u[320*240]; unsigned char input_v[320*240]; unsigned int output[640*480]; int main (int argc, char *argv[]) { /* Call a function that uses Orc */ convert_I420_AYUV (output, 1280*4, output + 640, 1280 * 4, input_y, 1280, input_y + 640, 1280, input_u, 320, input_v, 320, 320, 240); return 0; } orc-0.4.18/examples/Makefile.in0000664000175000017500000004764612206165327013222 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) @CROSS_COMPILING_FALSE@am__append_1 = example1 example2 example3 mt19937ar @ENABLE_BACKEND_MMX_TRUE@am__append_2 = volscale subdir = examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @CROSS_COMPILING_FALSE@am__EXEEXT_1 = example1$(EXEEXT) \ @CROSS_COMPILING_FALSE@ example2$(EXEEXT) example3$(EXEEXT) \ @CROSS_COMPILING_FALSE@ mt19937ar$(EXEEXT) @ENABLE_BACKEND_MMX_TRUE@am__EXEEXT_2 = volscale$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_example1_OBJECTS = example1.$(OBJEXT) nodist_example1_OBJECTS = example1orc.$(OBJEXT) example1_OBJECTS = $(am_example1_OBJECTS) $(nodist_example1_OBJECTS) example1_LDADD = $(LDADD) am_example2_OBJECTS = example2.$(OBJEXT) nodist_example2_OBJECTS = example2orc.$(OBJEXT) example2_OBJECTS = $(am_example2_OBJECTS) $(nodist_example2_OBJECTS) example2_LDADD = $(LDADD) am_example3_OBJECTS = example3.$(OBJEXT) nodist_example3_OBJECTS = example3orc.$(OBJEXT) example3_OBJECTS = $(am_example3_OBJECTS) $(nodist_example3_OBJECTS) example3_LDADD = $(LDADD) am_mt19937ar_OBJECTS = mt19937ar.$(OBJEXT) nodist_mt19937ar_OBJECTS = mt19937arorc.$(OBJEXT) mt19937ar_OBJECTS = $(am_mt19937ar_OBJECTS) \ $(nodist_mt19937ar_OBJECTS) mt19937ar_LDADD = $(LDADD) volscale_SOURCES = volscale.c volscale_OBJECTS = volscale.$(OBJEXT) volscale_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(example1_SOURCES) $(nodist_example1_SOURCES) \ $(example2_SOURCES) $(nodist_example2_SOURCES) \ $(example3_SOURCES) $(nodist_example3_SOURCES) \ $(mt19937ar_SOURCES) $(nodist_mt19937ar_SOURCES) volscale.c DIST_SOURCES = $(example1_SOURCES) $(example2_SOURCES) \ $(example3_SOURCES) $(mt19937ar_SOURCES) volscale.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @CROSS_COMPILING_FALSE@BUILT_SOURCES = example1orc.c example1orc.h \ @CROSS_COMPILING_FALSE@ example2orc.c example2orc.h \ @CROSS_COMPILING_FALSE@ example3orc.c example3orc.h \ @CROSS_COMPILING_FALSE@ mt19937arorc.c mt19937arorc.h AM_LDFLAGS = $(ORC_LIBS) AM_CFLAGS = $(ORC_CFLAGS) EXTRA_DIST = example1orc.orc example2orc.orc example3orc.orc mt19937arorc.orc CLEANFILES = example1orc.c example1orc.h \ example2orc.c example2orc.h \ example3orc.c example3orc.h \ mt19937arorc.c mt19937arorc.h example1_SOURCES = example1.c nodist_example1_SOURCES = example1orc.c example1orc.h example2_SOURCES = example2.c nodist_example2_SOURCES = example2orc.c example2orc.h example3_SOURCES = example3.c nodist_example3_SOURCES = example3orc.c example3orc.h mt19937ar_SOURCES = mt19937ar.c nodist_mt19937ar_SOURCES = mt19937arorc.c mt19937arorc.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list example1$(EXEEXT): $(example1_OBJECTS) $(example1_DEPENDENCIES) $(EXTRA_example1_DEPENDENCIES) @rm -f example1$(EXEEXT) $(LINK) $(example1_OBJECTS) $(example1_LDADD) $(LIBS) example2$(EXEEXT): $(example2_OBJECTS) $(example2_DEPENDENCIES) $(EXTRA_example2_DEPENDENCIES) @rm -f example2$(EXEEXT) $(LINK) $(example2_OBJECTS) $(example2_LDADD) $(LIBS) example3$(EXEEXT): $(example3_OBJECTS) $(example3_DEPENDENCIES) $(EXTRA_example3_DEPENDENCIES) @rm -f example3$(EXEEXT) $(LINK) $(example3_OBJECTS) $(example3_LDADD) $(LIBS) mt19937ar$(EXEEXT): $(mt19937ar_OBJECTS) $(mt19937ar_DEPENDENCIES) $(EXTRA_mt19937ar_DEPENDENCIES) @rm -f mt19937ar$(EXEEXT) $(LINK) $(mt19937ar_OBJECTS) $(mt19937ar_LDADD) $(LIBS) volscale$(EXEEXT): $(volscale_OBJECTS) $(volscale_DEPENDENCIES) $(EXTRA_volscale_DEPENDENCIES) @rm -f volscale$(EXEEXT) $(LINK) $(volscale_OBJECTS) $(volscale_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example1orc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example2orc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example3orc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt19937ar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt19937arorc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/volscale.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am example1orc.c: $(srcdir)/example1orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o example1orc.c $(srcdir)/example1orc.orc example1orc.h: $(srcdir)/example1orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o example1orc.h $(srcdir)/example1orc.orc example2orc.c: $(srcdir)/example2orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o example2orc.c $(srcdir)/example2orc.orc example2orc.h: $(srcdir)/example2orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o example2orc.h $(srcdir)/example2orc.orc example3orc.c: $(srcdir)/example3orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o example3orc.c $(srcdir)/example3orc.orc example3orc.h: $(srcdir)/example3orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o example3orc.h $(srcdir)/example3orc.orc mt19937arorc.c: $(srcdir)/mt19937arorc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o mt19937arorc.c $(srcdir)/mt19937arorc.orc mt19937arorc.h: $(srcdir)/mt19937arorc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o mt19937arorc.h $(srcdir)/mt19937arorc.orc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/examples/example2orc.orc0000644000175000017500000000045511551076052014062 00000000000000 .function audio_add_mono_to_stereo_scaled_s16 .dest 4 d1 short .source 4 s1 short .source 2 s2 short .param 2 volume .temp 4 s2_scaled .temp 2 t .temp 4 s2_stereo mulswl s2_scaled, s2, volume shrsl s2_scaled, s2_scaled, 12 convssslw t, s2_scaled mergewl s2_stereo, t, t x2 addssw d1, s1, s2_stereo orc-0.4.18/examples/example3orc.orc0000644000175000017500000000046011551076052014057 00000000000000 .function convert_I420_AYUV .flags 2d .dest 4 d1 .dest 4 d2 .source 1 y1 .source 1 y2 .source 1 u .source 1 v .const 1 c255 255 .temp 2 uv .temp 2 ay .temp 1 tu .temp 1 tv loadupdb tu, u loadupdb tv, v mergebw uv, tu, tv mergebw ay, c255, y1 mergewl d1, ay, uv mergebw ay, c255, y2 mergewl d2, ay, uv orc-0.4.18/examples/example2.c0000664000175000017500000000110212053776470013016 00000000000000#include #include "example2orc.h" #define N 10 short a[N*2]; short b[N]; short c[N*2]; int main (int argc, char *argv[]) { int i; double volume = 0.5; /* Create some data in the source arrays */ for(i=0;i %d,%d\n", i, a[2*i], a[2*i+1], b[i], c[2*i], c[2*i+1]); } return 0; } orc-0.4.18/examples/mt19937ar.c0000664000175000017500000002076412053776470012700 00000000000000/* A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, 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. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) */ #include #include #include #include #include "mt19937arorc.h" /* Period parameters */ #define N 624 #define M 397 #define MATRIX_A 0x9908b0dfUL /* constant vector a */ #define UPPER_MASK 0x80000000UL /* most significant w-r bits */ #define LOWER_MASK 0x7fffffffUL /* least significant r bits */ static unsigned long mt[N]; /* the array for the state vector */ static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ /* initializes mt[N] with a seed */ void init_genrand(unsigned long s) { mt[0]= s & 0xffffffffUL; for (mti=1; mti> 30)) + mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array mt[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ mt[mti] &= 0xffffffffUL; /* for >32 bit machines */ } } /* initialize by an array with array-length */ /* init_key is the array for initializing keys */ /* key_length is its length */ /* slight change for C++, 2004/2/26 */ void init_by_array(orc_uint32 init_key[], int key_length) { int i, j, k; init_genrand(19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for (; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; if (i>=N) { mt[0] = mt[N-1]; i=1; } if (j>=key_length) j=0; } for (k=N-1; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; if (i>=N) { mt[0] = mt[N-1]; i=1; } } mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ } /* generates a random number on [0,0xffffffff]-interval */ unsigned long genrand_int32(void) { unsigned long y; static unsigned long mag01[2]={0x0UL, MATRIX_A}; /* mag01[x] = x * MATRIX_A for x=0,1 */ if (mti >= N) { /* generate N words at one time */ int kk; if (mti == N+1) /* if init_genrand() has not been called, */ init_genrand(5489UL); /* a default initial seed is used */ for (kk=0;kk> 1) ^ mag01[y & 0x1UL]; } for (;kk> 1) ^ mag01[y & 0x1UL]; } y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL]; mti = 0; } y = mt[mti++]; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return y; } /* Orc version */ typedef struct _OrcRandomContext OrcRandomContext; struct _OrcRandomContext { orc_uint32 d[N]; orc_uint32 mt[N+1]; int mti; }; OrcRandomContext * orc_random_context_new (void) { OrcRandomContext *context; context = malloc(sizeof(OrcRandomContext)); memset (context, 0, sizeof(OrcRandomContext)); context->mti = N+1; return context; } void orc_random_init_genrand(OrcRandomContext *context, orc_uint32 s) { orc_uint32 *mt = context->mt; int mti; mt[0] = s; for (mti=1; mti> 30)) + mti); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ } context->mti = mti; } void orc_random_init_by_array (OrcRandomContext *context, orc_uint32 *init_key, int key_length) { int i, j, k; orc_uint32 *mt = context->mt; orc_random_init_genrand (context, 19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for (; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */ i++; j++; if (i>=N) { mt[0] = mt[N-1]; i=1; } if (j>=key_length) j=0; } for (k=N-1; k; k--) { mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */ i++; if (i>=N) { mt[0] = mt[N-1]; i=1; } } mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ } #if 0 /* These are the functions that were converted to Orc code. */ static void mix (orc_uint32 *mt, orc_uint32 *mt2, int n) { orc_uint32 y; int kk; for (kk=0;kk> 1; y ^= t1; mt[kk] = mt2[kk] ^ y; } } static void temper (orc_uint32 *d, orc_uint32 *mt, int n) { orc_uint32 y; int i; for(i=0;i> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); d[i] = y; } } #endif static void update_context (OrcRandomContext *context) { orc_uint32 *d = context->d; orc_uint32 *mt = context->mt; #if 0 mix (mt, mt + M, N-M); mt[N] = mt[0]; mix (mt + N - M, mt, M); temper (d, mt, N); #endif mt19937ar_mix (mt, mt + 1, mt + M, N-M); mt[N] = mt[0]; mt19937ar_mix (mt + N - M, mt + N - M + 1, mt, M); mt19937ar_temper (d, mt, N); #if 0 /* too many temp variables, compiles incorrectly */ mt19937ar_mix_temper (d, mt, mt + 1, mt + M, N-M); mt[N] = mt[0]; mt19937ar_mix_temper (d + N - M, mt + N - M, mt + N - M + 1, mt, M); #endif } orc_uint32 orc_random_genrand_int32 (OrcRandomContext *context) { if (context->mti >= N) { /* generate N words at one time */ if (context->mti == N+1) /* if init_genrand() has not been called, */ orc_random_init_genrand(context, 5489UL); /* a default initial seed is used */ update_context (context); context->mti = 0; } return context->d[context->mti++]; } int main(void) { int i; orc_uint32 init[4]={0x123, 0x234, 0x345, 0x456}; int length=4; orc_uint32 ref, test; OrcRandomContext *context; int error = 0; init_by_array(init, length); context = orc_random_context_new (); orc_random_init_by_array (context, init, length); printf("1000 outputs of genrand_int32()\n"); for (i=0; i<1000; i++) { ref = genrand_int32(); test = orc_random_genrand_int32(context); printf("%08x %08x %c\n", ref, test, (ref == test) ? ' ' : '*'); if (ref != test) error = 1; } if (error) { printf("FAIL\n"); } return 0; } orc-0.4.18/examples/mt19937arorc.orc0000644000175000017500000000235011551076052013721 00000000000000 .function mt19937ar_mix .dest 4 mt .source 4 mt1 .source 4 mt2 .temp 4 y .temp 4 t1 .temp 4 t2 .const 4 c1 1 .const 4 UPPER_MASK 0x80000000 .const 4 LOWER_MASK 0x7fffffff .const 4 MATRIX_A 0x9908b0df loadl t1, mt andl t1, t1, UPPER_MASK loadl t2, mt1 andl t2, t2, LOWER_MASK orl y, t1, t2 andl t1, y, c1 cmpeql t1, t1, c1 andl t1, t1, MATRIX_A shrul y, y, c1 xorl y, y, t1 xorl mt, mt2, y .function mt19937ar_temper .dest 4 d .source 4 s .temp 4 y .temp 4 t loadl y, s shrul t, y, 11 xorl y, y, t shll t, y, 7 andl t, t, 0x9d2c5680 xorl y, y, t shll t, y, 15 andl t, t, 0xefc60000 xorl y, y, t shrul t, y, 18 xorl d, y, t #.function mt19937ar_mix_temper #.dest 4 d #.dest 4 mt #.source 4 mt1 #.source 4 mt2 #.temp 4 y #.temp 4 t1 #.temp 4 t2 #.const 4 c1 1 #.const 4 UPPER_MASK 0x80000000 #.const 4 LOWER_MASK 0x7fffffff #.const 4 MATRIX_A 0x9908b0df # # #loadl t1, mt #andl t1, t1, UPPER_MASK #loadl t2, mt1 #andl t2, t2, LOWER_MASK #orl y, t1, t2 #andl t1, y, c1 #cmpeql t1, t1, c1 #andl t1, t1, MATRIX_A #shrul y, y, c1 #xorl y, y, t1 #xorl y, mt2, y #storel mt, y #shrul t1, y, 11 #xorl y, y, t1 #shll t1, y, 7 #andl t1, t1, 0x9d2c5680 #xorl y, y, t1 #shll t1, y, 15 #andl t1, t1, 0xefc60000 #xorl y, y, t1 #shrul t1, y, 18 #xorl d, y, t1 orc-0.4.18/examples/Makefile.am0000644000175000017500000000372511551076052013173 00000000000000 noinst_PROGRAMS = if CROSS_COMPILING else noinst_PROGRAMS += example1 example2 example3 mt19937ar BUILT_SOURCES = example1orc.c example1orc.h \ example2orc.c example2orc.h \ example3orc.c example3orc.h \ mt19937arorc.c mt19937arorc.h endif if ENABLE_BACKEND_MMX noinst_PROGRAMS += volscale endif AM_LDFLAGS = $(ORC_LIBS) AM_CFLAGS = $(ORC_CFLAGS) EXTRA_DIST = example1orc.orc example2orc.orc example3orc.orc mt19937arorc.orc CLEANFILES = example1orc.c example1orc.h \ example2orc.c example2orc.h \ example3orc.c example3orc.h \ mt19937arorc.c mt19937arorc.h example1_SOURCES = example1.c nodist_example1_SOURCES = example1orc.c example1orc.h example2_SOURCES = example2.c nodist_example2_SOURCES = example2orc.c example2orc.h example3_SOURCES = example3.c nodist_example3_SOURCES = example3orc.c example3orc.h mt19937ar_SOURCES = mt19937ar.c nodist_mt19937ar_SOURCES = mt19937arorc.c mt19937arorc.h example1orc.c: $(srcdir)/example1orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o example1orc.c $(srcdir)/example1orc.orc example1orc.h: $(srcdir)/example1orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o example1orc.h $(srcdir)/example1orc.orc example2orc.c: $(srcdir)/example2orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o example2orc.c $(srcdir)/example2orc.orc example2orc.h: $(srcdir)/example2orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o example2orc.h $(srcdir)/example2orc.orc example3orc.c: $(srcdir)/example3orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o example3orc.c $(srcdir)/example3orc.orc example3orc.h: $(srcdir)/example3orc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o example3orc.h $(srcdir)/example3orc.orc mt19937arorc.c: $(srcdir)/mt19937arorc.orc $(top_builddir)/tools/orcc$(EXEEXT) --implementation -o mt19937arorc.c $(srcdir)/mt19937arorc.orc mt19937arorc.h: $(srcdir)/mt19937arorc.orc $(top_builddir)/tools/orcc$(EXEEXT) --header -o mt19937arorc.h $(srcdir)/mt19937arorc.orc orc-0.4.18/examples/example1.c0000664000175000017500000000066612053776470013033 00000000000000#include #include "example1orc.h" #define N 10 short a[N]; short b[N]; short c[N]; int main (int argc, char *argv[]) { int i; /* Create some data in the source arrays */ for(i=0;i %d\n", i, a[i], b[i], c[i]); } return 0; } orc-0.4.18/examples/example1orc.orc0000644000175000017500000000014411551076052014054 00000000000000 .function audio_add_s16 .dest 2 d1 short .source 2 s1 short .source 2 s2 short addssw d1, s1, s2 orc-0.4.18/examples/volscale.c0000664000175000017500000001526412111024531013102 00000000000000 #include #ifndef _MSC_VER #include #endif #define ORC_ENABLE_UNSTABLE_API #include #include #include static OrcProgram *p = NULL; static void mmx_rule_mulhslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int tmp1 = X86_MM4; int tmp2 = X86_MM5; int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); if (dest != src1) { orc_mmx_emit_movq (p, src1, dest); } orc_mmx_emit_pxor (p, tmp1, tmp1); /* .. | 0 | 0 | */ orc_mmx_emit_punpcklwd (p, tmp1, src2); /* .. | 0 | p0 | */ orc_mmx_emit_pcmpgtw (p, dest, tmp1); /* .. | 0 | s(vl) | */ orc_mmx_emit_pand (p, src2, tmp1); /* .. | 0 | (p0) | (vl >> 15) & p */ orc_mmx_emit_movq (p, src2, tmp2); orc_mmx_emit_pmulhw (p, src1, src2); /* .. | 0 | vl*p0 | */ orc_mmx_emit_paddw (p, tmp1, src2); /* .. | 0 | vl*p0 | + sign correct */ orc_mmx_emit_psrld_imm (p, 16, dest); /* .. | 0 | vh | */ orc_mmx_emit_pmaddwd (p, tmp2, dest); /* .. | p0 * vh | */ orc_mmx_emit_paddd (p, src2, dest); /* .. | p0 * v0 | */ } static void sse_rule_mulhslw (OrcCompiler *p, void *user, OrcInstruction *insn) { int tmp1 = X86_XMM4; int tmp2 = X86_XMM5; int src1 = ORC_SRC_ARG (p, insn, 0); int src2 = ORC_SRC_ARG (p, insn, 1); int dest = ORC_DEST_ARG (p, insn, 0); if (dest != src1) { orc_sse_emit_movdqa (p, src1, dest); } orc_sse_emit_pxor (p, tmp1, tmp1); /* .. | 0 | 0 | */ orc_sse_emit_punpcklwd (p, tmp1, src2); /* .. | 0 | p0 | */ orc_sse_emit_pcmpgtw (p, dest, tmp1); /* .. | 0 | s(vl) | */ orc_sse_emit_pand (p, src2, tmp1); /* .. | 0 | (p0) | (vl >> 15) & p */ orc_sse_emit_movdqa (p, src2, tmp2); orc_sse_emit_pmulhw (p, src1, src2); /* .. | 0 | vl*p0 | */ orc_sse_emit_paddw (p, tmp1, src2); /* .. | 0 | vl*p0 | + sign correct */ orc_sse_emit_psrld_imm (p, 16, dest); /* .. | 0 | vh | */ orc_sse_emit_pmaddwd (p, tmp2, dest); /* .. | p0 * vh | */ orc_sse_emit_paddd (p, src2, dest); /* .. | p0 * v0 | */ } static void mmx_register_rules (void) { OrcRuleSet *rule_set; rule_set = orc_rule_set_new (orc_opcode_set_get("pulse"), orc_target_get_by_name ("mmx"), ORC_TARGET_MMX_MMX); orc_rule_register (rule_set, "mulhslw", mmx_rule_mulhslw, NULL); } static void sse_register_rules (void) { OrcRuleSet *rule_set; rule_set = orc_rule_set_new (orc_opcode_set_get("pulse"), orc_target_get_by_name ("sse"), ORC_TARGET_SSE_SSE2); orc_rule_register (rule_set, "mulhslw", sse_rule_mulhslw, NULL); } /* calculate the high 32 bits of a 32x16 signed multiply */ static void emulate_mulhslw (OrcOpcodeExecutor *ex, int offset, int n) { int i; orc_union32 * ptr0; const orc_union32 * ptr4; const orc_int16 * ptr5; orc_union32 var32; orc_int16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->dest_ptrs[0]; ptr4 = (orc_union32 *)ex->src_ptrs[0]; ptr5 = (orc_int16 *)ex->src_ptrs[1]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: mulsbw */ var34.i = (var32.i * var33)>>16; /* 3: storew */ ptr0[i] = var34; } } static OrcStaticOpcode opcodes[] = { { "mulhslw", 0, { 4 }, { 4, 2 }, emulate_mulhslw }, { "" } }; static void register_instr (void) { orc_opcode_register_static (opcodes, "pulse"); mmx_register_rules (); sse_register_rules (); } static void do_volume_c (orc_int16 *dest, const orc_int32 *vols, const orc_int16 *samp, int len) { int i; for (i = 0; i < len; i++) { orc_int32 t, hi, lo; hi = vols[i] >> 16; lo = vols[i] & 0xffff; t = (orc_int32)(samp[i]); t = ((t * lo) >> 16) + (t * hi); dest[i] = (orc_int16) ORC_CLAMP (t, -0x8000, 0x7FFF); } } static void do_volume_backup (OrcExecutor *ex) { orc_int16 *dest; orc_int32 *vols; const orc_int16 *samp; int len; dest = ex->arrays[ORC_VAR_D1]; vols = ex->arrays[ORC_VAR_S1]; samp = ex->arrays[ORC_VAR_S2]; len = ex->n; do_volume_c (dest, vols, samp, len); } static void make_volume_orc() { OrcCompileResult res; /* int16 destination samples that get scaled by int32 volumes */ p = orc_program_new (); orc_program_set_backup_function (p, do_volume_backup); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 2, "s2"); /* a temporary for the upscaled input samples */ orc_program_add_temporary (p, 4, "t1"); /* multiply with the volume, keeping only the high 32bits */ orc_program_append (p, "mulhslw", ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2); /* pack an saturate do 16 bits again */ orc_program_append_ds (p, "convssslw", ORC_VAR_D1, ORC_VAR_T1); /* Compile the program */ res = orc_program_compile (p); fprintf (stderr, "result: %d\n", res); if (res == ORC_COMPILE_RESULT_OK) fprintf (stderr, "%s\n", orc_program_get_asm_code (p)); } static void do_volume_orc (orc_int16 *dest, orc_int32 *volumes, orc_int16 *samp, int length) { OrcExecutor _ex; OrcExecutor *ex = &_ex; /* Set the values on the executor structure */ orc_executor_set_program (ex, p); orc_executor_set_n (ex, length); orc_executor_set_array (ex, ORC_VAR_D1, dest); orc_executor_set_array (ex, ORC_VAR_S1, volumes); orc_executor_set_array (ex, ORC_VAR_S2, samp); /* Run the program. This calls the code that was generated above, * or, if the compilation failed, will emulate the program. */ orc_executor_run (ex); } static orc_uint64 get_timestamp () { #ifndef _MSC_VER struct timeval now; gettimeofday (&now, NULL); return now.tv_sec * 1000000LL + now.tv_usec; #else return 0; #endif } #define TIMES 100000 #define N 1024 orc_int16 dest[N]; orc_int16 samp[N]; orc_int32 vols[N]; int main (int argc, char *argv[]) { int i; orc_uint64 start, stop; /* orc_init() must be called before any other Orc function */ orc_init (); orc_debug_set_level (ORC_DEBUG_LOG); register_instr (); make_volume_orc(); orc_debug_set_level (ORC_DEBUG_NONE); /* Create some data in the source arrays */ for(i=0;i %d\n", i, samp[i], dest[i]); } return 0; } orc-0.4.18/autogen.sh0000775000175000017500000000022212057245266011320 00000000000000#!/bin/sh if [ `whoami` = ds ] ; then confargs="$confargs --enable-gtk-doc" fi autoreconf -i -f && ./configure --disable-static $confargs $@ orc-0.4.18/README0000664000175000017500000000771212206165241010200 00000000000000 ORC - The Oil Runtime Compiler ============================== (and OIL stands for Optimized Inner Loops) Entropy Wave Inc (http://entropywave.com/) presents Orc, the sucessor to Liboil - The Library of Optimized Inner Loops. Orc is a library and set of tools for compiling and executing very simple programs that operate on arrays of data. The "language" is a generic assembly language that represents many of the features available in SIMD architectures, including saturated addition and subtraction, and many arithmetic operations. At this point, developers interested in using Orc should look at the examples and try out a few Orc programs in an experimental branch of their own projects. And provide feedback on how it works. There will likely be some major changes in ease of use from a developer's perspective over the next few releases. The 0.4 series of Orc releases will be API and ABI compatible, and will be incompatible with the 0.5 series when it comes out. The first release of the 0.5 series is anticipated to coincide with the release of GStreamer 1.0. Features: - Users can create, compile, and run simple programs that use the vector extensions of the CPU, all directly from an application. - Users can compile Orc programs to assembly source code to be compiled and used without linking against the Orc library. - The generic assembly language can be extended by an application by adding new opcodes. - An application can add rules for converting existing or new opcodes to binary code for a specific target. - Current targets: SSE, MMX, MIPS, Altivec, NEON, and TI C64x+. (The c64x target only produces source code.) - Programs can optionally be emulated, which is useful for testing, or if no rules are available to convert Orc opcodes to executable code. More information: Web: http://code.entropywave.com/projects/orc/ Download: http://code.entropywave.com/download/orc/ Questions and Answers: - Q: Why not let gcc vectorize my code? A: Two reasons: first, since Orc's assembly language is much more restrictive than C, Orc can generate better code than gcc, and second, Orc can generate code for functions you define at runtime. Many algorithms require gluing together several stages of operations, and if each stage has several options, the total amount of code to cover all combinations could be inconveniently large. - Q: Why not use compiler intrinsics for SIMD code? A: Compiler intrinsics only work for one target, and need to be hand written. Plus, some compilers are very picky about source code that uses intrinsics, and will silently produce slow code. And, of course, you can't compile intrinsics at runtime. - Q: How big is the Orc library? A: For embedded users, the --enable-backend configure option can be used to disable irrelvant targets. Compiled with only one target (SSE), the library size is about 150 kB uncompressed, or 48 kB compressed. The goal was to keep the uncompressed size under about 100 kB (but that failed!). A typical build with all targets and the full ABI is around 350 kB. Caveats (Known Bugs): - ? Future directions: - Addition of more complex loop control and array structures. - Addition of an option to compile the Orc library with only the runtime features for a single target, e.g., for embedded systems. - Addition of rewrite rules, which convert an instruction that cannot be converted to binary code into a series of instructions that can. This is necessary since assembly instructions on most targets do not cover all the features of the Orc assembly language. About Entropy Wave: Entropy Wave creates tools that allow content producers and distributors use open video technology. Through use of open source software like GStreamer and Dirac, Entropy Wave's customers save money on licensing costs for encoding and streaming video on the web. Entropy Wave was founded in 2008 by long-time open source developer David Schleef. orc-0.4.18/testsuite/0000775000175000017500000000000012206165374011431 500000000000000orc-0.4.18/testsuite/exec_opcodes_sys.c0000664000175000017500000002572312177015514015061 00000000000000 #include "config.h" #include #include #include int error = FALSE; int verbose = FALSE; void test_opcode_src (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); void test_opcode_inplace (OrcStaticOpcode *opcode); void test_opcode_src_2d (OrcStaticOpcode *opcode); void test_opcode_src_const_n (OrcStaticOpcode *opcode); void test_opcode_src_const_n_2d (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_test_init(); orc_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ if (verbose) printf("%s src %d,%d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].dest_size[1], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_src (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ if (verbose) printf("%s const %d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_const (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ if (verbose) printf("%s param %d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_param (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ if (verbose) printf("%s inplace %d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_inplace (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ if (verbose) printf("%s src 2d %d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_src_2d (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ if (verbose) printf("%s src const n %d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_src_const_n (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ if (verbose) printf("%s src const n 2d %d,%d,%d\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_src_const_n_2d (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode_src (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; int args[4] = { -1, -1, -1, -1 }; int n_args = 0; if (opcode->src_size[1] == 0) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_constant (p, opcode->src_size[1], 1, "c1"); if (opcode->src_size[2]) { args[n_args++] = orc_program_add_constant (p, opcode->src_size[2], 1, "c2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_const_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; int args[4] = { -1, -1, -1, -1 }; int n_args = 0; if (opcode->src_size[1] == 0) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_parameter (p, opcode->src_size[1], "p1"); if (opcode->src_size[2]) { args[n_args++] = orc_program_add_parameter (p, opcode->src_size[2], "p2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_p_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } void test_opcode_inplace (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->dest_size[0] != opcode->src_size[0]) return; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR || opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { return; } p = orc_program_new (); orc_program_add_destination (p, opcode->dest_size[0], "d1"); if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[0], "s2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_inplace_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_str (p, opcode->name, "d1", "d1", "s2"); ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } void test_opcode_src_2d (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); orc_program_set_2d (p); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } void test_opcode_src_const_n (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); orc_program_set_constant_n (p, 8); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } void test_opcode_src_const_n_2d (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); orc_program_set_2d (p); orc_program_set_constant_n (p, 8); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("test failed\n"); error = TRUE; } orc_program_free (p); } orc-0.4.18/testsuite/abi.c0000664000175000017500000000102612057245267012253 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include int main (int argc, char *argv[]) { long offset; int expected_offset; int error = 0; offset = ORC_STRUCT_OFFSET (OrcProgram, code_exec); if (sizeof(void *) == 4) { expected_offset = 8360; } else { expected_offset = 9688; } if (offset != expected_offset) { printf("ABI bug: OrcProgram->code_exec should be at offset %ld instead of %d\n", offset, expected_offset); error = 1; } return error; } orc-0.4.18/testsuite/bytecode_parse.c0000664000175000017500000000342012057245267014510 00000000000000 #define ORC_ENABLE_UNSTABLE_API #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; int j; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } if (filename == NULL) { filename = getenv ("testfile"); } if (filename == NULL) { filename = "test.orc"; } code = read_file (filename); if (!code) { printf("compile_parse_test \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;iname); bytecode = orc_bytecode_from_program (programs[i]); for(j=0;jlength;j++) { printf("%d, ", bytecode->bytecode[j]); } printf("\n"); } if (error) return 1; return 0; } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } orc-0.4.18/testsuite/generate_xml_table.c0000664000175000017500000000553112177015514015337 00000000000000 #include "config.h" #include #include #include #include int error = FALSE; char * test_opcode (OrcStaticOpcode *opcode, OrcTarget *target, unsigned int target_flags); int main (int argc, char *argv[]) { int i; int j; OrcOpcodeSet *opcode_set; OrcTarget *targets[10]; unsigned int target_flags[10]; int n_targets = 0; orc_init(); orc_test_init(); targets[n_targets] = orc_target_get_by_name("sse"); target_flags[n_targets] = orc_target_get_default_flags(targets[n_targets]); n_targets++; targets[n_targets] = orc_target_get_by_name("mmx"); target_flags[n_targets] = orc_target_get_default_flags(targets[n_targets]); n_targets++; targets[n_targets] = orc_target_get_by_name("altivec"); target_flags[n_targets] = orc_target_get_default_flags(targets[n_targets]); n_targets++; /* disabled due to bad coverage targets[n_targets] = orc_target_get_by_name("arm"); target_flags[n_targets] = orc_target_get_default_flags(targets[n_targets]); n_targets++; */ targets[n_targets] = orc_target_get_by_name("neon"); target_flags[n_targets] = orc_target_get_default_flags(targets[n_targets]); n_targets++; targets[n_targets] = orc_target_get_by_name("c64x-c"); target_flags[n_targets] = orc_target_get_default_flags(targets[n_targets]); n_targets++; printf( "\n" "\n" "Table of Opcode Rule Coverage\n" "\n" "\n" "\n" "opcode name\n", n_targets+1); for(j=0;j%s\n", orc_target_get_name(targets[j])); } printf( "\n" "\n" "\n"); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("\n"); printf("%s\n", opcode_set->opcodes[i].name); for(j=0;j%s\n", test_opcode (opcode_set->opcodes + i, targets[j], target_flags[j])); } printf("\n"); } printf( "\n" "\n" "
\n"); return 0; } char * test_opcode (OrcStaticOpcode *opcode, OrcTarget *target, unsigned int target_flags) { OrcProgram *p; OrcCompileResult ret; p = orc_test_get_program_for_opcode (opcode); if (p) { ret = orc_program_compile_full (p, target, target_flags); orc_program_free (p); if (ORC_COMPILE_RESULT_IS_SUCCESSFUL(ret)) { return "yes"; } } p = orc_test_get_program_for_opcode_const (opcode); if (p) { ret = orc_program_compile_full (p, target, target_flags); orc_program_free (p); if (ORC_COMPILE_RESULT_IS_SUCCESSFUL(ret)) { return "yes"; } } return "no"; } orc-0.4.18/testsuite/compile_opcodes_sys_neon.c0000664000175000017500000000452712057245267016612 00000000000000 #include "config.h" #include #include #include #include int error = FALSE; void test_opcode (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_init(); orc_test_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("/* %s %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("/* %s const %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_const (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("/* %s param %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_param (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode (opcode); if (!p) return; ret = orc_test_gcc_compile_neon (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_const (opcode); if (!p) return; ret = orc_test_gcc_compile_neon (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_param (opcode); if (!p) return; ret = orc_test_gcc_compile_neon (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } orc-0.4.18/testsuite/Makefile.in0000664000175000017500000010707512206165330013420 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test_accsadubl$(EXEEXT) test-schro$(EXEEXT) \ exec_opcodes_sys$(EXEEXT) exec_parse$(EXEEXT) \ perf_opcodes_sys$(EXEEXT) perf_parse$(EXEEXT) \ memcpy_speed$(EXEEXT) abi$(EXEEXT) noinst_PROGRAMS = $(am__EXEEXT_1) generate_xml_table$(EXEEXT) \ generate_xml_table2$(EXEEXT) generate_opcodes_sys$(EXEEXT) \ compile_parse$(EXEEXT) compile_parse_c$(EXEEXT) \ memcpy_speed$(EXEEXT) perf_opcodes_sys_compare$(EXEEXT) \ perf_parse_compare$(EXEEXT) exec_parse$(EXEEXT) \ bytecode_parse$(EXEEXT) compile_opcodes_sys_c$(EXEEXT) \ compile_opcodes_sys$(EXEEXT) show_parse$(EXEEXT) \ $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) @ENABLE_BACKEND_NEON_TRUE@am__append_1 = compile_opcodes_sys_neon \ @ENABLE_BACKEND_NEON_TRUE@ compile_parse_neon @ENABLE_BACKEND_C64X_TRUE@am__append_2 = compile_opcodes_sys_c64x @ENABLE_BACKEND_MIPS_TRUE@am__append_3 = compile_opcodes_sys_mips subdir = testsuite DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test_accsadubl$(EXEEXT) test-schro$(EXEEXT) \ exec_opcodes_sys$(EXEEXT) exec_parse$(EXEEXT) \ perf_opcodes_sys$(EXEEXT) perf_parse$(EXEEXT) \ memcpy_speed$(EXEEXT) abi$(EXEEXT) @ENABLE_BACKEND_NEON_TRUE@am__EXEEXT_2 = \ @ENABLE_BACKEND_NEON_TRUE@ compile_opcodes_sys_neon$(EXEEXT) \ @ENABLE_BACKEND_NEON_TRUE@ compile_parse_neon$(EXEEXT) @ENABLE_BACKEND_C64X_TRUE@am__EXEEXT_3 = \ @ENABLE_BACKEND_C64X_TRUE@ compile_opcodes_sys_c64x$(EXEEXT) @ENABLE_BACKEND_MIPS_TRUE@am__EXEEXT_4 = \ @ENABLE_BACKEND_MIPS_TRUE@ compile_opcodes_sys_mips$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) abi_SOURCES = abi.c abi_OBJECTS = abi.$(OBJEXT) abi_LDADD = $(LDADD) bytecode_parse_SOURCES = bytecode_parse.c bytecode_parse_OBJECTS = bytecode_parse.$(OBJEXT) bytecode_parse_LDADD = $(LDADD) compile_opcodes_sys_SOURCES = compile_opcodes_sys.c compile_opcodes_sys_OBJECTS = compile_opcodes_sys.$(OBJEXT) compile_opcodes_sys_LDADD = $(LDADD) compile_opcodes_sys_c_SOURCES = compile_opcodes_sys_c.c compile_opcodes_sys_c_OBJECTS = compile_opcodes_sys_c.$(OBJEXT) compile_opcodes_sys_c_LDADD = $(LDADD) compile_opcodes_sys_c64x_SOURCES = compile_opcodes_sys_c64x.c compile_opcodes_sys_c64x_OBJECTS = compile_opcodes_sys_c64x.$(OBJEXT) compile_opcodes_sys_c64x_LDADD = $(LDADD) compile_opcodes_sys_mips_SOURCES = compile_opcodes_sys_mips.c compile_opcodes_sys_mips_OBJECTS = compile_opcodes_sys_mips.$(OBJEXT) compile_opcodes_sys_mips_LDADD = $(LDADD) compile_opcodes_sys_neon_SOURCES = compile_opcodes_sys_neon.c compile_opcodes_sys_neon_OBJECTS = compile_opcodes_sys_neon.$(OBJEXT) compile_opcodes_sys_neon_LDADD = $(LDADD) compile_parse_SOURCES = compile_parse.c compile_parse_OBJECTS = compile_parse.$(OBJEXT) compile_parse_LDADD = $(LDADD) compile_parse_c_SOURCES = compile_parse_c.c compile_parse_c_OBJECTS = compile_parse_c.$(OBJEXT) compile_parse_c_LDADD = $(LDADD) compile_parse_neon_SOURCES = compile_parse_neon.c compile_parse_neon_OBJECTS = compile_parse_neon.$(OBJEXT) compile_parse_neon_LDADD = $(LDADD) exec_opcodes_sys_SOURCES = exec_opcodes_sys.c exec_opcodes_sys_OBJECTS = exec_opcodes_sys.$(OBJEXT) exec_opcodes_sys_LDADD = $(LDADD) exec_parse_SOURCES = exec_parse.c exec_parse_OBJECTS = exec_parse.$(OBJEXT) exec_parse_LDADD = $(LDADD) generate_opcodes_sys_SOURCES = generate_opcodes_sys.c generate_opcodes_sys_OBJECTS = generate_opcodes_sys.$(OBJEXT) generate_opcodes_sys_LDADD = $(LDADD) generate_xml_table_SOURCES = generate_xml_table.c generate_xml_table_OBJECTS = generate_xml_table.$(OBJEXT) generate_xml_table_LDADD = $(LDADD) generate_xml_table2_SOURCES = generate_xml_table2.c generate_xml_table2_OBJECTS = generate_xml_table2.$(OBJEXT) generate_xml_table2_LDADD = $(LDADD) memcpy_speed_SOURCES = memcpy_speed.c memcpy_speed_OBJECTS = memcpy_speed.$(OBJEXT) memcpy_speed_LDADD = $(LDADD) perf_opcodes_sys_SOURCES = perf_opcodes_sys.c perf_opcodes_sys_OBJECTS = perf_opcodes_sys.$(OBJEXT) perf_opcodes_sys_LDADD = $(LDADD) perf_opcodes_sys_compare_SOURCES = perf_opcodes_sys_compare.c perf_opcodes_sys_compare_OBJECTS = perf_opcodes_sys_compare.$(OBJEXT) perf_opcodes_sys_compare_LDADD = $(LDADD) perf_parse_SOURCES = perf_parse.c perf_parse_OBJECTS = perf_parse.$(OBJEXT) perf_parse_LDADD = $(LDADD) perf_parse_compare_SOURCES = perf_parse_compare.c perf_parse_compare_OBJECTS = perf_parse_compare.$(OBJEXT) perf_parse_compare_LDADD = $(LDADD) show_parse_SOURCES = show_parse.c show_parse_OBJECTS = show_parse.$(OBJEXT) show_parse_LDADD = $(LDADD) test_schro_SOURCES = test-schro.c test_schro_OBJECTS = test-schro.$(OBJEXT) test_schro_LDADD = $(LDADD) test_accsadubl_SOURCES = test_accsadubl.c test_accsadubl_OBJECTS = test_accsadubl.$(OBJEXT) test_accsadubl_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = abi.c bytecode_parse.c compile_opcodes_sys.c \ compile_opcodes_sys_c.c compile_opcodes_sys_c64x.c \ compile_opcodes_sys_mips.c compile_opcodes_sys_neon.c \ compile_parse.c compile_parse_c.c compile_parse_neon.c \ exec_opcodes_sys.c exec_parse.c generate_opcodes_sys.c \ generate_xml_table.c generate_xml_table2.c memcpy_speed.c \ perf_opcodes_sys.c perf_opcodes_sys_compare.c perf_parse.c \ perf_parse_compare.c show_parse.c test-schro.c \ test_accsadubl.c DIST_SOURCES = abi.c bytecode_parse.c compile_opcodes_sys.c \ compile_opcodes_sys_c.c compile_opcodes_sys_c64x.c \ compile_opcodes_sys_mips.c compile_opcodes_sys_neon.c \ compile_parse.c compile_parse_c.c compile_parse_neon.c \ exec_opcodes_sys.c exec_parse.c generate_opcodes_sys.c \ generate_xml_table.c generate_xml_table2.c memcpy_speed.c \ perf_opcodes_sys.c perf_opcodes_sys_compare.c perf_parse.c \ perf_parse_compare.c show_parse.c test-schro.c \ test_accsadubl.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DIST_SUBDIRS = orcc benchmorc SUBDIRS = orcc benchmorc TESTS_ENVIRONMENT = \ testfile="$(srcdir)/test.orc" EXTRA_DIST = test.orc CLEANFILES = temp-orc-test-* AM_CFLAGS = $(ORC_CFLAGS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu testsuite/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list abi$(EXEEXT): $(abi_OBJECTS) $(abi_DEPENDENCIES) $(EXTRA_abi_DEPENDENCIES) @rm -f abi$(EXEEXT) $(LINK) $(abi_OBJECTS) $(abi_LDADD) $(LIBS) bytecode_parse$(EXEEXT): $(bytecode_parse_OBJECTS) $(bytecode_parse_DEPENDENCIES) $(EXTRA_bytecode_parse_DEPENDENCIES) @rm -f bytecode_parse$(EXEEXT) $(LINK) $(bytecode_parse_OBJECTS) $(bytecode_parse_LDADD) $(LIBS) compile_opcodes_sys$(EXEEXT): $(compile_opcodes_sys_OBJECTS) $(compile_opcodes_sys_DEPENDENCIES) $(EXTRA_compile_opcodes_sys_DEPENDENCIES) @rm -f compile_opcodes_sys$(EXEEXT) $(LINK) $(compile_opcodes_sys_OBJECTS) $(compile_opcodes_sys_LDADD) $(LIBS) compile_opcodes_sys_c$(EXEEXT): $(compile_opcodes_sys_c_OBJECTS) $(compile_opcodes_sys_c_DEPENDENCIES) $(EXTRA_compile_opcodes_sys_c_DEPENDENCIES) @rm -f compile_opcodes_sys_c$(EXEEXT) $(LINK) $(compile_opcodes_sys_c_OBJECTS) $(compile_opcodes_sys_c_LDADD) $(LIBS) compile_opcodes_sys_c64x$(EXEEXT): $(compile_opcodes_sys_c64x_OBJECTS) $(compile_opcodes_sys_c64x_DEPENDENCIES) $(EXTRA_compile_opcodes_sys_c64x_DEPENDENCIES) @rm -f compile_opcodes_sys_c64x$(EXEEXT) $(LINK) $(compile_opcodes_sys_c64x_OBJECTS) $(compile_opcodes_sys_c64x_LDADD) $(LIBS) compile_opcodes_sys_mips$(EXEEXT): $(compile_opcodes_sys_mips_OBJECTS) $(compile_opcodes_sys_mips_DEPENDENCIES) $(EXTRA_compile_opcodes_sys_mips_DEPENDENCIES) @rm -f compile_opcodes_sys_mips$(EXEEXT) $(LINK) $(compile_opcodes_sys_mips_OBJECTS) $(compile_opcodes_sys_mips_LDADD) $(LIBS) compile_opcodes_sys_neon$(EXEEXT): $(compile_opcodes_sys_neon_OBJECTS) $(compile_opcodes_sys_neon_DEPENDENCIES) $(EXTRA_compile_opcodes_sys_neon_DEPENDENCIES) @rm -f compile_opcodes_sys_neon$(EXEEXT) $(LINK) $(compile_opcodes_sys_neon_OBJECTS) $(compile_opcodes_sys_neon_LDADD) $(LIBS) compile_parse$(EXEEXT): $(compile_parse_OBJECTS) $(compile_parse_DEPENDENCIES) $(EXTRA_compile_parse_DEPENDENCIES) @rm -f compile_parse$(EXEEXT) $(LINK) $(compile_parse_OBJECTS) $(compile_parse_LDADD) $(LIBS) compile_parse_c$(EXEEXT): $(compile_parse_c_OBJECTS) $(compile_parse_c_DEPENDENCIES) $(EXTRA_compile_parse_c_DEPENDENCIES) @rm -f compile_parse_c$(EXEEXT) $(LINK) $(compile_parse_c_OBJECTS) $(compile_parse_c_LDADD) $(LIBS) compile_parse_neon$(EXEEXT): $(compile_parse_neon_OBJECTS) $(compile_parse_neon_DEPENDENCIES) $(EXTRA_compile_parse_neon_DEPENDENCIES) @rm -f compile_parse_neon$(EXEEXT) $(LINK) $(compile_parse_neon_OBJECTS) $(compile_parse_neon_LDADD) $(LIBS) exec_opcodes_sys$(EXEEXT): $(exec_opcodes_sys_OBJECTS) $(exec_opcodes_sys_DEPENDENCIES) $(EXTRA_exec_opcodes_sys_DEPENDENCIES) @rm -f exec_opcodes_sys$(EXEEXT) $(LINK) $(exec_opcodes_sys_OBJECTS) $(exec_opcodes_sys_LDADD) $(LIBS) exec_parse$(EXEEXT): $(exec_parse_OBJECTS) $(exec_parse_DEPENDENCIES) $(EXTRA_exec_parse_DEPENDENCIES) @rm -f exec_parse$(EXEEXT) $(LINK) $(exec_parse_OBJECTS) $(exec_parse_LDADD) $(LIBS) generate_opcodes_sys$(EXEEXT): $(generate_opcodes_sys_OBJECTS) $(generate_opcodes_sys_DEPENDENCIES) $(EXTRA_generate_opcodes_sys_DEPENDENCIES) @rm -f generate_opcodes_sys$(EXEEXT) $(LINK) $(generate_opcodes_sys_OBJECTS) $(generate_opcodes_sys_LDADD) $(LIBS) generate_xml_table$(EXEEXT): $(generate_xml_table_OBJECTS) $(generate_xml_table_DEPENDENCIES) $(EXTRA_generate_xml_table_DEPENDENCIES) @rm -f generate_xml_table$(EXEEXT) $(LINK) $(generate_xml_table_OBJECTS) $(generate_xml_table_LDADD) $(LIBS) generate_xml_table2$(EXEEXT): $(generate_xml_table2_OBJECTS) $(generate_xml_table2_DEPENDENCIES) $(EXTRA_generate_xml_table2_DEPENDENCIES) @rm -f generate_xml_table2$(EXEEXT) $(LINK) $(generate_xml_table2_OBJECTS) $(generate_xml_table2_LDADD) $(LIBS) memcpy_speed$(EXEEXT): $(memcpy_speed_OBJECTS) $(memcpy_speed_DEPENDENCIES) $(EXTRA_memcpy_speed_DEPENDENCIES) @rm -f memcpy_speed$(EXEEXT) $(LINK) $(memcpy_speed_OBJECTS) $(memcpy_speed_LDADD) $(LIBS) perf_opcodes_sys$(EXEEXT): $(perf_opcodes_sys_OBJECTS) $(perf_opcodes_sys_DEPENDENCIES) $(EXTRA_perf_opcodes_sys_DEPENDENCIES) @rm -f perf_opcodes_sys$(EXEEXT) $(LINK) $(perf_opcodes_sys_OBJECTS) $(perf_opcodes_sys_LDADD) $(LIBS) perf_opcodes_sys_compare$(EXEEXT): $(perf_opcodes_sys_compare_OBJECTS) $(perf_opcodes_sys_compare_DEPENDENCIES) $(EXTRA_perf_opcodes_sys_compare_DEPENDENCIES) @rm -f perf_opcodes_sys_compare$(EXEEXT) $(LINK) $(perf_opcodes_sys_compare_OBJECTS) $(perf_opcodes_sys_compare_LDADD) $(LIBS) perf_parse$(EXEEXT): $(perf_parse_OBJECTS) $(perf_parse_DEPENDENCIES) $(EXTRA_perf_parse_DEPENDENCIES) @rm -f perf_parse$(EXEEXT) $(LINK) $(perf_parse_OBJECTS) $(perf_parse_LDADD) $(LIBS) perf_parse_compare$(EXEEXT): $(perf_parse_compare_OBJECTS) $(perf_parse_compare_DEPENDENCIES) $(EXTRA_perf_parse_compare_DEPENDENCIES) @rm -f perf_parse_compare$(EXEEXT) $(LINK) $(perf_parse_compare_OBJECTS) $(perf_parse_compare_LDADD) $(LIBS) show_parse$(EXEEXT): $(show_parse_OBJECTS) $(show_parse_DEPENDENCIES) $(EXTRA_show_parse_DEPENDENCIES) @rm -f show_parse$(EXEEXT) $(LINK) $(show_parse_OBJECTS) $(show_parse_LDADD) $(LIBS) test-schro$(EXEEXT): $(test_schro_OBJECTS) $(test_schro_DEPENDENCIES) $(EXTRA_test_schro_DEPENDENCIES) @rm -f test-schro$(EXEEXT) $(LINK) $(test_schro_OBJECTS) $(test_schro_LDADD) $(LIBS) test_accsadubl$(EXEEXT): $(test_accsadubl_OBJECTS) $(test_accsadubl_DEPENDENCIES) $(EXTRA_test_accsadubl_DEPENDENCIES) @rm -f test_accsadubl$(EXEEXT) $(LINK) $(test_accsadubl_OBJECTS) $(test_accsadubl_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bytecode_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_opcodes_sys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_opcodes_sys_c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_opcodes_sys_c64x.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_opcodes_sys_mips.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_opcodes_sys_neon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_parse_c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_parse_neon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exec_opcodes_sys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exec_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_opcodes_sys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_xml_table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_xml_table2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcpy_speed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_opcodes_sys.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_opcodes_sys_compare.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_parse_compare.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/show_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-schro.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_accsadubl.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-TESTS check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags ctags-recursive \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/testsuite/exec_parse.c0000664000175000017500000000316312057245267013642 00000000000000 #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int verbose = FALSE; int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } if (filename == NULL) { filename = getenv ("testfile"); } if (filename == NULL) { filename = "test.orc"; } code = read_file (filename); if (!code) { printf("perf_parse \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;iname); orc_test_compare_output_full (programs[i], 0); } if (error) return 1; return 0; } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } orc-0.4.18/testsuite/test-schro.c0000664000175000017500000001620012057245267013613 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include int error = FALSE; OrcProgram * get_program (int type) { OrcProgram *p; switch (type) { case 0: p = orc_program_new (); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 2, 2, "c1"); orc_program_add_constant (p, 2, 2, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_str (p, "addw", "t1", "s1", "s2"); orc_program_append_str (p, "addw", "t1", "t1", "c1"); orc_program_append_str (p, "shrsw", "t1", "t1", "c2"); orc_program_append_str (p, "addw", "d1", "d1", "t1"); break; case 1: p = orc_program_new (); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 2, 2, "c1"); orc_program_add_constant (p, 2, 2, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_str (p, "addw", "t1", "s1", "s2"); orc_program_append_str (p, "addw", "t1", "t1", "c1"); orc_program_append_str (p, "shrsw", "t1", "t1", "c2"); orc_program_append_str (p, "subw", "d1", "d1", "t1"); break; case 2: p = orc_program_new (); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 2, 1, "c1"); orc_program_add_constant (p, 2, 1, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_str (p, "addw", "t1", "s1", "s2"); orc_program_append_str (p, "addw", "t1", "t1", "c1"); orc_program_append_str (p, "shrsw", "t1", "t1", "c2"); orc_program_append_str (p, "addw", "d1", "d1", "t1"); break; case 3: p = orc_program_new (); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 2, 1, "c1"); orc_program_add_constant (p, 2, 1, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_str (p, "addw", "t1", "s1", "s2"); orc_program_append_str (p, "addw", "t1", "t1", "c1"); orc_program_append_str (p, "shrsw", "t1", "t1", "c2"); orc_program_append_str (p, "subw", "d1", "d1", "t1"); break; case 4: p = orc_program_new_dss (2,2,2); orc_program_add_constant (p, 2, 1, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_str (p, "addw", "t1", "s1", "c1"); orc_program_append_str (p, "shrsw", "d1", "t1", "c1"); break; case 5: p = orc_program_new_dss (2,2,2); orc_program_append_str (p, "addw", "d1", "s1", "s2"); break; case 6: p = orc_program_new_ds (2,2); orc_program_add_constant (p, 2, 1, "c1"); orc_program_append_str (p, "shlw", "d1", "s1", "c1"); break; case 7: p = orc_program_new_ds (2,2); orc_program_add_constant (p, 2, 2, "c1"); orc_program_append_str (p, "shlw", "d1", "s1", "c1"); break; case 8: p = orc_program_new_dss (2,2,2); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_append_str (p, "addw", "t1", "s1", "s2"); orc_program_append_str (p, "mulswl", "t2", "t1", "p1"); orc_program_append_str (p, "addl", "t2", "t2", "p2"); orc_program_append_str (p, "shll", "t2", "t2", "p3"); orc_program_append_ds_str (p, "convlw", "t1", "t2"); orc_program_append_str (p, "addw", "d1", "d1", "t1"); break; case 9: p = orc_program_new (); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s20"); orc_program_add_source (p, 2, "s21"); orc_program_add_source (p, 2, "s22"); orc_program_add_source (p, 2, "s23"); orc_program_add_constant (p, 2, 9, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_str (p, "addw", "t1", "s21", "s22"); orc_program_append_str (p, "mullw", "t1", "t1", "c1"); orc_program_append_str (p, "addw", "t2", "s20", "s23"); orc_program_append_str (p, "subw", "t1", "t1", "t2"); orc_program_append_str (p, "addw", "t1", "t1", "p1"); orc_program_append_str (p, "shrsw", "t1", "t1", "p2"); orc_program_append_str (p, "addw", "d1", "d1", "t1"); break; case 10: p = orc_program_new (); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s20"); orc_program_add_source (p, 2, "s21"); orc_program_add_source (p, 2, "s22"); orc_program_add_source (p, 2, "s23"); orc_program_add_constant (p, 2, 9, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_str (p, "addw", "t1", "s21", "s22"); orc_program_append_str (p, "mullw", "t1", "t1", "c1"); orc_program_append_str (p, "addw", "t2", "s20", "s23"); orc_program_append_str (p, "subw", "t1", "t1", "t2"); orc_program_append_str (p, "addw", "t1", "t1", "p1"); orc_program_append_str (p, "shrsw", "t1", "t1", "p2"); orc_program_append_str (p, "subw", "d1", "d1", "t1"); break; case 11: p = orc_program_new_dss (2,2,2); orc_program_append_str (p, "subw", "d1", "s1", "s2"); break; case 12: p = orc_program_new_ds (1,1); orc_program_append_ds_str (p, "copyb", "d1", "s1"); break; case 13: p = orc_program_new_dss (2,2,1); orc_program_add_temporary (p, 2, "t1"); orc_program_append_ds_str (p, "convubw", "t1", "s2"); orc_program_append_str (p, "addw", "d1", "t1", "s1"); break; case 14: p = orc_program_new_ds (2,1); orc_program_append_ds_str (p, "convubw", "d1", "s1"); break; case 15: p = orc_program_new_ds (1,2); orc_program_append_ds_str (p, "convsuswb", "d1", "s1"); break; case 16: p = orc_program_new_dss (2,2,1); orc_program_add_temporary (p, 2, "t1"); orc_program_append_ds_str (p, "convubw", "t1", "s2"); orc_program_append_str (p, "subw", "d1", "s1", "t1"); break; case 17: p = orc_program_new_dss (2,2,2); orc_program_add_source (p, 1, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_ds_str (p, "convubw", "t1", "s3"); orc_program_append_str (p, "mullw", "t1", "t1", "s2"); orc_program_append_str (p, "addw", "d1", "s1", "t1"); break; default: return NULL; } return p; } void test_program (int type) { OrcProgram *p; char s[40]; OrcTestResult ret; p = get_program(type); sprintf(s, "test_schro_%d", type); orc_program_set_name (p, s); ret = orc_test_compare_output (p); if (!ret) { error = TRUE; } } int main (int argc, char *argv[]) { int i; orc_init(); orc_test_init(); for(i=0;i<18;i++){ //printf("/* %d */\n", i); test_program (i); } if (error) return 1; return 0; } orc-0.4.18/testsuite/perf_parse_compare.c0000664000175000017500000000332012057245267015353 00000000000000 #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } if (filename == NULL) { filename = getenv ("testfile"); } if (filename == NULL) { filename = "test.orc"; } code = read_file (filename); if (!code) { printf("perf_parse \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;i #include #include #include int error = FALSE; void test_opcode (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; OrcStaticOpcode *opcode; const char *d1; orc_init(); orc_test_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ opcode = opcode_set->opcodes + i; printf(".function emulate_%s\n", opcode->name); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { printf(".accumulator %d a1\n", opcode->dest_size[0]); d1 = "a1"; } else { printf(".dest %d d1\n", opcode->dest_size[0]); d1 = "d1"; } if (opcode->dest_size[1]) { printf(".dest %d d2\n", opcode->dest_size[1]); } printf(".source %d s1\n", opcode->src_size[0]); if (opcode->src_size[1]) { if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { printf(".param %d s2\n", opcode->src_size[1]); } else { printf(".source %d s2\n", opcode->src_size[1]); } } printf("\n"); if (opcode->src_size[1]) { printf("%s %s, s1, s2\n", opcode->name, d1); } else { if (opcode->dest_size[1]) { printf("%s %s, d2, s1\n", opcode->name, d1); } else { printf("%s %s, s1\n", opcode->name, d1); } } printf("\n"); printf("\n"); printf(".function emulate_n16_%s\n", opcode->name); printf(".n 16\n"); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { printf(".accumulator %d a1\n", opcode->dest_size[0]); d1 = "a1"; } else { printf(".dest %d d1\n", opcode->dest_size[0]); d1 = "d1"; } if (opcode->dest_size[1]) { printf(".dest %d d2\n", opcode->dest_size[1]); } printf(".source %d s1\n", opcode->src_size[0]); if (opcode->src_size[1]) { if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { printf(".param %d s2\n", opcode->src_size[1]); } else { printf(".source %d s2\n", opcode->src_size[1]); } } printf("\n"); if (opcode->src_size[1]) { printf("%s %s, s1, s2\n", opcode->name, d1); } else { if (opcode->dest_size[1]) { printf("%s %s, d2, s1\n", opcode->name, d1); } else { printf("%s %s, s1\n", opcode->name, d1); } } printf("\n"); printf("\n"); } if (error) return 1; return 0; } orc-0.4.18/testsuite/compile_opcodes_sys_c64x.c0000664000175000017500000000454512057245267016437 00000000000000 #include "config.h" #include #include #include #include int error = FALSE; void test_opcode (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_init(); orc_test_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("/* %s %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode (opcode_set->opcodes + i); exit (0); } for(i=0;in_opcodes;i++){ printf("/* %s const %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_const (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("/* %s param %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_param (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode (opcode); if (!p) return; ret = orc_test_gcc_compile_c64x (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_const (opcode); if (!p) return; ret = orc_test_gcc_compile_c64x (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_param (opcode); if (!p) return; ret = orc_test_gcc_compile_c64x (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } orc-0.4.18/testsuite/compile_opcodes_sys_c.c0000664000175000017500000000452012057245267016066 00000000000000 #include "config.h" #include #include #include #include int error = FALSE; int verbose = FALSE; void test_opcode (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_init(); orc_test_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ if (verbose) printf("/* %s %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode (opcode_set->opcodes + i); } if (error) { printf("test failed\n"); return 1; } else { printf("test passed\n"); return 0; } } void test_opcode (OrcStaticOpcode *opcode) { OrcProgram *p; OrcCompileResult result; const char *s; p = orc_test_get_program_for_opcode (opcode); if (!p) return; result = orc_program_compile_for_target (p, orc_target_get_by_name("c")); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { s = orc_program_get_asm_code (p); if (s != NULL) { printf("%s\n", s); } else { printf("no code\n"); } error = TRUE; return; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; OrcCompileResult result; const char *s; p = orc_test_get_program_for_opcode_const (opcode); if (!p) return; result = orc_program_compile_for_target (p, orc_target_get_by_name("c")); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { s = orc_program_get_asm_code (p); if (s != NULL) { printf("%s\n", s); } else { printf("no code\n"); } error = TRUE; return; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; OrcCompileResult result; const char *s; p = orc_test_get_program_for_opcode_param (opcode); if (!p) return; result = orc_program_compile_for_target (p, orc_target_get_by_name("c")); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { s = orc_program_get_asm_code (p); if (s != NULL) { printf("%s\n", s); } else { printf("no code\n"); } error = TRUE; return; } orc_program_free (p); } orc-0.4.18/testsuite/memcpy_speed.c0000664000175000017500000000722212057245267014176 00000000000000 #include #include #include #include #define ORC_ENABLE_UNSTABLE_API #include #include #include #define ALIGN(ptr,n) ((void *)((orc_intptr)(ptr) & (~(orc_intptr)(n-1)))) int hot_src = TRUE; int hot_dest = TRUE; int flush_cache = FALSE; void touch (unsigned char *ptr, int n) { static int sum; int i; for(i=0;i 1) { unalign = strtoul (argv[1], NULL, 0); } else { unalign = 0; } s = malloc(1024*1024*64+1024); d = malloc(1024*1024*64+1024); src = ORC_PTR_OFFSET(ALIGN(s,128),unalign); dest = ALIGN(d,128); orc_profile_init (&prof); for(j=0;j<10;j++){ orc_profile_start(&prof); orc_profile_stop(&prof); } orc_profile_get_ave_std (&prof, &null, &std); { OrcCompileResult result; p = orc_program_new (); orc_program_set_name (p, "orc_memcpy"); //orc_program_set_name (p, "orc_memset"); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); //orc_program_add_parameter (p, 1, "p1"); orc_program_append (p, "copyb", ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); result = orc_program_compile (p); if (ORC_COMPILE_RESULT_IS_FATAL (result)) { fprintf (stderr, "Failed to compile orc_memcpy\n"); return -1; } } #ifndef M_LN2 #define M_LN2 0.69314718055994530942 #endif orc_get_data_cache_sizes (&level1, &level2, &level3); if (level3 > 0) { max = (log(level3)/M_LN2 - 6.0) * 10 + 20; } else if (level2 > 0) { max = (log(level2)/M_LN2 - 6.0) * 10 + 20; } else { max = 140; } for(i=0;iprogram = p; ex->n = size; ex->arrays[ORC_VAR_D1] = dest; ex->arrays[ORC_VAR_S1] = (void *)src; func = p->code_exec; func (ex); orc_profile_stop(&prof); if (flush_cache) { touch (src, (1<<18)); } if (hot_src) { touch (src, size); } if (hot_dest) { touch (dest, size); } } orc_profile_init (&prof_libc); for(j=0;j<10;j++){ orc_profile_start(&prof_libc); memcpy (dest, src, size); orc_profile_stop(&prof_libc); if (flush_cache) { touch (src, (1<<18)); } if (hot_src) { touch (src, size); } if (hot_dest) { touch (dest, size); } } orc_profile_get_ave_std (&prof, &ave, &std); orc_profile_get_ave_std (&prof_libc, &ave_libc, &std_libc); ave -= null; ave_libc -= null; //printf("%d: %10.4g %10.4g %10.4g %10.4g (libc %10.4g)\n", i, ave, std, // ave/(1< #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } if (filename == NULL) { filename = getenv ("testfile"); } if (filename == NULL) { filename = "test.orc"; } code = read_file (filename); if (!code) { printf("compile_parse_test \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;iname); ret = orc_test_gcc_compile (programs[i]); if (ret == ORC_TEST_FAILED) { error = TRUE; } } if (error) return 1; return 0; } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } orc-0.4.18/testsuite/perf_parse.c0000664000175000017500000000313612057245267013652 00000000000000 #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } if (filename == NULL) { filename = getenv ("testfile"); } if (filename == NULL) { filename = "test.orc"; } code = read_file (filename); if (!code) { printf("perf_parse \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;iname, orc_test_performance_full (programs[i], 0, NULL)); } if (error) return 1; return 0; } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } orc-0.4.18/testsuite/test_accsadubl.c0000664000175000017500000000323312057245267014502 00000000000000 #include "config.h" #include #include #include #include int error = FALSE; void test_opcode (OrcStaticOpcode *opcode); orc_uint8 array1[100]; orc_uint8 array2[100]; int orc_sad_u8 (orc_uint8 *s1, orc_uint8 *s2, int n); int main (int argc, char *argv[]) { int i; int n; int sum; orc_init(); for(n=0;n<20;n++){ sum = 0; for(i=0;i %d\n", i, array1[i], array2[i], abs(array1[i] - array2[i])); } printf("sum %d %d\n", sum, orc_sad_u8 (array1, array2, n)); error = TRUE; } } if (error) return 1; return 0; } int orc_sad_u8 (orc_uint8 *s1, orc_uint8 *s2, int n) { static OrcProgram *p = NULL; OrcExecutor *ex; int sum; OrcCompileResult result; if (p == NULL) { p = orc_program_new (); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_str (p, "accsadubl", "a1", "s1", "s2"); result = orc_program_compile (p); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { return 0; } //printf("%s\n", orc_program_get_asm_code (p)); } ex = orc_executor_new (p); orc_executor_set_n (ex, n); orc_executor_set_array_str (ex, "s1", s1); orc_executor_set_array_str (ex, "s2", s2); orc_executor_run (ex); //sum = orc_executor_get_accumulator (ex, "a1"); sum = ex->accumulators[0]; orc_executor_free (ex); return sum; } orc-0.4.18/testsuite/Makefile.am0000664000175000017500000000163212111024531013367 00000000000000 DIST_SUBDIRS = orcc benchmorc SUBDIRS = orcc benchmorc TESTS_ENVIRONMENT = \ testfile="$(srcdir)/test.orc" TESTS = \ test_accsadubl test-schro \ exec_opcodes_sys \ exec_parse \ perf_opcodes_sys perf_parse \ memcpy_speed \ abi noinst_PROGRAMS = $(TESTS) generate_xml_table generate_xml_table2 \ generate_opcodes_sys compile_parse compile_parse_c memcpy_speed \ perf_opcodes_sys_compare perf_parse_compare \ exec_parse \ bytecode_parse \ compile_opcodes_sys_c \ compile_opcodes_sys \ show_parse EXTRA_DIST = test.orc CLEANFILES = temp-orc-test-* if ENABLE_BACKEND_NEON noinst_PROGRAMS += compile_opcodes_sys_neon \ compile_parse_neon endif if ENABLE_BACKEND_C64X noinst_PROGRAMS += compile_opcodes_sys_c64x endif if ENABLE_BACKEND_MIPS noinst_PROGRAMS += compile_opcodes_sys_mips endif AM_CFLAGS = $(ORC_CFLAGS) LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la orc-0.4.18/testsuite/show_parse.c0000664000175000017500000002225512057245267013701 00000000000000 #define ORC_ENABLE_UNSTABLE_API #include #include #include #include #include #include #include #include #ifdef _MSC_VER #define isnan(x) _isnan(x) #endif static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); void show (OrcProgram *p); int error = FALSE; enum { FORMAT_SIGNED, FORMAT_UNSIGNED, FORMAT_HEX, FORMAT_FLOAT }; int format = FORMAT_SIGNED; int array_n = 10; int main (int argc, char *argv[]) { char *code; int n = 0; int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); for(i=1;i|opcode)\n"); exit(1); } } for(i=0;idata, i*array->element_size + j*array->stride); switch (array->element_size) { case 1: printf(" %4d", *(orc_int8 *)ptr); return *(orc_int8 *)ptr; case 2: printf(" %5d", *(orc_int16 *)ptr); return *(orc_int16 *)ptr; case 4: printf(" %10d", *(orc_int32 *)ptr); return *(orc_int32 *)ptr; case 8: printf(" 0x%08x%08x", (orc_uint32)((*(orc_uint64 *)ptr)>>32), (orc_uint32)((*(orc_uint64 *)ptr))); return *(orc_int64 *)ptr; default: return -1; } } int print_array_val_unsigned (OrcArray *array, int i, int j) { void *ptr = ORC_PTR_OFFSET (array->data, i*array->element_size + j*array->stride); switch (array->element_size) { case 1: printf(" %4u", *(orc_uint8 *)ptr); return *(orc_int8 *)ptr; case 2: printf(" %5u", *(orc_uint16 *)ptr); return *(orc_int16 *)ptr; case 4: printf(" %10u", *(orc_uint32 *)ptr); return *(orc_int32 *)ptr; case 8: printf(" 0x%08x%08x", (orc_uint32)((*(orc_uint64 *)ptr)>>32), (orc_uint32)((*(orc_uint64 *)ptr))); return *(orc_int64 *)ptr; default: return -1; } } int print_array_val_hex (OrcArray *array, int i, int j) { void *ptr = ORC_PTR_OFFSET (array->data, i*array->element_size + j*array->stride); switch (array->element_size) { case 1: printf(" %02x", *(orc_uint8 *)ptr); return *(orc_int8 *)ptr; case 2: printf(" %04x", *(orc_uint16 *)ptr); return *(orc_int16 *)ptr; case 4: printf(" %08x", *(orc_uint32 *)ptr); return *(orc_int32 *)ptr; case 8: printf(" 0x%08x%08x", (orc_uint32)((*(orc_uint64 *)ptr)>>32), (orc_uint32)((*(orc_uint64 *)ptr))); return *(orc_int64 *)ptr; default: return -1; } } int print_array_val_float (OrcArray *array, int i, int j) { void *ptr = ORC_PTR_OFFSET (array->data, i*array->element_size + j*array->stride); switch (array->element_size) { case 4: if (isnan(*(float *)ptr)) { printf(" nan %08x", *(orc_uint32 *)ptr); /* This is to get around signaling/non-signaling nans in the output */ return (*(orc_uint32 *)ptr) & 0xffbfffff; } else { printf(" %12.5g", *(float *)ptr); return *(orc_int32 *)ptr; } case 8: printf(" %12.5g", *(double *)ptr); return *(orc_int64 *)ptr; default: printf(" ERROR"); return -1; } } void show (OrcProgram *program) { OrcCompileResult result; OrcTarget *target; const char *target_name; unsigned int target_flags; int n, m; OrcExecutor *ex; OrcArray *dest[4] = { NULL, NULL, NULL, NULL }; OrcArray *src[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int i,j; OrcRandomContext rand_context = { 0 }; target_name = NULL; target = orc_target_get_by_name (target_name); target_flags = orc_target_get_default_flags (target); result = orc_program_compile_full (program, target, target_flags); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { printf("%s: compile failed\n", program->name); return; } printf("%s:\n", program->name); if (program->constant_n > 0) { n = program->constant_n; } else { n = array_n; } ex = orc_executor_new (program); orc_executor_set_n (ex, n); if (program->is_2d) { if (program->constant_m > 0) { m = program->constant_m; } else { m = 2; } } else { m = 1; } orc_executor_set_m (ex, m); for(i=0;ivars[i].name == NULL) continue; if (program->vars[i].vartype == ORC_VAR_TYPE_SRC) { src[i-ORC_VAR_S1] = orc_array_new (n, m, program->vars[i].size, 0, 0); orc_array_set_random (src[i-ORC_VAR_S1], &rand_context); } else if (program->vars[i].vartype == ORC_VAR_TYPE_DEST) { dest[i-ORC_VAR_D1] = orc_array_new (n, m, program->vars[i].size, 0, 0); orc_array_set_pattern (dest[i], ORC_OOB_VALUE); } else if (program->vars[i].vartype == ORC_VAR_TYPE_PARAM) { switch (program->vars[i].param_type) { case ORC_PARAM_TYPE_INT: orc_executor_set_param (ex, i, 2); break; case ORC_PARAM_TYPE_FLOAT: orc_executor_set_param_float (ex, i, 2.0); break; case ORC_PARAM_TYPE_INT64: orc_executor_set_param_int64 (ex, i, 2); break; case ORC_PARAM_TYPE_DOUBLE: orc_executor_set_param_double (ex, i, 2.0); break; default: ORC_ASSERT(0); } } } orc_executor_set_n (ex, n); orc_executor_set_m (ex, m); for(j=0;jvars[j].vartype == ORC_VAR_TYPE_DEST) { orc_executor_set_array (ex, j, dest[j-ORC_VAR_D1]->data); orc_executor_set_stride (ex, j, dest[j-ORC_VAR_D1]->stride); } if (program->vars[j].vartype == ORC_VAR_TYPE_SRC) { orc_executor_set_array (ex, j, src[j-ORC_VAR_S1]->data); orc_executor_set_stride (ex, j, src[j-ORC_VAR_S1]->stride); } } orc_executor_run (ex); { int i,j; for(j=0;jvars[l].size > 0) { switch (format) { case FORMAT_FLOAT: print_array_val_float (src[l-ORC_VAR_S1], i, j); break; case FORMAT_HEX: print_array_val_hex (src[l-ORC_VAR_S1], i, j); break; case FORMAT_SIGNED: print_array_val_signed (src[l-ORC_VAR_S1], i, j); break; case FORMAT_UNSIGNED: print_array_val_unsigned (src[l-ORC_VAR_S1], i, j); break; } } } printf(" ->"); for(l=ORC_VAR_D1;lvars[l].size > 0) { switch (format) { case FORMAT_FLOAT: print_array_val_float (dest[l-ORC_VAR_D1], i, j); break; case FORMAT_HEX: print_array_val_hex (dest[l-ORC_VAR_D1], i, j); break; case FORMAT_SIGNED: print_array_val_signed (dest[l-ORC_VAR_D1], i, j); break; case FORMAT_UNSIGNED: print_array_val_unsigned (dest[l-ORC_VAR_D1], i, j); break; } } } printf("\n"); } } } for(i=0;i<4;i++){ if (dest[i]) orc_array_free (dest[i]); } for(i=0;i<8;i++){ if (src[i]) orc_array_free (src[i]); } orc_executor_free (ex); } orc-0.4.18/testsuite/orcc/0000775000175000017500000000000012206165374012357 500000000000000orc-0.4.18/testsuite/orcc/testorc.c0000664000175000017500000303374312206165357014144 00000000000000 /* autogenerated from test.orc */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifndef _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif #ifndef ORC_INTERNAL #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) #define ORC_INTERNAL __attribute__((visibility("hidden"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #define ORC_INTERNAL __hidden #elif defined (__GNUC__) #define ORC_INTERNAL __attribute__((visibility("hidden"))) #else #define ORC_INTERNAL #endif #endif #ifndef DISABLE_ORC #include #endif void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n); void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n); void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n); void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n); void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n); void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n); void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n); void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n); void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n); void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n); void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n); void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m); void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m); void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n); void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m); void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m); void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n); void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n); void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n); void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n); void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n); void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n); void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m); void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m); void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m); void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m); void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n); void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n); void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n); void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n); void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n); void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n); void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n); void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n); void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n); void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m); void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m); void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m); void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m); void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m); void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride); void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride); void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m); void convert_rgb_to_gray (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void canny_calc_delta_x (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void i420_to_ayuv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int p1, int n); void test_4x (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void test_4x_2 (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int p1, int n); void orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n); void orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n); void orc_splat_u16_2d (orc_uint16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_splat_u32_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m); void orc_copy_u16_2d (orc_uint16 * ORC_RESTRICT d1, int d1_stride, const orc_uint16 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_copy_u32_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, const orc_uint32 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_composite_add_8888_8888_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, const orc_uint32 * ORC_RESTRICT s1, int s1_stride, int n, int m); void orc_composite_add_8_8_line (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n); void orc_composite_add_n_8_8_line (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int n); void orc_code_combine_add_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_add_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_over_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_over_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_in_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_in_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_out_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_out_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_atop_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_atop_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_xor_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_xor_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_add_ca (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_add_ca_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_code_combine_over_ca (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void orc_code_combine_over_ca_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n); void orc_composite_over_8888_8_8888_line (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n); void orc_composite_over_n_8888_8888_ca_2d (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int p1, int n); void cogorc_resample_horiz_1tap (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int p2, int n); void cogorc_resample_horiz_2tap (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int p2, int n); void test_float_constant_1 (orc_uint32 * ORC_RESTRICT d1, int n); void test_float_constant_2 (orc_uint32 * ORC_RESTRICT d1, int n); void convert_fc32_to_int32 (orc_uint32 * ORC_RESTRICT d1, const orc_uint64 * ORC_RESTRICT s1, int n); void param64 (orc_uint64 * ORC_RESTRICT d1, int p1, int n); void const64 (orc_uint64 * ORC_RESTRICT d1, int n); void param64_2 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n); void pa_volume_s16ne_orc_2ch (orc_int16 * ORC_RESTRICT d1, orc_int64 p1, int n); void cogorc_convert_YUY2_I420 (orc_uint16 * ORC_RESTRICT d1, orc_uint16 * ORC_RESTRICT d2, orc_uint8 * ORC_RESTRICT d3, orc_uint8 * ORC_RESTRICT d4, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n); void cogorc_convert_AYUV_I420 (orc_uint16 * ORC_RESTRICT d1, int d1_stride, orc_uint16 * ORC_RESTRICT d2, int d2_stride, orc_uint8 * ORC_RESTRICT d3, int d3_stride, orc_uint8 * ORC_RESTRICT d4, int d4_stride, const orc_uint64 * ORC_RESTRICT s1, int s1_stride, const orc_uint64 * ORC_RESTRICT s2, int s2_stride, int n, int m); void memcpy_aligned (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n); void memcpy_large (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n); void memcpy_small (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n); void memcpy_aligned_n16 (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n); /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ /* orc_add2_rshift_add_s16_22_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s16_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } void orc_add2_rshift_add_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 29, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 97, 100, 100, 95, 115, 49, 54, 95, 50, 50, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 20, 2, 70, 32, 5, 6, 70, 32, 32, 16, 94, 32, 32, 16, 70, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_22_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_add_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } void orc_add2_rshift_add_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 97, 100, 100, 95, 115, 49, 54, 95, 50, 50, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 20, 2, 70, 32, 4, 5, 70, 32, 32, 16, 94, 32, 32, 16, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_22); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_22_op */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_sub_s16_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } void orc_add2_rshift_sub_s16_22_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 29, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 115, 117, 98, 95, 115, 49, 54, 95, 50, 50, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 20, 2, 70, 32, 5, 6, 70, 32, 32, 16, 94, 32, 32, 16, 98, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_22_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_22 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } #else static void _backup_orc_add2_rshift_sub_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } void orc_add2_rshift_sub_s16_22 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 115, 117, 98, 95, 115, 49, 54, 95, 50, 50, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 20, 2, 70, 32, 4, 5, 70, 32, 32, 16, 94, 32, 32, 16, 98, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_22"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_22); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_11_op */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_add2_rshift_add_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 29, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 97, 100, 100, 95, 115, 49, 54, 95, 49, 49, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 20, 2, 75, 32, 5, 6, 70, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_11_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_add_s16_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_add_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_add2_rshift_add_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 97, 100, 100, 95, 115, 49, 54, 95, 49, 49, 11, 2, 2, 12, 2, 2, 12, 2, 2, 20, 2, 75, 32, 4, 5, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_add_s16_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_add_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_11_op */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_add2_rshift_sub_s16_11_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 29, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 115, 117, 98, 95, 115, 49, 54, 95, 49, 49, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 20, 2, 75, 32, 5, 6, 98, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_11_op"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_add2_rshift_sub_s16_11 */ #ifdef DISABLE_ORC void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_add2_rshift_sub_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_add2_rshift_sub_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 111, 114, 99, 95, 97, 100, 100, 50, 95, 114, 115, 104, 105, 102, 116, 95, 115, 117, 98, 95, 115, 49, 54, 95, 49, 49, 11, 2, 2, 12, 2, 2, 12, 2, 2, 20, 2, 75, 32, 4, 5, 98, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11); #else p = orc_program_new (); orc_program_set_name (p, "orc_add2_rshift_sub_s16_11"); orc_program_set_backup_function (p, _backup_orc_add2_rshift_sub_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s16_11 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } void orc_add_const_rshift_s16_11 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 27, 111, 114, 99, 95, 97, 100, 100, 95, 99, 111, 110, 115, 116, 95, 114, 115, 104, 105, 102, 116, 95, 115, 49, 54, 95, 49, 49, 11, 2, 2, 12, 2, 2, 14, 4, 1, 0, 0, 0, 20, 2, 70, 32, 4, 16, 94, 0, 32, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16_11); #else p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s16_11"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16_11); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_add_const_rshift_s16 */ #ifdef DISABLE_ORC void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; /* 1: loadpw */ var34.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> p2; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_const_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[25]; /* 4: storew */ ptr0[i] = var35; } } void orc_add_const_rshift_s16 (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 97, 100, 100, 95, 99, 111, 110, 115, 116, 95, 114, 115, 104, 105, 102, 116, 95, 115, 49, 54, 11, 2, 2, 16, 2, 16, 2, 20, 2, 70, 32, 0, 24, 94, 0, 32, 25, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_add_const_rshift_s16"); orc_program_set_backup_function (p, _backup_orc_add_const_rshift_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_add_s16 */ #ifdef DISABLE_ORC void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } void orc_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 11, 111, 114, 99, 95, 97, 100, 100, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 12, 2, 2, 70, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_add_s16"); orc_program_set_backup_function (p, _backup_orc_add_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_2d */ #ifdef DISABLE_ORC void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } #else static void _backup_orc_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } void orc_add_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 14, 111, 114, 99, 95, 97, 100, 100, 95, 115, 49, 54, 95, 50, 100, 11, 2, 2, 12, 2, 2, 70, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add_s16_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_add_s16_2d"); orc_program_set_backup_function (p, _backup_orc_add_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_addc_rshift_s16 */ #ifdef DISABLE_ORC void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> p1; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_addc_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[24]; /* 4: storew */ ptr0[i] = var35; } } void orc_addc_rshift_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 97, 100, 100, 99, 95, 114, 115, 104, 105, 102, 116, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 12, 2, 2, 16, 2, 20, 2, 70, 32, 4, 5, 94, 0, 32, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_addc_rshift_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_addc_rshift_s16"); orc_program_set_backup_function (p, _backup_orc_addc_rshift_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_lshift1_s16 */ #ifdef DISABLE_ORC void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } void orc_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 15, 111, 114, 99, 95, 108, 115, 104, 105, 102, 116, 49, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 1, 0, 0, 0, 93, 0, 4, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_lshift1_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_lshift1_s16"); orc_program_set_backup_function (p, _backup_orc_lshift1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_lshift2_s16 */ #ifdef DISABLE_ORC void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } void orc_lshift2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 15, 111, 114, 99, 95, 108, 115, 104, 105, 102, 116, 50, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 93, 0, 4, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_lshift2_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_lshift2_s16"); orc_program_set_backup_function (p, _backup_orc_lshift2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_lshift_s16_ip */ #ifdef DISABLE_ORC void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << p1; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_lshift_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << ex->params[24]; /* 2: storew */ ptr0[i] = var33; } } void orc_lshift_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 108, 115, 104, 105, 102, 116, 95, 115, 49, 54, 95, 105, 112, 11, 2, 2, 16, 2, 93, 0, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_lshift_s16_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_lshift_s16_ip"); orc_program_set_backup_function (p, _backup_orc_lshift_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_mas2_add_s16_op */ #ifdef DISABLE_ORC void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_add_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } void orc_mas2_add_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 109, 97, 115, 50, 95, 97, 100, 100, 95, 115, 49, 54, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 16, 2, 16, 4, 16, 4, 20, 2, 20, 4, 70, 32, 5, 6, 176, 33, 32, 24, 103, 33, 33, 25, 125, 33, 33, 26, 163, 32, 33, 70, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s16_op"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_add_s16_ip */ #ifdef DISABLE_ORC void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_add_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } void orc_mas2_add_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 109, 97, 115, 50, 95, 97, 100, 100, 95, 115, 49, 54, 95, 105, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 16, 2, 16, 4, 16, 4, 20, 2, 20, 4, 70, 32, 4, 5, 176, 33, 32, 24, 103, 33, 33, 25, 125, 33, 33, 26, 163, 32, 33, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas2_add_s16_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_add_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s16_op */ #ifdef DISABLE_ORC void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_sub_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } void orc_mas2_sub_s16_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 109, 97, 115, 50, 95, 115, 117, 98, 95, 115, 49, 54, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 16, 2, 16, 4, 16, 4, 20, 2, 20, 4, 70, 32, 5, 6, 176, 33, 32, 24, 103, 33, 33, 25, 125, 33, 33, 26, 163, 32, 33, 98, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s16_op"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas2_sub_s16_ip */ #ifdef DISABLE_ORC void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 3: loadpw */ var36.i = p1; /* 5: loadpl */ var37.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> p3; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } #else static void _backup_orc_mas2_sub_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } void orc_mas2_sub_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 109, 97, 115, 50, 95, 115, 117, 98, 95, 115, 49, 54, 95, 105, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 16, 2, 16, 4, 16, 4, 20, 2, 20, 4, 70, 32, 4, 5, 176, 33, 32, 24, 103, 33, 33, 25, 125, 33, 33, 26, 163, 32, 33, 98, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas2_sub_s16_ip"); orc_program_set_backup_function (p, _backup_orc_mas2_sub_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_parameter (p, 4, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_mas4_across_add_s16_1991_op */ #ifdef DISABLE_ORC void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; ptr8 = (orc_union16 *)s5; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_across_add_s16_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; ptr8 = (orc_union16 *)ex->arrays[8]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } void orc_mas4_across_add_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 31, 111, 114, 99, 95, 109, 97, 115, 52, 95, 97, 99, 114, 111, 115, 115, 95, 97, 100, 100, 95, 115, 49, 54, 95, 49, 57, 57, 49, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 9, 0, 0, 0, 16, 4, 16, 4, 20, 2, 20, 2, 20, 4, 20, 4, 70, 32, 6, 7, 176, 34, 32, 16, 70, 33, 5, 8, 153, 35, 33, 129, 34, 34, 35, 103, 34, 34, 24, 125, 34, 34, 25, 163, 32, 34, 70, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas4_across_add_s16_1991_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_add_s16_1991_op"); orc_program_set_backup_function (p, _backup_orc_mas4_across_add_s16_1991_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_source (p, 2, "s5"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S5, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_across_add_s16_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_across_add_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } void orc_mas4_across_add_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 31, 111, 114, 99, 95, 109, 97, 115, 52, 95, 97, 99, 114, 111, 115, 115, 95, 97, 100, 100, 95, 115, 49, 54, 95, 49, 57, 57, 49, 95, 105, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 9, 0, 0, 0, 16, 4, 16, 4, 20, 2, 20, 2, 20, 4, 20, 4, 70, 32, 5, 6, 176, 34, 32, 16, 70, 33, 4, 7, 153, 35, 33, 129, 34, 34, 35, 103, 34, 34, 24, 125, 34, 34, 25, 163, 32, 34, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas4_across_add_s16_1991_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_add_s16_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_across_add_s16_1991_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_across_sub_s16_1991_op */ #ifdef DISABLE_ORC void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; ptr8 = (orc_union16 *)s5; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_across_sub_s16_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; ptr8 = (orc_union16 *)ex->arrays[8]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } void orc_mas4_across_sub_s16_1991_op (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, const orc_int16 * ORC_RESTRICT s5, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 31, 111, 114, 99, 95, 109, 97, 115, 52, 95, 97, 99, 114, 111, 115, 115, 95, 115, 117, 98, 95, 115, 49, 54, 95, 49, 57, 57, 49, 95, 111, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 9, 0, 0, 0, 16, 4, 16, 4, 20, 2, 20, 2, 20, 4, 20, 4, 70, 32, 6, 7, 176, 34, 32, 16, 70, 33, 5, 8, 153, 35, 33, 129, 34, 34, 35, 103, 34, 34, 24, 125, 34, 34, 25, 163, 32, 34, 98, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas4_across_sub_s16_1991_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_sub_s16_1991_op"); orc_program_set_backup_function (p, _backup_orc_mas4_across_sub_s16_1991_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_source (p, 2, "s5"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S5, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->arrays[ORC_VAR_S5] = (void *)s5; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_mas4_across_sub_s16_1991_ip */ #ifdef DISABLE_ORC void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; ptr6 = (orc_union16 *)s3; ptr7 = (orc_union16 *)s4; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> p2; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } #else static void _backup_orc_mas4_across_sub_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } void orc_mas4_across_sub_s16_1991_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, const orc_int16 * ORC_RESTRICT s3, const orc_int16 * ORC_RESTRICT s4, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 31, 111, 114, 99, 95, 109, 97, 115, 52, 95, 97, 99, 114, 111, 115, 115, 95, 115, 117, 98, 95, 115, 49, 54, 95, 49, 57, 57, 49, 95, 105, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 9, 0, 0, 0, 16, 4, 16, 4, 20, 2, 20, 2, 20, 4, 20, 4, 70, 32, 5, 6, 176, 34, 32, 16, 70, 33, 4, 7, 153, 35, 33, 129, 34, 34, 35, 103, 34, 34, 24, 125, 34, 34, 25, 163, 32, 34, 98, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_mas4_across_sub_s16_1991_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_mas4_across_sub_s16_1991_ip"); orc_program_set_backup_function (p, _backup_orc_mas4_across_sub_s16_1991_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_source (p, 2, "s3"); orc_program_add_source (p, 2, "s4"); orc_program_add_constant (p, 4, 0x00000009, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mulswl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_S4, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shrsl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_subtract_s16 */ #ifdef DISABLE_ORC void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_subtract_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } void orc_subtract_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 16, 111, 114, 99, 95, 115, 117, 98, 116, 114, 97, 99, 116, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 12, 2, 2, 98, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_subtract_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_subtract_s16"); orc_program_set_backup_function (p, _backup_orc_subtract_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_u8 */ #ifdef DISABLE_ORC void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } void orc_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 14, 111, 114, 99, 95, 97, 100, 100, 95, 115, 49, 54, 95, 117, 56, 11, 2, 2, 12, 2, 2, 12, 1, 1, 20, 2, 150, 32, 5, 70, 0, 32, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add_s16_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_add_s16_u8"); orc_program_set_backup_function (p, _backup_orc_add_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_add_s16_u8_2d */ #ifdef DISABLE_ORC void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } #else static void _backup_orc_add_s16_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } void orc_add_s16_u8_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 17, 111, 114, 99, 95, 97, 100, 100, 95, 115, 49, 54, 95, 117, 56, 95, 50, 100, 11, 2, 2, 12, 1, 1, 20, 2, 150, 32, 4, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_add_s16_u8_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_add_s16_u8_2d"); orc_program_set_backup_function (p, _backup_orc_add_s16_u8_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_convert_s16_u8 */ #ifdef DISABLE_ORC void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_convert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } void orc_convert_s16_u8 (orc_uint16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 111, 114, 99, 95, 99, 111, 110, 118, 101, 114, 116, 95, 115, 49, 54, 95, 117, 56, 11, 2, 2, 12, 1, 1, 150, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_convert_s16_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_convert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_convert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_convert_u8_s16 */ #ifdef DISABLE_ORC void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_convert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } void orc_convert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 111, 114, 99, 95, 99, 111, 110, 118, 101, 114, 116, 95, 117, 56, 95, 115, 49, 54, 11, 1, 1, 12, 2, 2, 160, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_convert_u8_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_convert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_convert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_u8_s16 */ #ifdef DISABLE_ORC void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } void orc_offsetconvert_u8_s16 (orc_uint8 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 111, 102, 102, 115, 101, 116, 99, 111, 110, 118, 101, 114, 116, 95, 117, 56, 95, 115, 49, 54, 11, 1, 1, 12, 2, 2, 14, 4, 128, 0, 0, 0, 20, 2, 70, 32, 4, 16, 160, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_offsetconvert_u8_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_u8_s16"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_u8_s16); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_offsetconvert_s16_u8 */ #ifdef DISABLE_ORC void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_int8 *)s1; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_offsetconvert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } void orc_offsetconvert_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 111, 102, 102, 115, 101, 116, 99, 111, 110, 118, 101, 114, 116, 95, 115, 49, 54, 95, 117, 56, 11, 2, 2, 12, 1, 1, 14, 4, 128, 0, 0, 0, 20, 2, 150, 32, 4, 98, 0, 32, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_offsetconvert_s16_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_offsetconvert_s16_u8"); orc_program_set_backup_function (p, _backup_orc_offsetconvert_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_constant (p, 4, 0x00000080, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_subtract_s16_u8 */ #ifdef DISABLE_ORC void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_subtract_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } void orc_subtract_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 115, 117, 98, 116, 114, 97, 99, 116, 95, 115, 49, 54, 95, 117, 56, 11, 2, 2, 12, 2, 2, 12, 1, 1, 20, 2, 150, 32, 5, 98, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_subtract_s16_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_subtract_s16_u8"); orc_program_set_backup_function (p, _backup_orc_subtract_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_multiply_and_add_s16_u8 */ #ifdef DISABLE_ORC void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } #else static void _backup_orc_multiply_and_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } void orc_multiply_and_add_s16_u8 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 27, 111, 114, 99, 95, 109, 117, 108, 116, 105, 112, 108, 121, 95, 97, 110, 100, 95, 97, 100, 100, 95, 115, 49, 54, 95, 117, 56, 11, 2, 2, 12, 2, 2, 12, 1, 1, 20, 2, 150, 32, 5, 89, 32, 32, 4, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_multiply_and_add_s16_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_multiply_and_add_s16_u8"); orc_program_set_backup_function (p, _backup_orc_multiply_and_add_s16_u8); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_splat_s16_ns */ #ifdef DISABLE_ORC void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_splat_s16_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } void orc_splat_s16_ns (orc_int16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 16, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 115, 49, 54, 95, 110, 115, 11, 2, 2, 16, 2, 79, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_s16_ns); #else p = orc_program_new (); orc_program_set_name (p, "orc_splat_s16_ns"); orc_program_set_backup_function (p, _backup_orc_splat_s16_ns); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d_4xn */ #ifdef DISABLE_ORC void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m){ int i; int j; int n = 4; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } void orc_splat_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 4, 7, 9, 20, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 115, 49, 54, 95, 50, 100, 95, 52, 120, 110, 11, 2, 2, 16, 2, 79, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_4xn); #else p = orc_program_new (); orc_program_set_constant_n (p, 4); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d_4xn"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_4xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d_8xn */ #ifdef DISABLE_ORC void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } void orc_splat_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 9, 20, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 115, 49, 54, 95, 50, 100, 95, 56, 120, 110, 11, 2, 2, 16, 2, 79, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_8xn); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_s16_2d */ #ifdef DISABLE_ORC void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } void orc_splat_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 16, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 115, 49, 54, 95, 50, 100, 11, 2, 2, 16, 2, 79, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_s16_2d"); orc_program_set_backup_function (p, _backup_orc_splat_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u8_ns */ #ifdef DISABLE_ORC void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_splat_u8_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void orc_splat_u8_ns (orc_uint8 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 15, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 117, 56, 95, 110, 115, 11, 1, 1, 16, 1, 42, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_u8_ns); #else p = orc_program_new (); orc_program_set_name (p, "orc_splat_u8_ns"); orc_program_set_backup_function (p, _backup_orc_splat_u8_ns); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u8_2d */ #ifdef DISABLE_ORC void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpb */ var32 = p1; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } void orc_splat_u8_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 15, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 117, 56, 95, 50, 100, 11, 1, 1, 16, 1, 42, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_u8_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_u8_2d"); orc_program_set_backup_function (p, _backup_orc_splat_u8_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_parameter (p, 1, "p1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_average_u8 */ #ifdef DISABLE_ORC void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_average_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } void orc_average_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 14, 111, 114, 99, 95, 97, 118, 101, 114, 97, 103, 101, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 39, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_average_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_average_u8"); orc_program_set_backup_function (p, _backup_orc_average_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_rrshift6_add_s16_2d */ #ifdef DISABLE_ORC void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } #else static void _backup_orc_rrshift6_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } void orc_rrshift6_add_s16_2d (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, const orc_int16 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 23, 111, 114, 99, 95, 114, 114, 115, 104, 105, 102, 116, 54, 95, 97, 100, 100, 95, 115, 49, 54, 95, 50, 100, 11, 1, 1, 12, 2, 2, 12, 2, 2, 14, 4, 32, 0, 0, 0, 14, 4, 6, 0, 0, 0, 20, 2, 70, 32, 5, 16, 94, 32, 32, 17, 70, 32, 4, 32, 160, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_rrshift6_add_s16_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_add_s16_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_add_s16_2d); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000020, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_sub_s16_2d */ #ifdef DISABLE_ORC void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr1 = ORC_PTR_OFFSET(d2, d2_stride * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_rrshift6_sub_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } void orc_rrshift6_sub_s16_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, orc_int16 * ORC_RESTRICT d2, int d2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 23, 111, 114, 99, 95, 114, 114, 115, 104, 105, 102, 116, 54, 95, 115, 117, 98, 95, 115, 49, 54, 95, 50, 100, 11, 2, 2, 11, 2, 2, 14, 4, 224, 31, 0, 0, 14, 4, 6, 0, 0, 0, 20, 2, 98, 32, 1, 16, 94, 32, 32, 17, 79, 1, 32, 98, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_rrshift6_sub_s16_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_sub_s16_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_sub_s16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_D2] = d2_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_s16_ip_2d */ #ifdef DISABLE_ORC void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } #else static void _backup_orc_rrshift6_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } void orc_rrshift6_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 22, 111, 114, 99, 95, 114, 114, 115, 104, 105, 102, 116, 54, 95, 115, 49, 54, 95, 105, 112, 95, 50, 100, 11, 2, 2, 14, 4, 224, 31, 0, 0, 14, 4, 6, 0, 0, 0, 20, 2, 98, 32, 0, 16, 94, 0, 32, 17, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_rrshift6_s16_ip_2d"); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; func = c->exec; func (ex); } #endif /* orc_rrshift6_s16_ip */ #ifdef DISABLE_ORC void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)d1; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } #else static void _backup_orc_rrshift6_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } void orc_rrshift6_s16_ip (orc_int16 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 114, 114, 115, 104, 105, 102, 116, 54, 95, 115, 49, 54, 95, 105, 112, 11, 2, 2, 14, 4, 224, 31, 0, 0, 14, 4, 6, 0, 0, 0, 20, 2, 98, 32, 0, 16, 94, 0, 32, 17, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_rrshift6_s16_ip"); orc_program_set_backup_function (p, _backup_orc_rrshift6_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00001fe0, "c1"); orc_program_add_constant (p, 4, 0x00000006, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_y */ #ifdef DISABLE_ORC void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } void orc_unpack_yuyv_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 117, 110, 112, 97, 99, 107, 95, 121, 117, 121, 118, 95, 121, 11, 1, 1, 12, 2, 2, 188, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_y); #else p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_y"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_u */ #ifdef DISABLE_ORC void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } void orc_unpack_yuyv_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 117, 110, 112, 97, 99, 107, 95, 121, 117, 121, 118, 95, 117, 11, 1, 1, 12, 4, 4, 20, 2, 190, 32, 4, 189, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_u"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_u); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_yuyv_v */ #ifdef DISABLE_ORC void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } void orc_unpack_yuyv_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 117, 110, 112, 97, 99, 107, 95, 121, 117, 121, 118, 95, 118, 11, 1, 1, 12, 4, 4, 20, 2, 191, 32, 4, 189, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_v); #else p = orc_program_new (); orc_program_set_name (p, "orc_unpack_yuyv_v"); orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_v); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_packyuyv */ #ifdef DISABLE_ORC void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } #else static void _backup_orc_packyuyv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } void orc_packyuyv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 12, 111, 114, 99, 95, 112, 97, 99, 107, 121, 117, 121, 118, 11, 4, 4, 12, 2, 2, 12, 1, 1, 12, 1, 1, 20, 1, 20, 1, 20, 2, 20, 2, 20, 2, 79, 36, 4, 188, 32, 36, 189, 33, 36, 196, 34, 32, 5, 196, 35, 33, 6, 195, 0, 34, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_packyuyv); #else p = orc_program_new (); orc_program_set_name (p, "orc_packyuyv"); orc_program_set_backup_function (p, _backup_orc_packyuyv); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_temporary (p, 1, "t1"); orc_program_add_temporary (p, 1, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_y */ #ifdef DISABLE_ORC void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } void orc_unpack_uyvy_y (orc_uint8 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 117, 110, 112, 97, 99, 107, 95, 117, 121, 118, 121, 95, 121, 11, 1, 1, 12, 2, 2, 189, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_y); #else p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_y"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_y); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_u */ #ifdef DISABLE_ORC void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } void orc_unpack_uyvy_u (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 117, 110, 112, 97, 99, 107, 95, 117, 121, 118, 121, 95, 117, 11, 1, 1, 12, 4, 4, 20, 2, 190, 32, 4, 188, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_u"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_u); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_unpack_uyvy_v */ #ifdef DISABLE_ORC void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } void orc_unpack_uyvy_v (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 117, 110, 112, 97, 99, 107, 95, 117, 121, 118, 121, 95, 118, 11, 1, 1, 12, 4, 4, 20, 2, 191, 32, 4, 188, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_v); #else p = orc_program_new (); orc_program_set_name (p, "orc_unpack_uyvy_v"); orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_v); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_interleave2_s16 */ #ifdef DISABLE_ORC void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_orc_interleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } void orc_interleave2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 105, 110, 116, 101, 114, 108, 101, 97, 118, 101, 50, 95, 115, 49, 54, 11, 4, 4, 12, 2, 2, 12, 2, 2, 195, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_interleave2_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_s16"); orc_program_set_backup_function (p, _backup_orc_interleave2_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_interleave2_rrshift1_s16 */ #ifdef DISABLE_ORC void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } #else static void _backup_orc_interleave2_rrshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } void orc_interleave2_rrshift1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 28, 111, 114, 99, 95, 105, 110, 116, 101, 114, 108, 101, 97, 118, 101, 50, 95, 114, 114, 115, 104, 105, 102, 116, 49, 95, 115, 49, 54, 11, 4, 4, 12, 2, 2, 12, 2, 2, 14, 4, 1, 0, 0, 0, 20, 2, 20, 2, 70, 32, 4, 16, 94, 32, 32, 16, 70, 33, 5, 16, 94, 33, 33, 16, 195, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_interleave2_rrshift1_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_interleave2_rrshift1_s16"); orc_program_set_backup_function (p, _backup_orc_interleave2_rrshift1_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_deinterleave2_s16 */ #ifdef DISABLE_ORC void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: copyl */ var36.i = var33.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[0]; } /* 3: storew */ ptr0[i] = var34; /* 4: select1lw */ { orc_union32 _src; _src.i = var36.i; var35.i = _src.x2[1]; } /* 5: storew */ ptr1[i] = var35; } } #else static void _backup_orc_deinterleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: copyl */ var36.i = var33.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[0]; } /* 3: storew */ ptr0[i] = var34; /* 4: select1lw */ { orc_union32 _src; _src.i = var36.i; var35.i = _src.x2[1]; } /* 5: storew */ ptr1[i] = var35; } } void orc_deinterleave2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 100, 101, 105, 110, 116, 101, 114, 108, 101, 97, 118, 101, 50, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 12, 4, 4, 20, 4, 112, 32, 4, 190, 0, 32, 191, 1, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_deinterleave2_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_s16"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_deinterleave2_lshift1_s16 */ #ifdef DISABLE_ORC void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var38.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var38.i; var39.i = _src.x2[0]; } /* 3: shlw */ var36.i = var39.i << 1; /* 4: storew */ ptr0[i] = var36; /* 5: select1lw */ { orc_union32 _src; _src.i = var38.i; var40.i = _src.x2[1]; } /* 6: shlw */ var37.i = var40.i << 1; /* 7: storew */ ptr1[i] = var37; } } #else static void _backup_orc_deinterleave2_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var38.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var38.i; var39.i = _src.x2[0]; } /* 3: shlw */ var36.i = var39.i << 1; /* 4: storew */ ptr0[i] = var36; /* 5: select1lw */ { orc_union32 _src; _src.i = var38.i; var40.i = _src.x2[1]; } /* 6: shlw */ var37.i = var40.i << 1; /* 7: storew */ ptr1[i] = var37; } } void orc_deinterleave2_lshift1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 29, 111, 114, 99, 95, 100, 101, 105, 110, 116, 101, 114, 108, 101, 97, 118, 101, 50, 95, 108, 115, 104, 105, 102, 116, 49, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 12, 4, 4, 14, 4, 1, 0, 0, 0, 20, 4, 20, 2, 20, 2, 112, 32, 4, 190, 33, 32, 93, 0, 33, 16, 191, 34, 32, 93, 1, 34, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_deinterleave2_lshift1_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_deinterleave2_lshift1_s16"); orc_program_set_backup_function (p, _backup_orc_deinterleave2_lshift1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_D2, ORC_VAR_T3, ORC_VAR_C1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_lshift1_split_s16 */ #ifdef DISABLE_ORC void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; /* 9: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: shlw */ var42.i = var40.i << 1; /* 5: shlw */ var43.i = var41.i << 1; /* 6: subw */ var44.i = var43.i - var42.i; /* 7: copyw */ var36.i = var44.i; /* 8: storew */ ptr1[i] = var36; /* 10: avgsw */ var45.i = (var44.i + var37.i + 1)>>1; /* 11: addw */ var38.i = var42.i + var45.i; /* 12: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_deint_lshift1_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 9: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: shlw */ var42.i = var40.i << 1; /* 5: shlw */ var43.i = var41.i << 1; /* 6: subw */ var44.i = var43.i - var42.i; /* 7: copyw */ var36.i = var44.i; /* 8: storew */ ptr1[i] = var36; /* 10: avgsw */ var45.i = (var44.i + var37.i + 1)>>1; /* 11: addw */ var38.i = var42.i + var45.i; /* 12: storew */ ptr0[i] = var38; } } void orc_haar_deint_lshift1_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 32, 111, 114, 99, 95, 104, 97, 97, 114, 95, 100, 101, 105, 110, 116, 95, 108, 115, 104, 105, 102, 116, 49, 95, 115, 112, 108, 105, 116, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 12, 4, 4, 14, 4, 1, 0, 0, 0, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 20, 4, 112, 34, 4, 190, 32, 34, 191, 33, 34, 93, 32, 32, 16, 93, 33, 33, 16, 98, 33, 33, 32, 79, 1, 33, 75, 33, 33, 17, 70, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_deint_lshift1_split_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_lshift1_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_deint_lshift1_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_deint_split_s16 */ #ifdef DISABLE_ORC void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union32 *)s1; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: subw */ var42.i = var41.i - var40.i; /* 5: copyw */ var36.i = var42.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var40.i + var43.i; /* 10: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_deint_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: subw */ var42.i = var41.i - var40.i; /* 5: copyw */ var36.i = var42.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var40.i + var43.i; /* 10: storew */ ptr0[i] = var38; } } void orc_haar_deint_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 104, 97, 97, 114, 95, 100, 101, 105, 110, 116, 95, 115, 112, 108, 105, 116, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 12, 4, 4, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 20, 4, 112, 34, 4, 190, 32, 34, 191, 33, 34, 98, 33, 33, 32, 79, 1, 33, 75, 33, 33, 16, 70, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_deint_split_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_deint_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_deint_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_lo */ #ifdef DISABLE_ORC void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } #else static void _backup_orc_haar_split_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } void orc_haar_split_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 112, 108, 105, 116, 95, 115, 49, 54, 95, 108, 111, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 79, 32, 4, 98, 33, 5, 32, 75, 33, 33, 16, 70, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_lo); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_lo"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_lo); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_hi */ #ifdef DISABLE_ORC void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_split_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } void orc_haar_split_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 112, 108, 105, 116, 95, 115, 49, 54, 95, 104, 105, 11, 2, 2, 12, 2, 2, 12, 2, 2, 98, 0, 5, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_hi); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_hi"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_hi); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S2, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16_op */ #ifdef DISABLE_ORC void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } void orc_haar_split_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 112, 108, 105, 116, 95, 115, 49, 54, 95, 111, 112, 11, 2, 2, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 79, 32, 4, 98, 33, 5, 32, 79, 1, 33, 75, 33, 33, 16, 70, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16_op"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_split_s16 */ #ifdef DISABLE_ORC void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } void orc_haar_split_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 112, 108, 105, 116, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 79, 32, 0, 79, 33, 1, 98, 33, 33, 32, 79, 1, 33, 75, 33, 33, 16, 70, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_split_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_split_s16"); orc_program_set_backup_function (p, _backup_orc_haar_split_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_lo */ #ifdef DISABLE_ORC void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_synth_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_haar_synth_s16_lo (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 121, 110, 116, 104, 95, 115, 49, 54, 95, 108, 111, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 75, 32, 5, 16, 98, 0, 4, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_lo); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_lo"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_lo); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_hi */ #ifdef DISABLE_ORC void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } #else static void _backup_orc_haar_synth_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } void orc_haar_synth_s16_hi (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 121, 110, 116, 104, 95, 115, 49, 54, 95, 104, 105, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 20, 2, 79, 33, 5, 75, 34, 33, 16, 98, 32, 4, 34, 70, 0, 33, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_hi); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_hi"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_hi); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16_op */ #ifdef DISABLE_ORC void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } void orc_haar_synth_s16_op (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 121, 110, 116, 104, 95, 115, 49, 54, 95, 111, 112, 11, 2, 2, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 20, 2, 79, 33, 5, 75, 34, 33, 16, 98, 32, 4, 34, 79, 0, 32, 70, 1, 33, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_op); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16_op"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16_op); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } #else static void _backup_orc_haar_synth_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } void orc_haar_synth_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 121, 110, 116, 104, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 20, 2, 79, 32, 0, 79, 33, 1, 75, 34, 33, 16, 98, 32, 32, 34, 79, 0, 32, 70, 1, 33, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; func = c->exec; func (ex); } #endif /* orc_haar_synth_rrshift1_int_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } #else static void _backup_orc_haar_synth_rrshift1_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } void orc_haar_synth_rrshift1_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 31, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 121, 110, 116, 104, 95, 114, 114, 115, 104, 105, 102, 116, 49, 95, 105, 110, 116, 95, 115, 49, 54, 11, 4, 4, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 79, 33, 5, 75, 32, 33, 16, 98, 32, 4, 32, 70, 33, 33, 32, 75, 32, 32, 16, 75, 33, 33, 16, 195, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_synth_rrshift1_int_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_rrshift1_int_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_rrshift1_int_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_synth_int_s16 */ #ifdef DISABLE_ORC void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } #else static void _backup_orc_haar_synth_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } void orc_haar_synth_int_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 22, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 121, 110, 116, 104, 95, 105, 110, 116, 95, 115, 49, 54, 11, 4, 4, 12, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 20, 2, 79, 33, 5, 75, 32, 33, 16, 98, 32, 4, 32, 70, 33, 33, 32, 195, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_synth_int_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_synth_int_s16"); orc_program_set_backup_function (p, _backup_orc_haar_synth_int_s16); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_haar_sub_s16 */ #ifdef DISABLE_ORC void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_sub_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } void orc_haar_sub_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 16, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 117, 98, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 98, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_sub_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_sub_s16"); orc_program_set_backup_function (p, _backup_orc_haar_sub_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_add_half_s16 */ #ifdef DISABLE_ORC void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_add_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_haar_add_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 97, 100, 100, 95, 104, 97, 108, 102, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 75, 32, 4, 16, 70, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_add_half_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_add_half_s16"); orc_program_set_backup_function (p, _backup_orc_haar_add_half_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_add_s16 */ #ifdef DISABLE_ORC void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } #else static void _backup_orc_haar_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } void orc_haar_add_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 16, 111, 114, 99, 95, 104, 97, 97, 114, 95, 97, 100, 100, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 70, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_add_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_add_s16"); orc_program_set_backup_function (p, _backup_orc_haar_add_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "addw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_haar_sub_half_s16 */ #ifdef DISABLE_ORC void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } #else static void _backup_orc_haar_sub_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } void orc_haar_sub_half_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 104, 97, 97, 114, 95, 115, 117, 98, 95, 104, 97, 108, 102, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 0, 0, 0, 0, 20, 2, 75, 32, 4, 16, 98, 0, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_haar_sub_half_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_haar_sub_half_s16"); orc_program_set_backup_function (p, _backup_orc_haar_sub_half_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "avgsw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_sum_u8 */ #ifdef DISABLE_ORC void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } *a1 = var12.i; } #else static void _backup_orc_sum_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } ex->accumulators[0] = var12.i; } void orc_sum_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 10, 111, 114, 99, 95, 115, 117, 109, 95, 117, 56, 12, 1, 1, 13, 4, 20, 2, 20, 4, 150, 32, 4, 154, 33, 32, 181, 12, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sum_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_sum_u8"); orc_program_set_backup_function (p, _backup_orc_sum_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sum_s16 */ #ifdef DISABLE_ORC void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } *a1 = var12.i; } #else static void _backup_orc_sum_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } ex->accumulators[0] = var12.i; } void orc_sum_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 11, 111, 114, 99, 95, 115, 117, 109, 95, 115, 49, 54, 12, 2, 2, 13, 4, 20, 4, 153, 32, 4, 181, 12, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sum_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_sum_s16"); orc_program_set_backup_function (p, _backup_orc_sum_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 4, "t1"); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sum_square_diff_u8 */ #ifdef DISABLE_ORC void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } *a1 = var12.i; } #else static void _backup_orc_sum_square_diff_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } ex->accumulators[0] = var12.i; } void orc_sum_square_diff_u8 (orc_int32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 22, 111, 114, 99, 95, 115, 117, 109, 95, 115, 113, 117, 97, 114, 101, 95, 100, 105, 102, 102, 95, 117, 56, 12, 1, 1, 12, 1, 1, 13, 4, 20, 2, 20, 2, 20, 4, 150, 32, 4, 150, 33, 5, 98, 32, 32, 33, 89, 32, 32, 32, 154, 34, 32, 181, 12, 34, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sum_square_diff_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_sum_square_diff_u8"); orc_program_set_backup_function (p, _backup_orc_sum_square_diff_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_dequantise_s16_2d_4xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m){ int i; int j; int n = 4; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } void orc_dequantise_s16_2d_4xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 4, 7, 9, 25, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 115, 49, 54, 95, 50, 100, 95, 52, 120, 110, 11, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 4, 96, 33, 32, 69, 32, 32, 89, 32, 32, 24, 70, 32, 32, 25, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_4xn); #else p = orc_program_new (); orc_program_set_constant_n (p, 4); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_2d_4xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_4xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 4; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_2d_8xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } void orc_dequantise_s16_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, const orc_int16 * ORC_RESTRICT s1, int s1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 9, 25, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 115, 49, 54, 95, 50, 100, 95, 56, 120, 110, 11, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 4, 96, 33, 32, 69, 32, 32, 89, 32, 32, 24, 70, 32, 32, 25, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_8xn); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip_2d_8xn */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m){ int i; int j; int n = 8; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_ip_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } void orc_dequantise_s16_ip_2d_8xn (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 9, 28, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 115, 49, 54, 95, 105, 112, 95, 50, 100, 95, 56, 120, 110, 11, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 0, 96, 33, 32, 69, 32, 32, 89, 32, 32, 24, 70, 32, 32, 25, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d_8xn); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_ip_2d_8xn"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d_8xn); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip_2d */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } #else static void _backup_orc_dequantise_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } void orc_dequantise_s16_ip_2d (orc_int16 * ORC_RESTRICT d1, int d1_stride, int p1, int p2, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 24, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 115, 49, 54, 95, 105, 112, 95, 50, 100, 11, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 0, 96, 33, 32, 69, 32, 32, 89, 32, 32, 24, 70, 32, 32, 25, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_dequantise_s16_ip_2d"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16_ip */ #ifdef DISABLE_ORC void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } void orc_dequantise_s16_ip (orc_int16 * ORC_RESTRICT d1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 115, 49, 54, 95, 105, 112, 11, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 0, 96, 33, 32, 69, 32, 32, 89, 32, 32, 24, 70, 32, 32, 25, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_s16_ip"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_s16 */ #ifdef DISABLE_ORC void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 4: loadpw */ var35.i = p1; /* 6: loadpw */ var36.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } void orc_dequantise_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 4, 96, 33, 32, 69, 32, 32, 89, 32, 32, 24, 70, 32, 32, 25, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_s16"); orc_program_set_backup_function (p, _backup_orc_dequantise_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_dequantise_var_s16_ip */ #ifdef DISABLE_ORC void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } #else static void _backup_orc_dequantise_var_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } void orc_dequantise_var_s16_ip (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, const orc_int16 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 25, 111, 114, 99, 95, 100, 101, 113, 117, 97, 110, 116, 105, 115, 101, 95, 118, 97, 114, 95, 115, 49, 54, 95, 105, 112, 11, 2, 2, 12, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 20, 2, 20, 2, 79, 32, 0, 96, 33, 32, 69, 32, 32, 89, 32, 32, 4, 70, 32, 32, 5, 94, 32, 32, 16, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_dequantise_var_s16_ip); #else p = orc_program_new (); orc_program_set_name (p, "orc_dequantise_var_s16_ip"); orc_program_set_backup_function (p, _backup_orc_dequantise_var_s16_ip); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_quantise1_s16 */ #ifdef DISABLE_ORC void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 5: loadpw */ var35.i = p2; /* 7: loadpw */ var36.i = p1; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> p3; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } #else static void _backup_orc_quantise1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> ex->params[26]; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } void orc_quantise1_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int p3, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 113, 117, 97, 110, 116, 105, 115, 101, 49, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 4, 96, 33, 32, 69, 32, 32, 93, 32, 32, 16, 98, 32, 32, 25, 91, 32, 32, 24, 95, 32, 32, 26, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_quantise1_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_quantise1_s16"); orc_program_set_backup_function (p, _backup_orc_quantise1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; func = c->exec; func (ex); } #endif /* orc_quantise2_s16 */ #ifdef DISABLE_ORC void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)d1; ptr4 = (orc_union16 *)s1; /* 5: loadpw */ var35.i = p2; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> p1; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } #else static void _backup_orc_quantise2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> ex->params[24]; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } void orc_quantise2_s16 (orc_int16 * ORC_RESTRICT d1, const orc_int16 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 17, 111, 114, 99, 95, 113, 117, 97, 110, 116, 105, 115, 101, 50, 95, 115, 49, 54, 11, 2, 2, 12, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 4, 96, 33, 32, 69, 32, 32, 93, 32, 32, 16, 98, 32, 32, 25, 95, 32, 32, 24, 89, 0, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_quantise2_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_quantise2_s16"); orc_program_set_backup_function (p, _backup_orc_quantise2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* orc_quantdequant1_s16 */ #ifdef DISABLE_ORC void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var35.i = p2; /* 7: loadpw */ var36.i = p1; /* 14: loadpw */ var38.i = p4; /* 16: loadpw */ var39.i = p5; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> p3; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } #else static void _backup_orc_quantdequant1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; /* 14: loadpw */ var38.i = ex->params[27]; /* 16: loadpw */ var39.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> ex->params[26]; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } void orc_quantdequant1_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 113, 117, 97, 110, 116, 100, 101, 113, 117, 97, 110, 116, 49, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 1, 96, 33, 32, 69, 32, 32, 93, 32, 32, 16, 98, 32, 32, 25, 91, 32, 32, 24, 95, 32, 32, 26, 89, 33, 32, 33, 79, 0, 33, 96, 33, 33, 89, 32, 32, 27, 70, 32, 32, 28, 94, 32, 32, 16, 89, 1, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_quantdequant1_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant1_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant1_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_parameter (p, 2, "p5"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; func = c->exec; func (ex); } #endif /* orc_quantdequant3_s16 */ #ifdef DISABLE_ORC void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var36.i = p2; /* 7: loadpw */ var37.i = p1; /* 9: loadpl */ var38.i = p6; /* 17: loadpw */ var40.i = p4; /* 19: loadpw */ var41.i = p5; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> p3; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } #else static void _backup_orc_quantdequant3_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var36.i = ex->params[25]; /* 7: loadpw */ var37.i = ex->params[24]; /* 9: loadpl */ var38.i = ex->params[29]; /* 17: loadpw */ var40.i = ex->params[27]; /* 19: loadpw */ var41.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> ex->params[26]; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } void orc_quantdequant3_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int p5, int p6, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 113, 117, 97, 110, 116, 100, 101, 113, 117, 97, 110, 116, 51, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 16, 2, 16, 4, 20, 2, 20, 2, 20, 4, 79, 32, 1, 96, 33, 32, 69, 32, 32, 93, 32, 32, 16, 98, 32, 32, 25, 177, 34, 32, 24, 103, 34, 34, 29, 126, 34, 34, 26, 163, 32, 34, 89, 33, 32, 33, 79, 0, 33, 96, 33, 33, 89, 32, 32, 27, 70, 32, 32, 28, 94, 32, 32, 16, 89, 1, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_quantdequant3_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant3_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant3_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_parameter (p, 2, "p5"); orc_program_add_parameter (p, 4, "p6"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "muluwl", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P6, ORC_VAR_D1); orc_program_append_2 (p, "shrul", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; ex->params[ORC_VAR_P5] = p5; ex->params[ORC_VAR_P6] = p6; func = c->exec; func (ex); } #endif /* orc_quantdequant2_s16 */ #ifdef DISABLE_ORC void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; /* 5: loadpw */ var35.i = p2; /* 12: loadpw */ var37.i = p3; /* 14: loadpw */ var38.i = p4; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> p1; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } #else static void _backup_orc_quantdequant2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 12: loadpw */ var37.i = ex->params[26]; /* 14: loadpw */ var38.i = ex->params[27]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> ex->params[24]; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } void orc_quantdequant2_s16 (orc_int16 * ORC_RESTRICT d1, orc_int16 * ORC_RESTRICT d2, int p1, int p2, int p3, int p4, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 113, 117, 97, 110, 116, 100, 101, 113, 117, 97, 110, 116, 50, 95, 115, 49, 54, 11, 2, 2, 11, 2, 2, 14, 4, 2, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 79, 32, 1, 96, 33, 32, 69, 32, 32, 93, 32, 32, 16, 98, 32, 32, 25, 95, 32, 32, 24, 89, 33, 32, 33, 79, 0, 33, 96, 33, 33, 89, 32, 32, 26, 70, 32, 32, 27, 94, 32, 32, 16, 89, 1, 32, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_quantdequant2_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_quantdequant2_s16"); orc_program_set_backup_function (p, _backup_orc_quantdequant2_s16); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_D2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "shlw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "signw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_downsample_vert_u8 */ #ifdef DISABLE_ORC void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_int8 var38; orc_int8 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; ptr7 = (orc_int8 *)s4; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } #else static void _backup_orc_downsample_vert_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_int8 var38; orc_int8 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; ptr7 = (orc_int8 *)ex->arrays[7]; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } void orc_downsample_vert_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 22, 111, 114, 99, 95, 100, 111, 119, 110, 115, 97, 109, 112, 108, 101, 95, 118, 101, 114, 116, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 6, 0, 0, 0, 14, 4, 26, 0, 0, 0, 14, 4, 32, 0, 0, 0, 20, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 7, 70, 32, 32, 33, 89, 32, 32, 16, 150, 33, 5, 150, 34, 6, 70, 33, 33, 34, 89, 33, 33, 17, 70, 33, 33, 32, 70, 33, 33, 18, 95, 33, 33, 16, 157, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_downsample_vert_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_downsample_vert_u8"); orc_program_set_backup_function (p, _backup_orc_downsample_vert_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000006, "c1"); orc_program_add_constant (p, 4, 0x0000001a, "c2"); orc_program_add_constant (p, 4, 0x00000020, "c3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->arrays[ORC_VAR_S4] = (void *)s4; func = c->exec; func (ex); } #endif /* orc_downsample_horiz_u8 */ #ifdef DISABLE_ORC void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var38; orc_union16 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_int8 var52; orc_union16 var53; orc_int8 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union16 *)s1; ptr5 = (orc_union16 *)s2; /* 9: loadpw */ var40.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 16: loadpw */ var41.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 19: loadpw */ var42.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var38 = ptr4[i]; /* 1: copyw */ var44.i = var38.i; /* 2: loadw */ var39 = ptr5[i]; /* 3: copyw */ var45.i = var39.i; /* 4: select0wb */ { orc_union16 _src; _src.i = var44.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: select1wb */ { orc_union16 _src; _src.i = var45.i; var48 = _src.x2[1]; } /* 7: convubw */ var49.i = (orc_uint8)var48; /* 8: addw */ var50.i = var47.i + var49.i; /* 10: mullw */ var51.i = (var50.i * var40.i) & 0xffff; /* 11: select1wb */ { orc_union16 _src; _src.i = var44.i; var52 = _src.x2[1]; } /* 12: convubw */ var53.i = (orc_uint8)var52; /* 13: select0wb */ { orc_union16 _src; _src.i = var45.i; var54 = _src.x2[0]; } /* 14: convubw */ var55.i = (orc_uint8)var54; /* 15: addw */ var56.i = var53.i + var55.i; /* 17: mullw */ var57.i = (var56.i * var41.i) & 0xffff; /* 18: addw */ var58.i = var51.i + var57.i; /* 20: addw */ var59.i = var58.i + var42.i; /* 21: shruw */ var60.i = ((orc_uint16)var59.i) >> 6; /* 22: convwb */ var43 = var60.i; /* 23: storeb */ ptr0[i] = var43; } } #else static void _backup_orc_downsample_horiz_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var38; orc_union16 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_int8 var52; orc_union16 var53; orc_int8 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 9: loadpw */ var40.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 16: loadpw */ var41.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 19: loadpw */ var42.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var38 = ptr4[i]; /* 1: copyw */ var44.i = var38.i; /* 2: loadw */ var39 = ptr5[i]; /* 3: copyw */ var45.i = var39.i; /* 4: select0wb */ { orc_union16 _src; _src.i = var44.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: select1wb */ { orc_union16 _src; _src.i = var45.i; var48 = _src.x2[1]; } /* 7: convubw */ var49.i = (orc_uint8)var48; /* 8: addw */ var50.i = var47.i + var49.i; /* 10: mullw */ var51.i = (var50.i * var40.i) & 0xffff; /* 11: select1wb */ { orc_union16 _src; _src.i = var44.i; var52 = _src.x2[1]; } /* 12: convubw */ var53.i = (orc_uint8)var52; /* 13: select0wb */ { orc_union16 _src; _src.i = var45.i; var54 = _src.x2[0]; } /* 14: convubw */ var55.i = (orc_uint8)var54; /* 15: addw */ var56.i = var53.i + var55.i; /* 17: mullw */ var57.i = (var56.i * var41.i) & 0xffff; /* 18: addw */ var58.i = var51.i + var57.i; /* 20: addw */ var59.i = var58.i + var42.i; /* 21: shruw */ var60.i = ((orc_uint16)var59.i) >> 6; /* 22: convwb */ var43 = var60.i; /* 23: storeb */ ptr0[i] = var43; } } void orc_downsample_horiz_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 23, 111, 114, 99, 95, 100, 111, 119, 110, 115, 97, 109, 112, 108, 101, 95, 104, 111, 114, 105, 122, 95, 117, 56, 11, 1, 1, 12, 2, 2, 12, 2, 2, 14, 4, 6, 0, 0, 0, 14, 4, 26, 0, 0, 0, 14, 4, 32, 0, 0, 0, 20, 2, 20, 2, 20, 1, 20, 2, 20, 2, 20, 2, 79, 32, 4, 79, 33, 5, 188, 34, 32, 150, 35, 34, 189, 34, 33, 150, 36, 34, 70, 35, 35, 36, 89, 35, 35, 16, 189, 34, 32, 150, 36, 34, 188, 34, 33, 150, 37, 34, 70, 36, 36, 37, 89, 36, 36, 17, 70, 35, 35, 36, 70, 35, 35, 18, 95, 35, 35, 16, 157, 0, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_downsample_horiz_u8); #else p = orc_program_new (); orc_program_set_name (p, "orc_downsample_horiz_u8"); orc_program_set_backup_function (p, _backup_orc_downsample_horiz_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_add_source (p, 2, "s2"); orc_program_add_constant (p, 4, 0x00000006, "c1"); orc_program_add_constant (p, 4, 0x0000001a, "c2"); orc_program_add_constant (p, 4, 0x00000020, "c3"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 1, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_add_temporary (p, 2, "t6"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T6, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "shruw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_stats_moment_s16 */ #ifdef DISABLE_ORC void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)s1; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } *a1 = var12.i; } #else static void _backup_orc_stats_moment_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } ex->accumulators[0] = var12.i; } void orc_stats_moment_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 20, 111, 114, 99, 95, 115, 116, 97, 116, 115, 95, 109, 111, 109, 101, 110, 116, 95, 115, 49, 54, 12, 2, 2, 13, 4, 14, 4, 2, 0, 0, 0, 14, 4, 0, 0, 0, 0, 20, 2, 20, 4, 69, 32, 4, 98, 32, 32, 16, 85, 32, 32, 17, 154, 33, 32, 181, 12, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_stats_moment_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_stats_moment_s16"); orc_program_set_backup_function (p, _backup_orc_stats_moment_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_constant (p, 4, 0x00000002, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "maxsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_stats_above_s16 */ #ifdef DISABLE_ORC void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)s1; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } *a1 = var12.i; } #else static void _backup_orc_stats_above_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } ex->accumulators[0] = var12.i; } void orc_stats_above_s16 (orc_int32 * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 111, 114, 99, 95, 115, 116, 97, 116, 115, 95, 97, 98, 111, 118, 101, 95, 115, 49, 54, 12, 2, 2, 13, 4, 14, 4, 1, 0, 0, 0, 14, 4, 0, 0, 0, 0, 20, 2, 20, 4, 69, 32, 4, 98, 32, 32, 16, 85, 32, 32, 17, 87, 32, 32, 16, 154, 33, 32, 181, 12, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_stats_above_s16); #else p = orc_program_new (); orc_program_set_name (p, "orc_stats_above_s16"); orc_program_set_backup_function (p, _backup_orc_stats_above_s16); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 4, "a1"); orc_program_add_constant (p, 4, 0x00000001, "c1"); orc_program_add_constant (p, 4, 0x00000000, "c2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "maxsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "minsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accl", 0, ORC_VAR_A1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_accw */ #ifdef DISABLE_ORC void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n){ int i; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)s1; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } *a1 = (var12.i & 0xffff); } #else static void _backup_orc_accw (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } ex->accumulators[0] = (var12.i & 0xffff); } void orc_accw (int * ORC_RESTRICT a1, const orc_int16 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 8, 111, 114, 99, 95, 97, 99, 99, 119, 12, 2, 2, 13, 2, 20, 2, 69, 32, 4, 180, 12, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_accw); #else p = orc_program_new (); orc_program_set_name (p, "orc_accw"); orc_program_set_backup_function (p, _backup_orc_accw); orc_program_add_source (p, 2, "s1"); orc_program_add_accumulator (p, 2, "a1"); orc_program_add_temporary (p, 2, "t1"); orc_program_append_2 (p, "absw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "accw", 0, ORC_VAR_A1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_avg2_8xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } void orc_avg2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 9, 15, 111, 114, 99, 95, 97, 118, 103, 50, 95, 56, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 39, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_avg2_8xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_12xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } void orc_avg2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 12, 7, 9, 16, 111, 114, 99, 95, 97, 118, 103, 50, 95, 49, 50, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 39, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_avg2_12xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_16xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } void orc_avg2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 16, 7, 9, 16, 111, 114, 99, 95, 97, 118, 103, 50, 95, 49, 54, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 39, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_avg2_16xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_32xn_u8 */ #ifdef DISABLE_ORC void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 32; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } void orc_avg2_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 32, 7, 9, 16, 111, 114, 99, 95, 97, 118, 103, 50, 95, 51, 50, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 39, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_avg2_32xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_32xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_avg2_nxm_u8 */ #ifdef DISABLE_ORC void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } #else static void _backup_orc_avg2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } void orc_avg2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 15, 111, 114, 99, 95, 97, 118, 103, 50, 95, 110, 120, 109, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 39, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_avg2_nxm_u8); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_avg2_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_avg2_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* orc_combine4_8xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } void orc_combine4_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 9, 19, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 52, 95, 56, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 8, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 89, 33, 32, 24, 150, 32, 5, 89, 32, 32, 25, 70, 33, 33, 32, 150, 32, 6, 89, 32, 32, 26, 70, 33, 33, 32, 150, 32, 7, 89, 32, 32, 27, 70, 33, 33, 32, 70, 33, 33, 16, 160, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine4_8xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_12xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } void orc_combine4_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 12, 7, 9, 20, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 52, 95, 49, 50, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 8, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 89, 33, 32, 24, 150, 32, 5, 89, 32, 32, 25, 70, 33, 33, 32, 150, 32, 6, 89, 32, 32, 26, 70, 33, 33, 32, 150, 32, 7, 89, 32, 32, 27, 70, 33, 33, 32, 70, 33, 33, 16, 160, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine4_12xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_16xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } void orc_combine4_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 16, 7, 9, 20, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 52, 95, 49, 54, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 8, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 89, 33, 32, 24, 150, 32, 5, 89, 32, 32, 25, 70, 33, 33, 32, 150, 32, 6, 89, 32, 32, 26, 70, 33, 33, 32, 150, 32, 7, 89, 32, 32, 27, 70, 33, 33, 32, 70, 33, 33, 16, 160, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine4_16xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_24xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 24; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_24xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 24; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } void orc_combine4_24xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 24, 7, 9, 20, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 52, 95, 50, 52, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 8, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 89, 33, 32, 24, 150, 32, 5, 89, 32, 32, 25, 70, 33, 33, 32, 150, 32, 6, 89, 32, 32, 26, 70, 33, 33, 32, 150, 32, 7, 89, 32, 32, 27, 70, 33, 33, 32, 70, 33, 33, 16, 160, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine4_24xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 24); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_24xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_24xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 24; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_32xn_u8 */ #ifdef DISABLE_ORC void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 32; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } void orc_combine4_32xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 32, 7, 9, 20, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 52, 95, 51, 50, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 8, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 89, 33, 32, 24, 150, 32, 5, 89, 32, 32, 25, 70, 33, 33, 32, 150, 32, 6, 89, 32, 32, 26, 70, 33, 33, 32, 150, 32, 7, 89, 32, 32, 27, 70, 33, 33, 32, 70, 33, 33, 16, 160, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine4_32xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_32xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine4_nxm_u8 */ #ifdef DISABLE_ORC void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); ptr6 = ORC_PTR_OFFSET(s3, s3_stride * j); ptr7 = ORC_PTR_OFFSET(s4, s4_stride * j); /* 2: loadpw */ var35.i = p1; /* 6: loadpw */ var37.i = p2; /* 11: loadpw */ var39.i = p3; /* 16: loadpw */ var41.i = p4; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } #else static void _backup_orc_combine4_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } void orc_combine4_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, const orc_uint8 * ORC_RESTRICT s3, int s3_stride, const orc_uint8 * ORC_RESTRICT s4, int s4_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 19, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 52, 95, 110, 120, 109, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 12, 1, 1, 14, 4, 8, 0, 0, 0, 14, 4, 4, 0, 0, 0, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 89, 33, 32, 24, 150, 32, 5, 89, 32, 32, 25, 70, 33, 33, 32, 150, 32, 6, 89, 32, 32, 26, 70, 33, 33, 32, 150, 32, 7, 89, 32, 32, 27, 70, 33, 33, 32, 70, 33, 33, 16, 94, 33, 33, 17, 160, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine4_nxm_u8); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine4_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_combine4_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_source (p, 1, "s4"); orc_program_add_constant (p, 4, 0x00000008, "c1"); orc_program_add_constant (p, 4, 0x00000004, "c2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_S3] = s3_stride; ex->arrays[ORC_VAR_S4] = (void *)s4; ex->params[ORC_VAR_S4] = s4_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_8xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 8; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } void orc_combine2_8xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 9, 19, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 50, 95, 56, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 5, 89, 32, 32, 24, 89, 33, 33, 25, 70, 32, 32, 33, 70, 32, 32, 26, 94, 32, 32, 27, 160, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine2_8xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_8xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_8xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_12xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 12; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } void orc_combine2_12xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 12, 7, 9, 20, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 50, 95, 49, 50, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 5, 89, 32, 32, 24, 89, 33, 33, 25, 70, 32, 32, 33, 70, 32, 32, 26, 94, 32, 32, 27, 160, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine2_12xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_12xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_12xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_16xn_u8 */ #ifdef DISABLE_ORC void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m){ int i; int j; int n = 16; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } void orc_combine2_16xn_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 16, 7, 9, 20, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 50, 95, 49, 54, 120, 110, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 5, 89, 32, 32, 24, 89, 33, 33, 25, 70, 32, 32, 33, 70, 32, 32, 26, 94, 32, 32, 27, 160, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine2_16xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_16xn_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_combine2_nxm_u8 */ #ifdef DISABLE_ORC void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m){ int i; int j; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); /* 4: loadpw */ var36.i = p1; /* 6: loadpw */ var37.i = p2; /* 9: loadpw */ var38.i = p3; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> p4; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } #else static void _backup_orc_combine2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } void orc_combine2_nxm_u8 (orc_uint8 * ORC_RESTRICT d1, int d1_stride, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int p1, int p2, int p3, int p4, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 19, 111, 114, 99, 95, 99, 111, 109, 98, 105, 110, 101, 50, 95, 110, 120, 109, 95, 117, 56, 11, 1, 1, 12, 1, 1, 12, 1, 1, 16, 2, 16, 2, 16, 2, 16, 2, 20, 2, 20, 2, 150, 32, 4, 150, 33, 5, 89, 32, 32, 24, 89, 33, 33, 25, 70, 32, 32, 33, 70, 32, 32, 26, 94, 32, 32, 27, 160, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_combine2_nxm_u8); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_combine2_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_combine2_nxm_u8); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_add_parameter (p, 2, "p3"); orc_program_add_parameter (p, 2, "p4"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3, ORC_VAR_D1); orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4, ORC_VAR_D1); orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; ex->params[ORC_VAR_P3] = p3; ex->params[ORC_VAR_P4] = p4; func = c->exec; func (ex); } #endif /* orc_sad_nxm_u8 */ #ifdef DISABLE_ORC void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } void orc_sad_nxm_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 14, 111, 114, 99, 95, 115, 97, 100, 95, 110, 120, 109, 95, 117, 56, 12, 1, 1, 12, 1, 1, 13, 4, 182, 12, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sad_nxm_u8); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_nxm_u8"); orc_program_set_backup_function (p, _backup_orc_sad_nxm_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_8x8_u8 */ #ifdef DISABLE_ORC void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride){ int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_8x8_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } void orc_sad_8x8_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 8, 7, 8, 8, 9, 14, 111, 114, 99, 95, 115, 97, 100, 95, 56, 120, 56, 95, 117, 56, 12, 1, 1, 12, 1, 1, 13, 4, 182, 12, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sad_8x8_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 8); orc_program_set_2d (p); orc_program_set_constant_m (p, 8); orc_program_set_name (p, "orc_sad_8x8_u8"); orc_program_set_backup_function (p, _backup_orc_sad_8x8_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 8; ORC_EXECUTOR_M(ex) = 8; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_12x12_u8 */ #ifdef DISABLE_ORC void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride){ int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_12x12_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } void orc_sad_12x12_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 12, 7, 8, 12, 9, 16, 111, 114, 99, 95, 115, 97, 100, 95, 49, 50, 120, 49, 50, 95, 117, 56, 12, 1, 1, 12, 1, 1, 13, 4, 182, 12, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sad_12x12_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 12); orc_program_set_2d (p); orc_program_set_constant_m (p, 12); orc_program_set_name (p, "orc_sad_12x12_u8"); orc_program_set_backup_function (p, _backup_orc_sad_12x12_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 12; ORC_EXECUTOR_M(ex) = 12; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_16xn_u8 */ #ifdef DISABLE_ORC void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 16; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } void orc_sad_16xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 16, 7, 9, 15, 111, 114, 99, 95, 115, 97, 100, 95, 49, 54, 120, 110, 95, 117, 56, 12, 1, 1, 12, 1, 1, 13, 4, 182, 12, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sad_16xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 16); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_16xn_u8"); orc_program_set_backup_function (p, _backup_orc_sad_16xn_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 16; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* orc_sad_32xn_u8 */ #ifdef DISABLE_ORC void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m){ int i; int j; int n = 32; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } *a1 = var12.i; } #else static void _backup_orc_sad_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } void orc_sad_32xn_u8 (orc_uint32 * ORC_RESTRICT a1, const orc_uint8 * ORC_RESTRICT s1, int s1_stride, const orc_uint8 * ORC_RESTRICT s2, int s2_stride, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 3, 32, 7, 9, 15, 111, 114, 99, 95, 115, 97, 100, 95, 51, 50, 120, 110, 95, 117, 56, 12, 1, 1, 12, 1, 1, 13, 4, 182, 12, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_sad_32xn_u8); #else p = orc_program_new (); orc_program_set_constant_n (p, 32); orc_program_set_2d (p); orc_program_set_name (p, "orc_sad_32xn_u8"); orc_program_set_backup_function (p, _backup_orc_sad_32xn_u8); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_accumulator (p, 4, "a1"); orc_program_append_2 (p, "accsadubl", 0, ORC_VAR_A1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = 32; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); *a1 = orc_executor_get_accumulator (ex, ORC_VAR_A1); } #endif /* convert_rgb_to_gray */ #ifdef DISABLE_ORC void convert_rgb_to_gray (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union32 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union32 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif orc_int8 var42; orc_union16 var43; orc_int8 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_int8 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_int8 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)d1; ptr4 = (orc_union32 *)s1; /* 5: loadpw */ var36.i = (int)0x00004c8b; /* 19595 or 9.68122e-320f */ /* 12: loadpw */ var38.i = (int)0x00009646; /* 38470 or 1.90067e-319f */ /* 20: loadpw */ var40.i = (int)0x00001d2f; /* 7471 or 3.69116e-320f */ /* 23: loadpw */ var41.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var35.i; var43.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var43.i; var44 = _src.x2[0]; } /* 3: convubw */ var45.i = (orc_uint8)var44; /* 4: swapw */ var46.i = ORC_SWAP_W(var45.i); /* 6: mulhuw */ var47.i = ((orc_uint32)((orc_uint16)var46.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 7: loadl */ var37 = ptr4[i]; /* 8: select0lw */ { orc_union32 _src; _src.i = var37.i; var48.i = _src.x2[0]; } /* 9: select1wb */ { orc_union16 _src; _src.i = var48.i; var49 = _src.x2[1]; } /* 10: convubw */ var50.i = (orc_uint8)var49; /* 11: swapw */ var51.i = ORC_SWAP_W(var50.i); /* 13: mulhuw */ var52.i = ((orc_uint32)((orc_uint16)var51.i) * (orc_uint32)((orc_uint16)var38.i)) >> 16; /* 14: addusw */ var53.i = ORC_CLAMP_UW((orc_uint16)var47.i + (orc_uint16)var52.i); /* 15: loadl */ var39 = ptr4[i]; /* 16: select1lw */ { orc_union32 _src; _src.i = var39.i; var54.i = _src.x2[1]; } /* 17: select0wb */ { orc_union16 _src; _src.i = var54.i; var55 = _src.x2[0]; } /* 18: convubw */ var56.i = (orc_uint8)var55; /* 19: swapw */ var57.i = ORC_SWAP_W(var56.i); /* 21: mulhuw */ var58.i = ((orc_uint32)((orc_uint16)var57.i) * (orc_uint32)((orc_uint16)var40.i)) >> 16; /* 22: addusw */ var59.i = ORC_CLAMP_UW((orc_uint16)var53.i + (orc_uint16)var58.i); /* 24: addusw */ var60.i = ORC_CLAMP_UW((orc_uint16)var59.i + (orc_uint16)var41.i); /* 25: select1wb */ { orc_union16 _src; _src.i = var60.i; var42 = _src.x2[1]; } /* 26: storeb */ ptr0[i] = var42; } } #else static void _backup_convert_rgb_to_gray (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union32 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union32 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif orc_int8 var42; orc_union16 var43; orc_int8 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_int8 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_int8 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var36.i = (int)0x00004c8b; /* 19595 or 9.68122e-320f */ /* 12: loadpw */ var38.i = (int)0x00009646; /* 38470 or 1.90067e-319f */ /* 20: loadpw */ var40.i = (int)0x00001d2f; /* 7471 or 3.69116e-320f */ /* 23: loadpw */ var41.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var35.i; var43.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var43.i; var44 = _src.x2[0]; } /* 3: convubw */ var45.i = (orc_uint8)var44; /* 4: swapw */ var46.i = ORC_SWAP_W(var45.i); /* 6: mulhuw */ var47.i = ((orc_uint32)((orc_uint16)var46.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 7: loadl */ var37 = ptr4[i]; /* 8: select0lw */ { orc_union32 _src; _src.i = var37.i; var48.i = _src.x2[0]; } /* 9: select1wb */ { orc_union16 _src; _src.i = var48.i; var49 = _src.x2[1]; } /* 10: convubw */ var50.i = (orc_uint8)var49; /* 11: swapw */ var51.i = ORC_SWAP_W(var50.i); /* 13: mulhuw */ var52.i = ((orc_uint32)((orc_uint16)var51.i) * (orc_uint32)((orc_uint16)var38.i)) >> 16; /* 14: addusw */ var53.i = ORC_CLAMP_UW((orc_uint16)var47.i + (orc_uint16)var52.i); /* 15: loadl */ var39 = ptr4[i]; /* 16: select1lw */ { orc_union32 _src; _src.i = var39.i; var54.i = _src.x2[1]; } /* 17: select0wb */ { orc_union16 _src; _src.i = var54.i; var55 = _src.x2[0]; } /* 18: convubw */ var56.i = (orc_uint8)var55; /* 19: swapw */ var57.i = ORC_SWAP_W(var56.i); /* 21: mulhuw */ var58.i = ((orc_uint32)((orc_uint16)var57.i) * (orc_uint32)((orc_uint16)var40.i)) >> 16; /* 22: addusw */ var59.i = ORC_CLAMP_UW((orc_uint16)var53.i + (orc_uint16)var58.i); /* 24: addusw */ var60.i = ORC_CLAMP_UW((orc_uint16)var59.i + (orc_uint16)var41.i); /* 25: select1wb */ { orc_union16 _src; _src.i = var60.i; var42 = _src.x2[1]; } /* 26: storeb */ ptr0[i] = var42; } } void convert_rgb_to_gray (orc_uint8 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 19, 99, 111, 110, 118, 101, 114, 116, 95, 114, 103, 98, 95, 116, 111, 95, 103, 114, 97, 121, 11, 1, 1, 12, 4, 4, 14, 4, 139, 76, 0, 0, 14, 4, 70, 150, 0, 0, 14, 4, 47, 29, 0, 0, 14, 4, 128, 0, 0, 0, 20, 1, 20, 2, 20, 2, 190, 33, 4, 188, 32, 33, 150, 34, 32, 183, 34, 34, 91, 34, 34, 16, 190, 33, 4, 189, 32, 33, 150, 33, 32, 183, 33, 33, 91, 33, 33, 17, 72, 34, 34, 33, 191, 33, 4, 188, 32, 33, 150, 33, 32, 183, 33, 33, 91, 33, 33, 18, 72, 34, 34, 33, 72, 34, 34, 19, 189, 0, 34, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_convert_rgb_to_gray); #else p = orc_program_new (); orc_program_set_name (p, "convert_rgb_to_gray"); orc_program_set_backup_function (p, _backup_convert_rgb_to_gray); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x00004c8b, "c1"); orc_program_add_constant (p, 4, 0x00009646, "c2"); orc_program_add_constant (p, 4, 0x00001d2f, "c3"); orc_program_add_constant (p, 4, 0x00000080, "c4"); orc_program_add_temporary (p, 1, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "swapw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "swapw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "addusw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "swapw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3, ORC_VAR_D1); orc_program_append_2 (p, "addusw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "addusw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C4, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* canny_calc_delta_x */ #ifdef DISABLE_ORC void canny_calc_delta_x (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_int8 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union32 var54; orc_union32 var55; orc_union16 var56; orc_int8 var57; orc_union16 var58; orc_int8 var59; orc_union16 var60; orc_union16 var61; orc_union16 var62; orc_union32 var63; orc_union32 var64; orc_union32 var65; orc_union16 var66; orc_int8 var67; orc_union16 var68; orc_int8 var69; orc_union16 var70; orc_union16 var71; orc_union16 var72; orc_union32 var73; orc_union32 var74; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var40.i; var47.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var47.i; var48 = _src.x2[1]; } /* 3: loadl */ var41 = ptr5[i]; /* 4: select0lw */ { orc_union32 _src; _src.i = var41.i; var49.i = _src.x2[0]; } /* 5: select1wb */ { orc_union16 _src; _src.i = var49.i; var50 = _src.x2[1]; } /* 6: convubw */ var51.i = (orc_uint8)var48; /* 7: convubw */ var52.i = (orc_uint8)var50; /* 8: subw */ var53.i = var51.i - var52.i; /* 9: convswl */ var54.i = var53.i; /* 10: mulll */ var55.i = (var54.i * var54.i) & 0xffffffff; /* 11: loadl */ var42 = ptr4[i]; /* 12: select1lw */ { orc_union32 _src; _src.i = var42.i; var56.i = _src.x2[1]; } /* 13: select0wb */ { orc_union16 _src; _src.i = var56.i; var57 = _src.x2[0]; } /* 14: loadl */ var43 = ptr5[i]; /* 15: select1lw */ { orc_union32 _src; _src.i = var43.i; var58.i = _src.x2[1]; } /* 16: select0wb */ { orc_union16 _src; _src.i = var58.i; var59 = _src.x2[0]; } /* 17: convubw */ var60.i = (orc_uint8)var57; /* 18: convubw */ var61.i = (orc_uint8)var59; /* 19: subw */ var62.i = var60.i - var61.i; /* 20: convswl */ var63.i = var62.i; /* 21: mulll */ var64.i = (var63.i * var63.i) & 0xffffffff; /* 22: addl */ var65.i = var55.i + var64.i; /* 23: loadl */ var44 = ptr4[i]; /* 24: select1lw */ { orc_union32 _src; _src.i = var44.i; var66.i = _src.x2[1]; } /* 25: select1wb */ { orc_union16 _src; _src.i = var66.i; var67 = _src.x2[1]; } /* 26: loadl */ var45 = ptr5[i]; /* 27: select1lw */ { orc_union32 _src; _src.i = var45.i; var68.i = _src.x2[1]; } /* 28: select1wb */ { orc_union16 _src; _src.i = var68.i; var69 = _src.x2[1]; } /* 29: convubw */ var70.i = (orc_uint8)var67; /* 30: convubw */ var71.i = (orc_uint8)var69; /* 31: subw */ var72.i = var70.i - var71.i; /* 32: convswl */ var73.i = var72.i; /* 33: mulll */ var74.i = (var73.i * var73.i) & 0xffffffff; /* 34: addl */ var46.i = var65.i + var74.i; /* 35: storel */ ptr0[i] = var46; } } #else static void _backup_canny_calc_delta_x (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_int8 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union32 var54; orc_union32 var55; orc_union16 var56; orc_int8 var57; orc_union16 var58; orc_int8 var59; orc_union16 var60; orc_union16 var61; orc_union16 var62; orc_union32 var63; orc_union32 var64; orc_union32 var65; orc_union16 var66; orc_int8 var67; orc_union16 var68; orc_int8 var69; orc_union16 var70; orc_union16 var71; orc_union16 var72; orc_union32 var73; orc_union32 var74; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var40.i; var47.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var47.i; var48 = _src.x2[1]; } /* 3: loadl */ var41 = ptr5[i]; /* 4: select0lw */ { orc_union32 _src; _src.i = var41.i; var49.i = _src.x2[0]; } /* 5: select1wb */ { orc_union16 _src; _src.i = var49.i; var50 = _src.x2[1]; } /* 6: convubw */ var51.i = (orc_uint8)var48; /* 7: convubw */ var52.i = (orc_uint8)var50; /* 8: subw */ var53.i = var51.i - var52.i; /* 9: convswl */ var54.i = var53.i; /* 10: mulll */ var55.i = (var54.i * var54.i) & 0xffffffff; /* 11: loadl */ var42 = ptr4[i]; /* 12: select1lw */ { orc_union32 _src; _src.i = var42.i; var56.i = _src.x2[1]; } /* 13: select0wb */ { orc_union16 _src; _src.i = var56.i; var57 = _src.x2[0]; } /* 14: loadl */ var43 = ptr5[i]; /* 15: select1lw */ { orc_union32 _src; _src.i = var43.i; var58.i = _src.x2[1]; } /* 16: select0wb */ { orc_union16 _src; _src.i = var58.i; var59 = _src.x2[0]; } /* 17: convubw */ var60.i = (orc_uint8)var57; /* 18: convubw */ var61.i = (orc_uint8)var59; /* 19: subw */ var62.i = var60.i - var61.i; /* 20: convswl */ var63.i = var62.i; /* 21: mulll */ var64.i = (var63.i * var63.i) & 0xffffffff; /* 22: addl */ var65.i = var55.i + var64.i; /* 23: loadl */ var44 = ptr4[i]; /* 24: select1lw */ { orc_union32 _src; _src.i = var44.i; var66.i = _src.x2[1]; } /* 25: select1wb */ { orc_union16 _src; _src.i = var66.i; var67 = _src.x2[1]; } /* 26: loadl */ var45 = ptr5[i]; /* 27: select1lw */ { orc_union32 _src; _src.i = var45.i; var68.i = _src.x2[1]; } /* 28: select1wb */ { orc_union16 _src; _src.i = var68.i; var69 = _src.x2[1]; } /* 29: convubw */ var70.i = (orc_uint8)var67; /* 30: convubw */ var71.i = (orc_uint8)var69; /* 31: subw */ var72.i = var70.i - var71.i; /* 32: convswl */ var73.i = var72.i; /* 33: mulll */ var74.i = (var73.i * var73.i) & 0xffffffff; /* 34: addl */ var46.i = var65.i + var74.i; /* 35: storel */ ptr0[i] = var46; } } void canny_calc_delta_x (orc_int32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 99, 97, 110, 110, 121, 95, 99, 97, 108, 99, 95, 100, 101, 108, 116, 97, 95, 120, 11, 4, 4, 12, 4, 4, 12, 4, 4, 20, 2, 20, 2, 20, 1, 20, 2, 20, 1, 20, 2, 20, 4, 20, 4, 190, 33, 4, 189, 34, 33, 190, 35, 5, 189, 36, 35, 150, 35, 34, 150, 37, 36, 98, 32, 35, 37, 153, 38, 32, 120, 39, 38, 38, 191, 33, 4, 188, 34, 33, 191, 35, 5, 188, 36, 35, 150, 35, 34, 150, 37, 36, 98, 32, 35, 37, 153, 38, 32, 120, 38, 38, 38, 103, 39, 39, 38, 191, 33, 4, 189, 34, 33, 191, 35, 5, 189, 36, 35, 150, 35, 34, 150, 37, 36, 98, 32, 35, 37, 153, 38, 32, 120, 38, 38, 38, 103, 0, 39, 38, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_canny_calc_delta_x); #else p = orc_program_new (); orc_program_set_name (p, "canny_calc_delta_x"); orc_program_set_backup_function (p, _backup_canny_calc_delta_x); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 1, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 1, "t5"); orc_program_add_temporary (p, 2, "t6"); orc_program_add_temporary (p, 4, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T4, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_T6, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T7, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T8, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T4, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_T6, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T7, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_T8, ORC_VAR_T8, ORC_VAR_T7, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T2, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T4, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_T6, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 0, ORC_VAR_T7, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 0, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_T7, ORC_VAR_D1); orc_program_append_2 (p, "addl", 0, ORC_VAR_D1, ORC_VAR_T8, ORC_VAR_T7, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* i420_to_ayuv */ #ifdef DISABLE_ORC void i420_to_ayuv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_int8 var37; orc_union32 var38; orc_int8 var39; orc_int8 var40; orc_int8 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union32 *)d1; ptr4 = (orc_int8 *)s1; ptr5 = (orc_int8 *)s2; ptr6 = (orc_int8 *)s3; /* 3: loadpb */ var37 = p1; for (i = 0; i < n; i++) { /* 0: loadupdb */ var39 = ptr5[i>>1]; /* 1: loadupdb */ var40 = ptr6[i>>1]; /* 2: loadb */ var41 = ptr4[i]; /* 4: mergebw */ { orc_union16 _dest; _dest.x2[0] = var37; _dest.x2[1] = var41; var42.i = _dest.i; } /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var39; _dest.x2[1] = var40; var43.i = _dest.i; } /* 6: mergewl */ { orc_union32 _dest; _dest.x2[0] = var42.i; _dest.x2[1] = var43.i; var38.i = _dest.i; } /* 7: storel */ ptr0[i] = var38; } } #else static void _backup_i420_to_ayuv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_int8 var37; orc_union32 var38; orc_int8 var39; orc_int8 var40; orc_int8 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; /* 3: loadpb */ var37 = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadupdb */ var39 = ptr5[i>>1]; /* 1: loadupdb */ var40 = ptr6[i>>1]; /* 2: loadb */ var41 = ptr4[i]; /* 4: mergebw */ { orc_union16 _dest; _dest.x2[0] = var37; _dest.x2[1] = var41; var42.i = _dest.i; } /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var39; _dest.x2[1] = var40; var43.i = _dest.i; } /* 6: mergewl */ { orc_union32 _dest; _dest.x2[0] = var42.i; _dest.x2[1] = var43.i; var38.i = _dest.i; } /* 7: storel */ ptr0[i] = var38; } } void i420_to_ayuv (orc_uint32 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, const orc_uint8 * ORC_RESTRICT s3, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 12, 105, 52, 50, 48, 95, 116, 111, 95, 97, 121, 117, 118, 11, 4, 4, 12, 1, 1, 12, 1, 1, 12, 1, 1, 16, 1, 20, 1, 20, 1, 20, 1, 20, 2, 20, 2, 45, 32, 5, 45, 33, 6, 43, 34, 4, 196, 35, 24, 34, 196, 36, 32, 33, 195, 0, 35, 36, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_i420_to_ayuv); #else p = orc_program_new (); orc_program_set_name (p, "i420_to_ayuv"); orc_program_set_backup_function (p, _backup_i420_to_ayuv); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_source (p, 1, "s3"); orc_program_add_parameter (p, 1, "p1"); orc_program_add_temporary (p, 1, "t1"); orc_program_add_temporary (p, 1, "t2"); orc_program_add_temporary (p, 1, "t3"); orc_program_add_temporary (p, 2, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_append_2 (p, "loadupdb", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadupdb", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadb", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_P1, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->arrays[ORC_VAR_S3] = (void *)s3; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* test_4x */ #ifdef DISABLE_ORC void test_4x (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_test_4x (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } void test_4x (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 7, 116, 101, 115, 116, 95, 52, 120, 11, 4, 4, 12, 4, 4, 12, 4, 4, 21, 2, 35, 0, 4, 5, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_test_4x); #else p = orc_program_new (); orc_program_set_name (p, "test_4x"); orc_program_set_backup_function (p, _backup_test_4x); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* test_4x_2 */ #ifdef DISABLE_ORC void test_4x_2 (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 1: loadpb */ var33.x4[0] = p1; var33.x4[1] = p1; var33.x4[2] = p1; var33.x4[3] = p1; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_test_4x_2 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 1: loadpb */ var33.x4[0] = ex->params[24]; var33.x4[1] = ex->params[24]; var33.x4[2] = ex->params[24]; var33.x4[3] = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } void test_4x_2 (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 9, 116, 101, 115, 116, 95, 52, 120, 95, 50, 11, 4, 4, 12, 4, 4, 16, 4, 21, 2, 35, 0, 4, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_test_4x_2); #else p = orc_program_new (); orc_program_set_name (p, "test_4x_2"); orc_program_set_backup_function (p, _backup_test_4x_2); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_parameter (p, 4, "p1"); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_P1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u16 */ #ifdef DISABLE_ORC void orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)d1; /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } #else static void _backup_orc_splat_u16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } void orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 13, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 117, 49, 54, 11, 2, 2, 16, 2, 79, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_u16); #else p = orc_program_new (); orc_program_set_name (p, "orc_splat_u16"); orc_program_set_backup_function (p, _backup_orc_splat_u16); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u32 */ #ifdef DISABLE_ORC void orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)d1; /* 0: loadpl */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } #else static void _backup_orc_splat_u32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } void orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 13, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 117, 51, 50, 11, 4, 4, 16, 4, 112, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_u32); #else p = orc_program_new (); orc_program_set_name (p, "orc_splat_u32"); orc_program_set_backup_function (p, _backup_orc_splat_u32); orc_program_add_destination (p, 4, "d1"); orc_program_add_parameter (p, 4, "p1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u16_2d */ #ifdef DISABLE_ORC void orc_splat_u16_2d (orc_uint16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpw */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_u16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } void orc_splat_u16_2d (orc_uint16 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 16, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 117, 49, 54, 95, 50, 100, 11, 2, 2, 16, 2, 79, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_u16_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_u16_2d"); orc_program_set_backup_function (p, _backup_orc_splat_u16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_parameter (p, 2, "p1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_splat_u32_2d */ #ifdef DISABLE_ORC void orc_splat_u32_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m){ int i; int j; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); /* 0: loadpl */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } #else static void _backup_orc_splat_u32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } void orc_splat_u32_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, int p1, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 16, 111, 114, 99, 95, 115, 112, 108, 97, 116, 95, 117, 51, 50, 95, 50, 100, 11, 4, 4, 16, 4, 112, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_splat_u32_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_splat_u32_2d"); orc_program_set_backup_function (p, _backup_orc_splat_u32_2d); orc_program_add_destination (p, 4, "d1"); orc_program_add_parameter (p, 4, "p1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_copy_u16_2d */ #ifdef DISABLE_ORC void orc_copy_u16_2d (orc_uint16 * ORC_RESTRICT d1, int d1_stride, const orc_uint16 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } #else static void _backup_orc_copy_u16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } void orc_copy_u16_2d (orc_uint16 * ORC_RESTRICT d1, int d1_stride, const orc_uint16 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 15, 111, 114, 99, 95, 99, 111, 112, 121, 95, 117, 49, 54, 95, 50, 100, 11, 2, 2, 12, 2, 2, 79, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_copy_u16_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_copy_u16_2d"); orc_program_set_backup_function (p, _backup_orc_copy_u16_2d); orc_program_add_destination (p, 2, "d1"); orc_program_add_source (p, 2, "s1"); orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_copy_u32_2d */ #ifdef DISABLE_ORC void orc_copy_u32_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, const orc_uint32 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } #else static void _backup_orc_copy_u32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } void orc_copy_u32_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, const orc_uint32 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 15, 111, 114, 99, 95, 99, 111, 112, 121, 95, 117, 51, 50, 95, 50, 100, 11, 4, 4, 12, 4, 4, 112, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_copy_u32_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_copy_u32_2d"); orc_program_set_backup_function (p, _backup_orc_copy_u32_2d); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_composite_add_8888_8888_2d */ #ifdef DISABLE_ORC void orc_composite_add_8888_8888_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, const orc_uint32 * ORC_RESTRICT s1, int s1_stride, int n, int m){ int i; int j; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } } #else static void _backup_orc_composite_add_8888_8888_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } } void orc_composite_add_8888_8888_2d (orc_uint32 * ORC_RESTRICT d1, int d1_stride, const orc_uint32 * ORC_RESTRICT s1, int s1_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 30, 111, 114, 99, 95, 99, 111, 109, 112, 111, 115, 105, 116, 101, 95, 97, 100, 100, 95, 56, 56, 56, 56, 95, 56, 56, 56, 56, 95, 50, 100, 11, 4, 4, 12, 4, 4, 21, 2, 35, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_composite_add_8888_8888_2d); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "orc_composite_add_8888_8888_2d"); orc_program_set_backup_function (p, _backup_orc_composite_add_8888_8888_2d); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; func = c->exec; func (ex); } #endif /* orc_composite_add_8_8_line */ #ifdef DISABLE_ORC void orc_composite_add_8_8_line (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr0[i]; /* 1: loadb */ var33 = ptr4[i]; /* 2: addusb */ var34 = ORC_CLAMP_UB((orc_uint8)var32 + (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } #else static void _backup_orc_composite_add_8_8_line (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr0[i]; /* 1: loadb */ var33 = ptr4[i]; /* 2: addusb */ var34 = ORC_CLAMP_UB((orc_uint8)var32 + (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } void orc_composite_add_8_8_line (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 111, 114, 99, 95, 99, 111, 109, 112, 111, 115, 105, 116, 101, 95, 97, 100, 100, 95, 56, 95, 56, 95, 108, 105, 110, 101, 11, 1, 1, 12, 1, 1, 35, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_composite_add_8_8_line); #else p = orc_program_new (); orc_program_set_name (p, "orc_composite_add_8_8_line"); orc_program_set_backup_function (p, _backup_orc_composite_add_8_8_line); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_composite_add_n_8_8_line */ #ifdef DISABLE_ORC void orc_composite_add_n_8_8_line (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_int8 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_int8 var41; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; /* 2: loadpw */ var35.i = p1; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var38.i = (orc_uint8)var34; /* 3: mullw */ var39.i = (var38.i * var35.i) & 0xffff; /* 4: div255w */ var40.i = ((orc_uint16)(((orc_uint16)(var39.i+128)) + (((orc_uint16)(var39.i+128))>>8)))>>8; /* 5: convwb */ var41 = var40.i; /* 6: loadb */ var36 = ptr0[i]; /* 7: addusb */ var37 = ORC_CLAMP_UB((orc_uint8)var36 + (orc_uint8)var41); /* 8: storeb */ ptr0[i] = var37; } } #else static void _backup_orc_composite_add_n_8_8_line (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_int8 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_int8 var41; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var35.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var38.i = (orc_uint8)var34; /* 3: mullw */ var39.i = (var38.i * var35.i) & 0xffff; /* 4: div255w */ var40.i = ((orc_uint16)(((orc_uint16)(var39.i+128)) + (((orc_uint16)(var39.i+128))>>8)))>>8; /* 5: convwb */ var41 = var40.i; /* 6: loadb */ var36 = ptr0[i]; /* 7: addusb */ var37 = ORC_CLAMP_UB((orc_uint8)var36 + (orc_uint8)var41); /* 8: storeb */ ptr0[i] = var37; } } void orc_composite_add_n_8_8_line (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 28, 111, 114, 99, 95, 99, 111, 109, 112, 111, 115, 105, 116, 101, 95, 97, 100, 100, 95, 110, 95, 56, 95, 56, 95, 108, 105, 110, 101, 11, 1, 1, 12, 1, 1, 16, 2, 20, 2, 20, 1, 150, 32, 4, 89, 32, 32, 24, 80, 32, 32, 157, 33, 32, 35, 0, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_composite_add_n_8_8_line); #else p = orc_program_new (); orc_program_set_name (p, "orc_composite_add_n_8_8_line"); orc_program_set_backup_function (p, _backup_orc_composite_add_n_8_8_line); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 1, "t2"); orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* orc_code_combine_add_u */ #ifdef DISABLE_ORC void orc_code_combine_add_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union32 var44; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: convubw */ var39.x4[0] = (orc_uint8)var35.x4[0]; var39.x4[1] = (orc_uint8)var35.x4[1]; var39.x4[2] = (orc_uint8)var35.x4[2]; var39.x4[3] = (orc_uint8)var35.x4[3]; /* 2: loadl */ var36 = ptr5[i]; /* 3: convubw */ var40.x4[0] = (orc_uint8)var36.x4[0]; var40.x4[1] = (orc_uint8)var36.x4[1]; var40.x4[2] = (orc_uint8)var36.x4[2]; var40.x4[3] = (orc_uint8)var36.x4[3]; /* 4: splatw3q */ var41.i = ((((orc_uint64)var40.i)>>48) << 48) | ((((orc_uint64)var40.i)>>48)<<32) | ((((orc_uint64)var40.i)>>48) << 16) | ((((orc_uint64)var40.i)>>48)); /* 5: mullw */ var42.x4[0] = (var39.x4[0] * var41.x4[0]) & 0xffff; var42.x4[1] = (var39.x4[1] * var41.x4[1]) & 0xffff; var42.x4[2] = (var39.x4[2] * var41.x4[2]) & 0xffff; var42.x4[3] = (var39.x4[3] * var41.x4[3]) & 0xffff; /* 6: div255w */ var43.x4[0] = ((orc_uint16)(((orc_uint16)(var42.x4[0]+128)) + (((orc_uint16)(var42.x4[0]+128))>>8)))>>8; var43.x4[1] = ((orc_uint16)(((orc_uint16)(var42.x4[1]+128)) + (((orc_uint16)(var42.x4[1]+128))>>8)))>>8; var43.x4[2] = ((orc_uint16)(((orc_uint16)(var42.x4[2]+128)) + (((orc_uint16)(var42.x4[2]+128))>>8)))>>8; var43.x4[3] = ((orc_uint16)(((orc_uint16)(var42.x4[3]+128)) + (((orc_uint16)(var42.x4[3]+128))>>8)))>>8; /* 7: convwb */ var44.x4[0] = var43.x4[0]; var44.x4[1] = var43.x4[1]; var44.x4[2] = var43.x4[2]; var44.x4[3] = var43.x4[3]; /* 8: loadl */ var37 = ptr0[i]; /* 9: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var37.x4[0] + (orc_uint8)var44.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var37.x4[1] + (orc_uint8)var44.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var37.x4[2] + (orc_uint8)var44.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var37.x4[3] + (orc_uint8)var44.x4[3]); /* 10: storel */ ptr0[i] = var38; } } #else static void _backup_orc_code_combine_add_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union32 var44; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: convubw */ var39.x4[0] = (orc_uint8)var35.x4[0]; var39.x4[1] = (orc_uint8)var35.x4[1]; var39.x4[2] = (orc_uint8)var35.x4[2]; var39.x4[3] = (orc_uint8)var35.x4[3]; /* 2: loadl */ var36 = ptr5[i]; /* 3: convubw */ var40.x4[0] = (orc_uint8)var36.x4[0]; var40.x4[1] = (orc_uint8)var36.x4[1]; var40.x4[2] = (orc_uint8)var36.x4[2]; var40.x4[3] = (orc_uint8)var36.x4[3]; /* 4: splatw3q */ var41.i = ((((orc_uint64)var40.i)>>48) << 48) | ((((orc_uint64)var40.i)>>48)<<32) | ((((orc_uint64)var40.i)>>48) << 16) | ((((orc_uint64)var40.i)>>48)); /* 5: mullw */ var42.x4[0] = (var39.x4[0] * var41.x4[0]) & 0xffff; var42.x4[1] = (var39.x4[1] * var41.x4[1]) & 0xffff; var42.x4[2] = (var39.x4[2] * var41.x4[2]) & 0xffff; var42.x4[3] = (var39.x4[3] * var41.x4[3]) & 0xffff; /* 6: div255w */ var43.x4[0] = ((orc_uint16)(((orc_uint16)(var42.x4[0]+128)) + (((orc_uint16)(var42.x4[0]+128))>>8)))>>8; var43.x4[1] = ((orc_uint16)(((orc_uint16)(var42.x4[1]+128)) + (((orc_uint16)(var42.x4[1]+128))>>8)))>>8; var43.x4[2] = ((orc_uint16)(((orc_uint16)(var42.x4[2]+128)) + (((orc_uint16)(var42.x4[2]+128))>>8)))>>8; var43.x4[3] = ((orc_uint16)(((orc_uint16)(var42.x4[3]+128)) + (((orc_uint16)(var42.x4[3]+128))>>8)))>>8; /* 7: convwb */ var44.x4[0] = var43.x4[0]; var44.x4[1] = var43.x4[1]; var44.x4[2] = var43.x4[2]; var44.x4[3] = var43.x4[3]; /* 8: loadl */ var37 = ptr0[i]; /* 9: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var37.x4[0] + (orc_uint8)var44.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var37.x4[1] + (orc_uint8)var44.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var37.x4[2] + (orc_uint8)var44.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var37.x4[3] + (orc_uint8)var44.x4[3]); /* 10: storel */ ptr0[i] = var38; } } void orc_code_combine_add_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 22, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 97, 100, 100, 95, 117, 11, 4, 4, 12, 4, 4, 12, 4, 4, 20, 8, 20, 8, 20, 4, 21, 2, 150, 32, 4, 21, 2, 150, 33, 5, 136, 33, 33, 21, 2, 89, 32, 32, 33, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 21, 2, 35, 0, 0, 34, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_add_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_add_u"); orc_program_set_backup_function (p, _backup_orc_code_combine_add_u); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_add_u_n */ #ifdef DISABLE_ORC void orc_code_combine_add_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_orc_code_combine_add_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } void orc_code_combine_add_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 97, 100, 100, 95, 117, 95, 110, 11, 4, 4, 12, 4, 4, 21, 2, 35, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_add_u_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_add_u_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_add_u_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_over_u */ #ifdef DISABLE_ORC void orc_code_combine_over_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union32 var46; orc_union32 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union32 var53; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 10: loadpw */ var39.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 5: mullw */ var44.x4[0] = (var41.x4[0] * var43.x4[0]) & 0xffff; var44.x4[1] = (var41.x4[1] * var43.x4[1]) & 0xffff; var44.x4[2] = (var41.x4[2] * var43.x4[2]) & 0xffff; var44.x4[3] = (var41.x4[3] * var43.x4[3]) & 0xffff; /* 6: div255w */ var45.x4[0] = ((orc_uint16)(((orc_uint16)(var44.x4[0]+128)) + (((orc_uint16)(var44.x4[0]+128))>>8)))>>8; var45.x4[1] = ((orc_uint16)(((orc_uint16)(var44.x4[1]+128)) + (((orc_uint16)(var44.x4[1]+128))>>8)))>>8; var45.x4[2] = ((orc_uint16)(((orc_uint16)(var44.x4[2]+128)) + (((orc_uint16)(var44.x4[2]+128))>>8)))>>8; var45.x4[3] = ((orc_uint16)(((orc_uint16)(var44.x4[3]+128)) + (((orc_uint16)(var44.x4[3]+128))>>8)))>>8; /* 7: convwb */ var46.x4[0] = var45.x4[0]; var46.x4[1] = var45.x4[1]; var46.x4[2] = var45.x4[2]; var46.x4[3] = var45.x4[3]; /* 8: loadl */ var47 = ptr0[i]; /* 9: convubw */ var48.x4[0] = (orc_uint8)var47.x4[0]; var48.x4[1] = (orc_uint8)var47.x4[1]; var48.x4[2] = (orc_uint8)var47.x4[2]; var48.x4[3] = (orc_uint8)var47.x4[3]; /* 11: xorw */ var49.x4[0] = var45.x4[0] ^ var39.x4[0]; var49.x4[1] = var45.x4[1] ^ var39.x4[1]; var49.x4[2] = var45.x4[2] ^ var39.x4[2]; var49.x4[3] = var45.x4[3] ^ var39.x4[3]; /* 12: splatw3q */ var50.i = ((((orc_uint64)var49.i)>>48) << 48) | ((((orc_uint64)var49.i)>>48)<<32) | ((((orc_uint64)var49.i)>>48) << 16) | ((((orc_uint64)var49.i)>>48)); /* 13: mullw */ var51.x4[0] = (var48.x4[0] * var50.x4[0]) & 0xffff; var51.x4[1] = (var48.x4[1] * var50.x4[1]) & 0xffff; var51.x4[2] = (var48.x4[2] * var50.x4[2]) & 0xffff; var51.x4[3] = (var48.x4[3] * var50.x4[3]) & 0xffff; /* 14: div255w */ var52.x4[0] = ((orc_uint16)(((orc_uint16)(var51.x4[0]+128)) + (((orc_uint16)(var51.x4[0]+128))>>8)))>>8; var52.x4[1] = ((orc_uint16)(((orc_uint16)(var51.x4[1]+128)) + (((orc_uint16)(var51.x4[1]+128))>>8)))>>8; var52.x4[2] = ((orc_uint16)(((orc_uint16)(var51.x4[2]+128)) + (((orc_uint16)(var51.x4[2]+128))>>8)))>>8; var52.x4[3] = ((orc_uint16)(((orc_uint16)(var51.x4[3]+128)) + (((orc_uint16)(var51.x4[3]+128))>>8)))>>8; /* 15: convwb */ var53.x4[0] = var52.x4[0]; var53.x4[1] = var52.x4[1]; var53.x4[2] = var52.x4[2]; var53.x4[3] = var52.x4[3]; /* 16: addusb */ var40.x4[0] = ORC_CLAMP_UB((orc_uint8)var53.x4[0] + (orc_uint8)var46.x4[0]); var40.x4[1] = ORC_CLAMP_UB((orc_uint8)var53.x4[1] + (orc_uint8)var46.x4[1]); var40.x4[2] = ORC_CLAMP_UB((orc_uint8)var53.x4[2] + (orc_uint8)var46.x4[2]); var40.x4[3] = ORC_CLAMP_UB((orc_uint8)var53.x4[3] + (orc_uint8)var46.x4[3]); /* 17: storel */ ptr0[i] = var40; } } #else static void _backup_orc_code_combine_over_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union32 var46; orc_union32 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union32 var53; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 10: loadpw */ var39.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 5: mullw */ var44.x4[0] = (var41.x4[0] * var43.x4[0]) & 0xffff; var44.x4[1] = (var41.x4[1] * var43.x4[1]) & 0xffff; var44.x4[2] = (var41.x4[2] * var43.x4[2]) & 0xffff; var44.x4[3] = (var41.x4[3] * var43.x4[3]) & 0xffff; /* 6: div255w */ var45.x4[0] = ((orc_uint16)(((orc_uint16)(var44.x4[0]+128)) + (((orc_uint16)(var44.x4[0]+128))>>8)))>>8; var45.x4[1] = ((orc_uint16)(((orc_uint16)(var44.x4[1]+128)) + (((orc_uint16)(var44.x4[1]+128))>>8)))>>8; var45.x4[2] = ((orc_uint16)(((orc_uint16)(var44.x4[2]+128)) + (((orc_uint16)(var44.x4[2]+128))>>8)))>>8; var45.x4[3] = ((orc_uint16)(((orc_uint16)(var44.x4[3]+128)) + (((orc_uint16)(var44.x4[3]+128))>>8)))>>8; /* 7: convwb */ var46.x4[0] = var45.x4[0]; var46.x4[1] = var45.x4[1]; var46.x4[2] = var45.x4[2]; var46.x4[3] = var45.x4[3]; /* 8: loadl */ var47 = ptr0[i]; /* 9: convubw */ var48.x4[0] = (orc_uint8)var47.x4[0]; var48.x4[1] = (orc_uint8)var47.x4[1]; var48.x4[2] = (orc_uint8)var47.x4[2]; var48.x4[3] = (orc_uint8)var47.x4[3]; /* 11: xorw */ var49.x4[0] = var45.x4[0] ^ var39.x4[0]; var49.x4[1] = var45.x4[1] ^ var39.x4[1]; var49.x4[2] = var45.x4[2] ^ var39.x4[2]; var49.x4[3] = var45.x4[3] ^ var39.x4[3]; /* 12: splatw3q */ var50.i = ((((orc_uint64)var49.i)>>48) << 48) | ((((orc_uint64)var49.i)>>48)<<32) | ((((orc_uint64)var49.i)>>48) << 16) | ((((orc_uint64)var49.i)>>48)); /* 13: mullw */ var51.x4[0] = (var48.x4[0] * var50.x4[0]) & 0xffff; var51.x4[1] = (var48.x4[1] * var50.x4[1]) & 0xffff; var51.x4[2] = (var48.x4[2] * var50.x4[2]) & 0xffff; var51.x4[3] = (var48.x4[3] * var50.x4[3]) & 0xffff; /* 14: div255w */ var52.x4[0] = ((orc_uint16)(((orc_uint16)(var51.x4[0]+128)) + (((orc_uint16)(var51.x4[0]+128))>>8)))>>8; var52.x4[1] = ((orc_uint16)(((orc_uint16)(var51.x4[1]+128)) + (((orc_uint16)(var51.x4[1]+128))>>8)))>>8; var52.x4[2] = ((orc_uint16)(((orc_uint16)(var51.x4[2]+128)) + (((orc_uint16)(var51.x4[2]+128))>>8)))>>8; var52.x4[3] = ((orc_uint16)(((orc_uint16)(var51.x4[3]+128)) + (((orc_uint16)(var51.x4[3]+128))>>8)))>>8; /* 15: convwb */ var53.x4[0] = var52.x4[0]; var53.x4[1] = var52.x4[1]; var53.x4[2] = var52.x4[2]; var53.x4[3] = var52.x4[3]; /* 16: addusb */ var40.x4[0] = ORC_CLAMP_UB((orc_uint8)var53.x4[0] + (orc_uint8)var46.x4[0]); var40.x4[1] = ORC_CLAMP_UB((orc_uint8)var53.x4[1] + (orc_uint8)var46.x4[1]); var40.x4[2] = ORC_CLAMP_UB((orc_uint8)var53.x4[2] + (orc_uint8)var46.x4[2]); var40.x4[3] = ORC_CLAMP_UB((orc_uint8)var53.x4[3] + (orc_uint8)var46.x4[3]); /* 17: storel */ ptr0[i] = var40; } } void orc_code_combine_over_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 23, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 111, 118, 101, 114, 95, 117, 11, 4, 4, 12, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 4, 20, 4, 20, 8, 21, 2, 150, 32, 4, 21, 2, 150, 33, 5, 136, 33, 33, 21, 2, 89, 32, 32, 33, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 113, 35, 0, 21, 2, 150, 36, 35, 21, 2, 101, 32, 32, 16, 136, 33, 32, 21, 2, 89, 32, 36, 33, 21, 2, 80, 32, 32, 21, 2, 157, 35, 32, 21, 2, 35, 0, 35, 34, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_over_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_over_u"); orc_program_set_backup_function (p, _backup_orc_code_combine_over_u); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_over_u_n */ #ifdef DISABLE_ORC void orc_code_combine_over_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var37; #else orc_union64 var37; #endif orc_union32 var38; orc_union32 var39; orc_union64 var40; orc_union32 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union32 var47; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 4: loadpw */ var37.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var39 = ptr4[i]; /* 1: convubw */ var40.x4[0] = (orc_uint8)var39.x4[0]; var40.x4[1] = (orc_uint8)var39.x4[1]; var40.x4[2] = (orc_uint8)var39.x4[2]; var40.x4[3] = (orc_uint8)var39.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var41.x4[0]; var42.x4[1] = (orc_uint8)var41.x4[1]; var42.x4[2] = (orc_uint8)var41.x4[2]; var42.x4[3] = (orc_uint8)var41.x4[3]; /* 5: xorw */ var43.x4[0] = var40.x4[0] ^ var37.x4[0]; var43.x4[1] = var40.x4[1] ^ var37.x4[1]; var43.x4[2] = var40.x4[2] ^ var37.x4[2]; var43.x4[3] = var40.x4[3] ^ var37.x4[3]; /* 6: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 7: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 8: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 9: convwb */ var47.x4[0] = var46.x4[0]; var47.x4[1] = var46.x4[1]; var47.x4[2] = var46.x4[2]; var47.x4[3] = var46.x4[3]; /* 10: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var47.x4[0] + (orc_uint8)var39.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var47.x4[1] + (orc_uint8)var39.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var47.x4[2] + (orc_uint8)var39.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var47.x4[3] + (orc_uint8)var39.x4[3]); /* 11: storel */ ptr0[i] = var38; } } #else static void _backup_orc_code_combine_over_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var37; #else orc_union64 var37; #endif orc_union32 var38; orc_union32 var39; orc_union64 var40; orc_union32 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union32 var47; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 4: loadpw */ var37.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var39 = ptr4[i]; /* 1: convubw */ var40.x4[0] = (orc_uint8)var39.x4[0]; var40.x4[1] = (orc_uint8)var39.x4[1]; var40.x4[2] = (orc_uint8)var39.x4[2]; var40.x4[3] = (orc_uint8)var39.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var41.x4[0]; var42.x4[1] = (orc_uint8)var41.x4[1]; var42.x4[2] = (orc_uint8)var41.x4[2]; var42.x4[3] = (orc_uint8)var41.x4[3]; /* 5: xorw */ var43.x4[0] = var40.x4[0] ^ var37.x4[0]; var43.x4[1] = var40.x4[1] ^ var37.x4[1]; var43.x4[2] = var40.x4[2] ^ var37.x4[2]; var43.x4[3] = var40.x4[3] ^ var37.x4[3]; /* 6: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 7: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 8: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 9: convwb */ var47.x4[0] = var46.x4[0]; var47.x4[1] = var46.x4[1]; var47.x4[2] = var46.x4[2]; var47.x4[3] = var46.x4[3]; /* 10: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var47.x4[0] + (orc_uint8)var39.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var47.x4[1] + (orc_uint8)var39.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var47.x4[2] + (orc_uint8)var39.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var47.x4[3] + (orc_uint8)var39.x4[3]); /* 11: storel */ ptr0[i] = var38; } } void orc_code_combine_over_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 25, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 111, 118, 101, 114, 95, 117, 95, 110, 11, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 4, 20, 4, 20, 8, 113, 35, 4, 21, 2, 150, 32, 35, 113, 34, 0, 21, 2, 150, 36, 34, 21, 2, 101, 32, 32, 16, 136, 33, 32, 21, 2, 89, 32, 36, 33, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 21, 2, 35, 0, 34, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_over_u_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_over_u_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_over_u_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_in_u */ #ifdef DISABLE_ORC void orc_code_combine_in_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 5: mullw */ var44.x4[0] = (var41.x4[0] * var43.x4[0]) & 0xffff; var44.x4[1] = (var41.x4[1] * var43.x4[1]) & 0xffff; var44.x4[2] = (var41.x4[2] * var43.x4[2]) & 0xffff; var44.x4[3] = (var41.x4[3] * var43.x4[3]) & 0xffff; /* 6: div255w */ var45.x4[0] = ((orc_uint16)(((orc_uint16)(var44.x4[0]+128)) + (((orc_uint16)(var44.x4[0]+128))>>8)))>>8; var45.x4[1] = ((orc_uint16)(((orc_uint16)(var44.x4[1]+128)) + (((orc_uint16)(var44.x4[1]+128))>>8)))>>8; var45.x4[2] = ((orc_uint16)(((orc_uint16)(var44.x4[2]+128)) + (((orc_uint16)(var44.x4[2]+128))>>8)))>>8; var45.x4[3] = ((orc_uint16)(((orc_uint16)(var44.x4[3]+128)) + (((orc_uint16)(var44.x4[3]+128))>>8)))>>8; /* 7: loadl */ var39 = ptr0[i]; /* 8: convubw */ var46.x4[0] = (orc_uint8)var39.x4[0]; var46.x4[1] = (orc_uint8)var39.x4[1]; var46.x4[2] = (orc_uint8)var39.x4[2]; var46.x4[3] = (orc_uint8)var39.x4[3]; /* 9: splatw3q */ var47.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 10: mullw */ var48.x4[0] = (var45.x4[0] * var47.x4[0]) & 0xffff; var48.x4[1] = (var45.x4[1] * var47.x4[1]) & 0xffff; var48.x4[2] = (var45.x4[2] * var47.x4[2]) & 0xffff; var48.x4[3] = (var45.x4[3] * var47.x4[3]) & 0xffff; /* 11: div255w */ var49.x4[0] = ((orc_uint16)(((orc_uint16)(var48.x4[0]+128)) + (((orc_uint16)(var48.x4[0]+128))>>8)))>>8; var49.x4[1] = ((orc_uint16)(((orc_uint16)(var48.x4[1]+128)) + (((orc_uint16)(var48.x4[1]+128))>>8)))>>8; var49.x4[2] = ((orc_uint16)(((orc_uint16)(var48.x4[2]+128)) + (((orc_uint16)(var48.x4[2]+128))>>8)))>>8; var49.x4[3] = ((orc_uint16)(((orc_uint16)(var48.x4[3]+128)) + (((orc_uint16)(var48.x4[3]+128))>>8)))>>8; /* 12: convwb */ var40.x4[0] = var49.x4[0]; var40.x4[1] = var49.x4[1]; var40.x4[2] = var49.x4[2]; var40.x4[3] = var49.x4[3]; /* 13: storel */ ptr0[i] = var40; } } #else static void _backup_orc_code_combine_in_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 5: mullw */ var44.x4[0] = (var41.x4[0] * var43.x4[0]) & 0xffff; var44.x4[1] = (var41.x4[1] * var43.x4[1]) & 0xffff; var44.x4[2] = (var41.x4[2] * var43.x4[2]) & 0xffff; var44.x4[3] = (var41.x4[3] * var43.x4[3]) & 0xffff; /* 6: div255w */ var45.x4[0] = ((orc_uint16)(((orc_uint16)(var44.x4[0]+128)) + (((orc_uint16)(var44.x4[0]+128))>>8)))>>8; var45.x4[1] = ((orc_uint16)(((orc_uint16)(var44.x4[1]+128)) + (((orc_uint16)(var44.x4[1]+128))>>8)))>>8; var45.x4[2] = ((orc_uint16)(((orc_uint16)(var44.x4[2]+128)) + (((orc_uint16)(var44.x4[2]+128))>>8)))>>8; var45.x4[3] = ((orc_uint16)(((orc_uint16)(var44.x4[3]+128)) + (((orc_uint16)(var44.x4[3]+128))>>8)))>>8; /* 7: loadl */ var39 = ptr0[i]; /* 8: convubw */ var46.x4[0] = (orc_uint8)var39.x4[0]; var46.x4[1] = (orc_uint8)var39.x4[1]; var46.x4[2] = (orc_uint8)var39.x4[2]; var46.x4[3] = (orc_uint8)var39.x4[3]; /* 9: splatw3q */ var47.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 10: mullw */ var48.x4[0] = (var45.x4[0] * var47.x4[0]) & 0xffff; var48.x4[1] = (var45.x4[1] * var47.x4[1]) & 0xffff; var48.x4[2] = (var45.x4[2] * var47.x4[2]) & 0xffff; var48.x4[3] = (var45.x4[3] * var47.x4[3]) & 0xffff; /* 11: div255w */ var49.x4[0] = ((orc_uint16)(((orc_uint16)(var48.x4[0]+128)) + (((orc_uint16)(var48.x4[0]+128))>>8)))>>8; var49.x4[1] = ((orc_uint16)(((orc_uint16)(var48.x4[1]+128)) + (((orc_uint16)(var48.x4[1]+128))>>8)))>>8; var49.x4[2] = ((orc_uint16)(((orc_uint16)(var48.x4[2]+128)) + (((orc_uint16)(var48.x4[2]+128))>>8)))>>8; var49.x4[3] = ((orc_uint16)(((orc_uint16)(var48.x4[3]+128)) + (((orc_uint16)(var48.x4[3]+128))>>8)))>>8; /* 12: convwb */ var40.x4[0] = var49.x4[0]; var40.x4[1] = var49.x4[1]; var40.x4[2] = var49.x4[2]; var40.x4[3] = var49.x4[3]; /* 13: storel */ ptr0[i] = var40; } } void orc_code_combine_in_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 105, 110, 95, 117, 11, 4, 4, 12, 4, 4, 12, 4, 4, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 21, 2, 150, 35, 4, 21, 2, 150, 36, 5, 136, 36, 36, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 157, 0, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_in_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_in_u"); orc_program_set_backup_function (p, _backup_orc_code_combine_in_u); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_in_u_n */ #ifdef DISABLE_ORC void orc_code_combine_in_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var40.x4[0] = (orc_uint8)var37.x4[0]; var40.x4[1] = (orc_uint8)var37.x4[1]; var40.x4[2] = (orc_uint8)var37.x4[2]; var40.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr0[i]; /* 3: convubw */ var41.x4[0] = (orc_uint8)var38.x4[0]; var41.x4[1] = (orc_uint8)var38.x4[1]; var41.x4[2] = (orc_uint8)var38.x4[2]; var41.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var42.i = ((((orc_uint64)var41.i)>>48) << 48) | ((((orc_uint64)var41.i)>>48)<<32) | ((((orc_uint64)var41.i)>>48) << 16) | ((((orc_uint64)var41.i)>>48)); /* 5: mullw */ var43.x4[0] = (var40.x4[0] * var42.x4[0]) & 0xffff; var43.x4[1] = (var40.x4[1] * var42.x4[1]) & 0xffff; var43.x4[2] = (var40.x4[2] * var42.x4[2]) & 0xffff; var43.x4[3] = (var40.x4[3] * var42.x4[3]) & 0xffff; /* 6: div255w */ var44.x4[0] = ((orc_uint16)(((orc_uint16)(var43.x4[0]+128)) + (((orc_uint16)(var43.x4[0]+128))>>8)))>>8; var44.x4[1] = ((orc_uint16)(((orc_uint16)(var43.x4[1]+128)) + (((orc_uint16)(var43.x4[1]+128))>>8)))>>8; var44.x4[2] = ((orc_uint16)(((orc_uint16)(var43.x4[2]+128)) + (((orc_uint16)(var43.x4[2]+128))>>8)))>>8; var44.x4[3] = ((orc_uint16)(((orc_uint16)(var43.x4[3]+128)) + (((orc_uint16)(var43.x4[3]+128))>>8)))>>8; /* 7: convwb */ var39.x4[0] = var44.x4[0]; var39.x4[1] = var44.x4[1]; var39.x4[2] = var44.x4[2]; var39.x4[3] = var44.x4[3]; /* 8: storel */ ptr0[i] = var39; } } #else static void _backup_orc_code_combine_in_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var40.x4[0] = (orc_uint8)var37.x4[0]; var40.x4[1] = (orc_uint8)var37.x4[1]; var40.x4[2] = (orc_uint8)var37.x4[2]; var40.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr0[i]; /* 3: convubw */ var41.x4[0] = (orc_uint8)var38.x4[0]; var41.x4[1] = (orc_uint8)var38.x4[1]; var41.x4[2] = (orc_uint8)var38.x4[2]; var41.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var42.i = ((((orc_uint64)var41.i)>>48) << 48) | ((((orc_uint64)var41.i)>>48)<<32) | ((((orc_uint64)var41.i)>>48) << 16) | ((((orc_uint64)var41.i)>>48)); /* 5: mullw */ var43.x4[0] = (var40.x4[0] * var42.x4[0]) & 0xffff; var43.x4[1] = (var40.x4[1] * var42.x4[1]) & 0xffff; var43.x4[2] = (var40.x4[2] * var42.x4[2]) & 0xffff; var43.x4[3] = (var40.x4[3] * var42.x4[3]) & 0xffff; /* 6: div255w */ var44.x4[0] = ((orc_uint16)(((orc_uint16)(var43.x4[0]+128)) + (((orc_uint16)(var43.x4[0]+128))>>8)))>>8; var44.x4[1] = ((orc_uint16)(((orc_uint16)(var43.x4[1]+128)) + (((orc_uint16)(var43.x4[1]+128))>>8)))>>8; var44.x4[2] = ((orc_uint16)(((orc_uint16)(var43.x4[2]+128)) + (((orc_uint16)(var43.x4[2]+128))>>8)))>>8; var44.x4[3] = ((orc_uint16)(((orc_uint16)(var43.x4[3]+128)) + (((orc_uint16)(var43.x4[3]+128))>>8)))>>8; /* 7: convwb */ var39.x4[0] = var44.x4[0]; var39.x4[1] = var44.x4[1]; var39.x4[2] = var44.x4[2]; var39.x4[3] = var44.x4[3]; /* 8: storel */ ptr0[i] = var39; } } void orc_code_combine_in_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 23, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 105, 110, 95, 117, 95, 110, 11, 4, 4, 12, 4, 4, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 21, 2, 150, 35, 4, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 157, 0, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_in_u_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_in_u_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_in_u_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_out_u */ #ifdef DISABLE_ORC void orc_code_combine_out_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; orc_union32 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var40; #else orc_union64 var40; #endif orc_union32 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 10: loadpw */ var40.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var42.x4[0] = (orc_uint8)var37.x4[0]; var42.x4[1] = (orc_uint8)var37.x4[1]; var42.x4[2] = (orc_uint8)var37.x4[2]; var42.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var43.x4[0] = (orc_uint8)var38.x4[0]; var43.x4[1] = (orc_uint8)var38.x4[1]; var43.x4[2] = (orc_uint8)var38.x4[2]; var43.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 5: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 6: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 7: loadl */ var39 = ptr0[i]; /* 8: convubw */ var47.x4[0] = (orc_uint8)var39.x4[0]; var47.x4[1] = (orc_uint8)var39.x4[1]; var47.x4[2] = (orc_uint8)var39.x4[2]; var47.x4[3] = (orc_uint8)var39.x4[3]; /* 9: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 11: xorw */ var49.x4[0] = var48.x4[0] ^ var40.x4[0]; var49.x4[1] = var48.x4[1] ^ var40.x4[1]; var49.x4[2] = var48.x4[2] ^ var40.x4[2]; var49.x4[3] = var48.x4[3] ^ var40.x4[3]; /* 12: mullw */ var50.x4[0] = (var46.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var46.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var46.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var46.x4[3] * var49.x4[3]) & 0xffff; /* 13: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 14: convwb */ var41.x4[0] = var51.x4[0]; var41.x4[1] = var51.x4[1]; var41.x4[2] = var51.x4[2]; var41.x4[3] = var51.x4[3]; /* 15: storel */ ptr0[i] = var41; } } #else static void _backup_orc_code_combine_out_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; orc_union32 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var40; #else orc_union64 var40; #endif orc_union32 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 10: loadpw */ var40.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var42.x4[0] = (orc_uint8)var37.x4[0]; var42.x4[1] = (orc_uint8)var37.x4[1]; var42.x4[2] = (orc_uint8)var37.x4[2]; var42.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var43.x4[0] = (orc_uint8)var38.x4[0]; var43.x4[1] = (orc_uint8)var38.x4[1]; var43.x4[2] = (orc_uint8)var38.x4[2]; var43.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 5: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 6: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 7: loadl */ var39 = ptr0[i]; /* 8: convubw */ var47.x4[0] = (orc_uint8)var39.x4[0]; var47.x4[1] = (orc_uint8)var39.x4[1]; var47.x4[2] = (orc_uint8)var39.x4[2]; var47.x4[3] = (orc_uint8)var39.x4[3]; /* 9: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 11: xorw */ var49.x4[0] = var48.x4[0] ^ var40.x4[0]; var49.x4[1] = var48.x4[1] ^ var40.x4[1]; var49.x4[2] = var48.x4[2] ^ var40.x4[2]; var49.x4[3] = var48.x4[3] ^ var40.x4[3]; /* 12: mullw */ var50.x4[0] = (var46.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var46.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var46.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var46.x4[3] * var49.x4[3]) & 0xffff; /* 13: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 14: convwb */ var41.x4[0] = var51.x4[0]; var41.x4[1] = var51.x4[1]; var41.x4[2] = var51.x4[2]; var41.x4[3] = var51.x4[3]; /* 15: storel */ ptr0[i] = var41; } } void orc_code_combine_out_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 22, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 111, 117, 116, 95, 117, 11, 4, 4, 12, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 21, 2, 150, 35, 4, 21, 2, 150, 36, 5, 136, 36, 36, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 101, 36, 36, 16, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 157, 0, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_out_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_out_u"); orc_program_set_backup_function (p, _backup_orc_code_combine_out_u); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_out_u_n */ #ifdef DISABLE_ORC void orc_code_combine_out_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 5: loadpw */ var39.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr0[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 6: xorw */ var44.x4[0] = var43.x4[0] ^ var39.x4[0]; var44.x4[1] = var43.x4[1] ^ var39.x4[1]; var44.x4[2] = var43.x4[2] ^ var39.x4[2]; var44.x4[3] = var43.x4[3] ^ var39.x4[3]; /* 7: mullw */ var45.x4[0] = (var41.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var41.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var41.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var41.x4[3] * var44.x4[3]) & 0xffff; /* 8: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 9: convwb */ var40.x4[0] = var46.x4[0]; var40.x4[1] = var46.x4[1]; var40.x4[2] = var46.x4[2]; var40.x4[3] = var46.x4[3]; /* 10: storel */ ptr0[i] = var40; } } #else static void _backup_orc_code_combine_out_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var39.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr0[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 6: xorw */ var44.x4[0] = var43.x4[0] ^ var39.x4[0]; var44.x4[1] = var43.x4[1] ^ var39.x4[1]; var44.x4[2] = var43.x4[2] ^ var39.x4[2]; var44.x4[3] = var43.x4[3] ^ var39.x4[3]; /* 7: mullw */ var45.x4[0] = (var41.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var41.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var41.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var41.x4[3] * var44.x4[3]) & 0xffff; /* 8: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 9: convwb */ var40.x4[0] = var46.x4[0]; var40.x4[1] = var46.x4[1]; var40.x4[2] = var46.x4[2]; var40.x4[3] = var46.x4[3]; /* 10: storel */ ptr0[i] = var40; } } void orc_code_combine_out_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 111, 117, 116, 95, 117, 95, 110, 11, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 21, 2, 150, 35, 4, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 101, 36, 36, 16, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 157, 0, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_out_u_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_out_u_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_out_u_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_atop_u */ #ifdef DISABLE_ORC void orc_code_combine_atop_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var44; #else orc_union64 var44; #endif orc_union32 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union32 var55; orc_union64 var56; orc_union64 var57; orc_union64 var58; orc_union64 var59; orc_union64 var60; orc_union32 var61; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 16: loadpw */ var44.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var46.x4[0] = (orc_uint8)var40.x4[0]; var46.x4[1] = (orc_uint8)var40.x4[1]; var46.x4[2] = (orc_uint8)var40.x4[2]; var46.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var47.x4[0] = (orc_uint8)var41.x4[0]; var47.x4[1] = (orc_uint8)var41.x4[1]; var47.x4[2] = (orc_uint8)var41.x4[2]; var47.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 5: mullw */ var49.x4[0] = (var46.x4[0] * var48.x4[0]) & 0xffff; var49.x4[1] = (var46.x4[1] * var48.x4[1]) & 0xffff; var49.x4[2] = (var46.x4[2] * var48.x4[2]) & 0xffff; var49.x4[3] = (var46.x4[3] * var48.x4[3]) & 0xffff; /* 6: div255w */ var50.x4[0] = ((orc_uint16)(((orc_uint16)(var49.x4[0]+128)) + (((orc_uint16)(var49.x4[0]+128))>>8)))>>8; var50.x4[1] = ((orc_uint16)(((orc_uint16)(var49.x4[1]+128)) + (((orc_uint16)(var49.x4[1]+128))>>8)))>>8; var50.x4[2] = ((orc_uint16)(((orc_uint16)(var49.x4[2]+128)) + (((orc_uint16)(var49.x4[2]+128))>>8)))>>8; var50.x4[3] = ((orc_uint16)(((orc_uint16)(var49.x4[3]+128)) + (((orc_uint16)(var49.x4[3]+128))>>8)))>>8; /* 7: loadl */ var42 = ptr0[i]; /* 8: convubw */ var51.x4[0] = (orc_uint8)var42.x4[0]; var51.x4[1] = (orc_uint8)var42.x4[1]; var51.x4[2] = (orc_uint8)var42.x4[2]; var51.x4[3] = (orc_uint8)var42.x4[3]; /* 9: splatw3q */ var52.i = ((((orc_uint64)var51.i)>>48) << 48) | ((((orc_uint64)var51.i)>>48)<<32) | ((((orc_uint64)var51.i)>>48) << 16) | ((((orc_uint64)var51.i)>>48)); /* 10: mullw */ var53.x4[0] = (var50.x4[0] * var52.x4[0]) & 0xffff; var53.x4[1] = (var50.x4[1] * var52.x4[1]) & 0xffff; var53.x4[2] = (var50.x4[2] * var52.x4[2]) & 0xffff; var53.x4[3] = (var50.x4[3] * var52.x4[3]) & 0xffff; /* 11: div255w */ var54.x4[0] = ((orc_uint16)(((orc_uint16)(var53.x4[0]+128)) + (((orc_uint16)(var53.x4[0]+128))>>8)))>>8; var54.x4[1] = ((orc_uint16)(((orc_uint16)(var53.x4[1]+128)) + (((orc_uint16)(var53.x4[1]+128))>>8)))>>8; var54.x4[2] = ((orc_uint16)(((orc_uint16)(var53.x4[2]+128)) + (((orc_uint16)(var53.x4[2]+128))>>8)))>>8; var54.x4[3] = ((orc_uint16)(((orc_uint16)(var53.x4[3]+128)) + (((orc_uint16)(var53.x4[3]+128))>>8)))>>8; /* 12: convwb */ var55.x4[0] = var54.x4[0]; var55.x4[1] = var54.x4[1]; var55.x4[2] = var54.x4[2]; var55.x4[3] = var54.x4[3]; /* 13: loadl */ var43 = ptr0[i]; /* 14: convubw */ var56.x4[0] = (orc_uint8)var43.x4[0]; var56.x4[1] = (orc_uint8)var43.x4[1]; var56.x4[2] = (orc_uint8)var43.x4[2]; var56.x4[3] = (orc_uint8)var43.x4[3]; /* 15: splatw3q */ var57.i = ((((orc_uint64)var50.i)>>48) << 48) | ((((orc_uint64)var50.i)>>48)<<32) | ((((orc_uint64)var50.i)>>48) << 16) | ((((orc_uint64)var50.i)>>48)); /* 17: xorw */ var58.x4[0] = var57.x4[0] ^ var44.x4[0]; var58.x4[1] = var57.x4[1] ^ var44.x4[1]; var58.x4[2] = var57.x4[2] ^ var44.x4[2]; var58.x4[3] = var57.x4[3] ^ var44.x4[3]; /* 18: mullw */ var59.x4[0] = (var56.x4[0] * var58.x4[0]) & 0xffff; var59.x4[1] = (var56.x4[1] * var58.x4[1]) & 0xffff; var59.x4[2] = (var56.x4[2] * var58.x4[2]) & 0xffff; var59.x4[3] = (var56.x4[3] * var58.x4[3]) & 0xffff; /* 19: div255w */ var60.x4[0] = ((orc_uint16)(((orc_uint16)(var59.x4[0]+128)) + (((orc_uint16)(var59.x4[0]+128))>>8)))>>8; var60.x4[1] = ((orc_uint16)(((orc_uint16)(var59.x4[1]+128)) + (((orc_uint16)(var59.x4[1]+128))>>8)))>>8; var60.x4[2] = ((orc_uint16)(((orc_uint16)(var59.x4[2]+128)) + (((orc_uint16)(var59.x4[2]+128))>>8)))>>8; var60.x4[3] = ((orc_uint16)(((orc_uint16)(var59.x4[3]+128)) + (((orc_uint16)(var59.x4[3]+128))>>8)))>>8; /* 20: convwb */ var61.x4[0] = var60.x4[0]; var61.x4[1] = var60.x4[1]; var61.x4[2] = var60.x4[2]; var61.x4[3] = var60.x4[3]; /* 21: addusb */ var45.x4[0] = ORC_CLAMP_UB((orc_uint8)var55.x4[0] + (orc_uint8)var61.x4[0]); var45.x4[1] = ORC_CLAMP_UB((orc_uint8)var55.x4[1] + (orc_uint8)var61.x4[1]); var45.x4[2] = ORC_CLAMP_UB((orc_uint8)var55.x4[2] + (orc_uint8)var61.x4[2]); var45.x4[3] = ORC_CLAMP_UB((orc_uint8)var55.x4[3] + (orc_uint8)var61.x4[3]); /* 22: storel */ ptr0[i] = var45; } } #else static void _backup_orc_code_combine_atop_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var44; #else orc_union64 var44; #endif orc_union32 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union32 var55; orc_union64 var56; orc_union64 var57; orc_union64 var58; orc_union64 var59; orc_union64 var60; orc_union32 var61; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 16: loadpw */ var44.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var46.x4[0] = (orc_uint8)var40.x4[0]; var46.x4[1] = (orc_uint8)var40.x4[1]; var46.x4[2] = (orc_uint8)var40.x4[2]; var46.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var47.x4[0] = (orc_uint8)var41.x4[0]; var47.x4[1] = (orc_uint8)var41.x4[1]; var47.x4[2] = (orc_uint8)var41.x4[2]; var47.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 5: mullw */ var49.x4[0] = (var46.x4[0] * var48.x4[0]) & 0xffff; var49.x4[1] = (var46.x4[1] * var48.x4[1]) & 0xffff; var49.x4[2] = (var46.x4[2] * var48.x4[2]) & 0xffff; var49.x4[3] = (var46.x4[3] * var48.x4[3]) & 0xffff; /* 6: div255w */ var50.x4[0] = ((orc_uint16)(((orc_uint16)(var49.x4[0]+128)) + (((orc_uint16)(var49.x4[0]+128))>>8)))>>8; var50.x4[1] = ((orc_uint16)(((orc_uint16)(var49.x4[1]+128)) + (((orc_uint16)(var49.x4[1]+128))>>8)))>>8; var50.x4[2] = ((orc_uint16)(((orc_uint16)(var49.x4[2]+128)) + (((orc_uint16)(var49.x4[2]+128))>>8)))>>8; var50.x4[3] = ((orc_uint16)(((orc_uint16)(var49.x4[3]+128)) + (((orc_uint16)(var49.x4[3]+128))>>8)))>>8; /* 7: loadl */ var42 = ptr0[i]; /* 8: convubw */ var51.x4[0] = (orc_uint8)var42.x4[0]; var51.x4[1] = (orc_uint8)var42.x4[1]; var51.x4[2] = (orc_uint8)var42.x4[2]; var51.x4[3] = (orc_uint8)var42.x4[3]; /* 9: splatw3q */ var52.i = ((((orc_uint64)var51.i)>>48) << 48) | ((((orc_uint64)var51.i)>>48)<<32) | ((((orc_uint64)var51.i)>>48) << 16) | ((((orc_uint64)var51.i)>>48)); /* 10: mullw */ var53.x4[0] = (var50.x4[0] * var52.x4[0]) & 0xffff; var53.x4[1] = (var50.x4[1] * var52.x4[1]) & 0xffff; var53.x4[2] = (var50.x4[2] * var52.x4[2]) & 0xffff; var53.x4[3] = (var50.x4[3] * var52.x4[3]) & 0xffff; /* 11: div255w */ var54.x4[0] = ((orc_uint16)(((orc_uint16)(var53.x4[0]+128)) + (((orc_uint16)(var53.x4[0]+128))>>8)))>>8; var54.x4[1] = ((orc_uint16)(((orc_uint16)(var53.x4[1]+128)) + (((orc_uint16)(var53.x4[1]+128))>>8)))>>8; var54.x4[2] = ((orc_uint16)(((orc_uint16)(var53.x4[2]+128)) + (((orc_uint16)(var53.x4[2]+128))>>8)))>>8; var54.x4[3] = ((orc_uint16)(((orc_uint16)(var53.x4[3]+128)) + (((orc_uint16)(var53.x4[3]+128))>>8)))>>8; /* 12: convwb */ var55.x4[0] = var54.x4[0]; var55.x4[1] = var54.x4[1]; var55.x4[2] = var54.x4[2]; var55.x4[3] = var54.x4[3]; /* 13: loadl */ var43 = ptr0[i]; /* 14: convubw */ var56.x4[0] = (orc_uint8)var43.x4[0]; var56.x4[1] = (orc_uint8)var43.x4[1]; var56.x4[2] = (orc_uint8)var43.x4[2]; var56.x4[3] = (orc_uint8)var43.x4[3]; /* 15: splatw3q */ var57.i = ((((orc_uint64)var50.i)>>48) << 48) | ((((orc_uint64)var50.i)>>48)<<32) | ((((orc_uint64)var50.i)>>48) << 16) | ((((orc_uint64)var50.i)>>48)); /* 17: xorw */ var58.x4[0] = var57.x4[0] ^ var44.x4[0]; var58.x4[1] = var57.x4[1] ^ var44.x4[1]; var58.x4[2] = var57.x4[2] ^ var44.x4[2]; var58.x4[3] = var57.x4[3] ^ var44.x4[3]; /* 18: mullw */ var59.x4[0] = (var56.x4[0] * var58.x4[0]) & 0xffff; var59.x4[1] = (var56.x4[1] * var58.x4[1]) & 0xffff; var59.x4[2] = (var56.x4[2] * var58.x4[2]) & 0xffff; var59.x4[3] = (var56.x4[3] * var58.x4[3]) & 0xffff; /* 19: div255w */ var60.x4[0] = ((orc_uint16)(((orc_uint16)(var59.x4[0]+128)) + (((orc_uint16)(var59.x4[0]+128))>>8)))>>8; var60.x4[1] = ((orc_uint16)(((orc_uint16)(var59.x4[1]+128)) + (((orc_uint16)(var59.x4[1]+128))>>8)))>>8; var60.x4[2] = ((orc_uint16)(((orc_uint16)(var59.x4[2]+128)) + (((orc_uint16)(var59.x4[2]+128))>>8)))>>8; var60.x4[3] = ((orc_uint16)(((orc_uint16)(var59.x4[3]+128)) + (((orc_uint16)(var59.x4[3]+128))>>8)))>>8; /* 20: convwb */ var61.x4[0] = var60.x4[0]; var61.x4[1] = var60.x4[1]; var61.x4[2] = var60.x4[2]; var61.x4[3] = var60.x4[3]; /* 21: addusb */ var45.x4[0] = ORC_CLAMP_UB((orc_uint8)var55.x4[0] + (orc_uint8)var61.x4[0]); var45.x4[1] = ORC_CLAMP_UB((orc_uint8)var55.x4[1] + (orc_uint8)var61.x4[1]); var45.x4[2] = ORC_CLAMP_UB((orc_uint8)var55.x4[2] + (orc_uint8)var61.x4[2]); var45.x4[3] = ORC_CLAMP_UB((orc_uint8)var55.x4[3] + (orc_uint8)var61.x4[3]); /* 22: storel */ ptr0[i] = var45; } } void orc_code_combine_atop_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 23, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 97, 116, 111, 112, 95, 117, 11, 4, 4, 12, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 20, 4, 21, 2, 150, 35, 4, 21, 2, 150, 36, 5, 136, 36, 36, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 89, 37, 35, 36, 21, 2, 80, 37, 37, 21, 2, 157, 38, 37, 21, 2, 150, 32, 0, 136, 36, 35, 21, 2, 101, 36, 36, 16, 21, 2, 89, 35, 32, 36, 21, 2, 80, 35, 35, 21, 2, 157, 39, 35, 21, 2, 35, 0, 38, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_atop_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_atop_u"); orc_program_set_backup_function (p, _backup_orc_code_combine_atop_u); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 4, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_atop_u_n */ #ifdef DISABLE_ORC void orc_code_combine_atop_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; orc_union32 var42; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var43; #else orc_union64 var43; #endif orc_union32 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union32 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union32 var56; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 11: loadpw */ var43.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var45.x4[0] = (orc_uint8)var40.x4[0]; var45.x4[1] = (orc_uint8)var40.x4[1]; var45.x4[2] = (orc_uint8)var40.x4[2]; var45.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var46.x4[0] = (orc_uint8)var41.x4[0]; var46.x4[1] = (orc_uint8)var41.x4[1]; var46.x4[2] = (orc_uint8)var41.x4[2]; var46.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var47.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 5: mullw */ var48.x4[0] = (var45.x4[0] * var47.x4[0]) & 0xffff; var48.x4[1] = (var45.x4[1] * var47.x4[1]) & 0xffff; var48.x4[2] = (var45.x4[2] * var47.x4[2]) & 0xffff; var48.x4[3] = (var45.x4[3] * var47.x4[3]) & 0xffff; /* 6: div255w */ var49.x4[0] = ((orc_uint16)(((orc_uint16)(var48.x4[0]+128)) + (((orc_uint16)(var48.x4[0]+128))>>8)))>>8; var49.x4[1] = ((orc_uint16)(((orc_uint16)(var48.x4[1]+128)) + (((orc_uint16)(var48.x4[1]+128))>>8)))>>8; var49.x4[2] = ((orc_uint16)(((orc_uint16)(var48.x4[2]+128)) + (((orc_uint16)(var48.x4[2]+128))>>8)))>>8; var49.x4[3] = ((orc_uint16)(((orc_uint16)(var48.x4[3]+128)) + (((orc_uint16)(var48.x4[3]+128))>>8)))>>8; /* 7: convwb */ var50.x4[0] = var49.x4[0]; var50.x4[1] = var49.x4[1]; var50.x4[2] = var49.x4[2]; var50.x4[3] = var49.x4[3]; /* 8: loadl */ var42 = ptr0[i]; /* 9: convubw */ var51.x4[0] = (orc_uint8)var42.x4[0]; var51.x4[1] = (orc_uint8)var42.x4[1]; var51.x4[2] = (orc_uint8)var42.x4[2]; var51.x4[3] = (orc_uint8)var42.x4[3]; /* 10: splatw3q */ var52.i = ((((orc_uint64)var45.i)>>48) << 48) | ((((orc_uint64)var45.i)>>48)<<32) | ((((orc_uint64)var45.i)>>48) << 16) | ((((orc_uint64)var45.i)>>48)); /* 12: xorw */ var53.x4[0] = var52.x4[0] ^ var43.x4[0]; var53.x4[1] = var52.x4[1] ^ var43.x4[1]; var53.x4[2] = var52.x4[2] ^ var43.x4[2]; var53.x4[3] = var52.x4[3] ^ var43.x4[3]; /* 13: mullw */ var54.x4[0] = (var51.x4[0] * var53.x4[0]) & 0xffff; var54.x4[1] = (var51.x4[1] * var53.x4[1]) & 0xffff; var54.x4[2] = (var51.x4[2] * var53.x4[2]) & 0xffff; var54.x4[3] = (var51.x4[3] * var53.x4[3]) & 0xffff; /* 14: div255w */ var55.x4[0] = ((orc_uint16)(((orc_uint16)(var54.x4[0]+128)) + (((orc_uint16)(var54.x4[0]+128))>>8)))>>8; var55.x4[1] = ((orc_uint16)(((orc_uint16)(var54.x4[1]+128)) + (((orc_uint16)(var54.x4[1]+128))>>8)))>>8; var55.x4[2] = ((orc_uint16)(((orc_uint16)(var54.x4[2]+128)) + (((orc_uint16)(var54.x4[2]+128))>>8)))>>8; var55.x4[3] = ((orc_uint16)(((orc_uint16)(var54.x4[3]+128)) + (((orc_uint16)(var54.x4[3]+128))>>8)))>>8; /* 15: convwb */ var56.x4[0] = var55.x4[0]; var56.x4[1] = var55.x4[1]; var56.x4[2] = var55.x4[2]; var56.x4[3] = var55.x4[3]; /* 16: addusb */ var44.x4[0] = ORC_CLAMP_UB((orc_uint8)var50.x4[0] + (orc_uint8)var56.x4[0]); var44.x4[1] = ORC_CLAMP_UB((orc_uint8)var50.x4[1] + (orc_uint8)var56.x4[1]); var44.x4[2] = ORC_CLAMP_UB((orc_uint8)var50.x4[2] + (orc_uint8)var56.x4[2]); var44.x4[3] = ORC_CLAMP_UB((orc_uint8)var50.x4[3] + (orc_uint8)var56.x4[3]); /* 17: storel */ ptr0[i] = var44; } } #else static void _backup_orc_code_combine_atop_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; orc_union32 var42; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var43; #else orc_union64 var43; #endif orc_union32 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union32 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union32 var56; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 11: loadpw */ var43.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var45.x4[0] = (orc_uint8)var40.x4[0]; var45.x4[1] = (orc_uint8)var40.x4[1]; var45.x4[2] = (orc_uint8)var40.x4[2]; var45.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var46.x4[0] = (orc_uint8)var41.x4[0]; var46.x4[1] = (orc_uint8)var41.x4[1]; var46.x4[2] = (orc_uint8)var41.x4[2]; var46.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var47.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 5: mullw */ var48.x4[0] = (var45.x4[0] * var47.x4[0]) & 0xffff; var48.x4[1] = (var45.x4[1] * var47.x4[1]) & 0xffff; var48.x4[2] = (var45.x4[2] * var47.x4[2]) & 0xffff; var48.x4[3] = (var45.x4[3] * var47.x4[3]) & 0xffff; /* 6: div255w */ var49.x4[0] = ((orc_uint16)(((orc_uint16)(var48.x4[0]+128)) + (((orc_uint16)(var48.x4[0]+128))>>8)))>>8; var49.x4[1] = ((orc_uint16)(((orc_uint16)(var48.x4[1]+128)) + (((orc_uint16)(var48.x4[1]+128))>>8)))>>8; var49.x4[2] = ((orc_uint16)(((orc_uint16)(var48.x4[2]+128)) + (((orc_uint16)(var48.x4[2]+128))>>8)))>>8; var49.x4[3] = ((orc_uint16)(((orc_uint16)(var48.x4[3]+128)) + (((orc_uint16)(var48.x4[3]+128))>>8)))>>8; /* 7: convwb */ var50.x4[0] = var49.x4[0]; var50.x4[1] = var49.x4[1]; var50.x4[2] = var49.x4[2]; var50.x4[3] = var49.x4[3]; /* 8: loadl */ var42 = ptr0[i]; /* 9: convubw */ var51.x4[0] = (orc_uint8)var42.x4[0]; var51.x4[1] = (orc_uint8)var42.x4[1]; var51.x4[2] = (orc_uint8)var42.x4[2]; var51.x4[3] = (orc_uint8)var42.x4[3]; /* 10: splatw3q */ var52.i = ((((orc_uint64)var45.i)>>48) << 48) | ((((orc_uint64)var45.i)>>48)<<32) | ((((orc_uint64)var45.i)>>48) << 16) | ((((orc_uint64)var45.i)>>48)); /* 12: xorw */ var53.x4[0] = var52.x4[0] ^ var43.x4[0]; var53.x4[1] = var52.x4[1] ^ var43.x4[1]; var53.x4[2] = var52.x4[2] ^ var43.x4[2]; var53.x4[3] = var52.x4[3] ^ var43.x4[3]; /* 13: mullw */ var54.x4[0] = (var51.x4[0] * var53.x4[0]) & 0xffff; var54.x4[1] = (var51.x4[1] * var53.x4[1]) & 0xffff; var54.x4[2] = (var51.x4[2] * var53.x4[2]) & 0xffff; var54.x4[3] = (var51.x4[3] * var53.x4[3]) & 0xffff; /* 14: div255w */ var55.x4[0] = ((orc_uint16)(((orc_uint16)(var54.x4[0]+128)) + (((orc_uint16)(var54.x4[0]+128))>>8)))>>8; var55.x4[1] = ((orc_uint16)(((orc_uint16)(var54.x4[1]+128)) + (((orc_uint16)(var54.x4[1]+128))>>8)))>>8; var55.x4[2] = ((orc_uint16)(((orc_uint16)(var54.x4[2]+128)) + (((orc_uint16)(var54.x4[2]+128))>>8)))>>8; var55.x4[3] = ((orc_uint16)(((orc_uint16)(var54.x4[3]+128)) + (((orc_uint16)(var54.x4[3]+128))>>8)))>>8; /* 15: convwb */ var56.x4[0] = var55.x4[0]; var56.x4[1] = var55.x4[1]; var56.x4[2] = var55.x4[2]; var56.x4[3] = var55.x4[3]; /* 16: addusb */ var44.x4[0] = ORC_CLAMP_UB((orc_uint8)var50.x4[0] + (orc_uint8)var56.x4[0]); var44.x4[1] = ORC_CLAMP_UB((orc_uint8)var50.x4[1] + (orc_uint8)var56.x4[1]); var44.x4[2] = ORC_CLAMP_UB((orc_uint8)var50.x4[2] + (orc_uint8)var56.x4[2]); var44.x4[3] = ORC_CLAMP_UB((orc_uint8)var50.x4[3] + (orc_uint8)var56.x4[3]); /* 17: storel */ ptr0[i] = var44; } } void orc_code_combine_atop_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 25, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 97, 116, 111, 112, 95, 117, 95, 110, 11, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 20, 4, 21, 2, 150, 35, 4, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 89, 37, 35, 36, 21, 2, 80, 37, 37, 21, 2, 157, 38, 37, 21, 2, 150, 32, 0, 136, 36, 35, 21, 2, 101, 36, 36, 16, 21, 2, 89, 35, 32, 36, 21, 2, 80, 35, 35, 21, 2, 157, 39, 35, 21, 2, 35, 0, 38, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_atop_u_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_atop_u_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_atop_u_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 4, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_xor_u */ #ifdef DISABLE_ORC void orc_code_combine_xor_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var43; #else orc_union64 var43; #endif orc_union32 var44; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var45; #else orc_union64 var45; #endif orc_union32 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; orc_union64 var58; orc_union64 var59; orc_union64 var60; orc_union64 var61; orc_union64 var62; orc_union32 var63; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 10: loadpw */ var43.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ /* 18: loadpw */ var45.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var47.x4[0] = (orc_uint8)var40.x4[0]; var47.x4[1] = (orc_uint8)var40.x4[1]; var47.x4[2] = (orc_uint8)var40.x4[2]; var47.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var48.x4[0] = (orc_uint8)var41.x4[0]; var48.x4[1] = (orc_uint8)var41.x4[1]; var48.x4[2] = (orc_uint8)var41.x4[2]; var48.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var49.i = ((((orc_uint64)var48.i)>>48) << 48) | ((((orc_uint64)var48.i)>>48)<<32) | ((((orc_uint64)var48.i)>>48) << 16) | ((((orc_uint64)var48.i)>>48)); /* 5: mullw */ var50.x4[0] = (var47.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var47.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var47.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var47.x4[3] * var49.x4[3]) & 0xffff; /* 6: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 7: loadl */ var42 = ptr0[i]; /* 8: convubw */ var52.x4[0] = (orc_uint8)var42.x4[0]; var52.x4[1] = (orc_uint8)var42.x4[1]; var52.x4[2] = (orc_uint8)var42.x4[2]; var52.x4[3] = (orc_uint8)var42.x4[3]; /* 9: splatw3q */ var53.i = ((((orc_uint64)var52.i)>>48) << 48) | ((((orc_uint64)var52.i)>>48)<<32) | ((((orc_uint64)var52.i)>>48) << 16) | ((((orc_uint64)var52.i)>>48)); /* 11: xorw */ var54.x4[0] = var53.x4[0] ^ var43.x4[0]; var54.x4[1] = var53.x4[1] ^ var43.x4[1]; var54.x4[2] = var53.x4[2] ^ var43.x4[2]; var54.x4[3] = var53.x4[3] ^ var43.x4[3]; /* 12: mullw */ var55.x4[0] = (var51.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var51.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var51.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var51.x4[3] * var54.x4[3]) & 0xffff; /* 13: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 14: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 15: loadl */ var44 = ptr0[i]; /* 16: convubw */ var58.x4[0] = (orc_uint8)var44.x4[0]; var58.x4[1] = (orc_uint8)var44.x4[1]; var58.x4[2] = (orc_uint8)var44.x4[2]; var58.x4[3] = (orc_uint8)var44.x4[3]; /* 17: splatw3q */ var59.i = ((((orc_uint64)var51.i)>>48) << 48) | ((((orc_uint64)var51.i)>>48)<<32) | ((((orc_uint64)var51.i)>>48) << 16) | ((((orc_uint64)var51.i)>>48)); /* 19: xorw */ var60.x4[0] = var59.x4[0] ^ var45.x4[0]; var60.x4[1] = var59.x4[1] ^ var45.x4[1]; var60.x4[2] = var59.x4[2] ^ var45.x4[2]; var60.x4[3] = var59.x4[3] ^ var45.x4[3]; /* 20: mullw */ var61.x4[0] = (var58.x4[0] * var60.x4[0]) & 0xffff; var61.x4[1] = (var58.x4[1] * var60.x4[1]) & 0xffff; var61.x4[2] = (var58.x4[2] * var60.x4[2]) & 0xffff; var61.x4[3] = (var58.x4[3] * var60.x4[3]) & 0xffff; /* 21: div255w */ var62.x4[0] = ((orc_uint16)(((orc_uint16)(var61.x4[0]+128)) + (((orc_uint16)(var61.x4[0]+128))>>8)))>>8; var62.x4[1] = ((orc_uint16)(((orc_uint16)(var61.x4[1]+128)) + (((orc_uint16)(var61.x4[1]+128))>>8)))>>8; var62.x4[2] = ((orc_uint16)(((orc_uint16)(var61.x4[2]+128)) + (((orc_uint16)(var61.x4[2]+128))>>8)))>>8; var62.x4[3] = ((orc_uint16)(((orc_uint16)(var61.x4[3]+128)) + (((orc_uint16)(var61.x4[3]+128))>>8)))>>8; /* 22: convwb */ var63.x4[0] = var62.x4[0]; var63.x4[1] = var62.x4[1]; var63.x4[2] = var62.x4[2]; var63.x4[3] = var62.x4[3]; /* 23: addusb */ var46.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var63.x4[0]); var46.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var63.x4[1]); var46.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var63.x4[2]); var46.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var63.x4[3]); /* 24: storel */ ptr0[i] = var46; } } #else static void _backup_orc_code_combine_xor_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var43; #else orc_union64 var43; #endif orc_union32 var44; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var45; #else orc_union64 var45; #endif orc_union32 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; orc_union64 var58; orc_union64 var59; orc_union64 var60; orc_union64 var61; orc_union64 var62; orc_union32 var63; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 10: loadpw */ var43.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ /* 18: loadpw */ var45.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var47.x4[0] = (orc_uint8)var40.x4[0]; var47.x4[1] = (orc_uint8)var40.x4[1]; var47.x4[2] = (orc_uint8)var40.x4[2]; var47.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var48.x4[0] = (orc_uint8)var41.x4[0]; var48.x4[1] = (orc_uint8)var41.x4[1]; var48.x4[2] = (orc_uint8)var41.x4[2]; var48.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var49.i = ((((orc_uint64)var48.i)>>48) << 48) | ((((orc_uint64)var48.i)>>48)<<32) | ((((orc_uint64)var48.i)>>48) << 16) | ((((orc_uint64)var48.i)>>48)); /* 5: mullw */ var50.x4[0] = (var47.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var47.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var47.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var47.x4[3] * var49.x4[3]) & 0xffff; /* 6: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 7: loadl */ var42 = ptr0[i]; /* 8: convubw */ var52.x4[0] = (orc_uint8)var42.x4[0]; var52.x4[1] = (orc_uint8)var42.x4[1]; var52.x4[2] = (orc_uint8)var42.x4[2]; var52.x4[3] = (orc_uint8)var42.x4[3]; /* 9: splatw3q */ var53.i = ((((orc_uint64)var52.i)>>48) << 48) | ((((orc_uint64)var52.i)>>48)<<32) | ((((orc_uint64)var52.i)>>48) << 16) | ((((orc_uint64)var52.i)>>48)); /* 11: xorw */ var54.x4[0] = var53.x4[0] ^ var43.x4[0]; var54.x4[1] = var53.x4[1] ^ var43.x4[1]; var54.x4[2] = var53.x4[2] ^ var43.x4[2]; var54.x4[3] = var53.x4[3] ^ var43.x4[3]; /* 12: mullw */ var55.x4[0] = (var51.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var51.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var51.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var51.x4[3] * var54.x4[3]) & 0xffff; /* 13: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 14: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 15: loadl */ var44 = ptr0[i]; /* 16: convubw */ var58.x4[0] = (orc_uint8)var44.x4[0]; var58.x4[1] = (orc_uint8)var44.x4[1]; var58.x4[2] = (orc_uint8)var44.x4[2]; var58.x4[3] = (orc_uint8)var44.x4[3]; /* 17: splatw3q */ var59.i = ((((orc_uint64)var51.i)>>48) << 48) | ((((orc_uint64)var51.i)>>48)<<32) | ((((orc_uint64)var51.i)>>48) << 16) | ((((orc_uint64)var51.i)>>48)); /* 19: xorw */ var60.x4[0] = var59.x4[0] ^ var45.x4[0]; var60.x4[1] = var59.x4[1] ^ var45.x4[1]; var60.x4[2] = var59.x4[2] ^ var45.x4[2]; var60.x4[3] = var59.x4[3] ^ var45.x4[3]; /* 20: mullw */ var61.x4[0] = (var58.x4[0] * var60.x4[0]) & 0xffff; var61.x4[1] = (var58.x4[1] * var60.x4[1]) & 0xffff; var61.x4[2] = (var58.x4[2] * var60.x4[2]) & 0xffff; var61.x4[3] = (var58.x4[3] * var60.x4[3]) & 0xffff; /* 21: div255w */ var62.x4[0] = ((orc_uint16)(((orc_uint16)(var61.x4[0]+128)) + (((orc_uint16)(var61.x4[0]+128))>>8)))>>8; var62.x4[1] = ((orc_uint16)(((orc_uint16)(var61.x4[1]+128)) + (((orc_uint16)(var61.x4[1]+128))>>8)))>>8; var62.x4[2] = ((orc_uint16)(((orc_uint16)(var61.x4[2]+128)) + (((orc_uint16)(var61.x4[2]+128))>>8)))>>8; var62.x4[3] = ((orc_uint16)(((orc_uint16)(var61.x4[3]+128)) + (((orc_uint16)(var61.x4[3]+128))>>8)))>>8; /* 22: convwb */ var63.x4[0] = var62.x4[0]; var63.x4[1] = var62.x4[1]; var63.x4[2] = var62.x4[2]; var63.x4[3] = var62.x4[3]; /* 23: addusb */ var46.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var63.x4[0]); var46.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var63.x4[1]); var46.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var63.x4[2]); var46.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var63.x4[3]); /* 24: storel */ ptr0[i] = var46; } } void orc_code_combine_xor_u (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 22, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 120, 111, 114, 95, 117, 11, 4, 4, 12, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 20, 4, 21, 2, 150, 35, 4, 21, 2, 150, 36, 5, 136, 36, 36, 21, 2, 89, 35, 35, 36, 21, 2, 80, 35, 35, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 101, 36, 36, 16, 21, 2, 89, 37, 35, 36, 21, 2, 80, 37, 37, 21, 2, 157, 38, 37, 21, 2, 150, 32, 0, 136, 36, 35, 21, 2, 101, 36, 36, 16, 21, 2, 89, 35, 32, 36, 21, 2, 80, 35, 35, 21, 2, 157, 39, 35, 21, 2, 35, 0, 38, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_xor_u); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_xor_u"); orc_program_set_backup_function (p, _backup_orc_code_combine_xor_u); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 4, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_xor_u_n */ #ifdef DISABLE_ORC void orc_code_combine_xor_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var44; #else orc_union64 var44; #endif orc_union32 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union64 var57; orc_union32 var58; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 5: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ /* 13: loadpw */ var44.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var46.x4[0] = (orc_uint8)var40.x4[0]; var46.x4[1] = (orc_uint8)var40.x4[1]; var46.x4[2] = (orc_uint8)var40.x4[2]; var46.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var47.x4[0] = (orc_uint8)var41.x4[0]; var47.x4[1] = (orc_uint8)var41.x4[1]; var47.x4[2] = (orc_uint8)var41.x4[2]; var47.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 6: xorw */ var49.x4[0] = var48.x4[0] ^ var42.x4[0]; var49.x4[1] = var48.x4[1] ^ var42.x4[1]; var49.x4[2] = var48.x4[2] ^ var42.x4[2]; var49.x4[3] = var48.x4[3] ^ var42.x4[3]; /* 7: mullw */ var50.x4[0] = (var46.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var46.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var46.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var46.x4[3] * var49.x4[3]) & 0xffff; /* 8: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 9: convwb */ var52.x4[0] = var51.x4[0]; var52.x4[1] = var51.x4[1]; var52.x4[2] = var51.x4[2]; var52.x4[3] = var51.x4[3]; /* 10: loadl */ var43 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var43.x4[0]; var53.x4[1] = (orc_uint8)var43.x4[1]; var53.x4[2] = (orc_uint8)var43.x4[2]; var53.x4[3] = (orc_uint8)var43.x4[3]; /* 12: splatw3q */ var54.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 14: xorw */ var55.x4[0] = var54.x4[0] ^ var44.x4[0]; var55.x4[1] = var54.x4[1] ^ var44.x4[1]; var55.x4[2] = var54.x4[2] ^ var44.x4[2]; var55.x4[3] = var54.x4[3] ^ var44.x4[3]; /* 15: mullw */ var56.x4[0] = (var53.x4[0] * var55.x4[0]) & 0xffff; var56.x4[1] = (var53.x4[1] * var55.x4[1]) & 0xffff; var56.x4[2] = (var53.x4[2] * var55.x4[2]) & 0xffff; var56.x4[3] = (var53.x4[3] * var55.x4[3]) & 0xffff; /* 16: div255w */ var57.x4[0] = ((orc_uint16)(((orc_uint16)(var56.x4[0]+128)) + (((orc_uint16)(var56.x4[0]+128))>>8)))>>8; var57.x4[1] = ((orc_uint16)(((orc_uint16)(var56.x4[1]+128)) + (((orc_uint16)(var56.x4[1]+128))>>8)))>>8; var57.x4[2] = ((orc_uint16)(((orc_uint16)(var56.x4[2]+128)) + (((orc_uint16)(var56.x4[2]+128))>>8)))>>8; var57.x4[3] = ((orc_uint16)(((orc_uint16)(var56.x4[3]+128)) + (((orc_uint16)(var56.x4[3]+128))>>8)))>>8; /* 17: convwb */ var58.x4[0] = var57.x4[0]; var58.x4[1] = var57.x4[1]; var58.x4[2] = var57.x4[2]; var58.x4[3] = var57.x4[3]; /* 18: addusb */ var45.x4[0] = ORC_CLAMP_UB((orc_uint8)var52.x4[0] + (orc_uint8)var58.x4[0]); var45.x4[1] = ORC_CLAMP_UB((orc_uint8)var52.x4[1] + (orc_uint8)var58.x4[1]); var45.x4[2] = ORC_CLAMP_UB((orc_uint8)var52.x4[2] + (orc_uint8)var58.x4[2]); var45.x4[3] = ORC_CLAMP_UB((orc_uint8)var52.x4[3] + (orc_uint8)var58.x4[3]); /* 19: storel */ ptr0[i] = var45; } } #else static void _backup_orc_code_combine_xor_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var44; #else orc_union64 var44; #endif orc_union32 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union64 var57; orc_union32 var58; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ /* 13: loadpw */ var44.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var46.x4[0] = (orc_uint8)var40.x4[0]; var46.x4[1] = (orc_uint8)var40.x4[1]; var46.x4[2] = (orc_uint8)var40.x4[2]; var46.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var47.x4[0] = (orc_uint8)var41.x4[0]; var47.x4[1] = (orc_uint8)var41.x4[1]; var47.x4[2] = (orc_uint8)var41.x4[2]; var47.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 6: xorw */ var49.x4[0] = var48.x4[0] ^ var42.x4[0]; var49.x4[1] = var48.x4[1] ^ var42.x4[1]; var49.x4[2] = var48.x4[2] ^ var42.x4[2]; var49.x4[3] = var48.x4[3] ^ var42.x4[3]; /* 7: mullw */ var50.x4[0] = (var46.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var46.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var46.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var46.x4[3] * var49.x4[3]) & 0xffff; /* 8: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 9: convwb */ var52.x4[0] = var51.x4[0]; var52.x4[1] = var51.x4[1]; var52.x4[2] = var51.x4[2]; var52.x4[3] = var51.x4[3]; /* 10: loadl */ var43 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var43.x4[0]; var53.x4[1] = (orc_uint8)var43.x4[1]; var53.x4[2] = (orc_uint8)var43.x4[2]; var53.x4[3] = (orc_uint8)var43.x4[3]; /* 12: splatw3q */ var54.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 14: xorw */ var55.x4[0] = var54.x4[0] ^ var44.x4[0]; var55.x4[1] = var54.x4[1] ^ var44.x4[1]; var55.x4[2] = var54.x4[2] ^ var44.x4[2]; var55.x4[3] = var54.x4[3] ^ var44.x4[3]; /* 15: mullw */ var56.x4[0] = (var53.x4[0] * var55.x4[0]) & 0xffff; var56.x4[1] = (var53.x4[1] * var55.x4[1]) & 0xffff; var56.x4[2] = (var53.x4[2] * var55.x4[2]) & 0xffff; var56.x4[3] = (var53.x4[3] * var55.x4[3]) & 0xffff; /* 16: div255w */ var57.x4[0] = ((orc_uint16)(((orc_uint16)(var56.x4[0]+128)) + (((orc_uint16)(var56.x4[0]+128))>>8)))>>8; var57.x4[1] = ((orc_uint16)(((orc_uint16)(var56.x4[1]+128)) + (((orc_uint16)(var56.x4[1]+128))>>8)))>>8; var57.x4[2] = ((orc_uint16)(((orc_uint16)(var56.x4[2]+128)) + (((orc_uint16)(var56.x4[2]+128))>>8)))>>8; var57.x4[3] = ((orc_uint16)(((orc_uint16)(var56.x4[3]+128)) + (((orc_uint16)(var56.x4[3]+128))>>8)))>>8; /* 17: convwb */ var58.x4[0] = var57.x4[0]; var58.x4[1] = var57.x4[1]; var58.x4[2] = var57.x4[2]; var58.x4[3] = var57.x4[3]; /* 18: addusb */ var45.x4[0] = ORC_CLAMP_UB((orc_uint8)var52.x4[0] + (orc_uint8)var58.x4[0]); var45.x4[1] = ORC_CLAMP_UB((orc_uint8)var52.x4[1] + (orc_uint8)var58.x4[1]); var45.x4[2] = ORC_CLAMP_UB((orc_uint8)var52.x4[2] + (orc_uint8)var58.x4[2]); var45.x4[3] = ORC_CLAMP_UB((orc_uint8)var52.x4[3] + (orc_uint8)var58.x4[3]); /* 19: storel */ ptr0[i] = var45; } } void orc_code_combine_xor_u_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 120, 111, 114, 95, 117, 95, 110, 11, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 20, 4, 21, 2, 150, 35, 4, 21, 2, 150, 32, 0, 136, 36, 32, 21, 2, 101, 36, 36, 16, 21, 2, 89, 37, 35, 36, 21, 2, 80, 37, 37, 21, 2, 157, 38, 37, 21, 2, 150, 32, 0, 136, 36, 35, 21, 2, 101, 36, 36, 16, 21, 2, 89, 35, 32, 36, 21, 2, 80, 35, 35, 21, 2, 157, 39, 35, 21, 2, 35, 0, 38, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_xor_u_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_xor_u_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_xor_u_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 4, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_add_ca */ #ifdef DISABLE_ORC void orc_code_combine_add_ca (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union32 var43; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: convubw */ var39.x4[0] = (orc_uint8)var35.x4[0]; var39.x4[1] = (orc_uint8)var35.x4[1]; var39.x4[2] = (orc_uint8)var35.x4[2]; var39.x4[3] = (orc_uint8)var35.x4[3]; /* 2: loadl */ var36 = ptr5[i]; /* 3: convubw */ var40.x4[0] = (orc_uint8)var36.x4[0]; var40.x4[1] = (orc_uint8)var36.x4[1]; var40.x4[2] = (orc_uint8)var36.x4[2]; var40.x4[3] = (orc_uint8)var36.x4[3]; /* 4: mullw */ var41.x4[0] = (var39.x4[0] * var40.x4[0]) & 0xffff; var41.x4[1] = (var39.x4[1] * var40.x4[1]) & 0xffff; var41.x4[2] = (var39.x4[2] * var40.x4[2]) & 0xffff; var41.x4[3] = (var39.x4[3] * var40.x4[3]) & 0xffff; /* 5: div255w */ var42.x4[0] = ((orc_uint16)(((orc_uint16)(var41.x4[0]+128)) + (((orc_uint16)(var41.x4[0]+128))>>8)))>>8; var42.x4[1] = ((orc_uint16)(((orc_uint16)(var41.x4[1]+128)) + (((orc_uint16)(var41.x4[1]+128))>>8)))>>8; var42.x4[2] = ((orc_uint16)(((orc_uint16)(var41.x4[2]+128)) + (((orc_uint16)(var41.x4[2]+128))>>8)))>>8; var42.x4[3] = ((orc_uint16)(((orc_uint16)(var41.x4[3]+128)) + (((orc_uint16)(var41.x4[3]+128))>>8)))>>8; /* 6: convwb */ var43.x4[0] = var42.x4[0]; var43.x4[1] = var42.x4[1]; var43.x4[2] = var42.x4[2]; var43.x4[3] = var42.x4[3]; /* 7: loadl */ var37 = ptr0[i]; /* 8: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var37.x4[0] + (orc_uint8)var43.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var37.x4[1] + (orc_uint8)var43.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var37.x4[2] + (orc_uint8)var43.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var37.x4[3] + (orc_uint8)var43.x4[3]); /* 9: storel */ ptr0[i] = var38; } } #else static void _backup_orc_code_combine_add_ca (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: convubw */ var39.x4[0] = (orc_uint8)var35.x4[0]; var39.x4[1] = (orc_uint8)var35.x4[1]; var39.x4[2] = (orc_uint8)var35.x4[2]; var39.x4[3] = (orc_uint8)var35.x4[3]; /* 2: loadl */ var36 = ptr5[i]; /* 3: convubw */ var40.x4[0] = (orc_uint8)var36.x4[0]; var40.x4[1] = (orc_uint8)var36.x4[1]; var40.x4[2] = (orc_uint8)var36.x4[2]; var40.x4[3] = (orc_uint8)var36.x4[3]; /* 4: mullw */ var41.x4[0] = (var39.x4[0] * var40.x4[0]) & 0xffff; var41.x4[1] = (var39.x4[1] * var40.x4[1]) & 0xffff; var41.x4[2] = (var39.x4[2] * var40.x4[2]) & 0xffff; var41.x4[3] = (var39.x4[3] * var40.x4[3]) & 0xffff; /* 5: div255w */ var42.x4[0] = ((orc_uint16)(((orc_uint16)(var41.x4[0]+128)) + (((orc_uint16)(var41.x4[0]+128))>>8)))>>8; var42.x4[1] = ((orc_uint16)(((orc_uint16)(var41.x4[1]+128)) + (((orc_uint16)(var41.x4[1]+128))>>8)))>>8; var42.x4[2] = ((orc_uint16)(((orc_uint16)(var41.x4[2]+128)) + (((orc_uint16)(var41.x4[2]+128))>>8)))>>8; var42.x4[3] = ((orc_uint16)(((orc_uint16)(var41.x4[3]+128)) + (((orc_uint16)(var41.x4[3]+128))>>8)))>>8; /* 6: convwb */ var43.x4[0] = var42.x4[0]; var43.x4[1] = var42.x4[1]; var43.x4[2] = var42.x4[2]; var43.x4[3] = var42.x4[3]; /* 7: loadl */ var37 = ptr0[i]; /* 8: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var37.x4[0] + (orc_uint8)var43.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var37.x4[1] + (orc_uint8)var43.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var37.x4[2] + (orc_uint8)var43.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var37.x4[3] + (orc_uint8)var43.x4[3]); /* 9: storel */ ptr0[i] = var38; } } void orc_code_combine_add_ca (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 23, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 97, 100, 100, 95, 99, 97, 11, 4, 4, 12, 4, 4, 12, 4, 4, 20, 8, 20, 8, 20, 4, 21, 2, 150, 32, 4, 21, 2, 150, 33, 5, 21, 2, 89, 32, 32, 33, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 21, 2, 35, 0, 0, 34, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_add_ca); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_add_ca"); orc_program_set_backup_function (p, _backup_orc_code_combine_add_ca); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_add_ca_n */ #ifdef DISABLE_ORC void orc_code_combine_add_ca_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } #else static void _backup_orc_code_combine_add_ca_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } void orc_code_combine_add_ca_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 25, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 97, 100, 100, 95, 99, 97, 95, 110, 11, 4, 4, 12, 4, 4, 21, 2, 35, 0, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_add_ca_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_add_ca_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_add_ca_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_code_combine_over_ca */ #ifdef DISABLE_ORC void orc_code_combine_over_ca (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union32 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; /* 12: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var44.x4[0] = (orc_uint8)var40.x4[0]; var44.x4[1] = (orc_uint8)var40.x4[1]; var44.x4[2] = (orc_uint8)var40.x4[2]; var44.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var45.x4[0] = (orc_uint8)var41.x4[0]; var45.x4[1] = (orc_uint8)var41.x4[1]; var45.x4[2] = (orc_uint8)var41.x4[2]; var45.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var46.i = ((((orc_uint64)var44.i)>>48) << 48) | ((((orc_uint64)var44.i)>>48)<<32) | ((((orc_uint64)var44.i)>>48) << 16) | ((((orc_uint64)var44.i)>>48)); /* 5: mullw */ var47.x4[0] = (var44.x4[0] * var45.x4[0]) & 0xffff; var47.x4[1] = (var44.x4[1] * var45.x4[1]) & 0xffff; var47.x4[2] = (var44.x4[2] * var45.x4[2]) & 0xffff; var47.x4[3] = (var44.x4[3] * var45.x4[3]) & 0xffff; /* 6: div255w */ var48.x4[0] = ((orc_uint16)(((orc_uint16)(var47.x4[0]+128)) + (((orc_uint16)(var47.x4[0]+128))>>8)))>>8; var48.x4[1] = ((orc_uint16)(((orc_uint16)(var47.x4[1]+128)) + (((orc_uint16)(var47.x4[1]+128))>>8)))>>8; var48.x4[2] = ((orc_uint16)(((orc_uint16)(var47.x4[2]+128)) + (((orc_uint16)(var47.x4[2]+128))>>8)))>>8; var48.x4[3] = ((orc_uint16)(((orc_uint16)(var47.x4[3]+128)) + (((orc_uint16)(var47.x4[3]+128))>>8)))>>8; /* 7: convwb */ var49.x4[0] = var48.x4[0]; var49.x4[1] = var48.x4[1]; var49.x4[2] = var48.x4[2]; var49.x4[3] = var48.x4[3]; /* 8: mullw */ var50.x4[0] = (var45.x4[0] * var46.x4[0]) & 0xffff; var50.x4[1] = (var45.x4[1] * var46.x4[1]) & 0xffff; var50.x4[2] = (var45.x4[2] * var46.x4[2]) & 0xffff; var50.x4[3] = (var45.x4[3] * var46.x4[3]) & 0xffff; /* 9: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 10: loadl */ var52 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var52.x4[0]; var53.x4[1] = (orc_uint8)var52.x4[1]; var53.x4[2] = (orc_uint8)var52.x4[2]; var53.x4[3] = (orc_uint8)var52.x4[3]; /* 13: xorw */ var54.x4[0] = var51.x4[0] ^ var42.x4[0]; var54.x4[1] = var51.x4[1] ^ var42.x4[1]; var54.x4[2] = var51.x4[2] ^ var42.x4[2]; var54.x4[3] = var51.x4[3] ^ var42.x4[3]; /* 14: mullw */ var55.x4[0] = (var53.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var53.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var53.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var53.x4[3] * var54.x4[3]) & 0xffff; /* 15: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 16: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 17: addusb */ var43.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var49.x4[0]); var43.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var49.x4[1]); var43.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var49.x4[2]); var43.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var49.x4[3]); /* 18: storel */ ptr0[i] = var43; } } #else static void _backup_orc_code_combine_over_ca (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union32 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 12: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var44.x4[0] = (orc_uint8)var40.x4[0]; var44.x4[1] = (orc_uint8)var40.x4[1]; var44.x4[2] = (orc_uint8)var40.x4[2]; var44.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var45.x4[0] = (orc_uint8)var41.x4[0]; var45.x4[1] = (orc_uint8)var41.x4[1]; var45.x4[2] = (orc_uint8)var41.x4[2]; var45.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var46.i = ((((orc_uint64)var44.i)>>48) << 48) | ((((orc_uint64)var44.i)>>48)<<32) | ((((orc_uint64)var44.i)>>48) << 16) | ((((orc_uint64)var44.i)>>48)); /* 5: mullw */ var47.x4[0] = (var44.x4[0] * var45.x4[0]) & 0xffff; var47.x4[1] = (var44.x4[1] * var45.x4[1]) & 0xffff; var47.x4[2] = (var44.x4[2] * var45.x4[2]) & 0xffff; var47.x4[3] = (var44.x4[3] * var45.x4[3]) & 0xffff; /* 6: div255w */ var48.x4[0] = ((orc_uint16)(((orc_uint16)(var47.x4[0]+128)) + (((orc_uint16)(var47.x4[0]+128))>>8)))>>8; var48.x4[1] = ((orc_uint16)(((orc_uint16)(var47.x4[1]+128)) + (((orc_uint16)(var47.x4[1]+128))>>8)))>>8; var48.x4[2] = ((orc_uint16)(((orc_uint16)(var47.x4[2]+128)) + (((orc_uint16)(var47.x4[2]+128))>>8)))>>8; var48.x4[3] = ((orc_uint16)(((orc_uint16)(var47.x4[3]+128)) + (((orc_uint16)(var47.x4[3]+128))>>8)))>>8; /* 7: convwb */ var49.x4[0] = var48.x4[0]; var49.x4[1] = var48.x4[1]; var49.x4[2] = var48.x4[2]; var49.x4[3] = var48.x4[3]; /* 8: mullw */ var50.x4[0] = (var45.x4[0] * var46.x4[0]) & 0xffff; var50.x4[1] = (var45.x4[1] * var46.x4[1]) & 0xffff; var50.x4[2] = (var45.x4[2] * var46.x4[2]) & 0xffff; var50.x4[3] = (var45.x4[3] * var46.x4[3]) & 0xffff; /* 9: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 10: loadl */ var52 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var52.x4[0]; var53.x4[1] = (orc_uint8)var52.x4[1]; var53.x4[2] = (orc_uint8)var52.x4[2]; var53.x4[3] = (orc_uint8)var52.x4[3]; /* 13: xorw */ var54.x4[0] = var51.x4[0] ^ var42.x4[0]; var54.x4[1] = var51.x4[1] ^ var42.x4[1]; var54.x4[2] = var51.x4[2] ^ var42.x4[2]; var54.x4[3] = var51.x4[3] ^ var42.x4[3]; /* 14: mullw */ var55.x4[0] = (var53.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var53.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var53.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var53.x4[3] * var54.x4[3]) & 0xffff; /* 15: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 16: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 17: addusb */ var43.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var49.x4[0]); var43.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var49.x4[1]); var43.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var49.x4[2]); var43.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var49.x4[3]); /* 18: storel */ ptr0[i] = var43; } } void orc_code_combine_over_ca (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 111, 118, 101, 114, 95, 99, 97, 11, 4, 4, 12, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 4, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 21, 2, 150, 37, 4, 21, 2, 150, 36, 5, 136, 38, 37, 21, 2, 89, 37, 37, 36, 21, 2, 80, 37, 37, 21, 2, 157, 39, 37, 21, 2, 89, 36, 36, 38, 21, 2, 80, 36, 36, 113, 34, 0, 21, 2, 150, 35, 34, 21, 2, 101, 36, 36, 16, 21, 2, 89, 32, 35, 36, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 21, 2, 35, 0, 34, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_over_ca); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_over_ca"); orc_program_set_backup_function (p, _backup_orc_code_combine_over_ca); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 8, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T6, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T7, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_code_combine_over_ca_n */ #ifdef DISABLE_ORC void orc_code_combine_over_ca_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var41; #else orc_union64 var41; #endif orc_union32 var42; orc_union64 var43; orc_union64 var44; orc_union32 var45; orc_union64 var46; orc_union32 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 7: loadpw */ var41.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var43.x4[0] = (orc_uint8)var40.x4[0]; var43.x4[1] = (orc_uint8)var40.x4[1]; var43.x4[2] = (orc_uint8)var40.x4[2]; var43.x4[3] = (orc_uint8)var40.x4[3]; /* 2: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 3: convwb */ var45.x4[0] = var43.x4[0]; var45.x4[1] = var43.x4[1]; var45.x4[2] = var43.x4[2]; var45.x4[3] = var43.x4[3]; /* 4: copyw */ var46.x4[0] = var44.x4[0]; var46.x4[1] = var44.x4[1]; var46.x4[2] = var44.x4[2]; var46.x4[3] = var44.x4[3]; /* 5: loadl */ var47 = ptr0[i]; /* 6: convubw */ var48.x4[0] = (orc_uint8)var47.x4[0]; var48.x4[1] = (orc_uint8)var47.x4[1]; var48.x4[2] = (orc_uint8)var47.x4[2]; var48.x4[3] = (orc_uint8)var47.x4[3]; /* 8: xorw */ var49.x4[0] = var46.x4[0] ^ var41.x4[0]; var49.x4[1] = var46.x4[1] ^ var41.x4[1]; var49.x4[2] = var46.x4[2] ^ var41.x4[2]; var49.x4[3] = var46.x4[3] ^ var41.x4[3]; /* 9: mullw */ var50.x4[0] = (var48.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var48.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var48.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var48.x4[3] * var49.x4[3]) & 0xffff; /* 10: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 11: convwb */ var52.x4[0] = var51.x4[0]; var52.x4[1] = var51.x4[1]; var52.x4[2] = var51.x4[2]; var52.x4[3] = var51.x4[3]; /* 12: addusb */ var42.x4[0] = ORC_CLAMP_UB((orc_uint8)var52.x4[0] + (orc_uint8)var45.x4[0]); var42.x4[1] = ORC_CLAMP_UB((orc_uint8)var52.x4[1] + (orc_uint8)var45.x4[1]); var42.x4[2] = ORC_CLAMP_UB((orc_uint8)var52.x4[2] + (orc_uint8)var45.x4[2]); var42.x4[3] = ORC_CLAMP_UB((orc_uint8)var52.x4[3] + (orc_uint8)var45.x4[3]); /* 13: storel */ ptr0[i] = var42; } } #else static void _backup_orc_code_combine_over_ca_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var41; #else orc_union64 var41; #endif orc_union32 var42; orc_union64 var43; orc_union64 var44; orc_union32 var45; orc_union64 var46; orc_union32 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 7: loadpw */ var41.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var43.x4[0] = (orc_uint8)var40.x4[0]; var43.x4[1] = (orc_uint8)var40.x4[1]; var43.x4[2] = (orc_uint8)var40.x4[2]; var43.x4[3] = (orc_uint8)var40.x4[3]; /* 2: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 3: convwb */ var45.x4[0] = var43.x4[0]; var45.x4[1] = var43.x4[1]; var45.x4[2] = var43.x4[2]; var45.x4[3] = var43.x4[3]; /* 4: copyw */ var46.x4[0] = var44.x4[0]; var46.x4[1] = var44.x4[1]; var46.x4[2] = var44.x4[2]; var46.x4[3] = var44.x4[3]; /* 5: loadl */ var47 = ptr0[i]; /* 6: convubw */ var48.x4[0] = (orc_uint8)var47.x4[0]; var48.x4[1] = (orc_uint8)var47.x4[1]; var48.x4[2] = (orc_uint8)var47.x4[2]; var48.x4[3] = (orc_uint8)var47.x4[3]; /* 8: xorw */ var49.x4[0] = var46.x4[0] ^ var41.x4[0]; var49.x4[1] = var46.x4[1] ^ var41.x4[1]; var49.x4[2] = var46.x4[2] ^ var41.x4[2]; var49.x4[3] = var46.x4[3] ^ var41.x4[3]; /* 9: mullw */ var50.x4[0] = (var48.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var48.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var48.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var48.x4[3] * var49.x4[3]) & 0xffff; /* 10: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 11: convwb */ var52.x4[0] = var51.x4[0]; var52.x4[1] = var51.x4[1]; var52.x4[2] = var51.x4[2]; var52.x4[3] = var51.x4[3]; /* 12: addusb */ var42.x4[0] = ORC_CLAMP_UB((orc_uint8)var52.x4[0] + (orc_uint8)var45.x4[0]); var42.x4[1] = ORC_CLAMP_UB((orc_uint8)var52.x4[1] + (orc_uint8)var45.x4[1]); var42.x4[2] = ORC_CLAMP_UB((orc_uint8)var52.x4[2] + (orc_uint8)var45.x4[2]); var42.x4[3] = ORC_CLAMP_UB((orc_uint8)var52.x4[3] + (orc_uint8)var45.x4[3]); /* 13: storel */ ptr0[i] = var42; } } void orc_code_combine_over_ca_n (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 111, 114, 99, 95, 99, 111, 100, 101, 95, 99, 111, 109, 98, 105, 110, 101, 95, 111, 118, 101, 114, 95, 99, 97, 95, 110, 11, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 4, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 21, 2, 150, 37, 4, 136, 38, 37, 21, 2, 157, 39, 37, 21, 2, 79, 36, 38, 113, 34, 0, 21, 2, 150, 35, 34, 21, 2, 101, 36, 36, 16, 21, 2, 89, 32, 35, 36, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 21, 2, 35, 0, 34, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_code_combine_over_ca_n); #else p = orc_program_new (); orc_program_set_name (p, "orc_code_combine_over_ca_n"); orc_program_set_backup_function (p, _backup_orc_code_combine_over_ca_n); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 8, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T6, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyw", 2, ORC_VAR_T5, ORC_VAR_T7, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* orc_composite_over_8888_8_8888_line */ #ifdef DISABLE_ORC void orc_composite_over_8888_8_8888_line (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var38; orc_int8 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var40; #else orc_union64 var40; #endif orc_union32 var41; orc_union64 var42; orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union32 var47; orc_union32 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union32 var54; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; ptr5 = (orc_int8 *)s2; /* 10: loadpw */ var40.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var38 = ptr4[i]; /* 1: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 2: loadb */ var39 = ptr5[i]; /* 3: splatbl */ var43.i = ((var39&0xff) << 24) | ((var39&0xff)<<16) | ((var39&0xff) << 8) | (var39&0xff); /* 4: convubw */ var44.x4[0] = (orc_uint8)var43.x4[0]; var44.x4[1] = (orc_uint8)var43.x4[1]; var44.x4[2] = (orc_uint8)var43.x4[2]; var44.x4[3] = (orc_uint8)var43.x4[3]; /* 5: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 6: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 7: convwb */ var47.x4[0] = var46.x4[0]; var47.x4[1] = var46.x4[1]; var47.x4[2] = var46.x4[2]; var47.x4[3] = var46.x4[3]; /* 8: loadl */ var48 = ptr0[i]; /* 9: convubw */ var49.x4[0] = (orc_uint8)var48.x4[0]; var49.x4[1] = (orc_uint8)var48.x4[1]; var49.x4[2] = (orc_uint8)var48.x4[2]; var49.x4[3] = (orc_uint8)var48.x4[3]; /* 11: xorw */ var50.x4[0] = var46.x4[0] ^ var40.x4[0]; var50.x4[1] = var46.x4[1] ^ var40.x4[1]; var50.x4[2] = var46.x4[2] ^ var40.x4[2]; var50.x4[3] = var46.x4[3] ^ var40.x4[3]; /* 12: splatw3q */ var51.i = ((((orc_uint64)var50.i)>>48) << 48) | ((((orc_uint64)var50.i)>>48)<<32) | ((((orc_uint64)var50.i)>>48) << 16) | ((((orc_uint64)var50.i)>>48)); /* 13: mullw */ var52.x4[0] = (var49.x4[0] * var51.x4[0]) & 0xffff; var52.x4[1] = (var49.x4[1] * var51.x4[1]) & 0xffff; var52.x4[2] = (var49.x4[2] * var51.x4[2]) & 0xffff; var52.x4[3] = (var49.x4[3] * var51.x4[3]) & 0xffff; /* 14: div255w */ var53.x4[0] = ((orc_uint16)(((orc_uint16)(var52.x4[0]+128)) + (((orc_uint16)(var52.x4[0]+128))>>8)))>>8; var53.x4[1] = ((orc_uint16)(((orc_uint16)(var52.x4[1]+128)) + (((orc_uint16)(var52.x4[1]+128))>>8)))>>8; var53.x4[2] = ((orc_uint16)(((orc_uint16)(var52.x4[2]+128)) + (((orc_uint16)(var52.x4[2]+128))>>8)))>>8; var53.x4[3] = ((orc_uint16)(((orc_uint16)(var52.x4[3]+128)) + (((orc_uint16)(var52.x4[3]+128))>>8)))>>8; /* 15: convwb */ var54.x4[0] = var53.x4[0]; var54.x4[1] = var53.x4[1]; var54.x4[2] = var53.x4[2]; var54.x4[3] = var53.x4[3]; /* 16: addusb */ var41.x4[0] = ORC_CLAMP_UB((orc_uint8)var54.x4[0] + (orc_uint8)var47.x4[0]); var41.x4[1] = ORC_CLAMP_UB((orc_uint8)var54.x4[1] + (orc_uint8)var47.x4[1]); var41.x4[2] = ORC_CLAMP_UB((orc_uint8)var54.x4[2] + (orc_uint8)var47.x4[2]); var41.x4[3] = ORC_CLAMP_UB((orc_uint8)var54.x4[3] + (orc_uint8)var47.x4[3]); /* 17: storel */ ptr0[i] = var41; } } #else static void _backup_orc_composite_over_8888_8_8888_line (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var38; orc_int8 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var40; #else orc_union64 var40; #endif orc_union32 var41; orc_union64 var42; orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union32 var47; orc_union32 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union32 var54; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; /* 10: loadpw */ var40.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var38 = ptr4[i]; /* 1: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 2: loadb */ var39 = ptr5[i]; /* 3: splatbl */ var43.i = ((var39&0xff) << 24) | ((var39&0xff)<<16) | ((var39&0xff) << 8) | (var39&0xff); /* 4: convubw */ var44.x4[0] = (orc_uint8)var43.x4[0]; var44.x4[1] = (orc_uint8)var43.x4[1]; var44.x4[2] = (orc_uint8)var43.x4[2]; var44.x4[3] = (orc_uint8)var43.x4[3]; /* 5: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 6: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 7: convwb */ var47.x4[0] = var46.x4[0]; var47.x4[1] = var46.x4[1]; var47.x4[2] = var46.x4[2]; var47.x4[3] = var46.x4[3]; /* 8: loadl */ var48 = ptr0[i]; /* 9: convubw */ var49.x4[0] = (orc_uint8)var48.x4[0]; var49.x4[1] = (orc_uint8)var48.x4[1]; var49.x4[2] = (orc_uint8)var48.x4[2]; var49.x4[3] = (orc_uint8)var48.x4[3]; /* 11: xorw */ var50.x4[0] = var46.x4[0] ^ var40.x4[0]; var50.x4[1] = var46.x4[1] ^ var40.x4[1]; var50.x4[2] = var46.x4[2] ^ var40.x4[2]; var50.x4[3] = var46.x4[3] ^ var40.x4[3]; /* 12: splatw3q */ var51.i = ((((orc_uint64)var50.i)>>48) << 48) | ((((orc_uint64)var50.i)>>48)<<32) | ((((orc_uint64)var50.i)>>48) << 16) | ((((orc_uint64)var50.i)>>48)); /* 13: mullw */ var52.x4[0] = (var49.x4[0] * var51.x4[0]) & 0xffff; var52.x4[1] = (var49.x4[1] * var51.x4[1]) & 0xffff; var52.x4[2] = (var49.x4[2] * var51.x4[2]) & 0xffff; var52.x4[3] = (var49.x4[3] * var51.x4[3]) & 0xffff; /* 14: div255w */ var53.x4[0] = ((orc_uint16)(((orc_uint16)(var52.x4[0]+128)) + (((orc_uint16)(var52.x4[0]+128))>>8)))>>8; var53.x4[1] = ((orc_uint16)(((orc_uint16)(var52.x4[1]+128)) + (((orc_uint16)(var52.x4[1]+128))>>8)))>>8; var53.x4[2] = ((orc_uint16)(((orc_uint16)(var52.x4[2]+128)) + (((orc_uint16)(var52.x4[2]+128))>>8)))>>8; var53.x4[3] = ((orc_uint16)(((orc_uint16)(var52.x4[3]+128)) + (((orc_uint16)(var52.x4[3]+128))>>8)))>>8; /* 15: convwb */ var54.x4[0] = var53.x4[0]; var54.x4[1] = var53.x4[1]; var54.x4[2] = var53.x4[2]; var54.x4[3] = var53.x4[3]; /* 16: addusb */ var41.x4[0] = ORC_CLAMP_UB((orc_uint8)var54.x4[0] + (orc_uint8)var47.x4[0]); var41.x4[1] = ORC_CLAMP_UB((orc_uint8)var54.x4[1] + (orc_uint8)var47.x4[1]); var41.x4[2] = ORC_CLAMP_UB((orc_uint8)var54.x4[2] + (orc_uint8)var47.x4[2]); var41.x4[3] = ORC_CLAMP_UB((orc_uint8)var54.x4[3] + (orc_uint8)var47.x4[3]); /* 17: storel */ ptr0[i] = var41; } } void orc_composite_over_8888_8_8888_line (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 35, 111, 114, 99, 95, 99, 111, 109, 112, 111, 115, 105, 116, 101, 95, 111, 118, 101, 114, 95, 56, 56, 56, 56, 95, 56, 95, 56, 56, 56, 56, 95, 108, 105, 110, 101, 11, 4, 4, 12, 4, 4, 12, 1, 1, 14, 4, 255, 0, 0, 0, 20, 8, 20, 8, 20, 4, 20, 4, 20, 4, 20, 8, 21, 2, 150, 32, 4, 152, 36, 5, 21, 2, 150, 33, 36, 21, 2, 89, 32, 32, 33, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 113, 35, 0, 21, 2, 150, 37, 35, 21, 2, 101, 32, 32, 16, 136, 33, 32, 21, 2, 89, 32, 37, 33, 21, 2, 80, 32, 32, 21, 2, 157, 35, 32, 21, 2, 35, 0, 35, 34, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_composite_over_8888_8_8888_line); #else p = orc_program_new (); orc_program_set_name (p, "orc_composite_over_8888_8_8888_line"); orc_program_set_backup_function (p, _backup_orc_composite_over_8888_8_8888_line); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 1, "s2"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_add_temporary (p, 4, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatbl", 0, ORC_VAR_T5, ORC_VAR_S2, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T2, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T6, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T6, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* orc_composite_over_n_8888_8888_ca_2d */ #ifdef DISABLE_ORC void orc_composite_over_n_8888_8888_ca_2d (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union32 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union32 *)s1; /* 0: loadpb */ var40.x4[0] = p1; var40.x4[1] = p1; var40.x4[2] = p1; var40.x4[3] = p1; /* 12: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 1: convubw */ var44.x4[0] = (orc_uint8)var40.x4[0]; var44.x4[1] = (orc_uint8)var40.x4[1]; var44.x4[2] = (orc_uint8)var40.x4[2]; var44.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr4[i]; /* 3: convubw */ var45.x4[0] = (orc_uint8)var41.x4[0]; var45.x4[1] = (orc_uint8)var41.x4[1]; var45.x4[2] = (orc_uint8)var41.x4[2]; var45.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var46.i = ((((orc_uint64)var44.i)>>48) << 48) | ((((orc_uint64)var44.i)>>48)<<32) | ((((orc_uint64)var44.i)>>48) << 16) | ((((orc_uint64)var44.i)>>48)); /* 5: mullw */ var47.x4[0] = (var44.x4[0] * var45.x4[0]) & 0xffff; var47.x4[1] = (var44.x4[1] * var45.x4[1]) & 0xffff; var47.x4[2] = (var44.x4[2] * var45.x4[2]) & 0xffff; var47.x4[3] = (var44.x4[3] * var45.x4[3]) & 0xffff; /* 6: div255w */ var48.x4[0] = ((orc_uint16)(((orc_uint16)(var47.x4[0]+128)) + (((orc_uint16)(var47.x4[0]+128))>>8)))>>8; var48.x4[1] = ((orc_uint16)(((orc_uint16)(var47.x4[1]+128)) + (((orc_uint16)(var47.x4[1]+128))>>8)))>>8; var48.x4[2] = ((orc_uint16)(((orc_uint16)(var47.x4[2]+128)) + (((orc_uint16)(var47.x4[2]+128))>>8)))>>8; var48.x4[3] = ((orc_uint16)(((orc_uint16)(var47.x4[3]+128)) + (((orc_uint16)(var47.x4[3]+128))>>8)))>>8; /* 7: convwb */ var49.x4[0] = var48.x4[0]; var49.x4[1] = var48.x4[1]; var49.x4[2] = var48.x4[2]; var49.x4[3] = var48.x4[3]; /* 8: mullw */ var50.x4[0] = (var45.x4[0] * var46.x4[0]) & 0xffff; var50.x4[1] = (var45.x4[1] * var46.x4[1]) & 0xffff; var50.x4[2] = (var45.x4[2] * var46.x4[2]) & 0xffff; var50.x4[3] = (var45.x4[3] * var46.x4[3]) & 0xffff; /* 9: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 10: loadl */ var52 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var52.x4[0]; var53.x4[1] = (orc_uint8)var52.x4[1]; var53.x4[2] = (orc_uint8)var52.x4[2]; var53.x4[3] = (orc_uint8)var52.x4[3]; /* 13: xorw */ var54.x4[0] = var51.x4[0] ^ var42.x4[0]; var54.x4[1] = var51.x4[1] ^ var42.x4[1]; var54.x4[2] = var51.x4[2] ^ var42.x4[2]; var54.x4[3] = var51.x4[3] ^ var42.x4[3]; /* 14: mullw */ var55.x4[0] = (var53.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var53.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var53.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var53.x4[3] * var54.x4[3]) & 0xffff; /* 15: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 16: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 17: addusb */ var43.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var49.x4[0]); var43.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var49.x4[1]); var43.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var49.x4[2]); var43.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var49.x4[3]); /* 18: storel */ ptr0[i] = var43; } } #else static void _backup_orc_composite_over_n_8888_8888_ca_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union32 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 0: loadpb */ var40.x4[0] = ex->params[24]; var40.x4[1] = ex->params[24]; var40.x4[2] = ex->params[24]; var40.x4[3] = ex->params[24]; /* 12: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 1: convubw */ var44.x4[0] = (orc_uint8)var40.x4[0]; var44.x4[1] = (orc_uint8)var40.x4[1]; var44.x4[2] = (orc_uint8)var40.x4[2]; var44.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr4[i]; /* 3: convubw */ var45.x4[0] = (orc_uint8)var41.x4[0]; var45.x4[1] = (orc_uint8)var41.x4[1]; var45.x4[2] = (orc_uint8)var41.x4[2]; var45.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var46.i = ((((orc_uint64)var44.i)>>48) << 48) | ((((orc_uint64)var44.i)>>48)<<32) | ((((orc_uint64)var44.i)>>48) << 16) | ((((orc_uint64)var44.i)>>48)); /* 5: mullw */ var47.x4[0] = (var44.x4[0] * var45.x4[0]) & 0xffff; var47.x4[1] = (var44.x4[1] * var45.x4[1]) & 0xffff; var47.x4[2] = (var44.x4[2] * var45.x4[2]) & 0xffff; var47.x4[3] = (var44.x4[3] * var45.x4[3]) & 0xffff; /* 6: div255w */ var48.x4[0] = ((orc_uint16)(((orc_uint16)(var47.x4[0]+128)) + (((orc_uint16)(var47.x4[0]+128))>>8)))>>8; var48.x4[1] = ((orc_uint16)(((orc_uint16)(var47.x4[1]+128)) + (((orc_uint16)(var47.x4[1]+128))>>8)))>>8; var48.x4[2] = ((orc_uint16)(((orc_uint16)(var47.x4[2]+128)) + (((orc_uint16)(var47.x4[2]+128))>>8)))>>8; var48.x4[3] = ((orc_uint16)(((orc_uint16)(var47.x4[3]+128)) + (((orc_uint16)(var47.x4[3]+128))>>8)))>>8; /* 7: convwb */ var49.x4[0] = var48.x4[0]; var49.x4[1] = var48.x4[1]; var49.x4[2] = var48.x4[2]; var49.x4[3] = var48.x4[3]; /* 8: mullw */ var50.x4[0] = (var45.x4[0] * var46.x4[0]) & 0xffff; var50.x4[1] = (var45.x4[1] * var46.x4[1]) & 0xffff; var50.x4[2] = (var45.x4[2] * var46.x4[2]) & 0xffff; var50.x4[3] = (var45.x4[3] * var46.x4[3]) & 0xffff; /* 9: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 10: loadl */ var52 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var52.x4[0]; var53.x4[1] = (orc_uint8)var52.x4[1]; var53.x4[2] = (orc_uint8)var52.x4[2]; var53.x4[3] = (orc_uint8)var52.x4[3]; /* 13: xorw */ var54.x4[0] = var51.x4[0] ^ var42.x4[0]; var54.x4[1] = var51.x4[1] ^ var42.x4[1]; var54.x4[2] = var51.x4[2] ^ var42.x4[2]; var54.x4[3] = var51.x4[3] ^ var42.x4[3]; /* 14: mullw */ var55.x4[0] = (var53.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var53.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var53.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var53.x4[3] * var54.x4[3]) & 0xffff; /* 15: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 16: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 17: addusb */ var43.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var49.x4[0]); var43.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var49.x4[1]); var43.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var49.x4[2]); var43.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var49.x4[3]); /* 18: storel */ ptr0[i] = var43; } } void orc_composite_over_n_8888_8888_ca_2d (orc_uint32 * ORC_RESTRICT d1, const orc_uint32 * ORC_RESTRICT s1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 36, 111, 114, 99, 95, 99, 111, 109, 112, 111, 115, 105, 116, 101, 95, 111, 118, 101, 114, 95, 110, 95, 56, 56, 56, 56, 95, 56, 56, 56, 56, 95, 99, 97, 95, 50, 100, 11, 4, 4, 12, 4, 4, 14, 4, 255, 0, 0, 0, 16, 4, 20, 8, 20, 8, 20, 4, 20, 8, 20, 8, 20, 8, 20, 8, 20, 4, 21, 2, 150, 37, 24, 21, 2, 150, 36, 4, 136, 38, 37, 21, 2, 89, 37, 37, 36, 21, 2, 80, 37, 37, 21, 2, 157, 39, 37, 21, 2, 89, 36, 36, 38, 21, 2, 80, 36, 36, 113, 34, 0, 21, 2, 150, 35, 34, 21, 2, 101, 36, 36, 16, 21, 2, 89, 32, 35, 36, 21, 2, 80, 32, 32, 21, 2, 157, 34, 32, 21, 2, 35, 0, 34, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_orc_composite_over_n_8888_8888_ca_2d); #else p = orc_program_new (); orc_program_set_name (p, "orc_composite_over_n_8888_8888_ca_2d"); orc_program_set_backup_function (p, _backup_orc_composite_over_n_8888_8888_ca_2d); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 4, "s1"); orc_program_add_constant (p, 4, 0x000000ff, "c1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_add_temporary (p, 8, "t6"); orc_program_add_temporary (p, 8, "t7"); orc_program_add_temporary (p, 4, "t8"); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T6, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splatw3q", 0, ORC_VAR_T7, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T6, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T8, ORC_VAR_T6, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T7, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "loadl", 0, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convubw", 2, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "xorw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "mullw", 2, ORC_VAR_T1, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "div255w", 2, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convwb", 2, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "addusb", 2, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* cogorc_resample_horiz_1tap */ #ifdef DISABLE_ORC void cogorc_resample_horiz_1tap (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: ldresnearb */ var32 = ptr4[(p1 + i*p2)>>16]; /* 1: storeb */ ptr0[i] = var32; } } #else static void _backup_cogorc_resample_horiz_1tap (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: ldresnearb */ var32 = ptr4[(ex->params[24] + i*ex->params[25])>>16]; /* 1: storeb */ ptr0[i] = var32; } } void cogorc_resample_horiz_1tap (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 99, 111, 103, 111, 114, 99, 95, 114, 101, 115, 97, 109, 112, 108, 101, 95, 104, 111, 114, 105, 122, 95, 49, 116, 97, 112, 11, 1, 1, 12, 1, 1, 16, 2, 16, 2, 48, 0, 4, 24, 25, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_cogorc_resample_horiz_1tap); #else p = orc_program_new (); orc_program_set_name (p, "cogorc_resample_horiz_1tap"); orc_program_set_backup_function (p, _backup_cogorc_resample_horiz_1tap); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_parameter (p, 2, "p1"); orc_program_add_parameter (p, 2, "p2"); orc_program_append_2 (p, "ldresnearb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_P1, ORC_VAR_P2); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* cogorc_resample_horiz_2tap */ #ifdef DISABLE_ORC void cogorc_resample_horiz_2tap (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int p2, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: ldreslinb */ { int tmp = p1 + i * p2; var32 = ((orc_uint8)ptr4[tmp>>16] * (256-((tmp>>8)&0xff)) + (orc_uint8)ptr4[(tmp>>16)+1] * ((tmp>>8)&0xff))>>8; } /* 1: storeb */ ptr0[i] = var32; } } #else static void _backup_cogorc_resample_horiz_2tap (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: ldreslinb */ { int tmp = ex->params[24] + i * ex->params[25]; var32 = ((orc_uint8)ptr4[tmp>>16] * (256-((tmp>>8)&0xff)) + (orc_uint8)ptr4[(tmp>>16)+1] * ((tmp>>8)&0xff))>>8; } /* 1: storeb */ ptr0[i] = var32; } } void cogorc_resample_horiz_2tap (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, int p1, int p2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 26, 99, 111, 103, 111, 114, 99, 95, 114, 101, 115, 97, 109, 112, 108, 101, 95, 104, 111, 114, 105, 122, 95, 50, 116, 97, 112, 11, 1, 1, 12, 1, 1, 16, 4, 16, 4, 50, 0, 4, 24, 25, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_cogorc_resample_horiz_2tap); #else p = orc_program_new (); orc_program_set_name (p, "cogorc_resample_horiz_2tap"); orc_program_set_backup_function (p, _backup_cogorc_resample_horiz_2tap); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_add_parameter (p, 4, "p1"); orc_program_add_parameter (p, 4, "p2"); orc_program_append_2 (p, "ldreslinb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_P1, ORC_VAR_P2); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_P1] = p1; ex->params[ORC_VAR_P2] = p2; func = c->exec; func (ex); } #endif /* test_float_constant_1 */ #ifdef DISABLE_ORC void test_float_constant_1 (orc_uint32 * ORC_RESTRICT d1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union32 var32; #else orc_union32 var32; #endif orc_union32 var33; ptr0 = (orc_union32 *)d1; /* 0: loadpl */ var32.i = (int)0x40000000; /* 1073741824 or 5.30499e-315f */ for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } #else static void _backup_test_float_constant_1 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union32 var32; #else orc_union32 var32; #endif orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = (int)0x40000000; /* 1073741824 or 5.30499e-315f */ for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } void test_float_constant_1 (orc_uint32 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 116, 101, 115, 116, 95, 102, 108, 111, 97, 116, 95, 99, 111, 110, 115, 116, 97, 110, 116, 95, 49, 11, 4, 4, 14, 4, 0, 0, 0, 64, 112, 0, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_test_float_constant_1); #else p = orc_program_new (); orc_program_set_name (p, "test_float_constant_1"); orc_program_set_backup_function (p, _backup_test_float_constant_1); orc_program_add_destination (p, 4, "d1"); orc_program_add_constant (p, 4, 0x40000000, "c1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } #endif /* test_float_constant_2 */ #ifdef DISABLE_ORC void test_float_constant_2 (orc_uint32 * ORC_RESTRICT d1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union32 var32; #else orc_union32 var32; #endif orc_union32 var33; ptr0 = (orc_union32 *)d1; /* 0: loadpl */ var32.i = (int)0x40000000; /* 1073741824 or 5.30499e-315f */ for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } #else static void _backup_test_float_constant_2 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union32 var32; #else orc_union32 var32; #endif orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = (int)0x40000000; /* 1073741824 or 5.30499e-315f */ for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } void test_float_constant_2 (orc_uint32 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 116, 101, 115, 116, 95, 102, 108, 111, 97, 116, 95, 99, 111, 110, 115, 116, 97, 110, 116, 95, 50, 11, 4, 4, 14, 4, 0, 0, 0, 64, 112, 0, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_test_float_constant_2); #else p = orc_program_new (); orc_program_set_name (p, "test_float_constant_2"); orc_program_set_backup_function (p, _backup_test_float_constant_2); orc_program_add_destination (p, 4, "d1"); orc_program_add_constant (p, 4, 0x40000000, "c1"); orc_program_append_2 (p, "copyl", 0, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } #endif /* convert_fc32_to_int32 */ #ifdef DISABLE_ORC void convert_fc32_to_int32 (orc_uint32 * ORC_RESTRICT d1, const orc_uint64 * ORC_RESTRICT s1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var35; #else orc_union64 var35; #endif orc_union32 var36; orc_union64 var37; orc_union64 var38; ptr0 = (orc_union32 *)d1; ptr4 = (orc_union64 *)s1; /* 1: loadpl */ var35.x2[0] = (int)0x46fffe00; /* 1191181824 or 5.88522e-315f */ var35.x2[1] = (int)0x46fffe00; /* 1191181824 or 5.88522e-315f */ for (i = 0; i < n; i++) { /* 0: loadq */ var34 = ptr4[i]; /* 2: mulf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var34.x2[0]); _src2.i = ORC_DENORMAL(var35.x2[0]); _dest1.f = _src1.f * _src2.f; var37.x2[0] = ORC_DENORMAL(_dest1.i); } { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var34.x2[1]); _src2.i = ORC_DENORMAL(var35.x2[1]); _dest1.f = _src1.f * _src2.f; var37.x2[1] = ORC_DENORMAL(_dest1.i); } /* 3: convfl */ { int tmp; tmp = (int)var37.x2f[0]; if (tmp == 0x80000000 && !(var37.x2[0]&0x80000000)) tmp = 0x7fffffff; var38.x2[0] = tmp; } { int tmp; tmp = (int)var37.x2f[1]; if (tmp == 0x80000000 && !(var37.x2[1]&0x80000000)) tmp = 0x7fffffff; var38.x2[1] = tmp; } /* 4: convlw */ var36.x2[0] = var38.x2[0]; var36.x2[1] = var38.x2[1]; /* 5: storel */ ptr0[i] = var36; } } #else static void _backup_convert_fc32_to_int32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var35; #else orc_union64 var35; #endif orc_union32 var36; orc_union64 var37; orc_union64 var38; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union64 *)ex->arrays[4]; /* 1: loadpl */ var35.x2[0] = (int)0x46fffe00; /* 1191181824 or 5.88522e-315f */ var35.x2[1] = (int)0x46fffe00; /* 1191181824 or 5.88522e-315f */ for (i = 0; i < n; i++) { /* 0: loadq */ var34 = ptr4[i]; /* 2: mulf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var34.x2[0]); _src2.i = ORC_DENORMAL(var35.x2[0]); _dest1.f = _src1.f * _src2.f; var37.x2[0] = ORC_DENORMAL(_dest1.i); } { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var34.x2[1]); _src2.i = ORC_DENORMAL(var35.x2[1]); _dest1.f = _src1.f * _src2.f; var37.x2[1] = ORC_DENORMAL(_dest1.i); } /* 3: convfl */ { int tmp; tmp = (int)var37.x2f[0]; if (tmp == 0x80000000 && !(var37.x2[0]&0x80000000)) tmp = 0x7fffffff; var38.x2[0] = tmp; } { int tmp; tmp = (int)var37.x2f[1]; if (tmp == 0x80000000 && !(var37.x2[1]&0x80000000)) tmp = 0x7fffffff; var38.x2[1] = tmp; } /* 4: convlw */ var36.x2[0] = var38.x2[0]; var36.x2[1] = var38.x2[1]; /* 5: storel */ ptr0[i] = var36; } } void convert_fc32_to_int32 (orc_uint32 * ORC_RESTRICT d1, const orc_uint64 * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 21, 99, 111, 110, 118, 101, 114, 116, 95, 102, 99, 51, 50, 95, 116, 111, 95, 105, 110, 116, 51, 50, 11, 4, 4, 12, 8, 8, 14, 4, 0, 254, 255, 70, 20, 8, 20, 8, 21, 1, 202, 32, 4, 16, 21, 1, 210, 33, 32, 21, 1, 163, 0, 33, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_convert_fc32_to_int32); #else p = orc_program_new (); orc_program_set_name (p, "convert_fc32_to_int32"); orc_program_set_backup_function (p, _backup_convert_fc32_to_int32); orc_program_add_destination (p, 4, "d1"); orc_program_add_source (p, 8, "s1"); orc_program_add_constant (p, 4, 0x46fffe00, "c1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_append_2 (p, "mulf", 1, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1, ORC_VAR_D1); orc_program_append_2 (p, "convfl", 1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convlw", 1, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* param64 */ #ifdef DISABLE_ORC void param64 (orc_uint64 * ORC_RESTRICT d1, int p1, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)d1; /* 0: loadpq */ var32.i = p1; for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } #else static void _backup_param64 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->arrays[0]; /* 0: loadpq */ var32.i = (ex->params[24] & 0xffffffff) | ((orc_uint64)(ex->params[24 + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32); for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } void param64 (orc_uint64 * ORC_RESTRICT d1, int p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 7, 112, 97, 114, 97, 109, 54, 52, 11, 8, 8, 16, 8, 137, 0, 24, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_param64); #else p = orc_program_new (); orc_program_set_name (p, "param64"); orc_program_set_backup_function (p, _backup_param64); orc_program_add_destination (p, 8, "d1"); orc_program_add_parameter (p, 8, "p1"); orc_program_append_2 (p, "copyq", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_P1] = p1; func = c->exec; func (ex); } #endif /* const64 */ #ifdef DISABLE_ORC void const64 (orc_uint64 * ORC_RESTRICT d1, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var32; #else orc_union64 var32; #endif orc_union64 var33; ptr0 = (orc_union64 *)d1; /* 0: loadpq */ var32.i = ORC_UINT64_C(0x0123456789abcdef); /* 3.5127e-303f */ for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } #else static void _backup_const64 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var32; #else orc_union64 var32; #endif orc_union64 var33; ptr0 = (orc_union64 *)ex->arrays[0]; /* 0: loadpq */ var32.i = ORC_UINT64_C(0x0123456789abcdef); /* 3.5127e-303f */ for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } void const64 (orc_uint64 * ORC_RESTRICT d1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 7, 99, 111, 110, 115, 116, 54, 52, 11, 8, 8, 15, 8, 239, 205, 171, 137, 103, 69, 35, 1, 137, 0, 16, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_const64); #else p = orc_program_new (); orc_program_set_name (p, "const64"); orc_program_set_backup_function (p, _backup_const64); orc_program_add_destination (p, 8, "d1"); orc_program_add_constant_int64 (p, 8, 0x0123456789abcdefULL, "c1"); orc_program_append_2 (p, "copyq", 0, ORC_VAR_D1, ORC_VAR_C1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; func = c->exec; func (ex); } #endif /* param64_2 */ #ifdef DISABLE_ORC void param64_2 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n){ int i; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)d1; /* 0: loadpq */ var34.i = p1; for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var34.i; /* 2: storeq */ ptr0[i] = var33; } } #else static void _backup_param64_2 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->arrays[0]; /* 0: loadpq */ var34.i = (ex->params[24] & 0xffffffff) | ((orc_uint64)(ex->params[24 + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32); for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var34.i; /* 2: storeq */ ptr0[i] = var33; } } void param64_2 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 9, 112, 97, 114, 97, 109, 54, 52, 95, 50, 11, 8, 8, 18, 8, 20, 8, 134, 32, 24, 137, 0, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_param64_2); #else p = orc_program_new (); orc_program_set_name (p, "param64_2"); orc_program_set_backup_function (p, _backup_param64_2); orc_program_add_destination (p, 8, "d1"); orc_program_add_parameter_int64 (p, 8, "p1"); orc_program_add_temporary (p, 8, "t1"); orc_program_append_2 (p, "loadpq", 0, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "copyq", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; { orc_union64 tmp; tmp.i = p1; ex->params[ORC_VAR_P1] = tmp.x2[0]; ex->params[ORC_VAR_T1] = tmp.x2[1]; } func = c->exec; func (ex); } #endif /* pa_volume_s16ne_orc_2ch */ #ifdef DISABLE_ORC void pa_volume_s16ne_orc_2ch (orc_int16 * ORC_RESTRICT d1, orc_int64 p1, int n){ int i; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; ptr0 = (orc_union32 *)d1; /* 0: loadpq */ var41.i = p1; /* 5: loadpw */ var39.x4[0] = (int)0x00000000; /* 0 or 0f */ var39.x4[1] = (int)0x00000000; /* 0 or 0f */ var39.x4[2] = (int)0x00000000; /* 0 or 0f */ var39.x4[3] = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 1: loadl */ var37 = ptr0[i]; /* 2: convuwl */ var42.x2[0] = (orc_uint16)var37.x2[0]; var42.x2[1] = (orc_uint16)var37.x2[1]; /* 3: loadl */ var38 = ptr0[i]; /* 4: convswl */ var43.x2[0] = var38.x2[0]; var43.x2[1] = var38.x2[1]; /* 6: cmpgtsw */ var44.x4[0] = (var39.x4[0] > var42.x4[0]) ? (~0) : 0; var44.x4[1] = (var39.x4[1] > var42.x4[1]) ? (~0) : 0; var44.x4[2] = (var39.x4[2] > var42.x4[2]) ? (~0) : 0; var44.x4[3] = (var39.x4[3] > var42.x4[3]) ? (~0) : 0; /* 7: andw */ var45.x4[0] = var44.x4[0] & var41.x4[0]; var45.x4[1] = var44.x4[1] & var41.x4[1]; var45.x4[2] = var44.x4[2] & var41.x4[2]; var45.x4[3] = var44.x4[3] & var41.x4[3]; /* 8: mulhuw */ var46.x4[0] = ((orc_uint32)((orc_uint16)var42.x4[0]) * (orc_uint32)((orc_uint16)var41.x4[0])) >> 16; var46.x4[1] = ((orc_uint32)((orc_uint16)var42.x4[1]) * (orc_uint32)((orc_uint16)var41.x4[1])) >> 16; var46.x4[2] = ((orc_uint32)((orc_uint16)var42.x4[2]) * (orc_uint32)((orc_uint16)var41.x4[2])) >> 16; var46.x4[3] = ((orc_uint32)((orc_uint16)var42.x4[3]) * (orc_uint32)((orc_uint16)var41.x4[3])) >> 16; /* 9: subl */ var47.x2[0] = var46.x2[0] - var45.x2[0]; var47.x2[1] = var46.x2[1] - var45.x2[1]; /* 10: shrul */ var48.x2[0] = ((orc_uint32)var41.x2[0]) >> 16; var48.x2[1] = ((orc_uint32)var41.x2[1]) >> 16; /* 11: mulll */ var49.x2[0] = (var43.x2[0] * var48.x2[0]) & 0xffffffff; var49.x2[1] = (var43.x2[1] * var48.x2[1]) & 0xffffffff; /* 12: addl */ var50.x2[0] = var47.x2[0] + var49.x2[0]; var50.x2[1] = var47.x2[1] + var49.x2[1]; /* 13: convssslw */ var40.x2[0] = ORC_CLAMP_SW(var50.x2[0]); var40.x2[1] = ORC_CLAMP_SW(var50.x2[1]); /* 14: storel */ ptr0[i] = var40; } } #else static void _backup_pa_volume_s16ne_orc_2ch (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpq */ var41.i = (ex->params[24] & 0xffffffff) | ((orc_uint64)(ex->params[24 + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32); /* 5: loadpw */ var39.x4[0] = (int)0x00000000; /* 0 or 0f */ var39.x4[1] = (int)0x00000000; /* 0 or 0f */ var39.x4[2] = (int)0x00000000; /* 0 or 0f */ var39.x4[3] = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 1: loadl */ var37 = ptr0[i]; /* 2: convuwl */ var42.x2[0] = (orc_uint16)var37.x2[0]; var42.x2[1] = (orc_uint16)var37.x2[1]; /* 3: loadl */ var38 = ptr0[i]; /* 4: convswl */ var43.x2[0] = var38.x2[0]; var43.x2[1] = var38.x2[1]; /* 6: cmpgtsw */ var44.x4[0] = (var39.x4[0] > var42.x4[0]) ? (~0) : 0; var44.x4[1] = (var39.x4[1] > var42.x4[1]) ? (~0) : 0; var44.x4[2] = (var39.x4[2] > var42.x4[2]) ? (~0) : 0; var44.x4[3] = (var39.x4[3] > var42.x4[3]) ? (~0) : 0; /* 7: andw */ var45.x4[0] = var44.x4[0] & var41.x4[0]; var45.x4[1] = var44.x4[1] & var41.x4[1]; var45.x4[2] = var44.x4[2] & var41.x4[2]; var45.x4[3] = var44.x4[3] & var41.x4[3]; /* 8: mulhuw */ var46.x4[0] = ((orc_uint32)((orc_uint16)var42.x4[0]) * (orc_uint32)((orc_uint16)var41.x4[0])) >> 16; var46.x4[1] = ((orc_uint32)((orc_uint16)var42.x4[1]) * (orc_uint32)((orc_uint16)var41.x4[1])) >> 16; var46.x4[2] = ((orc_uint32)((orc_uint16)var42.x4[2]) * (orc_uint32)((orc_uint16)var41.x4[2])) >> 16; var46.x4[3] = ((orc_uint32)((orc_uint16)var42.x4[3]) * (orc_uint32)((orc_uint16)var41.x4[3])) >> 16; /* 9: subl */ var47.x2[0] = var46.x2[0] - var45.x2[0]; var47.x2[1] = var46.x2[1] - var45.x2[1]; /* 10: shrul */ var48.x2[0] = ((orc_uint32)var41.x2[0]) >> 16; var48.x2[1] = ((orc_uint32)var41.x2[1]) >> 16; /* 11: mulll */ var49.x2[0] = (var43.x2[0] * var48.x2[0]) & 0xffffffff; var49.x2[1] = (var43.x2[1] * var48.x2[1]) & 0xffffffff; /* 12: addl */ var50.x2[0] = var47.x2[0] + var49.x2[0]; var50.x2[1] = var47.x2[1] + var49.x2[1]; /* 13: convssslw */ var40.x2[0] = ORC_CLAMP_SW(var50.x2[0]); var40.x2[1] = ORC_CLAMP_SW(var50.x2[1]); /* 14: storel */ ptr0[i] = var40; } } void pa_volume_s16ne_orc_2ch (orc_int16 * ORC_RESTRICT d1, orc_int64 p1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 23, 112, 97, 95, 118, 111, 108, 117, 109, 101, 95, 115, 49, 54, 110, 101, 95, 111, 114, 99, 95, 50, 99, 104, 11, 4, 4, 14, 4, 0, 0, 0, 0, 14, 4, 16, 0, 0, 0, 18, 8, 20, 8, 20, 8, 20, 8, 20, 8, 20, 8, 134, 32, 24, 21, 1, 154, 33, 0, 21, 1, 153, 34, 0, 21, 2, 78, 36, 16, 33, 21, 2, 73, 36, 36, 32, 21, 2, 91, 35, 33, 32, 21, 1, 129, 35, 35, 36, 21, 1, 126, 32, 32, 17, 21, 1, 120, 34, 34, 32, 21, 1, 103, 35, 35, 34, 21, 1, 165, 0, 35, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_pa_volume_s16ne_orc_2ch); #else p = orc_program_new (); orc_program_set_name (p, "pa_volume_s16ne_orc_2ch"); orc_program_set_backup_function (p, _backup_pa_volume_s16ne_orc_2ch); orc_program_add_destination (p, 4, "d1"); orc_program_add_constant (p, 4, 0x00000000, "c1"); orc_program_add_constant (p, 4, 0x00000010, "c2"); orc_program_add_parameter_int64 (p, 8, "p1"); orc_program_add_temporary (p, 8, "t1"); orc_program_add_temporary (p, 8, "t2"); orc_program_add_temporary (p, 8, "t3"); orc_program_add_temporary (p, 8, "t4"); orc_program_add_temporary (p, 8, "t5"); orc_program_append_2 (p, "loadpq", 0, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convuwl", 1, ORC_VAR_T2, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "convswl", 1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "cmpgtsw", 2, ORC_VAR_T5, ORC_VAR_C1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "andw", 2, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "mulhuw", 2, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "subl", 1, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "shrul", 1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2, ORC_VAR_D1); orc_program_append_2 (p, "mulll", 1, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_D1); orc_program_append_2 (p, "addl", 1, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "convssslw", 1, ORC_VAR_D1, ORC_VAR_T4, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; { orc_union64 tmp; tmp.i = p1; ex->params[ORC_VAR_P1] = tmp.x2[0]; ex->params[ORC_VAR_T1] = tmp.x2[1]; } func = c->exec; func (ex); } #endif /* cogorc_convert_YUY2_I420 */ #ifdef DISABLE_ORC void cogorc_convert_YUY2_I420 (orc_uint16 * ORC_RESTRICT d1, orc_uint16 * ORC_RESTRICT d2, orc_uint8 * ORC_RESTRICT d3, orc_uint8 * ORC_RESTRICT d4, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n){ int i; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_int8 * ORC_RESTRICT ptr2; orc_int8 * ORC_RESTRICT ptr3; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_int8 var37; orc_int8 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)d1; ptr1 = (orc_union16 *)d2; ptr2 = (orc_int8 *)d3; ptr3 = (orc_int8 *)d4; ptr4 = (orc_union32 *)s1; ptr5 = (orc_union32 *)s2; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: splitwb */ { orc_union16 _src; _src.i = var35.x2[0]; var39.x2[0] = _src.x2[1]; var40.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var35.x2[1]; var39.x2[1] = _src.x2[1]; var40.x2[1] = _src.x2[0]; } /* 2: storew */ ptr0[i] = var40; /* 3: loadl */ var36 = ptr5[i]; /* 4: splitwb */ { orc_union16 _src; _src.i = var36.x2[0]; var41.x2[0] = _src.x2[1]; var42.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var36.x2[1]; var41.x2[1] = _src.x2[1]; var42.x2[1] = _src.x2[0]; } /* 5: storew */ ptr1[i] = var42; /* 6: avgub */ var43.x2[0] = ((orc_uint8)var39.x2[0] + (orc_uint8)var41.x2[0] + 1)>>1; var43.x2[1] = ((orc_uint8)var39.x2[1] + (orc_uint8)var41.x2[1] + 1)>>1; /* 7: splitwb */ { orc_union16 _src; _src.i = var43.i; var37 = _src.x2[1]; var38 = _src.x2[0]; } /* 8: storeb */ ptr3[i] = var37; /* 9: storeb */ ptr2[i] = var38; } } #else static void _backup_cogorc_convert_YUY2_I420 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_int8 * ORC_RESTRICT ptr2; orc_int8 * ORC_RESTRICT ptr3; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_int8 var37; orc_int8 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr2 = (orc_int8 *)ex->arrays[2]; ptr3 = (orc_int8 *)ex->arrays[3]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: splitwb */ { orc_union16 _src; _src.i = var35.x2[0]; var39.x2[0] = _src.x2[1]; var40.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var35.x2[1]; var39.x2[1] = _src.x2[1]; var40.x2[1] = _src.x2[0]; } /* 2: storew */ ptr0[i] = var40; /* 3: loadl */ var36 = ptr5[i]; /* 4: splitwb */ { orc_union16 _src; _src.i = var36.x2[0]; var41.x2[0] = _src.x2[1]; var42.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var36.x2[1]; var41.x2[1] = _src.x2[1]; var42.x2[1] = _src.x2[0]; } /* 5: storew */ ptr1[i] = var42; /* 6: avgub */ var43.x2[0] = ((orc_uint8)var39.x2[0] + (orc_uint8)var41.x2[0] + 1)>>1; var43.x2[1] = ((orc_uint8)var39.x2[1] + (orc_uint8)var41.x2[1] + 1)>>1; /* 7: splitwb */ { orc_union16 _src; _src.i = var43.i; var37 = _src.x2[1]; var38 = _src.x2[0]; } /* 8: storeb */ ptr3[i] = var37; /* 9: storeb */ ptr2[i] = var38; } } void cogorc_convert_YUY2_I420 (orc_uint16 * ORC_RESTRICT d1, orc_uint16 * ORC_RESTRICT d2, orc_uint8 * ORC_RESTRICT d3, orc_uint8 * ORC_RESTRICT d4, const orc_uint32 * ORC_RESTRICT s1, const orc_uint32 * ORC_RESTRICT s2, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 24, 99, 111, 103, 111, 114, 99, 95, 99, 111, 110, 118, 101, 114, 116, 95, 89, 85, 89, 50, 95, 73, 52, 50, 48, 11, 2, 2, 11, 2, 2, 11, 1, 1, 11, 1, 1, 12, 4, 4, 12, 4, 4, 20, 2, 20, 2, 20, 2, 21, 1, 199, 32, 34, 4, 97, 0, 34, 21, 1, 199, 33, 34, 5, 97, 1, 34, 21, 1, 39, 32, 32, 33, 199, 3, 2, 32, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_cogorc_convert_YUY2_I420); #else p = orc_program_new (); orc_program_set_name (p, "cogorc_convert_YUY2_I420"); orc_program_set_backup_function (p, _backup_cogorc_convert_YUY2_I420); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_destination (p, 1, "d3"); orc_program_add_destination (p, 1, "d4"); orc_program_add_source (p, 4, "s1"); orc_program_add_source (p, 4, "s2"); orc_program_add_temporary (p, 2, "t1"); orc_program_add_temporary (p, 2, "t2"); orc_program_add_temporary (p, 2, "t3"); orc_program_append_2 (p, "splitwb", 1, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "storew", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splitwb", 1, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "storew", 0, ORC_VAR_D2, ORC_VAR_T3, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgub", 1, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2, ORC_VAR_D1); orc_program_append_2 (p, "splitwb", 0, ORC_VAR_D4, ORC_VAR_D3, ORC_VAR_T1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_D2] = d2; ex->arrays[ORC_VAR_D3] = d3; ex->arrays[ORC_VAR_D4] = d4; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->arrays[ORC_VAR_S2] = (void *)s2; func = c->exec; func (ex); } #endif /* cogorc_convert_AYUV_I420 */ #ifdef DISABLE_ORC void cogorc_convert_AYUV_I420 (orc_uint16 * ORC_RESTRICT d1, int d1_stride, orc_uint16 * ORC_RESTRICT d2, int d2_stride, orc_uint8 * ORC_RESTRICT d3, int d3_stride, orc_uint8 * ORC_RESTRICT d4, int d4_stride, const orc_uint64 * ORC_RESTRICT s1, int s1_stride, const orc_uint64 * ORC_RESTRICT s2, int s2_stride, int n, int m){ int i; int j; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_int8 * ORC_RESTRICT ptr2; orc_int8 * ORC_RESTRICT ptr3; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var40; orc_union16 var41; orc_union64 var42; orc_union16 var43; orc_int8 var44; orc_int8 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_int8 var53; orc_int8 var54; orc_int8 var55; orc_int8 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(d1, d1_stride * j); ptr1 = ORC_PTR_OFFSET(d2, d2_stride * j); ptr2 = ORC_PTR_OFFSET(d3, d3_stride * j); ptr3 = ORC_PTR_OFFSET(d4, d4_stride * j); ptr4 = ORC_PTR_OFFSET(s1, s1_stride * j); ptr5 = ORC_PTR_OFFSET(s2, s2_stride * j); for (i = 0; i < n; i++) { /* 0: loadq */ var40 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var40.x2[0]; var46.x2[0] = _src.x2[1]; var47.x2[0] = _src.x2[0]; } { orc_union32 _src; _src.i = var40.x2[1]; var46.x2[1] = _src.x2[1]; var47.x2[1] = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var47.x2[0]; var41.x2[0] = _src.x2[1]; } { orc_union16 _src; _src.i = var47.x2[1]; var41.x2[1] = _src.x2[1]; } /* 3: storew */ ptr0[i] = var41; /* 4: loadq */ var42 = ptr5[i]; /* 5: splitlw */ { orc_union32 _src; _src.i = var42.x2[0]; var48.x2[0] = _src.x2[1]; var49.x2[0] = _src.x2[0]; } { orc_union32 _src; _src.i = var42.x2[1]; var48.x2[1] = _src.x2[1]; var49.x2[1] = _src.x2[0]; } /* 6: select1wb */ { orc_union16 _src; _src.i = var49.x2[0]; var43.x2[0] = _src.x2[1]; } { orc_union16 _src; _src.i = var49.x2[1]; var43.x2[1] = _src.x2[1]; } /* 7: storew */ ptr1[i] = var43; /* 8: avgub */ var50.x4[0] = ((orc_uint8)var46.x4[0] + (orc_uint8)var48.x4[0] + 1)>>1; var50.x4[1] = ((orc_uint8)var46.x4[1] + (orc_uint8)var48.x4[1] + 1)>>1; var50.x4[2] = ((orc_uint8)var46.x4[2] + (orc_uint8)var48.x4[2] + 1)>>1; var50.x4[3] = ((orc_uint8)var46.x4[3] + (orc_uint8)var48.x4[3] + 1)>>1; /* 9: splitwb */ { orc_union16 _src; _src.i = var50.x2[0]; var51.x2[0] = _src.x2[1]; var52.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var50.x2[1]; var51.x2[1] = _src.x2[1]; var52.x2[1] = _src.x2[0]; } /* 10: splitwb */ { orc_union16 _src; _src.i = var52.i; var53 = _src.x2[1]; var54 = _src.x2[0]; } /* 11: avgub */ var44 = ((orc_uint8)var53 + (orc_uint8)var54 + 1)>>1; /* 12: storeb */ ptr2[i] = var44; /* 13: splitwb */ { orc_union16 _src; _src.i = var51.i; var55 = _src.x2[1]; var56 = _src.x2[0]; } /* 14: avgub */ var45 = ((orc_uint8)var55 + (orc_uint8)var56 + 1)>>1; /* 15: storeb */ ptr3[i] = var45; } } } #else static void _backup_cogorc_convert_AYUV_I420 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_int8 * ORC_RESTRICT ptr2; orc_int8 * ORC_RESTRICT ptr3; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var40; orc_union16 var41; orc_union64 var42; orc_union16 var43; orc_int8 var44; orc_int8 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_int8 var53; orc_int8 var54; orc_int8 var55; orc_int8 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); ptr2 = ORC_PTR_OFFSET(ex->arrays[2], ex->params[2] * j); ptr3 = ORC_PTR_OFFSET(ex->arrays[3], ex->params[3] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadq */ var40 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var40.x2[0]; var46.x2[0] = _src.x2[1]; var47.x2[0] = _src.x2[0]; } { orc_union32 _src; _src.i = var40.x2[1]; var46.x2[1] = _src.x2[1]; var47.x2[1] = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var47.x2[0]; var41.x2[0] = _src.x2[1]; } { orc_union16 _src; _src.i = var47.x2[1]; var41.x2[1] = _src.x2[1]; } /* 3: storew */ ptr0[i] = var41; /* 4: loadq */ var42 = ptr5[i]; /* 5: splitlw */ { orc_union32 _src; _src.i = var42.x2[0]; var48.x2[0] = _src.x2[1]; var49.x2[0] = _src.x2[0]; } { orc_union32 _src; _src.i = var42.x2[1]; var48.x2[1] = _src.x2[1]; var49.x2[1] = _src.x2[0]; } /* 6: select1wb */ { orc_union16 _src; _src.i = var49.x2[0]; var43.x2[0] = _src.x2[1]; } { orc_union16 _src; _src.i = var49.x2[1]; var43.x2[1] = _src.x2[1]; } /* 7: storew */ ptr1[i] = var43; /* 8: avgub */ var50.x4[0] = ((orc_uint8)var46.x4[0] + (orc_uint8)var48.x4[0] + 1)>>1; var50.x4[1] = ((orc_uint8)var46.x4[1] + (orc_uint8)var48.x4[1] + 1)>>1; var50.x4[2] = ((orc_uint8)var46.x4[2] + (orc_uint8)var48.x4[2] + 1)>>1; var50.x4[3] = ((orc_uint8)var46.x4[3] + (orc_uint8)var48.x4[3] + 1)>>1; /* 9: splitwb */ { orc_union16 _src; _src.i = var50.x2[0]; var51.x2[0] = _src.x2[1]; var52.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var50.x2[1]; var51.x2[1] = _src.x2[1]; var52.x2[1] = _src.x2[0]; } /* 10: splitwb */ { orc_union16 _src; _src.i = var52.i; var53 = _src.x2[1]; var54 = _src.x2[0]; } /* 11: avgub */ var44 = ((orc_uint8)var53 + (orc_uint8)var54 + 1)>>1; /* 12: storeb */ ptr2[i] = var44; /* 13: splitwb */ { orc_union16 _src; _src.i = var51.i; var55 = _src.x2[1]; var56 = _src.x2[0]; } /* 14: avgub */ var45 = ((orc_uint8)var55 + (orc_uint8)var56 + 1)>>1; /* 15: storeb */ ptr3[i] = var45; } } } void cogorc_convert_AYUV_I420 (orc_uint16 * ORC_RESTRICT d1, int d1_stride, orc_uint16 * ORC_RESTRICT d2, int d2_stride, orc_uint8 * ORC_RESTRICT d3, int d3_stride, orc_uint8 * ORC_RESTRICT d4, int d4_stride, const orc_uint64 * ORC_RESTRICT s1, int s1_stride, const orc_uint64 * ORC_RESTRICT s2, int s2_stride, int n, int m) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 7, 9, 24, 99, 111, 103, 111, 114, 99, 95, 99, 111, 110, 118, 101, 114, 116, 95, 65, 89, 85, 86, 95, 73, 52, 50, 48, 11, 2, 2, 11, 2, 2, 11, 1, 1, 11, 1, 1, 12, 8, 8, 12, 8, 8, 20, 4, 20, 4, 20, 4, 20, 4, 20, 2, 20, 2, 20, 1, 20, 1, 21, 1, 198, 33, 32, 4, 21, 1, 189, 0, 32, 21, 1, 198, 34, 32, 5, 21, 1, 189, 1, 32, 21, 2, 39, 35, 33, 34, 21, 1, 199, 37, 36, 35, 199, 38, 39, 36, 39, 2, 38, 39, 199, 38, 39, 37, 39, 3, 38, 39, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_cogorc_convert_AYUV_I420); #else p = orc_program_new (); orc_program_set_2d (p); orc_program_set_name (p, "cogorc_convert_AYUV_I420"); orc_program_set_backup_function (p, _backup_cogorc_convert_AYUV_I420); orc_program_add_destination (p, 2, "d1"); orc_program_add_destination (p, 2, "d2"); orc_program_add_destination (p, 1, "d3"); orc_program_add_destination (p, 1, "d4"); orc_program_add_source (p, 8, "s1"); orc_program_add_source (p, 8, "s2"); orc_program_add_temporary (p, 4, "t1"); orc_program_add_temporary (p, 4, "t2"); orc_program_add_temporary (p, 4, "t3"); orc_program_add_temporary (p, 4, "t4"); orc_program_add_temporary (p, 2, "t5"); orc_program_add_temporary (p, 2, "t6"); orc_program_add_temporary (p, 1, "t7"); orc_program_add_temporary (p, 1, "t8"); orc_program_append_2 (p, "splitlw", 1, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 1, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "splitlw", 1, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1); orc_program_append_2 (p, "select1wb", 1, ORC_VAR_D2, ORC_VAR_T1, ORC_VAR_D1, ORC_VAR_D1); orc_program_append_2 (p, "avgub", 2, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_T3, ORC_VAR_D1); orc_program_append_2 (p, "splitwb", 1, ORC_VAR_T6, ORC_VAR_T5, ORC_VAR_T4, ORC_VAR_D1); orc_program_append_2 (p, "splitwb", 0, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_T5, ORC_VAR_D1); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D3, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_D1); orc_program_append_2 (p, "splitwb", 0, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_T6, ORC_VAR_D1); orc_program_append_2 (p, "avgub", 0, ORC_VAR_D4, ORC_VAR_T7, ORC_VAR_T8, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ORC_EXECUTOR_M(ex) = m; ex->arrays[ORC_VAR_D1] = d1; ex->params[ORC_VAR_D1] = d1_stride; ex->arrays[ORC_VAR_D2] = d2; ex->params[ORC_VAR_D2] = d2_stride; ex->arrays[ORC_VAR_D3] = d3; ex->params[ORC_VAR_D3] = d3_stride; ex->arrays[ORC_VAR_D4] = d4; ex->params[ORC_VAR_D4] = d4_stride; ex->arrays[ORC_VAR_S1] = (void *)s1; ex->params[ORC_VAR_S1] = s1_stride; ex->arrays[ORC_VAR_S2] = (void *)s2; ex->params[ORC_VAR_S2] = s2_stride; func = c->exec; func (ex); } #endif /* memcpy_aligned */ #ifdef DISABLE_ORC void memcpy_aligned (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_memcpy_aligned (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void memcpy_aligned (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 14, 109, 101, 109, 99, 112, 121, 95, 97, 108, 105, 103, 110, 101, 100, 11, 1, 16, 12, 1, 16, 42, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_memcpy_aligned); #else p = orc_program_new (); orc_program_set_name (p, "memcpy_aligned"); orc_program_set_backup_function (p, _backup_memcpy_aligned); orc_program_add_destination_full (p, 1, "d1", 0, 16); orc_program_add_source_full (p, 1, "s1", 0, 16); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* memcpy_large */ #ifdef DISABLE_ORC void memcpy_large (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_memcpy_large (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void memcpy_large (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 12, 109, 101, 109, 99, 112, 121, 95, 108, 97, 114, 103, 101, 11, 1, 1, 12, 1, 1, 42, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_memcpy_large); #else p = orc_program_new (); orc_program_set_name (p, "memcpy_large"); orc_program_set_backup_function (p, _backup_memcpy_large); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* memcpy_small */ #ifdef DISABLE_ORC void memcpy_small (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_memcpy_small (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void memcpy_small (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 12, 109, 101, 109, 99, 112, 121, 95, 115, 109, 97, 108, 108, 11, 1, 1, 12, 1, 1, 42, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_memcpy_small); #else p = orc_program_new (); orc_program_set_name (p, "memcpy_small"); orc_program_set_backup_function (p, _backup_memcpy_small); orc_program_add_destination (p, 1, "d1"); orc_program_add_source (p, 1, "s1"); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif /* memcpy_aligned_n16 */ #ifdef DISABLE_ORC void memcpy_aligned_n16 (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n){ int i; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)d1; ptr4 = (orc_int8 *)s1; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } #else static void _backup_memcpy_aligned_n16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } void memcpy_aligned_n16 (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n) { OrcExecutor _ex, *ex = &_ex; static volatile int p_inited = 0; static OrcCode *c = 0; void (*func) (OrcExecutor *); if (!p_inited) { orc_once_mutex_lock (); if (!p_inited) { OrcProgram *p; #if 1 static const orc_uint8 bc[] = { 1, 9, 18, 109, 101, 109, 99, 112, 121, 95, 97, 108, 105, 103, 110, 101, 100, 95, 110, 49, 54, 11, 1, 16, 12, 1, 16, 42, 0, 4, 2, 0, }; p = orc_program_new_from_static_bytecode (bc); orc_program_set_backup_function (p, _backup_memcpy_aligned_n16); #else p = orc_program_new (); orc_program_set_name (p, "memcpy_aligned_n16"); orc_program_set_backup_function (p, _backup_memcpy_aligned_n16); orc_program_add_destination_full (p, 1, "d1", 0, 16); orc_program_add_source_full (p, 1, "s1", 0, 16); orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_D1, ORC_VAR_D1); #endif orc_program_compile (p); c = orc_program_take_code (p); orc_program_free (p); } p_inited = TRUE; orc_once_mutex_unlock (); } ex->arrays[ORC_VAR_A2] = c; ex->program = 0; ex->n = n; ex->arrays[ORC_VAR_D1] = d1; ex->arrays[ORC_VAR_S1] = (void *)s1; func = c->exec; func (ex); } #endif orc-0.4.18/testsuite/orcc/Makefile.in0000664000175000017500000005637512206165330014354 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @CROSS_COMPILING_FALSE@TESTS = orc_test$(EXEEXT) test2$(EXEEXT) \ @CROSS_COMPILING_FALSE@ test3$(EXEEXT) @CROSS_COMPILING_FALSE@noinst_PROGRAMS = orc_test$(EXEEXT) \ @CROSS_COMPILING_FALSE@ test2$(EXEEXT) test3$(EXEEXT) subdir = testsuite/orcc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) orc_test_SOURCES = orc_test.c orc_test_OBJECTS = orc_test.$(OBJEXT) orc_test_LDADD = $(LDADD) am_test2_OBJECTS = test2.$(OBJEXT) testorc.$(OBJEXT) test2_OBJECTS = $(am_test2_OBJECTS) test2_LDADD = $(LDADD) am_test3_OBJECTS = test3-test3.$(OBJEXT) test3-testorc.$(OBJEXT) test3_OBJECTS = $(am_test3_OBJECTS) test3_LDADD = $(LDADD) test3_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(test3_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = orc_test.c $(test2_SOURCES) $(test3_SOURCES) DIST_SOURCES = orc_test.c $(test2_SOURCES) $(test3_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @CROSS_COMPILING_FALSE@BUILT_SOURCES = testorc.c testorc.h orc_test.c test2_SOURCES = test2.c testorc.c test3_SOURCES = test3.c testorc.c test3_CFLAGS = -DDISABLE_ORC AM_CFLAGS = $(ORC_CFLAGS) CLEANFILES = testorc.c testorc.h orc_test.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/orcc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu testsuite/orcc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list orc_test$(EXEEXT): $(orc_test_OBJECTS) $(orc_test_DEPENDENCIES) $(EXTRA_orc_test_DEPENDENCIES) @rm -f orc_test$(EXEEXT) $(LINK) $(orc_test_OBJECTS) $(orc_test_LDADD) $(LIBS) test2$(EXEEXT): $(test2_OBJECTS) $(test2_DEPENDENCIES) $(EXTRA_test2_DEPENDENCIES) @rm -f test2$(EXEEXT) $(LINK) $(test2_OBJECTS) $(test2_LDADD) $(LIBS) test3$(EXEEXT): $(test3_OBJECTS) $(test3_DEPENDENCIES) $(EXTRA_test3_DEPENDENCIES) @rm -f test3$(EXEEXT) $(test3_LINK) $(test3_OBJECTS) $(test3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orc_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test3-test3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test3-testorc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testorc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< test3-test3.o: test3.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -MT test3-test3.o -MD -MP -MF $(DEPDIR)/test3-test3.Tpo -c -o test3-test3.o `test -f 'test3.c' || echo '$(srcdir)/'`test3.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test3-test3.Tpo $(DEPDIR)/test3-test3.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test3.c' object='test3-test3.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -c -o test3-test3.o `test -f 'test3.c' || echo '$(srcdir)/'`test3.c test3-test3.obj: test3.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -MT test3-test3.obj -MD -MP -MF $(DEPDIR)/test3-test3.Tpo -c -o test3-test3.obj `if test -f 'test3.c'; then $(CYGPATH_W) 'test3.c'; else $(CYGPATH_W) '$(srcdir)/test3.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test3-test3.Tpo $(DEPDIR)/test3-test3.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test3.c' object='test3-test3.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -c -o test3-test3.obj `if test -f 'test3.c'; then $(CYGPATH_W) 'test3.c'; else $(CYGPATH_W) '$(srcdir)/test3.c'; fi` test3-testorc.o: testorc.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -MT test3-testorc.o -MD -MP -MF $(DEPDIR)/test3-testorc.Tpo -c -o test3-testorc.o `test -f 'testorc.c' || echo '$(srcdir)/'`testorc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test3-testorc.Tpo $(DEPDIR)/test3-testorc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testorc.c' object='test3-testorc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -c -o test3-testorc.o `test -f 'testorc.c' || echo '$(srcdir)/'`testorc.c test3-testorc.obj: testorc.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -MT test3-testorc.obj -MD -MP -MF $(DEPDIR)/test3-testorc.Tpo -c -o test3-testorc.obj `if test -f 'testorc.c'; then $(CYGPATH_W) 'testorc.c'; else $(CYGPATH_W) '$(srcdir)/testorc.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test3-testorc.Tpo $(DEPDIR)/test3-testorc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='testorc.c' object='test3-testorc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test3_CFLAGS) $(CFLAGS) -c -o test3-testorc.obj `if test -f 'testorc.c'; then $(CYGPATH_W) 'testorc.c'; else $(CYGPATH_W) '$(srcdir)/testorc.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am testorc.h: $(srcdir)/../test.orc $(top_builddir)/tools/orcc$(EXEEXT) --include stdint.h --header -o testorc.h $< testorc.c: $(srcdir)/../test.orc $(top_builddir)/tools/orcc$(EXEEXT) --include stdint.h --implementation -o testorc.c $< orc_test.c: $(srcdir)/../test.orc $(top_builddir)/tools/orcc$(EXEEXT) --include stdint.h --test -o orc_test.c $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/testsuite/orcc/test2.c0000644000175000017500000000020511551076053013474 00000000000000 #include int main (int argc, char *argv[]) { /* This is mostly just to test that compilation works */ return 0; } orc-0.4.18/testsuite/orcc/Makefile.am0000664000175000017500000000135612057245267014344 00000000000000 if CROSS_COMPILING else TESTS = orc_test test2 test3 noinst_PROGRAMS = orc_test test2 test3 BUILT_SOURCES = testorc.c testorc.h orc_test.c endif test2_SOURCES = test2.c testorc.c test3_SOURCES = test3.c testorc.c test3_CFLAGS = -DDISABLE_ORC AM_CFLAGS = $(ORC_CFLAGS) LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la CLEANFILES = testorc.c testorc.h orc_test.c testorc.h: $(srcdir)/../test.orc $(top_builddir)/tools/orcc$(EXEEXT) --include stdint.h --header -o testorc.h $< testorc.c: $(srcdir)/../test.orc $(top_builddir)/tools/orcc$(EXEEXT) --include stdint.h --implementation -o testorc.c $< orc_test.c: $(srcdir)/../test.orc $(top_builddir)/tools/orcc$(EXEEXT) --include stdint.h --test -o orc_test.c $< orc-0.4.18/testsuite/orcc/orc_test.c0000664000175000017500000200762512206165357014302 00000000000000 /* autogenerated from test.orc */ #include #include #include #include #include #ifndef _ORC_INTEGER_TYPEDEFS_ #define _ORC_INTEGER_TYPEDEFS_ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include typedef int8_t orc_int8; typedef int16_t orc_int16; typedef int32_t orc_int32; typedef int64_t orc_int64; typedef uint8_t orc_uint8; typedef uint16_t orc_uint16; typedef uint32_t orc_uint32; typedef uint64_t orc_uint64; #define ORC_UINT64_C(x) UINT64_C(x) #elif defined(_MSC_VER) typedef signed __int8 orc_int8; typedef signed __int16 orc_int16; typedef signed __int32 orc_int32; typedef signed __int64 orc_int64; typedef unsigned __int8 orc_uint8; typedef unsigned __int16 orc_uint16; typedef unsigned __int32 orc_uint32; typedef unsigned __int64 orc_uint64; #define ORC_UINT64_C(x) (x##Ui64) #define inline __inline #else #include typedef signed char orc_int8; typedef short orc_int16; typedef int orc_int32; typedef unsigned char orc_uint8; typedef unsigned short orc_uint16; typedef unsigned int orc_uint32; #if INT_MAX == LONG_MAX typedef long long orc_int64; typedef unsigned long long orc_uint64; #define ORC_UINT64_C(x) (x##ULL) #else typedef long orc_int64; typedef unsigned long orc_uint64; #define ORC_UINT64_C(x) (x##UL) #endif #endif typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; #endif #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif #ifndef ORC_INTERNAL #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) #define ORC_INTERNAL __attribute__((visibility("hidden"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #define ORC_INTERNAL __hidden #elif defined (__GNUC__) #define ORC_INTERNAL __attribute__((visibility("hidden"))) #else #define ORC_INTERNAL #endif #endif #include #include /* begin Orc C target preamble */ #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define ORC_ABS(a) ((a)<0 ? -(a) : (a)) #define ORC_MIN(a,b) ((a)<(b) ? (a) : (b)) #define ORC_MAX(a,b) ((a)>(b) ? (a) : (b)) #define ORC_SB_MAX 127 #define ORC_SB_MIN (-1-ORC_SB_MAX) #define ORC_UB_MAX 255 #define ORC_UB_MIN 0 #define ORC_SW_MAX 32767 #define ORC_SW_MIN (-1-ORC_SW_MAX) #define ORC_UW_MAX 65535 #define ORC_UW_MIN 0 #define ORC_SL_MAX 2147483647 #define ORC_SL_MIN (-1-ORC_SL_MAX) #define ORC_UL_MAX 4294967295U #define ORC_UL_MIN 0 #define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX) #define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX) #define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX) #define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX) #define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX) #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) #define ORC_SWAP_Q(x) ((((x)&ORC_UINT64_C(0xff))<<56) | (((x)&ORC_UINT64_C(0xff00))<<40) | (((x)&ORC_UINT64_C(0xff0000))<<24) | (((x)&ORC_UINT64_C(0xff000000))<<8) | (((x)&ORC_UINT64_C(0xff00000000))>>8) | (((x)&ORC_UINT64_C(0xff0000000000))>>24) | (((x)&ORC_UINT64_C(0xff000000000000))>>40) | (((x)&ORC_UINT64_C(0xff00000000000000))>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_DENORMAL(x) ((x) & ((((x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff)) #define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff))) #define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0)) #ifndef ORC_RESTRICT #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define ORC_RESTRICT restrict #elif defined(__GNUC__) && __GNUC__ >= 4 #define ORC_RESTRICT __restrict__ #else #define ORC_RESTRICT #endif #endif /* end Orc C target preamble */ /* orc_add2_rshift_add_s16_22_op */ static void _backup_orc_add2_rshift_add_s16_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_add2_rshift_add_s16_22 */ static void _backup_orc_add2_rshift_add_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: addw */ var37.i = var36.i + var40.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_add2_rshift_sub_s16_22_op */ static void _backup_orc_add2_rshift_sub_s16_22_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr4[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_add2_rshift_sub_s16_22 */ static void _backup_orc_add2_rshift_sub_s16_22 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var38.i = var33.i + var34.i; /* 4: addw */ var39.i = var38.i + var35.i; /* 5: shrsw */ var40.i = var39.i >> 2; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var40.i; /* 8: storew */ ptr0[i] = var37; } } /* orc_add2_rshift_add_s16_11_op */ static void _backup_orc_add2_rshift_add_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_add_s16_11 */ static void _backup_orc_add2_rshift_add_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_sub_s16_11_op */ static void _backup_orc_add2_rshift_sub_s16_11_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 1: loadw */ var34 = ptr6[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_add2_rshift_sub_s16_11 */ static void _backup_orc_add2_rshift_sub_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_add_const_rshift_s16_11 */ static void _backup_orc_add_const_rshift_s16_11 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> 1; /* 4: storew */ ptr0[i] = var35; } } /* orc_add_const_rshift_s16 */ static void _backup_orc_add_const_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[25]; /* 4: storew */ ptr0[i] = var35; } } /* orc_add_s16 */ static void _backup_orc_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_add_s16_2d */ static void _backup_orc_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } } /* orc_addc_rshift_s16 */ static void _backup_orc_addc_rshift_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: loadw */ var34 = ptr5[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: shrsw */ var35.i = var36.i >> ex->params[24]; /* 4: storew */ ptr0[i] = var35; } } /* orc_lshift1_s16 */ static void _backup_orc_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 1; /* 2: storew */ ptr0[i] = var33; } } /* orc_lshift2_s16 */ static void _backup_orc_lshift2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: shlw */ var33.i = var32.i << 2; /* 2: storew */ ptr0[i] = var33; } } /* orc_lshift_s16_ip */ static void _backup_orc_lshift_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: shlw */ var33.i = var32.i << ex->params[24]; /* 2: storew */ ptr0[i] = var33; } } /* orc_mas2_add_s16_op */ static void _backup_orc_mas2_add_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } /* orc_mas2_add_s16_ip */ static void _backup_orc_mas2_add_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: addw */ var39.i = var38.i + var44.i; /* 11: storew */ ptr0[i] = var39; } } /* orc_mas2_sub_s16_op */ static void _backup_orc_mas2_sub_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: loadw */ var35 = ptr6[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr4[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } /* orc_mas2_sub_s16_ip */ static void _backup_orc_mas2_sub_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 3: loadpw */ var36.i = ex->params[24]; /* 5: loadpl */ var37.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: loadw */ var35 = ptr5[i]; /* 2: addw */ var40.i = var34.i + var35.i; /* 4: mulswl */ var41.i = var40.i * var36.i; /* 6: addl */ var42.i = var41.i + var37.i; /* 7: shrsl */ var43.i = var42.i >> ex->params[26]; /* 8: convlw */ var44.i = var43.i; /* 9: loadw */ var38 = ptr0[i]; /* 10: subw */ var39.i = var38.i - var44.i; /* 11: storew */ ptr0[i] = var39; } } /* orc_mas4_across_add_s16_1991_op */ static void _backup_orc_mas4_across_add_s16_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; ptr8 = (orc_union16 *)ex->arrays[8]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } /* orc_mas4_across_add_s16_1991_ip */ static void _backup_orc_mas4_across_add_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: addw */ var43.i = var42.i + var51.i; /* 16: storew */ ptr0[i] = var43; } } /* orc_mas4_across_sub_s16_1991_op */ static void _backup_orc_mas4_across_sub_s16_1991_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; const orc_union16 * ORC_RESTRICT ptr8; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; ptr8 = (orc_union16 *)ex->arrays[8]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr6[i]; /* 1: loadw */ var37 = ptr7[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr5[i]; /* 6: loadw */ var40 = ptr8[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr4[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } /* orc_mas4_across_sub_s16_1991_ip */ static void _backup_orc_mas4_across_sub_s16_1991_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; const orc_union16 * ORC_RESTRICT ptr6; const orc_union16 * ORC_RESTRICT ptr7; orc_union16 var36; orc_union16 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union16 var39; orc_union16 var40; orc_union32 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union32 var45; orc_union16 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; ptr6 = (orc_union16 *)ex->arrays[6]; ptr7 = (orc_union16 *)ex->arrays[7]; /* 3: loadpw */ var38.i = (int)0x00000009; /* 9 or 4.44659e-323f */ /* 10: loadpl */ var41.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var36 = ptr5[i]; /* 1: loadw */ var37 = ptr6[i]; /* 2: addw */ var44.i = var36.i + var37.i; /* 4: mulswl */ var45.i = var44.i * var38.i; /* 5: loadw */ var39 = ptr4[i]; /* 6: loadw */ var40 = ptr7[i]; /* 7: addw */ var46.i = var39.i + var40.i; /* 8: convswl */ var47.i = var46.i; /* 9: subl */ var48.i = var45.i - var47.i; /* 11: addl */ var49.i = var48.i + var41.i; /* 12: shrsl */ var50.i = var49.i >> ex->params[25]; /* 13: convlw */ var51.i = var50.i; /* 14: loadw */ var42 = ptr0[i]; /* 15: subw */ var43.i = var42.i - var51.i; /* 16: storew */ ptr0[i] = var43; } } /* orc_subtract_s16 */ static void _backup_orc_subtract_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_add_s16_u8 */ static void _backup_orc_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: addw */ var35.i = var36.i + var34.i; /* 4: storew */ ptr0[i] = var35; } } /* orc_add_s16_u8_2d */ static void _backup_orc_add_s16_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr0[i]; /* 3: addw */ var35.i = var34.i + var36.i; /* 4: storew */ ptr0[i] = var35; } } } /* orc_convert_s16_u8 */ static void _backup_orc_convert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: convubw */ var33.i = (orc_uint8)var32; /* 2: storew */ ptr0[i] = var33; } } /* orc_convert_u8_s16 */ static void _backup_orc_convert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: convsuswb */ var33 = ORC_CLAMP_UB(var32.i); /* 2: storeb */ ptr0[i] = var33; } } /* orc_offsetconvert_u8_s16 */ static void _backup_orc_offsetconvert_u8_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_int8 var35; orc_union16 var36; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: addw */ var36.i = var33.i + var34.i; /* 3: convsuswb */ var35 = ORC_CLAMP_UB(var36.i); /* 4: storeb */ ptr0[i] = var35; } } /* orc_offsetconvert_s16_u8 */ static void _backup_orc_offsetconvert_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var34.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr4[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 3: subw */ var35.i = var36.i - var34.i; /* 4: storew */ ptr0[i] = var35; } } /* orc_subtract_s16_u8 */ static void _backup_orc_subtract_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var36.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: subw */ var35.i = var34.i - var36.i; /* 4: storew */ ptr0[i] = var35; } } /* orc_multiply_and_add_s16_u8 */ static void _backup_orc_multiply_and_add_s16_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var33; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var33 = ptr5[i]; /* 1: convubw */ var37.i = (orc_uint8)var33; /* 2: loadw */ var34 = ptr4[i]; /* 3: mullw */ var38.i = (var37.i * var34.i) & 0xffff; /* 4: loadw */ var35 = ptr0[i]; /* 5: addw */ var36.i = var35.i + var38.i; /* 6: storew */ ptr0[i] = var36; } } /* orc_splat_s16_ns */ static void _backup_orc_splat_s16_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } /* orc_splat_s16_2d_4xn */ static void _backup_orc_splat_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_s16_2d_8xn */ static void _backup_orc_splat_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_s16_2d */ static void _backup_orc_splat_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_u8_ns */ static void _backup_orc_splat_u8_ns (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } /* orc_splat_u8_2d */ static void _backup_orc_splat_u8_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpb */ var32 = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } } /* orc_average_u8 */ static void _backup_orc_average_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } /* orc_rrshift6_add_s16_2d */ static void _backup_orc_rrshift6_add_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 1: loadpw */ var34.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: addw */ var37.i = var33.i + var34.i; /* 3: shrsw */ var38.i = var37.i >> 6; /* 4: loadw */ var35 = ptr4[i]; /* 5: addw */ var39.i = var35.i + var38.i; /* 6: convsuswb */ var36 = ORC_CLAMP_UB(var39.i); /* 7: storeb */ ptr0[i] = var36; } } } /* orc_rrshift6_sub_s16_2d */ static void _backup_orc_rrshift6_sub_s16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr1[i]; /* 2: subw */ var38.i = var33.i - var34.i; /* 3: shrsw */ var39.i = var38.i >> 6; /* 4: copyw */ var35.i = var39.i; /* 5: storew */ ptr1[i] = var35; /* 6: loadw */ var36 = ptr0[i]; /* 7: subw */ var37.i = var36.i - var39.i; /* 8: storew */ ptr0[i] = var37; } } } /* orc_rrshift6_s16_ip_2d */ static void _backup_orc_rrshift6_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } } /* orc_rrshift6_s16_ip */ static void _backup_orc_rrshift6_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; ptr0 = (orc_union16 *)ex->arrays[0]; /* 1: loadpw */ var34.i = (int)0x00001fe0; /* 8160 or 4.03158e-320f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr0[i]; /* 2: subw */ var36.i = var33.i - var34.i; /* 3: shrsw */ var35.i = var36.i >> 6; /* 4: storew */ ptr0[i] = var35; } } /* orc_unpack_yuyv_y */ static void _backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select0wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[0]; } /* 2: storeb */ ptr0[i] = var33; } } /* orc_unpack_yuyv_u */ static void _backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_unpack_yuyv_v */ static void _backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[1]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_packyuyv */ static void _backup_orc_packyuyv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_union16 var37; orc_int8 var38; orc_int8 var39; orc_union32 var40; orc_union16 var41; orc_int8 var42; orc_int8 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; for (i = 0; i < n; i++) { /* 0: loadw */ var37 = ptr4[i]; /* 1: copyw */ var41.i = var37.i; /* 2: select0wb */ { orc_union16 _src; _src.i = var41.i; var42 = _src.x2[0]; } /* 3: select1wb */ { orc_union16 _src; _src.i = var41.i; var43 = _src.x2[1]; } /* 4: loadb */ var38 = ptr5[i]; /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var42; _dest.x2[1] = var38; var44.i = _dest.i; } /* 6: loadb */ var39 = ptr6[i]; /* 7: mergebw */ { orc_union16 _dest; _dest.x2[0] = var43; _dest.x2[1] = var39; var45.i = _dest.i; } /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var40.i = _dest.i; } /* 9: storel */ ptr0[i] = var40; } } /* orc_unpack_uyvy_y */ static void _backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: select1wb */ { orc_union16 _src; _src.i = var32.i; var33 = _src.x2[1]; } /* 2: storeb */ ptr0[i] = var33; } } /* orc_unpack_uyvy_u */ static void _backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_unpack_uyvy_v */ static void _backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_int8 var34; orc_union16 var35; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: select1lw */ { orc_union32 _src; _src.i = var33.i; var35.i = _src.x2[1]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var35.i; var34 = _src.x2[0]; } /* 3: storeb */ ptr0[i] = var34; } } /* orc_interleave2_s16 */ static void _backup_orc_interleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: loadw */ var33 = ptr5[i]; /* 2: mergewl */ { orc_union32 _dest; _dest.x2[0] = var32.i; _dest.x2[1] = var33.i; var34.i = _dest.i; } /* 3: storel */ ptr0[i] = var34; } } /* orc_interleave2_rrshift1_s16 */ static void _backup_orc_interleave2_rrshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 5: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 2: addw */ var39.i = var34.i + var35.i; /* 3: shrsw */ var40.i = var39.i >> 1; /* 4: loadw */ var36 = ptr5[i]; /* 6: addw */ var41.i = var36.i + var37.i; /* 7: shrsw */ var42.i = var41.i >> 1; /* 8: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var42.i; var38.i = _dest.i; } /* 9: storel */ ptr0[i] = var38; } } /* orc_deinterleave2_s16 */ static void _backup_orc_deinterleave2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union16 var34; orc_union16 var35; orc_union32 var36; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var33 = ptr4[i]; /* 1: copyl */ var36.i = var33.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var36.i; var34.i = _src.x2[0]; } /* 3: storew */ ptr0[i] = var34; /* 4: select1lw */ { orc_union32 _src; _src.i = var36.i; var35.i = _src.x2[1]; } /* 5: storew */ ptr1[i] = var35; } } /* orc_deinterleave2_lshift1_s16 */ static void _backup_orc_deinterleave2_lshift1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var38.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var38.i; var39.i = _src.x2[0]; } /* 3: shlw */ var36.i = var39.i << 1; /* 4: storew */ ptr0[i] = var36; /* 5: select1lw */ { orc_union32 _src; _src.i = var38.i; var40.i = _src.x2[1]; } /* 6: shlw */ var37.i = var40.i << 1; /* 7: storew */ ptr1[i] = var37; } } /* orc_haar_deint_lshift1_split_s16 */ static void _backup_orc_haar_deint_lshift1_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 9: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: shlw */ var42.i = var40.i << 1; /* 5: shlw */ var43.i = var41.i << 1; /* 6: subw */ var44.i = var43.i - var42.i; /* 7: copyw */ var36.i = var44.i; /* 8: storew */ ptr1[i] = var36; /* 10: avgsw */ var45.i = (var44.i + var37.i + 1)>>1; /* 11: addw */ var38.i = var42.i + var45.i; /* 12: storew */ ptr0[i] = var38; } } /* orc_haar_deint_split_s16 */ static void _backup_orc_haar_deint_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: copyl */ var39.i = var35.i; /* 2: select0lw */ { orc_union32 _src; _src.i = var39.i; var40.i = _src.x2[0]; } /* 3: select1lw */ { orc_union32 _src; _src.i = var39.i; var41.i = _src.x2[1]; } /* 4: subw */ var42.i = var41.i - var40.i; /* 5: copyw */ var36.i = var42.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var43.i = (var42.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var40.i + var43.i; /* 10: storew */ ptr0[i] = var38; } } /* orc_haar_split_s16_lo */ static void _backup_orc_haar_split_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var39.i = var35.i - var38.i; /* 5: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 6: addw */ var37.i = var38.i + var40.i; /* 7: storew */ ptr0[i] = var37; } } /* orc_haar_split_s16_hi */ static void _backup_orc_haar_split_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr5[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_haar_split_s16_op */ static void _backup_orc_haar_split_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 6: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr5[i]; /* 3: subw */ var40.i = var35.i - var39.i; /* 4: copyw */ var36.i = var40.i; /* 5: storew */ ptr1[i] = var36; /* 7: avgsw */ var41.i = (var40.i + var37.i + 1)>>1; /* 8: addw */ var38.i = var39.i + var41.i; /* 9: storew */ ptr0[i] = var38; } } /* orc_haar_split_s16 */ static void _backup_orc_haar_split_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var39.i = var34.i; /* 2: loadw */ var35 = ptr1[i]; /* 3: copyw */ var40.i = var35.i; /* 4: subw */ var41.i = var40.i - var39.i; /* 5: copyw */ var36.i = var41.i; /* 6: storew */ ptr1[i] = var36; /* 8: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 9: addw */ var38.i = var39.i + var42.i; /* 10: storew */ ptr0[i] = var38; } } /* orc_haar_synth_s16_lo */ static void _backup_orc_haar_synth_s16_lo (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr5[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr4[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_haar_synth_s16_hi */ static void _backup_orc_haar_synth_s16_hi (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var39.i = var35.i; /* 3: avgsw */ var40.i = (var39.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var41.i = var37.i - var40.i; /* 6: addw */ var38.i = var39.i + var41.i; /* 7: storew */ ptr0[i] = var38; } } /* orc_haar_synth_s16_op */ static void _backup_orc_haar_synth_s16_op (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr5[i]; /* 1: copyw */ var40.i = var35.i; /* 3: avgsw */ var41.i = (var40.i + var36.i + 1)>>1; /* 4: loadw */ var37 = ptr4[i]; /* 5: subw */ var42.i = var37.i - var41.i; /* 6: copyw */ var38.i = var42.i; /* 7: storew */ ptr0[i] = var38; /* 8: addw */ var39.i = var40.i + var42.i; /* 9: storew */ ptr1[i] = var39; } } /* orc_haar_synth_s16 */ static void _backup_orc_haar_synth_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 4: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr0[i]; /* 1: copyw */ var40.i = var35.i; /* 2: loadw */ var36 = ptr1[i]; /* 3: copyw */ var41.i = var36.i; /* 5: avgsw */ var42.i = (var41.i + var37.i + 1)>>1; /* 6: subw */ var43.i = var40.i - var42.i; /* 7: copyw */ var38.i = var43.i; /* 8: storew */ ptr0[i] = var38; /* 9: addw */ var39.i = var41.i + var43.i; /* 10: storew */ ptr1[i] = var39; } } /* orc_haar_synth_rrshift1_int_s16 */ static void _backup_orc_haar_synth_rrshift1_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union32 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ /* 7: loadpw */ var37.i = (int)0x00000000; /* 0 or 0f */ /* 9: loadpw */ var38.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var40.i = var34.i; /* 3: avgsw */ var41.i = (var40.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var42.i = var36.i - var41.i; /* 6: addw */ var43.i = var40.i + var42.i; /* 8: avgsw */ var44.i = (var42.i + var37.i + 1)>>1; /* 10: avgsw */ var45.i = (var43.i + var38.i + 1)>>1; /* 11: mergewl */ { orc_union32 _dest; _dest.x2[0] = var44.i; _dest.x2[1] = var45.i; var39.i = _dest.i; } /* 12: storel */ ptr0[i] = var39; } } /* orc_haar_synth_int_s16 */ static void _backup_orc_haar_synth_int_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif orc_union16 var36; orc_union32 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 2: loadpw */ var35.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr5[i]; /* 1: copyw */ var38.i = var34.i; /* 3: avgsw */ var39.i = (var38.i + var35.i + 1)>>1; /* 4: loadw */ var36 = ptr4[i]; /* 5: subw */ var40.i = var36.i - var39.i; /* 6: addw */ var41.i = var38.i + var40.i; /* 7: mergewl */ { orc_union32 _dest; _dest.x2[0] = var40.i; _dest.x2[1] = var41.i; var37.i = _dest.i; } /* 8: storel */ ptr0[i] = var37; } } /* orc_haar_sub_s16 */ static void _backup_orc_haar_sub_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: subw */ var34.i = var32.i - var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_haar_add_half_s16 */ static void _backup_orc_haar_add_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: addw */ var36.i = var35.i + var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_haar_add_s16 */ static void _backup_orc_haar_add_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; orc_union16 var34; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr0[i]; /* 1: loadw */ var33 = ptr4[i]; /* 2: addw */ var34.i = var32.i + var33.i; /* 3: storew */ ptr0[i] = var34; } } /* orc_haar_sub_half_s16 */ static void _backup_orc_haar_sub_half_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var33; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var34; #else orc_union16 var34; #endif orc_union16 var35; orc_union16 var36; orc_union16 var37; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 1: loadpw */ var34.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 2: avgsw */ var37.i = (var33.i + var34.i + 1)>>1; /* 3: loadw */ var35 = ptr0[i]; /* 4: subw */ var36.i = var35.i - var37.i; /* 5: storew */ ptr0[i] = var36; } } /* orc_sum_u8 */ static void _backup_orc_sum_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_int8 var34; orc_union16 var35; orc_union32 var36; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var35.i = (orc_uint8)var34; /* 2: convuwl */ var36.i = (orc_uint16)var35.i; /* 3: accl */ var12.i = var12.i + var36.i; } ex->accumulators[0] = var12.i; } /* orc_sum_s16 */ static void _backup_orc_sum_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var33; orc_union32 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: convswl */ var34.i = var33.i; /* 2: accl */ var12.i = var12.i + var34.i; } ex->accumulators[0] = var12.i; } /* orc_sum_square_diff_u8 */ static void _backup_orc_sum_square_diff_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var35; orc_int8 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union32 var41; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var37.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr5[i]; /* 3: convubw */ var38.i = (orc_uint8)var36; /* 4: subw */ var39.i = var37.i - var38.i; /* 5: mullw */ var40.i = (var39.i * var39.i) & 0xffff; /* 6: convuwl */ var41.i = (orc_uint16)var40.i; /* 7: accl */ var12.i = var12.i + var41.i; } ex->accumulators[0] = var12.i; } /* orc_dequantise_s16_2d_4xn */ static void _backup_orc_dequantise_s16_2d_4xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 4; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_2d_8xn */ static void _backup_orc_dequantise_s16_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_ip_2d_8xn */ static void _backup_orc_dequantise_s16_ip_2d_8xn (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_ip_2d */ static void _backup_orc_dequantise_s16_ip_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } } /* orc_dequantise_s16_ip */ static void _backup_orc_dequantise_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } /* orc_dequantise_s16 */ static void _backup_orc_dequantise_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 4: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var36.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } /* orc_dequantise_var_s16_ip */ static void _backup_orc_dequantise_var_s16_ip (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr0[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: loadw */ var35 = ptr4[i]; /* 5: mullw */ var41.i = (var40.i * var35.i) & 0xffff; /* 6: loadw */ var36 = ptr5[i]; /* 7: addw */ var42.i = var41.i + var36.i; /* 8: shrsw */ var43.i = var42.i >> 2; /* 9: mullw */ var37.i = (var43.i * var39.i) & 0xffff; /* 10: storew */ ptr0[i] = var37; } } /* orc_quantise1_s16 */ static void _backup_orc_quantise1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var38.i = var34.i; /* 2: signw */ var39.i = ORC_CLAMP(var38.i,-1,1); /* 3: absw */ var40.i = ORC_ABS(var38.i); /* 4: shlw */ var41.i = var40.i << 2; /* 6: subw */ var42.i = var41.i - var35.i; /* 8: mulhuw */ var43.i = ((orc_uint32)((orc_uint16)var42.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var44.i = ((orc_uint16)var43.i) >> ex->params[26]; /* 10: mullw */ var37.i = (var44.i * var39.i) & 0xffff; /* 11: storew */ ptr0[i] = var37; } } /* orc_quantise2_s16 */ static void _backup_orc_quantise2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; ptr0 = (orc_union16 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; /* 5: loadpw */ var35.i = ex->params[25]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: copyw */ var37.i = var34.i; /* 2: signw */ var38.i = ORC_CLAMP(var37.i,-1,1); /* 3: absw */ var39.i = ORC_ABS(var37.i); /* 4: shlw */ var40.i = var39.i << 2; /* 6: subw */ var41.i = var40.i - var35.i; /* 7: shruw */ var42.i = ((orc_uint16)var41.i) >> ex->params[24]; /* 8: mullw */ var36.i = (var42.i * var38.i) & 0xffff; /* 9: storew */ ptr0[i] = var36; } } /* orc_quantdequant1_s16 */ static void _backup_orc_quantdequant1_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 7: loadpw */ var36.i = ex->params[24]; /* 14: loadpw */ var38.i = ex->params[27]; /* 16: loadpw */ var39.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var41.i = var34.i; /* 2: signw */ var42.i = ORC_CLAMP(var41.i,-1,1); /* 3: absw */ var43.i = ORC_ABS(var41.i); /* 4: shlw */ var44.i = var43.i << 2; /* 6: subw */ var45.i = var44.i - var35.i; /* 8: mulhuw */ var46.i = ((orc_uint32)((orc_uint16)var45.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 9: shruw */ var47.i = ((orc_uint16)var46.i) >> ex->params[26]; /* 10: mullw */ var48.i = (var47.i * var42.i) & 0xffff; /* 11: copyw */ var37.i = var48.i; /* 12: storew */ ptr0[i] = var37; /* 13: signw */ var49.i = ORC_CLAMP(var48.i,-1,1); /* 15: mullw */ var50.i = (var47.i * var38.i) & 0xffff; /* 17: addw */ var51.i = var50.i + var39.i; /* 18: shrsw */ var52.i = var51.i >> 2; /* 19: mullw */ var40.i = (var52.i * var49.i) & 0xffff; /* 20: storew */ ptr1[i] = var40; } } /* orc_quantdequant3_s16 */ static void _backup_orc_quantdequant3_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union32 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var36.i = ex->params[25]; /* 7: loadpw */ var37.i = ex->params[24]; /* 9: loadpl */ var38.i = ex->params[29]; /* 17: loadpw */ var40.i = ex->params[27]; /* 19: loadpw */ var41.i = ex->params[28]; for (i = 0; i < n; i++) { /* 0: loadw */ var35 = ptr1[i]; /* 1: copyw */ var43.i = var35.i; /* 2: signw */ var44.i = ORC_CLAMP(var43.i,-1,1); /* 3: absw */ var45.i = ORC_ABS(var43.i); /* 4: shlw */ var46.i = var45.i << 2; /* 6: subw */ var47.i = var46.i - var36.i; /* 8: muluwl */ var48.i = ((orc_uint16)var47.i) * ((orc_uint16)var37.i); /* 10: addl */ var49.i = var48.i + var38.i; /* 11: shrul */ var50.i = ((orc_uint32)var49.i) >> ex->params[26]; /* 12: convlw */ var51.i = var50.i; /* 13: mullw */ var52.i = (var51.i * var44.i) & 0xffff; /* 14: copyw */ var39.i = var52.i; /* 15: storew */ ptr0[i] = var39; /* 16: signw */ var53.i = ORC_CLAMP(var52.i,-1,1); /* 18: mullw */ var54.i = (var51.i * var40.i) & 0xffff; /* 20: addw */ var55.i = var54.i + var41.i; /* 21: shrsw */ var56.i = var55.i >> 2; /* 22: mullw */ var42.i = (var56.i * var53.i) & 0xffff; /* 23: storew */ ptr1[i] = var42; } } /* orc_quantdequant2_s16 */ static void _backup_orc_quantdequant2_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_union16 var34; orc_union16 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; /* 5: loadpw */ var35.i = ex->params[25]; /* 12: loadpw */ var37.i = ex->params[26]; /* 14: loadpw */ var38.i = ex->params[27]; for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr1[i]; /* 1: copyw */ var40.i = var34.i; /* 2: signw */ var41.i = ORC_CLAMP(var40.i,-1,1); /* 3: absw */ var42.i = ORC_ABS(var40.i); /* 4: shlw */ var43.i = var42.i << 2; /* 6: subw */ var44.i = var43.i - var35.i; /* 7: shruw */ var45.i = ((orc_uint16)var44.i) >> ex->params[24]; /* 8: mullw */ var46.i = (var45.i * var41.i) & 0xffff; /* 9: copyw */ var36.i = var46.i; /* 10: storew */ ptr0[i] = var36; /* 11: signw */ var47.i = ORC_CLAMP(var46.i,-1,1); /* 13: mullw */ var48.i = (var45.i * var37.i) & 0xffff; /* 15: addw */ var49.i = var48.i + var38.i; /* 16: shrsw */ var50.i = var49.i >> 2; /* 17: mullw */ var39.i = (var50.i * var47.i) & 0xffff; /* 18: storew */ ptr1[i] = var39; } } /* orc_downsample_vert_u8 */ static void _backup_orc_downsample_vert_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var35; orc_int8 var36; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_int8 var38; orc_int8 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif orc_int8 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; ptr7 = (orc_int8 *)ex->arrays[7]; /* 5: loadpw */ var37.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 12: loadpw */ var40.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 15: loadpw */ var41.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadb */ var35 = ptr4[i]; /* 1: convubw */ var43.i = (orc_uint8)var35; /* 2: loadb */ var36 = ptr7[i]; /* 3: convubw */ var44.i = (orc_uint8)var36; /* 4: addw */ var45.i = var43.i + var44.i; /* 6: mullw */ var46.i = (var45.i * var37.i) & 0xffff; /* 7: loadb */ var38 = ptr5[i]; /* 8: convubw */ var47.i = (orc_uint8)var38; /* 9: loadb */ var39 = ptr6[i]; /* 10: convubw */ var48.i = (orc_uint8)var39; /* 11: addw */ var49.i = var47.i + var48.i; /* 13: mullw */ var50.i = (var49.i * var40.i) & 0xffff; /* 14: addw */ var51.i = var50.i + var46.i; /* 16: addw */ var52.i = var51.i + var41.i; /* 17: shruw */ var53.i = ((orc_uint16)var52.i) >> 6; /* 18: convwb */ var42 = var53.i; /* 19: storeb */ ptr0[i] = var42; } } /* orc_downsample_horiz_u8 */ static void _backup_orc_downsample_horiz_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; const orc_union16 * ORC_RESTRICT ptr5; orc_union16 var38; orc_union16 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_int8 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_int8 var52; orc_union16 var53; orc_int8 var54; orc_union16 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union16 *)ex->arrays[4]; ptr5 = (orc_union16 *)ex->arrays[5]; /* 9: loadpw */ var40.i = (int)0x00000006; /* 6 or 2.96439e-323f */ /* 16: loadpw */ var41.i = (int)0x0000001a; /* 26 or 1.28457e-322f */ /* 19: loadpw */ var42.i = (int)0x00000020; /* 32 or 1.58101e-322f */ for (i = 0; i < n; i++) { /* 0: loadw */ var38 = ptr4[i]; /* 1: copyw */ var44.i = var38.i; /* 2: loadw */ var39 = ptr5[i]; /* 3: copyw */ var45.i = var39.i; /* 4: select0wb */ { orc_union16 _src; _src.i = var44.i; var46 = _src.x2[0]; } /* 5: convubw */ var47.i = (orc_uint8)var46; /* 6: select1wb */ { orc_union16 _src; _src.i = var45.i; var48 = _src.x2[1]; } /* 7: convubw */ var49.i = (orc_uint8)var48; /* 8: addw */ var50.i = var47.i + var49.i; /* 10: mullw */ var51.i = (var50.i * var40.i) & 0xffff; /* 11: select1wb */ { orc_union16 _src; _src.i = var44.i; var52 = _src.x2[1]; } /* 12: convubw */ var53.i = (orc_uint8)var52; /* 13: select0wb */ { orc_union16 _src; _src.i = var45.i; var54 = _src.x2[0]; } /* 14: convubw */ var55.i = (orc_uint8)var54; /* 15: addw */ var56.i = var53.i + var55.i; /* 17: mullw */ var57.i = (var56.i * var41.i) & 0xffff; /* 18: addw */ var58.i = var51.i + var57.i; /* 20: addw */ var59.i = var58.i + var42.i; /* 21: shruw */ var60.i = ((orc_uint16)var59.i) >> 6; /* 22: convwb */ var43 = var60.i; /* 23: storeb */ ptr0[i] = var43; } } /* orc_stats_moment_s16 */ static void _backup_orc_stats_moment_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union16 var37; orc_union16 var38; orc_union16 var39; orc_union32 var40; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000002; /* 2 or 9.88131e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var37.i = ORC_ABS(var34.i); /* 3: subw */ var38.i = var37.i - var35.i; /* 5: maxsw */ var39.i = ORC_MAX(var38.i, var36.i); /* 6: convuwl */ var40.i = (orc_uint16)var39.i; /* 7: accl */ var12.i = var12.i + var40.i; } ex->accumulators[0] = var12.i; } /* orc_stats_above_s16 */ static void _backup_orc_stats_above_s16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union32 var12 = { 0 }; orc_union16 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var35; #else orc_union16 var35; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var37; #else orc_union16 var37; #endif orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union32 var42; ptr4 = (orc_union16 *)ex->arrays[4]; /* 2: loadpw */ var35.i = (int)0x00000001; /* 1 or 4.94066e-324f */ /* 4: loadpw */ var36.i = (int)0x00000000; /* 0 or 0f */ /* 6: loadpw */ var37.i = (int)0x00000001; /* 1 or 4.94066e-324f */ for (i = 0; i < n; i++) { /* 0: loadw */ var34 = ptr4[i]; /* 1: absw */ var38.i = ORC_ABS(var34.i); /* 3: subw */ var39.i = var38.i - var35.i; /* 5: maxsw */ var40.i = ORC_MAX(var39.i, var36.i); /* 7: minsw */ var41.i = ORC_MIN(var40.i, var37.i); /* 8: convuwl */ var42.i = (orc_uint16)var41.i; /* 9: accl */ var12.i = var12.i + var42.i; } ex->accumulators[0] = var12.i; } /* orc_accw */ static void _backup_orc_accw (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var12 = { 0 }; orc_union16 var33; orc_union16 var34; ptr4 = (orc_union16 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadw */ var33 = ptr4[i]; /* 1: absw */ var34.i = ORC_ABS(var33.i); /* 2: accw */ var12.i = var12.i + var34.i; } ex->accumulators[0] = (var12.i & 0xffff); } /* orc_avg2_8xn_u8 */ static void _backup_orc_avg2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_12xn_u8 */ static void _backup_orc_avg2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_16xn_u8 */ static void _backup_orc_avg2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_32xn_u8 */ static void _backup_orc_avg2_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_avg2_nxm_u8 */ static void _backup_orc_avg2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var32; orc_int8 var33; orc_int8 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: avgub */ var34 = ((orc_uint8)var32 + (orc_uint8)var33 + 1)>>1; /* 3: storeb */ ptr0[i] = var34; } } } /* orc_combine4_8xn_u8 */ static void _backup_orc_combine4_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_12xn_u8 */ static void _backup_orc_combine4_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_16xn_u8 */ static void _backup_orc_combine4_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_24xn_u8 */ static void _backup_orc_combine4_24xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 24; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_32xn_u8 */ static void _backup_orc_combine4_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: convsuswb */ var43 = ORC_CLAMP_UB(var55.i); /* 22: storeb */ ptr0[i] = var43; } } } /* orc_combine4_nxm_u8 */ static void _backup_orc_combine4_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; const orc_int8 * ORC_RESTRICT ptr7; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_union16 var37; orc_int8 var38; orc_union16 var39; orc_int8 var40; orc_union16 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var42; #else orc_union16 var42; #endif orc_int8 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_union16 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_union16 var55; orc_union16 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); ptr6 = ORC_PTR_OFFSET(ex->arrays[6], ex->params[6] * j); ptr7 = ORC_PTR_OFFSET(ex->arrays[7], ex->params[7] * j); /* 2: loadpw */ var35.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 11: loadpw */ var39.i = ex->params[26]; /* 16: loadpw */ var41.i = ex->params[27]; /* 19: loadpw */ var42.i = (int)0x00000008; /* 8 or 3.95253e-323f */ for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var44.i = (orc_uint8)var34; /* 3: mullw */ var45.i = (var44.i * var35.i) & 0xffff; /* 4: loadb */ var36 = ptr5[i]; /* 5: convubw */ var46.i = (orc_uint8)var36; /* 7: mullw */ var47.i = (var46.i * var37.i) & 0xffff; /* 8: addw */ var48.i = var45.i + var47.i; /* 9: loadb */ var38 = ptr6[i]; /* 10: convubw */ var49.i = (orc_uint8)var38; /* 12: mullw */ var50.i = (var49.i * var39.i) & 0xffff; /* 13: addw */ var51.i = var48.i + var50.i; /* 14: loadb */ var40 = ptr7[i]; /* 15: convubw */ var52.i = (orc_uint8)var40; /* 17: mullw */ var53.i = (var52.i * var41.i) & 0xffff; /* 18: addw */ var54.i = var51.i + var53.i; /* 20: addw */ var55.i = var54.i + var42.i; /* 21: shrsw */ var56.i = var55.i >> 4; /* 22: convsuswb */ var43 = ORC_CLAMP_UB(var56.i); /* 23: storeb */ ptr0[i] = var43; } } } /* orc_combine2_8xn_u8 */ static void _backup_orc_combine2_8xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_combine2_12xn_u8 */ static void _backup_orc_combine2_12xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_combine2_16xn_u8 */ static void _backup_orc_combine2_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_combine2_nxm_u8 */ static void _backup_orc_combine2_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_int8 var34; orc_int8 var35; orc_union16 var36; orc_union16 var37; orc_union16 var38; orc_int8 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; orc_union16 var44; orc_union16 var45; orc_union16 var46; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); /* 4: loadpw */ var36.i = ex->params[24]; /* 6: loadpw */ var37.i = ex->params[25]; /* 9: loadpw */ var38.i = ex->params[26]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var40.i = (orc_uint8)var34; /* 2: loadb */ var35 = ptr5[i]; /* 3: convubw */ var41.i = (orc_uint8)var35; /* 5: mullw */ var42.i = (var40.i * var36.i) & 0xffff; /* 7: mullw */ var43.i = (var41.i * var37.i) & 0xffff; /* 8: addw */ var44.i = var42.i + var43.i; /* 10: addw */ var45.i = var44.i + var38.i; /* 11: shrsw */ var46.i = var45.i >> ex->params[27]; /* 12: convsuswb */ var39 = ORC_CLAMP_UB(var46.i); /* 13: storeb */ ptr0[i] = var39; } } } /* orc_sad_nxm_u8 */ static void _backup_orc_sad_nxm_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_8x8_u8 */ static void _backup_orc_sad_8x8_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 8; int m = 8; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_12x12_u8 */ static void _backup_orc_sad_12x12_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 12; int m = 12; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_16xn_u8 */ static void _backup_orc_sad_16xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 16; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* orc_sad_32xn_u8 */ static void _backup_orc_sad_32xn_u8 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = 32; int m = ex->params[ORC_VAR_A1]; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var12 = { 0 }; orc_int8 var32; orc_int8 var33; for (j = 0; j < m; j++) { ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: loadb */ var33 = ptr5[i]; /* 2: accsadubl */ var12.i = var12.i + ORC_ABS((orc_int32)(orc_uint8)var32 - (orc_int32)(orc_uint8)var33); } } ex->accumulators[0] = var12.i; } /* convert_rgb_to_gray */ static void _backup_convert_rgb_to_gray (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var35; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var36; #else orc_union16 var36; #endif orc_union32 var37; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var38; #else orc_union16 var38; #endif orc_union32 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var40; #else orc_union16 var40; #endif #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union16 var41; #else orc_union16 var41; #endif orc_int8 var42; orc_union16 var43; orc_int8 var44; orc_union16 var45; orc_union16 var46; orc_union16 var47; orc_union16 var48; orc_int8 var49; orc_union16 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union16 var54; orc_int8 var55; orc_union16 var56; orc_union16 var57; orc_union16 var58; orc_union16 var59; orc_union16 var60; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var36.i = (int)0x00004c8b; /* 19595 or 9.68122e-320f */ /* 12: loadpw */ var38.i = (int)0x00009646; /* 38470 or 1.90067e-319f */ /* 20: loadpw */ var40.i = (int)0x00001d2f; /* 7471 or 3.69116e-320f */ /* 23: loadpw */ var41.i = (int)0x00000080; /* 128 or 6.32404e-322f */ for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var35.i; var43.i = _src.x2[0]; } /* 2: select0wb */ { orc_union16 _src; _src.i = var43.i; var44 = _src.x2[0]; } /* 3: convubw */ var45.i = (orc_uint8)var44; /* 4: swapw */ var46.i = ORC_SWAP_W(var45.i); /* 6: mulhuw */ var47.i = ((orc_uint32)((orc_uint16)var46.i) * (orc_uint32)((orc_uint16)var36.i)) >> 16; /* 7: loadl */ var37 = ptr4[i]; /* 8: select0lw */ { orc_union32 _src; _src.i = var37.i; var48.i = _src.x2[0]; } /* 9: select1wb */ { orc_union16 _src; _src.i = var48.i; var49 = _src.x2[1]; } /* 10: convubw */ var50.i = (orc_uint8)var49; /* 11: swapw */ var51.i = ORC_SWAP_W(var50.i); /* 13: mulhuw */ var52.i = ((orc_uint32)((orc_uint16)var51.i) * (orc_uint32)((orc_uint16)var38.i)) >> 16; /* 14: addusw */ var53.i = ORC_CLAMP_UW((orc_uint16)var47.i + (orc_uint16)var52.i); /* 15: loadl */ var39 = ptr4[i]; /* 16: select1lw */ { orc_union32 _src; _src.i = var39.i; var54.i = _src.x2[1]; } /* 17: select0wb */ { orc_union16 _src; _src.i = var54.i; var55 = _src.x2[0]; } /* 18: convubw */ var56.i = (orc_uint8)var55; /* 19: swapw */ var57.i = ORC_SWAP_W(var56.i); /* 21: mulhuw */ var58.i = ((orc_uint32)((orc_uint16)var57.i) * (orc_uint32)((orc_uint16)var40.i)) >> 16; /* 22: addusw */ var59.i = ORC_CLAMP_UW((orc_uint16)var53.i + (orc_uint16)var58.i); /* 24: addusw */ var60.i = ORC_CLAMP_UW((orc_uint16)var59.i + (orc_uint16)var41.i); /* 25: select1wb */ { orc_union16 _src; _src.i = var60.i; var42 = _src.x2[1]; } /* 26: storeb */ ptr0[i] = var42; } } /* canny_calc_delta_x */ static void _backup_canny_calc_delta_x (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; orc_union32 var44; orc_union32 var45; orc_union32 var46; orc_union16 var47; orc_int8 var48; orc_union16 var49; orc_int8 var50; orc_union16 var51; orc_union16 var52; orc_union16 var53; orc_union32 var54; orc_union32 var55; orc_union16 var56; orc_int8 var57; orc_union16 var58; orc_int8 var59; orc_union16 var60; orc_union16 var61; orc_union16 var62; orc_union32 var63; orc_union32 var64; orc_union32 var65; orc_union16 var66; orc_int8 var67; orc_union16 var68; orc_int8 var69; orc_union16 var70; orc_union16 var71; orc_union16 var72; orc_union32 var73; orc_union32 var74; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: select0lw */ { orc_union32 _src; _src.i = var40.i; var47.i = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var47.i; var48 = _src.x2[1]; } /* 3: loadl */ var41 = ptr5[i]; /* 4: select0lw */ { orc_union32 _src; _src.i = var41.i; var49.i = _src.x2[0]; } /* 5: select1wb */ { orc_union16 _src; _src.i = var49.i; var50 = _src.x2[1]; } /* 6: convubw */ var51.i = (orc_uint8)var48; /* 7: convubw */ var52.i = (orc_uint8)var50; /* 8: subw */ var53.i = var51.i - var52.i; /* 9: convswl */ var54.i = var53.i; /* 10: mulll */ var55.i = (var54.i * var54.i) & 0xffffffff; /* 11: loadl */ var42 = ptr4[i]; /* 12: select1lw */ { orc_union32 _src; _src.i = var42.i; var56.i = _src.x2[1]; } /* 13: select0wb */ { orc_union16 _src; _src.i = var56.i; var57 = _src.x2[0]; } /* 14: loadl */ var43 = ptr5[i]; /* 15: select1lw */ { orc_union32 _src; _src.i = var43.i; var58.i = _src.x2[1]; } /* 16: select0wb */ { orc_union16 _src; _src.i = var58.i; var59 = _src.x2[0]; } /* 17: convubw */ var60.i = (orc_uint8)var57; /* 18: convubw */ var61.i = (orc_uint8)var59; /* 19: subw */ var62.i = var60.i - var61.i; /* 20: convswl */ var63.i = var62.i; /* 21: mulll */ var64.i = (var63.i * var63.i) & 0xffffffff; /* 22: addl */ var65.i = var55.i + var64.i; /* 23: loadl */ var44 = ptr4[i]; /* 24: select1lw */ { orc_union32 _src; _src.i = var44.i; var66.i = _src.x2[1]; } /* 25: select1wb */ { orc_union16 _src; _src.i = var66.i; var67 = _src.x2[1]; } /* 26: loadl */ var45 = ptr5[i]; /* 27: select1lw */ { orc_union32 _src; _src.i = var45.i; var68.i = _src.x2[1]; } /* 28: select1wb */ { orc_union16 _src; _src.i = var68.i; var69 = _src.x2[1]; } /* 29: convubw */ var70.i = (orc_uint8)var67; /* 30: convubw */ var71.i = (orc_uint8)var69; /* 31: subw */ var72.i = var70.i - var71.i; /* 32: convswl */ var73.i = var72.i; /* 33: mulll */ var74.i = (var73.i * var73.i) & 0xffffffff; /* 34: addl */ var46.i = var65.i + var74.i; /* 35: storel */ ptr0[i] = var46; } } /* i420_to_ayuv */ static void _backup_i420_to_ayuv (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; const orc_int8 * ORC_RESTRICT ptr6; orc_int8 var37; orc_union32 var38; orc_int8 var39; orc_int8 var40; orc_int8 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; ptr6 = (orc_int8 *)ex->arrays[6]; /* 3: loadpb */ var37 = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadupdb */ var39 = ptr5[i>>1]; /* 1: loadupdb */ var40 = ptr6[i>>1]; /* 2: loadb */ var41 = ptr4[i]; /* 4: mergebw */ { orc_union16 _dest; _dest.x2[0] = var37; _dest.x2[1] = var41; var42.i = _dest.i; } /* 5: mergebw */ { orc_union16 _dest; _dest.x2[0] = var39; _dest.x2[1] = var40; var43.i = _dest.i; } /* 6: mergewl */ { orc_union32 _dest; _dest.x2[0] = var42.i; _dest.x2[1] = var43.i; var38.i = _dest.i; } /* 7: storel */ ptr0[i] = var38; } } /* test_4x */ static void _backup_test_4x (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: loadl */ var33 = ptr5[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } /* test_4x_2 */ static void _backup_test_4x_2 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 1: loadpb */ var33.x4[0] = ex->params[24]; var33.x4[1] = ex->params[24]; var33.x4[2] = ex->params[24]; var33.x4[3] = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } /* orc_splat_u16 */ static void _backup_orc_splat_u16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; ptr0 = (orc_union16 *)ex->arrays[0]; /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } /* orc_splat_u32 */ static void _backup_orc_splat_u32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } /* orc_splat_u16_2d */ static void _backup_orc_splat_u16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpw */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_splat_u32_2d */ static void _backup_orc_splat_u32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); /* 0: loadpl */ var32.i = ex->params[24]; for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } /* orc_copy_u16_2d */ static void _backup_orc_copy_u16_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; const orc_union16 * ORC_RESTRICT ptr4; orc_union16 var32; orc_union16 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadw */ var32 = ptr4[i]; /* 1: copyw */ var33.i = var32.i; /* 2: storew */ ptr0[i] = var33; } } } /* orc_copy_u32_2d */ static void _backup_orc_copy_u32_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr4[i]; /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } } /* orc_composite_add_8888_8888_2d */ static void _backup_orc_composite_add_8888_8888_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } } /* orc_composite_add_8_8_line */ static void _backup_orc_composite_add_8_8_line (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; orc_int8 var34; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr0[i]; /* 1: loadb */ var33 = ptr4[i]; /* 2: addusb */ var34 = ORC_CLAMP_UB((orc_uint8)var32 + (orc_uint8)var33); /* 3: storeb */ ptr0[i] = var34; } } /* orc_composite_add_n_8_8_line */ static void _backup_orc_composite_add_n_8_8_line (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var34; orc_union16 var35; orc_int8 var36; orc_int8 var37; orc_union16 var38; orc_union16 var39; orc_union16 var40; orc_int8 var41; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; /* 2: loadpw */ var35.i = ex->params[24]; for (i = 0; i < n; i++) { /* 0: loadb */ var34 = ptr4[i]; /* 1: convubw */ var38.i = (orc_uint8)var34; /* 3: mullw */ var39.i = (var38.i * var35.i) & 0xffff; /* 4: div255w */ var40.i = ((orc_uint16)(((orc_uint16)(var39.i+128)) + (((orc_uint16)(var39.i+128))>>8)))>>8; /* 5: convwb */ var41 = var40.i; /* 6: loadb */ var36 = ptr0[i]; /* 7: addusb */ var37 = ORC_CLAMP_UB((orc_uint8)var36 + (orc_uint8)var41); /* 8: storeb */ ptr0[i] = var37; } } /* orc_code_combine_add_u */ static void _backup_orc_code_combine_add_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union32 var44; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: convubw */ var39.x4[0] = (orc_uint8)var35.x4[0]; var39.x4[1] = (orc_uint8)var35.x4[1]; var39.x4[2] = (orc_uint8)var35.x4[2]; var39.x4[3] = (orc_uint8)var35.x4[3]; /* 2: loadl */ var36 = ptr5[i]; /* 3: convubw */ var40.x4[0] = (orc_uint8)var36.x4[0]; var40.x4[1] = (orc_uint8)var36.x4[1]; var40.x4[2] = (orc_uint8)var36.x4[2]; var40.x4[3] = (orc_uint8)var36.x4[3]; /* 4: splatw3q */ var41.i = ((((orc_uint64)var40.i)>>48) << 48) | ((((orc_uint64)var40.i)>>48)<<32) | ((((orc_uint64)var40.i)>>48) << 16) | ((((orc_uint64)var40.i)>>48)); /* 5: mullw */ var42.x4[0] = (var39.x4[0] * var41.x4[0]) & 0xffff; var42.x4[1] = (var39.x4[1] * var41.x4[1]) & 0xffff; var42.x4[2] = (var39.x4[2] * var41.x4[2]) & 0xffff; var42.x4[3] = (var39.x4[3] * var41.x4[3]) & 0xffff; /* 6: div255w */ var43.x4[0] = ((orc_uint16)(((orc_uint16)(var42.x4[0]+128)) + (((orc_uint16)(var42.x4[0]+128))>>8)))>>8; var43.x4[1] = ((orc_uint16)(((orc_uint16)(var42.x4[1]+128)) + (((orc_uint16)(var42.x4[1]+128))>>8)))>>8; var43.x4[2] = ((orc_uint16)(((orc_uint16)(var42.x4[2]+128)) + (((orc_uint16)(var42.x4[2]+128))>>8)))>>8; var43.x4[3] = ((orc_uint16)(((orc_uint16)(var42.x4[3]+128)) + (((orc_uint16)(var42.x4[3]+128))>>8)))>>8; /* 7: convwb */ var44.x4[0] = var43.x4[0]; var44.x4[1] = var43.x4[1]; var44.x4[2] = var43.x4[2]; var44.x4[3] = var43.x4[3]; /* 8: loadl */ var37 = ptr0[i]; /* 9: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var37.x4[0] + (orc_uint8)var44.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var37.x4[1] + (orc_uint8)var44.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var37.x4[2] + (orc_uint8)var44.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var37.x4[3] + (orc_uint8)var44.x4[3]); /* 10: storel */ ptr0[i] = var38; } } /* orc_code_combine_add_u_n */ static void _backup_orc_code_combine_add_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } /* orc_code_combine_over_u */ static void _backup_orc_code_combine_over_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union32 var46; orc_union32 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union32 var53; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 10: loadpw */ var39.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 5: mullw */ var44.x4[0] = (var41.x4[0] * var43.x4[0]) & 0xffff; var44.x4[1] = (var41.x4[1] * var43.x4[1]) & 0xffff; var44.x4[2] = (var41.x4[2] * var43.x4[2]) & 0xffff; var44.x4[3] = (var41.x4[3] * var43.x4[3]) & 0xffff; /* 6: div255w */ var45.x4[0] = ((orc_uint16)(((orc_uint16)(var44.x4[0]+128)) + (((orc_uint16)(var44.x4[0]+128))>>8)))>>8; var45.x4[1] = ((orc_uint16)(((orc_uint16)(var44.x4[1]+128)) + (((orc_uint16)(var44.x4[1]+128))>>8)))>>8; var45.x4[2] = ((orc_uint16)(((orc_uint16)(var44.x4[2]+128)) + (((orc_uint16)(var44.x4[2]+128))>>8)))>>8; var45.x4[3] = ((orc_uint16)(((orc_uint16)(var44.x4[3]+128)) + (((orc_uint16)(var44.x4[3]+128))>>8)))>>8; /* 7: convwb */ var46.x4[0] = var45.x4[0]; var46.x4[1] = var45.x4[1]; var46.x4[2] = var45.x4[2]; var46.x4[3] = var45.x4[3]; /* 8: loadl */ var47 = ptr0[i]; /* 9: convubw */ var48.x4[0] = (orc_uint8)var47.x4[0]; var48.x4[1] = (orc_uint8)var47.x4[1]; var48.x4[2] = (orc_uint8)var47.x4[2]; var48.x4[3] = (orc_uint8)var47.x4[3]; /* 11: xorw */ var49.x4[0] = var45.x4[0] ^ var39.x4[0]; var49.x4[1] = var45.x4[1] ^ var39.x4[1]; var49.x4[2] = var45.x4[2] ^ var39.x4[2]; var49.x4[3] = var45.x4[3] ^ var39.x4[3]; /* 12: splatw3q */ var50.i = ((((orc_uint64)var49.i)>>48) << 48) | ((((orc_uint64)var49.i)>>48)<<32) | ((((orc_uint64)var49.i)>>48) << 16) | ((((orc_uint64)var49.i)>>48)); /* 13: mullw */ var51.x4[0] = (var48.x4[0] * var50.x4[0]) & 0xffff; var51.x4[1] = (var48.x4[1] * var50.x4[1]) & 0xffff; var51.x4[2] = (var48.x4[2] * var50.x4[2]) & 0xffff; var51.x4[3] = (var48.x4[3] * var50.x4[3]) & 0xffff; /* 14: div255w */ var52.x4[0] = ((orc_uint16)(((orc_uint16)(var51.x4[0]+128)) + (((orc_uint16)(var51.x4[0]+128))>>8)))>>8; var52.x4[1] = ((orc_uint16)(((orc_uint16)(var51.x4[1]+128)) + (((orc_uint16)(var51.x4[1]+128))>>8)))>>8; var52.x4[2] = ((orc_uint16)(((orc_uint16)(var51.x4[2]+128)) + (((orc_uint16)(var51.x4[2]+128))>>8)))>>8; var52.x4[3] = ((orc_uint16)(((orc_uint16)(var51.x4[3]+128)) + (((orc_uint16)(var51.x4[3]+128))>>8)))>>8; /* 15: convwb */ var53.x4[0] = var52.x4[0]; var53.x4[1] = var52.x4[1]; var53.x4[2] = var52.x4[2]; var53.x4[3] = var52.x4[3]; /* 16: addusb */ var40.x4[0] = ORC_CLAMP_UB((orc_uint8)var53.x4[0] + (orc_uint8)var46.x4[0]); var40.x4[1] = ORC_CLAMP_UB((orc_uint8)var53.x4[1] + (orc_uint8)var46.x4[1]); var40.x4[2] = ORC_CLAMP_UB((orc_uint8)var53.x4[2] + (orc_uint8)var46.x4[2]); var40.x4[3] = ORC_CLAMP_UB((orc_uint8)var53.x4[3] + (orc_uint8)var46.x4[3]); /* 17: storel */ ptr0[i] = var40; } } /* orc_code_combine_over_u_n */ static void _backup_orc_code_combine_over_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var37; #else orc_union64 var37; #endif orc_union32 var38; orc_union32 var39; orc_union64 var40; orc_union32 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union32 var47; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 4: loadpw */ var37.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var37.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var39 = ptr4[i]; /* 1: convubw */ var40.x4[0] = (orc_uint8)var39.x4[0]; var40.x4[1] = (orc_uint8)var39.x4[1]; var40.x4[2] = (orc_uint8)var39.x4[2]; var40.x4[3] = (orc_uint8)var39.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var41.x4[0]; var42.x4[1] = (orc_uint8)var41.x4[1]; var42.x4[2] = (orc_uint8)var41.x4[2]; var42.x4[3] = (orc_uint8)var41.x4[3]; /* 5: xorw */ var43.x4[0] = var40.x4[0] ^ var37.x4[0]; var43.x4[1] = var40.x4[1] ^ var37.x4[1]; var43.x4[2] = var40.x4[2] ^ var37.x4[2]; var43.x4[3] = var40.x4[3] ^ var37.x4[3]; /* 6: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 7: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 8: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 9: convwb */ var47.x4[0] = var46.x4[0]; var47.x4[1] = var46.x4[1]; var47.x4[2] = var46.x4[2]; var47.x4[3] = var46.x4[3]; /* 10: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var47.x4[0] + (orc_uint8)var39.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var47.x4[1] + (orc_uint8)var39.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var47.x4[2] + (orc_uint8)var39.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var47.x4[3] + (orc_uint8)var39.x4[3]); /* 11: storel */ ptr0[i] = var38; } } /* orc_code_combine_in_u */ static void _backup_orc_code_combine_in_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 5: mullw */ var44.x4[0] = (var41.x4[0] * var43.x4[0]) & 0xffff; var44.x4[1] = (var41.x4[1] * var43.x4[1]) & 0xffff; var44.x4[2] = (var41.x4[2] * var43.x4[2]) & 0xffff; var44.x4[3] = (var41.x4[3] * var43.x4[3]) & 0xffff; /* 6: div255w */ var45.x4[0] = ((orc_uint16)(((orc_uint16)(var44.x4[0]+128)) + (((orc_uint16)(var44.x4[0]+128))>>8)))>>8; var45.x4[1] = ((orc_uint16)(((orc_uint16)(var44.x4[1]+128)) + (((orc_uint16)(var44.x4[1]+128))>>8)))>>8; var45.x4[2] = ((orc_uint16)(((orc_uint16)(var44.x4[2]+128)) + (((orc_uint16)(var44.x4[2]+128))>>8)))>>8; var45.x4[3] = ((orc_uint16)(((orc_uint16)(var44.x4[3]+128)) + (((orc_uint16)(var44.x4[3]+128))>>8)))>>8; /* 7: loadl */ var39 = ptr0[i]; /* 8: convubw */ var46.x4[0] = (orc_uint8)var39.x4[0]; var46.x4[1] = (orc_uint8)var39.x4[1]; var46.x4[2] = (orc_uint8)var39.x4[2]; var46.x4[3] = (orc_uint8)var39.x4[3]; /* 9: splatw3q */ var47.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 10: mullw */ var48.x4[0] = (var45.x4[0] * var47.x4[0]) & 0xffff; var48.x4[1] = (var45.x4[1] * var47.x4[1]) & 0xffff; var48.x4[2] = (var45.x4[2] * var47.x4[2]) & 0xffff; var48.x4[3] = (var45.x4[3] * var47.x4[3]) & 0xffff; /* 11: div255w */ var49.x4[0] = ((orc_uint16)(((orc_uint16)(var48.x4[0]+128)) + (((orc_uint16)(var48.x4[0]+128))>>8)))>>8; var49.x4[1] = ((orc_uint16)(((orc_uint16)(var48.x4[1]+128)) + (((orc_uint16)(var48.x4[1]+128))>>8)))>>8; var49.x4[2] = ((orc_uint16)(((orc_uint16)(var48.x4[2]+128)) + (((orc_uint16)(var48.x4[2]+128))>>8)))>>8; var49.x4[3] = ((orc_uint16)(((orc_uint16)(var48.x4[3]+128)) + (((orc_uint16)(var48.x4[3]+128))>>8)))>>8; /* 12: convwb */ var40.x4[0] = var49.x4[0]; var40.x4[1] = var49.x4[1]; var40.x4[2] = var49.x4[2]; var40.x4[3] = var49.x4[3]; /* 13: storel */ ptr0[i] = var40; } } /* orc_code_combine_in_u_n */ static void _backup_orc_code_combine_in_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var37; orc_union32 var38; orc_union32 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var40.x4[0] = (orc_uint8)var37.x4[0]; var40.x4[1] = (orc_uint8)var37.x4[1]; var40.x4[2] = (orc_uint8)var37.x4[2]; var40.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr0[i]; /* 3: convubw */ var41.x4[0] = (orc_uint8)var38.x4[0]; var41.x4[1] = (orc_uint8)var38.x4[1]; var41.x4[2] = (orc_uint8)var38.x4[2]; var41.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var42.i = ((((orc_uint64)var41.i)>>48) << 48) | ((((orc_uint64)var41.i)>>48)<<32) | ((((orc_uint64)var41.i)>>48) << 16) | ((((orc_uint64)var41.i)>>48)); /* 5: mullw */ var43.x4[0] = (var40.x4[0] * var42.x4[0]) & 0xffff; var43.x4[1] = (var40.x4[1] * var42.x4[1]) & 0xffff; var43.x4[2] = (var40.x4[2] * var42.x4[2]) & 0xffff; var43.x4[3] = (var40.x4[3] * var42.x4[3]) & 0xffff; /* 6: div255w */ var44.x4[0] = ((orc_uint16)(((orc_uint16)(var43.x4[0]+128)) + (((orc_uint16)(var43.x4[0]+128))>>8)))>>8; var44.x4[1] = ((orc_uint16)(((orc_uint16)(var43.x4[1]+128)) + (((orc_uint16)(var43.x4[1]+128))>>8)))>>8; var44.x4[2] = ((orc_uint16)(((orc_uint16)(var43.x4[2]+128)) + (((orc_uint16)(var43.x4[2]+128))>>8)))>>8; var44.x4[3] = ((orc_uint16)(((orc_uint16)(var43.x4[3]+128)) + (((orc_uint16)(var43.x4[3]+128))>>8)))>>8; /* 7: convwb */ var39.x4[0] = var44.x4[0]; var39.x4[1] = var44.x4[1]; var39.x4[2] = var44.x4[2]; var39.x4[3] = var44.x4[3]; /* 8: storel */ ptr0[i] = var39; } } /* orc_code_combine_out_u */ static void _backup_orc_code_combine_out_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var37; orc_union32 var38; orc_union32 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var40; #else orc_union64 var40; #endif orc_union32 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 10: loadpw */ var40.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var42.x4[0] = (orc_uint8)var37.x4[0]; var42.x4[1] = (orc_uint8)var37.x4[1]; var42.x4[2] = (orc_uint8)var37.x4[2]; var42.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr5[i]; /* 3: convubw */ var43.x4[0] = (orc_uint8)var38.x4[0]; var43.x4[1] = (orc_uint8)var38.x4[1]; var43.x4[2] = (orc_uint8)var38.x4[2]; var43.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 5: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 6: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 7: loadl */ var39 = ptr0[i]; /* 8: convubw */ var47.x4[0] = (orc_uint8)var39.x4[0]; var47.x4[1] = (orc_uint8)var39.x4[1]; var47.x4[2] = (orc_uint8)var39.x4[2]; var47.x4[3] = (orc_uint8)var39.x4[3]; /* 9: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 11: xorw */ var49.x4[0] = var48.x4[0] ^ var40.x4[0]; var49.x4[1] = var48.x4[1] ^ var40.x4[1]; var49.x4[2] = var48.x4[2] ^ var40.x4[2]; var49.x4[3] = var48.x4[3] ^ var40.x4[3]; /* 12: mullw */ var50.x4[0] = (var46.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var46.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var46.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var46.x4[3] * var49.x4[3]) & 0xffff; /* 13: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 14: convwb */ var41.x4[0] = var51.x4[0]; var41.x4[1] = var51.x4[1]; var41.x4[2] = var51.x4[2]; var41.x4[3] = var51.x4[3]; /* 15: storel */ ptr0[i] = var41; } } /* orc_code_combine_out_u_n */ static void _backup_orc_code_combine_out_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var39.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var39.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var37 = ptr4[i]; /* 1: convubw */ var41.x4[0] = (orc_uint8)var37.x4[0]; var41.x4[1] = (orc_uint8)var37.x4[1]; var41.x4[2] = (orc_uint8)var37.x4[2]; var41.x4[3] = (orc_uint8)var37.x4[3]; /* 2: loadl */ var38 = ptr0[i]; /* 3: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 4: splatw3q */ var43.i = ((((orc_uint64)var42.i)>>48) << 48) | ((((orc_uint64)var42.i)>>48)<<32) | ((((orc_uint64)var42.i)>>48) << 16) | ((((orc_uint64)var42.i)>>48)); /* 6: xorw */ var44.x4[0] = var43.x4[0] ^ var39.x4[0]; var44.x4[1] = var43.x4[1] ^ var39.x4[1]; var44.x4[2] = var43.x4[2] ^ var39.x4[2]; var44.x4[3] = var43.x4[3] ^ var39.x4[3]; /* 7: mullw */ var45.x4[0] = (var41.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var41.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var41.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var41.x4[3] * var44.x4[3]) & 0xffff; /* 8: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 9: convwb */ var40.x4[0] = var46.x4[0]; var40.x4[1] = var46.x4[1]; var40.x4[2] = var46.x4[2]; var40.x4[3] = var46.x4[3]; /* 10: storel */ ptr0[i] = var40; } } /* orc_code_combine_atop_u */ static void _backup_orc_code_combine_atop_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; orc_union32 var43; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var44; #else orc_union64 var44; #endif orc_union32 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union32 var55; orc_union64 var56; orc_union64 var57; orc_union64 var58; orc_union64 var59; orc_union64 var60; orc_union32 var61; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 16: loadpw */ var44.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var46.x4[0] = (orc_uint8)var40.x4[0]; var46.x4[1] = (orc_uint8)var40.x4[1]; var46.x4[2] = (orc_uint8)var40.x4[2]; var46.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var47.x4[0] = (orc_uint8)var41.x4[0]; var47.x4[1] = (orc_uint8)var41.x4[1]; var47.x4[2] = (orc_uint8)var41.x4[2]; var47.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 5: mullw */ var49.x4[0] = (var46.x4[0] * var48.x4[0]) & 0xffff; var49.x4[1] = (var46.x4[1] * var48.x4[1]) & 0xffff; var49.x4[2] = (var46.x4[2] * var48.x4[2]) & 0xffff; var49.x4[3] = (var46.x4[3] * var48.x4[3]) & 0xffff; /* 6: div255w */ var50.x4[0] = ((orc_uint16)(((orc_uint16)(var49.x4[0]+128)) + (((orc_uint16)(var49.x4[0]+128))>>8)))>>8; var50.x4[1] = ((orc_uint16)(((orc_uint16)(var49.x4[1]+128)) + (((orc_uint16)(var49.x4[1]+128))>>8)))>>8; var50.x4[2] = ((orc_uint16)(((orc_uint16)(var49.x4[2]+128)) + (((orc_uint16)(var49.x4[2]+128))>>8)))>>8; var50.x4[3] = ((orc_uint16)(((orc_uint16)(var49.x4[3]+128)) + (((orc_uint16)(var49.x4[3]+128))>>8)))>>8; /* 7: loadl */ var42 = ptr0[i]; /* 8: convubw */ var51.x4[0] = (orc_uint8)var42.x4[0]; var51.x4[1] = (orc_uint8)var42.x4[1]; var51.x4[2] = (orc_uint8)var42.x4[2]; var51.x4[3] = (orc_uint8)var42.x4[3]; /* 9: splatw3q */ var52.i = ((((orc_uint64)var51.i)>>48) << 48) | ((((orc_uint64)var51.i)>>48)<<32) | ((((orc_uint64)var51.i)>>48) << 16) | ((((orc_uint64)var51.i)>>48)); /* 10: mullw */ var53.x4[0] = (var50.x4[0] * var52.x4[0]) & 0xffff; var53.x4[1] = (var50.x4[1] * var52.x4[1]) & 0xffff; var53.x4[2] = (var50.x4[2] * var52.x4[2]) & 0xffff; var53.x4[3] = (var50.x4[3] * var52.x4[3]) & 0xffff; /* 11: div255w */ var54.x4[0] = ((orc_uint16)(((orc_uint16)(var53.x4[0]+128)) + (((orc_uint16)(var53.x4[0]+128))>>8)))>>8; var54.x4[1] = ((orc_uint16)(((orc_uint16)(var53.x4[1]+128)) + (((orc_uint16)(var53.x4[1]+128))>>8)))>>8; var54.x4[2] = ((orc_uint16)(((orc_uint16)(var53.x4[2]+128)) + (((orc_uint16)(var53.x4[2]+128))>>8)))>>8; var54.x4[3] = ((orc_uint16)(((orc_uint16)(var53.x4[3]+128)) + (((orc_uint16)(var53.x4[3]+128))>>8)))>>8; /* 12: convwb */ var55.x4[0] = var54.x4[0]; var55.x4[1] = var54.x4[1]; var55.x4[2] = var54.x4[2]; var55.x4[3] = var54.x4[3]; /* 13: loadl */ var43 = ptr0[i]; /* 14: convubw */ var56.x4[0] = (orc_uint8)var43.x4[0]; var56.x4[1] = (orc_uint8)var43.x4[1]; var56.x4[2] = (orc_uint8)var43.x4[2]; var56.x4[3] = (orc_uint8)var43.x4[3]; /* 15: splatw3q */ var57.i = ((((orc_uint64)var50.i)>>48) << 48) | ((((orc_uint64)var50.i)>>48)<<32) | ((((orc_uint64)var50.i)>>48) << 16) | ((((orc_uint64)var50.i)>>48)); /* 17: xorw */ var58.x4[0] = var57.x4[0] ^ var44.x4[0]; var58.x4[1] = var57.x4[1] ^ var44.x4[1]; var58.x4[2] = var57.x4[2] ^ var44.x4[2]; var58.x4[3] = var57.x4[3] ^ var44.x4[3]; /* 18: mullw */ var59.x4[0] = (var56.x4[0] * var58.x4[0]) & 0xffff; var59.x4[1] = (var56.x4[1] * var58.x4[1]) & 0xffff; var59.x4[2] = (var56.x4[2] * var58.x4[2]) & 0xffff; var59.x4[3] = (var56.x4[3] * var58.x4[3]) & 0xffff; /* 19: div255w */ var60.x4[0] = ((orc_uint16)(((orc_uint16)(var59.x4[0]+128)) + (((orc_uint16)(var59.x4[0]+128))>>8)))>>8; var60.x4[1] = ((orc_uint16)(((orc_uint16)(var59.x4[1]+128)) + (((orc_uint16)(var59.x4[1]+128))>>8)))>>8; var60.x4[2] = ((orc_uint16)(((orc_uint16)(var59.x4[2]+128)) + (((orc_uint16)(var59.x4[2]+128))>>8)))>>8; var60.x4[3] = ((orc_uint16)(((orc_uint16)(var59.x4[3]+128)) + (((orc_uint16)(var59.x4[3]+128))>>8)))>>8; /* 20: convwb */ var61.x4[0] = var60.x4[0]; var61.x4[1] = var60.x4[1]; var61.x4[2] = var60.x4[2]; var61.x4[3] = var60.x4[3]; /* 21: addusb */ var45.x4[0] = ORC_CLAMP_UB((orc_uint8)var55.x4[0] + (orc_uint8)var61.x4[0]); var45.x4[1] = ORC_CLAMP_UB((orc_uint8)var55.x4[1] + (orc_uint8)var61.x4[1]); var45.x4[2] = ORC_CLAMP_UB((orc_uint8)var55.x4[2] + (orc_uint8)var61.x4[2]); var45.x4[3] = ORC_CLAMP_UB((orc_uint8)var55.x4[3] + (orc_uint8)var61.x4[3]); /* 22: storel */ ptr0[i] = var45; } } /* orc_code_combine_atop_u_n */ static void _backup_orc_code_combine_atop_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; orc_union32 var42; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var43; #else orc_union64 var43; #endif orc_union32 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union32 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union32 var56; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 11: loadpw */ var43.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var45.x4[0] = (orc_uint8)var40.x4[0]; var45.x4[1] = (orc_uint8)var40.x4[1]; var45.x4[2] = (orc_uint8)var40.x4[2]; var45.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var46.x4[0] = (orc_uint8)var41.x4[0]; var46.x4[1] = (orc_uint8)var41.x4[1]; var46.x4[2] = (orc_uint8)var41.x4[2]; var46.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var47.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 5: mullw */ var48.x4[0] = (var45.x4[0] * var47.x4[0]) & 0xffff; var48.x4[1] = (var45.x4[1] * var47.x4[1]) & 0xffff; var48.x4[2] = (var45.x4[2] * var47.x4[2]) & 0xffff; var48.x4[3] = (var45.x4[3] * var47.x4[3]) & 0xffff; /* 6: div255w */ var49.x4[0] = ((orc_uint16)(((orc_uint16)(var48.x4[0]+128)) + (((orc_uint16)(var48.x4[0]+128))>>8)))>>8; var49.x4[1] = ((orc_uint16)(((orc_uint16)(var48.x4[1]+128)) + (((orc_uint16)(var48.x4[1]+128))>>8)))>>8; var49.x4[2] = ((orc_uint16)(((orc_uint16)(var48.x4[2]+128)) + (((orc_uint16)(var48.x4[2]+128))>>8)))>>8; var49.x4[3] = ((orc_uint16)(((orc_uint16)(var48.x4[3]+128)) + (((orc_uint16)(var48.x4[3]+128))>>8)))>>8; /* 7: convwb */ var50.x4[0] = var49.x4[0]; var50.x4[1] = var49.x4[1]; var50.x4[2] = var49.x4[2]; var50.x4[3] = var49.x4[3]; /* 8: loadl */ var42 = ptr0[i]; /* 9: convubw */ var51.x4[0] = (orc_uint8)var42.x4[0]; var51.x4[1] = (orc_uint8)var42.x4[1]; var51.x4[2] = (orc_uint8)var42.x4[2]; var51.x4[3] = (orc_uint8)var42.x4[3]; /* 10: splatw3q */ var52.i = ((((orc_uint64)var45.i)>>48) << 48) | ((((orc_uint64)var45.i)>>48)<<32) | ((((orc_uint64)var45.i)>>48) << 16) | ((((orc_uint64)var45.i)>>48)); /* 12: xorw */ var53.x4[0] = var52.x4[0] ^ var43.x4[0]; var53.x4[1] = var52.x4[1] ^ var43.x4[1]; var53.x4[2] = var52.x4[2] ^ var43.x4[2]; var53.x4[3] = var52.x4[3] ^ var43.x4[3]; /* 13: mullw */ var54.x4[0] = (var51.x4[0] * var53.x4[0]) & 0xffff; var54.x4[1] = (var51.x4[1] * var53.x4[1]) & 0xffff; var54.x4[2] = (var51.x4[2] * var53.x4[2]) & 0xffff; var54.x4[3] = (var51.x4[3] * var53.x4[3]) & 0xffff; /* 14: div255w */ var55.x4[0] = ((orc_uint16)(((orc_uint16)(var54.x4[0]+128)) + (((orc_uint16)(var54.x4[0]+128))>>8)))>>8; var55.x4[1] = ((orc_uint16)(((orc_uint16)(var54.x4[1]+128)) + (((orc_uint16)(var54.x4[1]+128))>>8)))>>8; var55.x4[2] = ((orc_uint16)(((orc_uint16)(var54.x4[2]+128)) + (((orc_uint16)(var54.x4[2]+128))>>8)))>>8; var55.x4[3] = ((orc_uint16)(((orc_uint16)(var54.x4[3]+128)) + (((orc_uint16)(var54.x4[3]+128))>>8)))>>8; /* 15: convwb */ var56.x4[0] = var55.x4[0]; var56.x4[1] = var55.x4[1]; var56.x4[2] = var55.x4[2]; var56.x4[3] = var55.x4[3]; /* 16: addusb */ var44.x4[0] = ORC_CLAMP_UB((orc_uint8)var50.x4[0] + (orc_uint8)var56.x4[0]); var44.x4[1] = ORC_CLAMP_UB((orc_uint8)var50.x4[1] + (orc_uint8)var56.x4[1]); var44.x4[2] = ORC_CLAMP_UB((orc_uint8)var50.x4[2] + (orc_uint8)var56.x4[2]); var44.x4[3] = ORC_CLAMP_UB((orc_uint8)var50.x4[3] + (orc_uint8)var56.x4[3]); /* 17: storel */ ptr0[i] = var44; } } /* orc_code_combine_xor_u */ static void _backup_orc_code_combine_xor_u (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; orc_union32 var42; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var43; #else orc_union64 var43; #endif orc_union32 var44; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var45; #else orc_union64 var45; #endif orc_union32 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; orc_union64 var58; orc_union64 var59; orc_union64 var60; orc_union64 var61; orc_union64 var62; orc_union32 var63; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 10: loadpw */ var43.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var43.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ /* 18: loadpw */ var45.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var45.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var47.x4[0] = (orc_uint8)var40.x4[0]; var47.x4[1] = (orc_uint8)var40.x4[1]; var47.x4[2] = (orc_uint8)var40.x4[2]; var47.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var48.x4[0] = (orc_uint8)var41.x4[0]; var48.x4[1] = (orc_uint8)var41.x4[1]; var48.x4[2] = (orc_uint8)var41.x4[2]; var48.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var49.i = ((((orc_uint64)var48.i)>>48) << 48) | ((((orc_uint64)var48.i)>>48)<<32) | ((((orc_uint64)var48.i)>>48) << 16) | ((((orc_uint64)var48.i)>>48)); /* 5: mullw */ var50.x4[0] = (var47.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var47.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var47.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var47.x4[3] * var49.x4[3]) & 0xffff; /* 6: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 7: loadl */ var42 = ptr0[i]; /* 8: convubw */ var52.x4[0] = (orc_uint8)var42.x4[0]; var52.x4[1] = (orc_uint8)var42.x4[1]; var52.x4[2] = (orc_uint8)var42.x4[2]; var52.x4[3] = (orc_uint8)var42.x4[3]; /* 9: splatw3q */ var53.i = ((((orc_uint64)var52.i)>>48) << 48) | ((((orc_uint64)var52.i)>>48)<<32) | ((((orc_uint64)var52.i)>>48) << 16) | ((((orc_uint64)var52.i)>>48)); /* 11: xorw */ var54.x4[0] = var53.x4[0] ^ var43.x4[0]; var54.x4[1] = var53.x4[1] ^ var43.x4[1]; var54.x4[2] = var53.x4[2] ^ var43.x4[2]; var54.x4[3] = var53.x4[3] ^ var43.x4[3]; /* 12: mullw */ var55.x4[0] = (var51.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var51.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var51.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var51.x4[3] * var54.x4[3]) & 0xffff; /* 13: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 14: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 15: loadl */ var44 = ptr0[i]; /* 16: convubw */ var58.x4[0] = (orc_uint8)var44.x4[0]; var58.x4[1] = (orc_uint8)var44.x4[1]; var58.x4[2] = (orc_uint8)var44.x4[2]; var58.x4[3] = (orc_uint8)var44.x4[3]; /* 17: splatw3q */ var59.i = ((((orc_uint64)var51.i)>>48) << 48) | ((((orc_uint64)var51.i)>>48)<<32) | ((((orc_uint64)var51.i)>>48) << 16) | ((((orc_uint64)var51.i)>>48)); /* 19: xorw */ var60.x4[0] = var59.x4[0] ^ var45.x4[0]; var60.x4[1] = var59.x4[1] ^ var45.x4[1]; var60.x4[2] = var59.x4[2] ^ var45.x4[2]; var60.x4[3] = var59.x4[3] ^ var45.x4[3]; /* 20: mullw */ var61.x4[0] = (var58.x4[0] * var60.x4[0]) & 0xffff; var61.x4[1] = (var58.x4[1] * var60.x4[1]) & 0xffff; var61.x4[2] = (var58.x4[2] * var60.x4[2]) & 0xffff; var61.x4[3] = (var58.x4[3] * var60.x4[3]) & 0xffff; /* 21: div255w */ var62.x4[0] = ((orc_uint16)(((orc_uint16)(var61.x4[0]+128)) + (((orc_uint16)(var61.x4[0]+128))>>8)))>>8; var62.x4[1] = ((orc_uint16)(((orc_uint16)(var61.x4[1]+128)) + (((orc_uint16)(var61.x4[1]+128))>>8)))>>8; var62.x4[2] = ((orc_uint16)(((orc_uint16)(var61.x4[2]+128)) + (((orc_uint16)(var61.x4[2]+128))>>8)))>>8; var62.x4[3] = ((orc_uint16)(((orc_uint16)(var61.x4[3]+128)) + (((orc_uint16)(var61.x4[3]+128))>>8)))>>8; /* 22: convwb */ var63.x4[0] = var62.x4[0]; var63.x4[1] = var62.x4[1]; var63.x4[2] = var62.x4[2]; var63.x4[3] = var62.x4[3]; /* 23: addusb */ var46.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var63.x4[0]); var46.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var63.x4[1]); var46.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var63.x4[2]); var46.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var63.x4[3]); /* 24: storel */ ptr0[i] = var46; } } /* orc_code_combine_xor_u_n */ static void _backup_orc_code_combine_xor_u_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var44; #else orc_union64 var44; #endif orc_union32 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union64 var57; orc_union32 var58; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 5: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ /* 13: loadpw */ var44.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var44.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var46.x4[0] = (orc_uint8)var40.x4[0]; var46.x4[1] = (orc_uint8)var40.x4[1]; var46.x4[2] = (orc_uint8)var40.x4[2]; var46.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr0[i]; /* 3: convubw */ var47.x4[0] = (orc_uint8)var41.x4[0]; var47.x4[1] = (orc_uint8)var41.x4[1]; var47.x4[2] = (orc_uint8)var41.x4[2]; var47.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var48.i = ((((orc_uint64)var47.i)>>48) << 48) | ((((orc_uint64)var47.i)>>48)<<32) | ((((orc_uint64)var47.i)>>48) << 16) | ((((orc_uint64)var47.i)>>48)); /* 6: xorw */ var49.x4[0] = var48.x4[0] ^ var42.x4[0]; var49.x4[1] = var48.x4[1] ^ var42.x4[1]; var49.x4[2] = var48.x4[2] ^ var42.x4[2]; var49.x4[3] = var48.x4[3] ^ var42.x4[3]; /* 7: mullw */ var50.x4[0] = (var46.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var46.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var46.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var46.x4[3] * var49.x4[3]) & 0xffff; /* 8: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 9: convwb */ var52.x4[0] = var51.x4[0]; var52.x4[1] = var51.x4[1]; var52.x4[2] = var51.x4[2]; var52.x4[3] = var51.x4[3]; /* 10: loadl */ var43 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var43.x4[0]; var53.x4[1] = (orc_uint8)var43.x4[1]; var53.x4[2] = (orc_uint8)var43.x4[2]; var53.x4[3] = (orc_uint8)var43.x4[3]; /* 12: splatw3q */ var54.i = ((((orc_uint64)var46.i)>>48) << 48) | ((((orc_uint64)var46.i)>>48)<<32) | ((((orc_uint64)var46.i)>>48) << 16) | ((((orc_uint64)var46.i)>>48)); /* 14: xorw */ var55.x4[0] = var54.x4[0] ^ var44.x4[0]; var55.x4[1] = var54.x4[1] ^ var44.x4[1]; var55.x4[2] = var54.x4[2] ^ var44.x4[2]; var55.x4[3] = var54.x4[3] ^ var44.x4[3]; /* 15: mullw */ var56.x4[0] = (var53.x4[0] * var55.x4[0]) & 0xffff; var56.x4[1] = (var53.x4[1] * var55.x4[1]) & 0xffff; var56.x4[2] = (var53.x4[2] * var55.x4[2]) & 0xffff; var56.x4[3] = (var53.x4[3] * var55.x4[3]) & 0xffff; /* 16: div255w */ var57.x4[0] = ((orc_uint16)(((orc_uint16)(var56.x4[0]+128)) + (((orc_uint16)(var56.x4[0]+128))>>8)))>>8; var57.x4[1] = ((orc_uint16)(((orc_uint16)(var56.x4[1]+128)) + (((orc_uint16)(var56.x4[1]+128))>>8)))>>8; var57.x4[2] = ((orc_uint16)(((orc_uint16)(var56.x4[2]+128)) + (((orc_uint16)(var56.x4[2]+128))>>8)))>>8; var57.x4[3] = ((orc_uint16)(((orc_uint16)(var56.x4[3]+128)) + (((orc_uint16)(var56.x4[3]+128))>>8)))>>8; /* 17: convwb */ var58.x4[0] = var57.x4[0]; var58.x4[1] = var57.x4[1]; var58.x4[2] = var57.x4[2]; var58.x4[3] = var57.x4[3]; /* 18: addusb */ var45.x4[0] = ORC_CLAMP_UB((orc_uint8)var52.x4[0] + (orc_uint8)var58.x4[0]); var45.x4[1] = ORC_CLAMP_UB((orc_uint8)var52.x4[1] + (orc_uint8)var58.x4[1]); var45.x4[2] = ORC_CLAMP_UB((orc_uint8)var52.x4[2] + (orc_uint8)var58.x4[2]); var45.x4[3] = ORC_CLAMP_UB((orc_uint8)var52.x4[3] + (orc_uint8)var58.x4[3]); /* 19: storel */ ptr0[i] = var45; } } /* orc_code_combine_add_ca */ static void _backup_orc_code_combine_add_ca (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_union32 var37; orc_union32 var38; orc_union64 var39; orc_union64 var40; orc_union64 var41; orc_union64 var42; orc_union32 var43; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: convubw */ var39.x4[0] = (orc_uint8)var35.x4[0]; var39.x4[1] = (orc_uint8)var35.x4[1]; var39.x4[2] = (orc_uint8)var35.x4[2]; var39.x4[3] = (orc_uint8)var35.x4[3]; /* 2: loadl */ var36 = ptr5[i]; /* 3: convubw */ var40.x4[0] = (orc_uint8)var36.x4[0]; var40.x4[1] = (orc_uint8)var36.x4[1]; var40.x4[2] = (orc_uint8)var36.x4[2]; var40.x4[3] = (orc_uint8)var36.x4[3]; /* 4: mullw */ var41.x4[0] = (var39.x4[0] * var40.x4[0]) & 0xffff; var41.x4[1] = (var39.x4[1] * var40.x4[1]) & 0xffff; var41.x4[2] = (var39.x4[2] * var40.x4[2]) & 0xffff; var41.x4[3] = (var39.x4[3] * var40.x4[3]) & 0xffff; /* 5: div255w */ var42.x4[0] = ((orc_uint16)(((orc_uint16)(var41.x4[0]+128)) + (((orc_uint16)(var41.x4[0]+128))>>8)))>>8; var42.x4[1] = ((orc_uint16)(((orc_uint16)(var41.x4[1]+128)) + (((orc_uint16)(var41.x4[1]+128))>>8)))>>8; var42.x4[2] = ((orc_uint16)(((orc_uint16)(var41.x4[2]+128)) + (((orc_uint16)(var41.x4[2]+128))>>8)))>>8; var42.x4[3] = ((orc_uint16)(((orc_uint16)(var41.x4[3]+128)) + (((orc_uint16)(var41.x4[3]+128))>>8)))>>8; /* 6: convwb */ var43.x4[0] = var42.x4[0]; var43.x4[1] = var42.x4[1]; var43.x4[2] = var42.x4[2]; var43.x4[3] = var42.x4[3]; /* 7: loadl */ var37 = ptr0[i]; /* 8: addusb */ var38.x4[0] = ORC_CLAMP_UB((orc_uint8)var37.x4[0] + (orc_uint8)var43.x4[0]); var38.x4[1] = ORC_CLAMP_UB((orc_uint8)var37.x4[1] + (orc_uint8)var43.x4[1]); var38.x4[2] = ORC_CLAMP_UB((orc_uint8)var37.x4[2] + (orc_uint8)var43.x4[2]); var38.x4[3] = ORC_CLAMP_UB((orc_uint8)var37.x4[3] + (orc_uint8)var43.x4[3]); /* 9: storel */ ptr0[i] = var38; } } /* orc_code_combine_add_ca_n */ static void _backup_orc_code_combine_add_ca_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var32; orc_union32 var33; orc_union32 var34; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadl */ var32 = ptr0[i]; /* 1: loadl */ var33 = ptr4[i]; /* 2: addusb */ var34.x4[0] = ORC_CLAMP_UB((orc_uint8)var32.x4[0] + (orc_uint8)var33.x4[0]); var34.x4[1] = ORC_CLAMP_UB((orc_uint8)var32.x4[1] + (orc_uint8)var33.x4[1]); var34.x4[2] = ORC_CLAMP_UB((orc_uint8)var32.x4[2] + (orc_uint8)var33.x4[2]); var34.x4[3] = ORC_CLAMP_UB((orc_uint8)var32.x4[3] + (orc_uint8)var33.x4[3]); /* 3: storel */ ptr0[i] = var34; } } /* orc_code_combine_over_ca */ static void _backup_orc_code_combine_over_ca (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union32 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; /* 12: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var44.x4[0] = (orc_uint8)var40.x4[0]; var44.x4[1] = (orc_uint8)var40.x4[1]; var44.x4[2] = (orc_uint8)var40.x4[2]; var44.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr5[i]; /* 3: convubw */ var45.x4[0] = (orc_uint8)var41.x4[0]; var45.x4[1] = (orc_uint8)var41.x4[1]; var45.x4[2] = (orc_uint8)var41.x4[2]; var45.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var46.i = ((((orc_uint64)var44.i)>>48) << 48) | ((((orc_uint64)var44.i)>>48)<<32) | ((((orc_uint64)var44.i)>>48) << 16) | ((((orc_uint64)var44.i)>>48)); /* 5: mullw */ var47.x4[0] = (var44.x4[0] * var45.x4[0]) & 0xffff; var47.x4[1] = (var44.x4[1] * var45.x4[1]) & 0xffff; var47.x4[2] = (var44.x4[2] * var45.x4[2]) & 0xffff; var47.x4[3] = (var44.x4[3] * var45.x4[3]) & 0xffff; /* 6: div255w */ var48.x4[0] = ((orc_uint16)(((orc_uint16)(var47.x4[0]+128)) + (((orc_uint16)(var47.x4[0]+128))>>8)))>>8; var48.x4[1] = ((orc_uint16)(((orc_uint16)(var47.x4[1]+128)) + (((orc_uint16)(var47.x4[1]+128))>>8)))>>8; var48.x4[2] = ((orc_uint16)(((orc_uint16)(var47.x4[2]+128)) + (((orc_uint16)(var47.x4[2]+128))>>8)))>>8; var48.x4[3] = ((orc_uint16)(((orc_uint16)(var47.x4[3]+128)) + (((orc_uint16)(var47.x4[3]+128))>>8)))>>8; /* 7: convwb */ var49.x4[0] = var48.x4[0]; var49.x4[1] = var48.x4[1]; var49.x4[2] = var48.x4[2]; var49.x4[3] = var48.x4[3]; /* 8: mullw */ var50.x4[0] = (var45.x4[0] * var46.x4[0]) & 0xffff; var50.x4[1] = (var45.x4[1] * var46.x4[1]) & 0xffff; var50.x4[2] = (var45.x4[2] * var46.x4[2]) & 0xffff; var50.x4[3] = (var45.x4[3] * var46.x4[3]) & 0xffff; /* 9: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 10: loadl */ var52 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var52.x4[0]; var53.x4[1] = (orc_uint8)var52.x4[1]; var53.x4[2] = (orc_uint8)var52.x4[2]; var53.x4[3] = (orc_uint8)var52.x4[3]; /* 13: xorw */ var54.x4[0] = var51.x4[0] ^ var42.x4[0]; var54.x4[1] = var51.x4[1] ^ var42.x4[1]; var54.x4[2] = var51.x4[2] ^ var42.x4[2]; var54.x4[3] = var51.x4[3] ^ var42.x4[3]; /* 14: mullw */ var55.x4[0] = (var53.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var53.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var53.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var53.x4[3] * var54.x4[3]) & 0xffff; /* 15: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 16: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 17: addusb */ var43.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var49.x4[0]); var43.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var49.x4[1]); var43.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var49.x4[2]); var43.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var49.x4[3]); /* 18: storel */ ptr0[i] = var43; } } /* orc_code_combine_over_ca_n */ static void _backup_orc_code_combine_over_ca_n (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var41; #else orc_union64 var41; #endif orc_union32 var42; orc_union64 var43; orc_union64 var44; orc_union32 var45; orc_union64 var46; orc_union32 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 7: loadpw */ var41.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var41.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var40 = ptr4[i]; /* 1: convubw */ var43.x4[0] = (orc_uint8)var40.x4[0]; var43.x4[1] = (orc_uint8)var40.x4[1]; var43.x4[2] = (orc_uint8)var40.x4[2]; var43.x4[3] = (orc_uint8)var40.x4[3]; /* 2: splatw3q */ var44.i = ((((orc_uint64)var43.i)>>48) << 48) | ((((orc_uint64)var43.i)>>48)<<32) | ((((orc_uint64)var43.i)>>48) << 16) | ((((orc_uint64)var43.i)>>48)); /* 3: convwb */ var45.x4[0] = var43.x4[0]; var45.x4[1] = var43.x4[1]; var45.x4[2] = var43.x4[2]; var45.x4[3] = var43.x4[3]; /* 4: copyw */ var46.x4[0] = var44.x4[0]; var46.x4[1] = var44.x4[1]; var46.x4[2] = var44.x4[2]; var46.x4[3] = var44.x4[3]; /* 5: loadl */ var47 = ptr0[i]; /* 6: convubw */ var48.x4[0] = (orc_uint8)var47.x4[0]; var48.x4[1] = (orc_uint8)var47.x4[1]; var48.x4[2] = (orc_uint8)var47.x4[2]; var48.x4[3] = (orc_uint8)var47.x4[3]; /* 8: xorw */ var49.x4[0] = var46.x4[0] ^ var41.x4[0]; var49.x4[1] = var46.x4[1] ^ var41.x4[1]; var49.x4[2] = var46.x4[2] ^ var41.x4[2]; var49.x4[3] = var46.x4[3] ^ var41.x4[3]; /* 9: mullw */ var50.x4[0] = (var48.x4[0] * var49.x4[0]) & 0xffff; var50.x4[1] = (var48.x4[1] * var49.x4[1]) & 0xffff; var50.x4[2] = (var48.x4[2] * var49.x4[2]) & 0xffff; var50.x4[3] = (var48.x4[3] * var49.x4[3]) & 0xffff; /* 10: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 11: convwb */ var52.x4[0] = var51.x4[0]; var52.x4[1] = var51.x4[1]; var52.x4[2] = var51.x4[2]; var52.x4[3] = var51.x4[3]; /* 12: addusb */ var42.x4[0] = ORC_CLAMP_UB((orc_uint8)var52.x4[0] + (orc_uint8)var45.x4[0]); var42.x4[1] = ORC_CLAMP_UB((orc_uint8)var52.x4[1] + (orc_uint8)var45.x4[1]); var42.x4[2] = ORC_CLAMP_UB((orc_uint8)var52.x4[2] + (orc_uint8)var45.x4[2]); var42.x4[3] = ORC_CLAMP_UB((orc_uint8)var52.x4[3] + (orc_uint8)var45.x4[3]); /* 13: storel */ ptr0[i] = var42; } } /* orc_composite_over_8888_8_8888_line */ static void _backup_orc_composite_over_8888_8_8888_line (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; const orc_int8 * ORC_RESTRICT ptr5; orc_union32 var38; orc_int8 var39; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var40; #else orc_union64 var40; #endif orc_union32 var41; orc_union64 var42; orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union32 var47; orc_union32 var48; orc_union64 var49; orc_union64 var50; orc_union64 var51; orc_union64 var52; orc_union64 var53; orc_union32 var54; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_int8 *)ex->arrays[5]; /* 10: loadpw */ var40.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var40.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 0: loadl */ var38 = ptr4[i]; /* 1: convubw */ var42.x4[0] = (orc_uint8)var38.x4[0]; var42.x4[1] = (orc_uint8)var38.x4[1]; var42.x4[2] = (orc_uint8)var38.x4[2]; var42.x4[3] = (orc_uint8)var38.x4[3]; /* 2: loadb */ var39 = ptr5[i]; /* 3: splatbl */ var43.i = ((var39&0xff) << 24) | ((var39&0xff)<<16) | ((var39&0xff) << 8) | (var39&0xff); /* 4: convubw */ var44.x4[0] = (orc_uint8)var43.x4[0]; var44.x4[1] = (orc_uint8)var43.x4[1]; var44.x4[2] = (orc_uint8)var43.x4[2]; var44.x4[3] = (orc_uint8)var43.x4[3]; /* 5: mullw */ var45.x4[0] = (var42.x4[0] * var44.x4[0]) & 0xffff; var45.x4[1] = (var42.x4[1] * var44.x4[1]) & 0xffff; var45.x4[2] = (var42.x4[2] * var44.x4[2]) & 0xffff; var45.x4[3] = (var42.x4[3] * var44.x4[3]) & 0xffff; /* 6: div255w */ var46.x4[0] = ((orc_uint16)(((orc_uint16)(var45.x4[0]+128)) + (((orc_uint16)(var45.x4[0]+128))>>8)))>>8; var46.x4[1] = ((orc_uint16)(((orc_uint16)(var45.x4[1]+128)) + (((orc_uint16)(var45.x4[1]+128))>>8)))>>8; var46.x4[2] = ((orc_uint16)(((orc_uint16)(var45.x4[2]+128)) + (((orc_uint16)(var45.x4[2]+128))>>8)))>>8; var46.x4[3] = ((orc_uint16)(((orc_uint16)(var45.x4[3]+128)) + (((orc_uint16)(var45.x4[3]+128))>>8)))>>8; /* 7: convwb */ var47.x4[0] = var46.x4[0]; var47.x4[1] = var46.x4[1]; var47.x4[2] = var46.x4[2]; var47.x4[3] = var46.x4[3]; /* 8: loadl */ var48 = ptr0[i]; /* 9: convubw */ var49.x4[0] = (orc_uint8)var48.x4[0]; var49.x4[1] = (orc_uint8)var48.x4[1]; var49.x4[2] = (orc_uint8)var48.x4[2]; var49.x4[3] = (orc_uint8)var48.x4[3]; /* 11: xorw */ var50.x4[0] = var46.x4[0] ^ var40.x4[0]; var50.x4[1] = var46.x4[1] ^ var40.x4[1]; var50.x4[2] = var46.x4[2] ^ var40.x4[2]; var50.x4[3] = var46.x4[3] ^ var40.x4[3]; /* 12: splatw3q */ var51.i = ((((orc_uint64)var50.i)>>48) << 48) | ((((orc_uint64)var50.i)>>48)<<32) | ((((orc_uint64)var50.i)>>48) << 16) | ((((orc_uint64)var50.i)>>48)); /* 13: mullw */ var52.x4[0] = (var49.x4[0] * var51.x4[0]) & 0xffff; var52.x4[1] = (var49.x4[1] * var51.x4[1]) & 0xffff; var52.x4[2] = (var49.x4[2] * var51.x4[2]) & 0xffff; var52.x4[3] = (var49.x4[3] * var51.x4[3]) & 0xffff; /* 14: div255w */ var53.x4[0] = ((orc_uint16)(((orc_uint16)(var52.x4[0]+128)) + (((orc_uint16)(var52.x4[0]+128))>>8)))>>8; var53.x4[1] = ((orc_uint16)(((orc_uint16)(var52.x4[1]+128)) + (((orc_uint16)(var52.x4[1]+128))>>8)))>>8; var53.x4[2] = ((orc_uint16)(((orc_uint16)(var52.x4[2]+128)) + (((orc_uint16)(var52.x4[2]+128))>>8)))>>8; var53.x4[3] = ((orc_uint16)(((orc_uint16)(var52.x4[3]+128)) + (((orc_uint16)(var52.x4[3]+128))>>8)))>>8; /* 15: convwb */ var54.x4[0] = var53.x4[0]; var54.x4[1] = var53.x4[1]; var54.x4[2] = var53.x4[2]; var54.x4[3] = var53.x4[3]; /* 16: addusb */ var41.x4[0] = ORC_CLAMP_UB((orc_uint8)var54.x4[0] + (orc_uint8)var47.x4[0]); var41.x4[1] = ORC_CLAMP_UB((orc_uint8)var54.x4[1] + (orc_uint8)var47.x4[1]); var41.x4[2] = ORC_CLAMP_UB((orc_uint8)var54.x4[2] + (orc_uint8)var47.x4[2]); var41.x4[3] = ORC_CLAMP_UB((orc_uint8)var54.x4[3] + (orc_uint8)var47.x4[3]); /* 17: storel */ ptr0[i] = var41; } } /* orc_composite_over_n_8888_8888_ca_2d */ static void _backup_orc_composite_over_n_8888_8888_ca_2d (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var40; orc_union32 var41; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var42; #else orc_union64 var42; #endif orc_union32 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union32 var49; orc_union64 var50; orc_union64 var51; orc_union32 var52; orc_union64 var53; orc_union64 var54; orc_union64 var55; orc_union64 var56; orc_union32 var57; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; /* 0: loadpb */ var40.x4[0] = ex->params[24]; var40.x4[1] = ex->params[24]; var40.x4[2] = ex->params[24]; var40.x4[3] = ex->params[24]; /* 12: loadpw */ var42.x4[0] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[1] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[2] = (int)0x000000ff; /* 255 or 1.25987e-321f */ var42.x4[3] = (int)0x000000ff; /* 255 or 1.25987e-321f */ for (i = 0; i < n; i++) { /* 1: convubw */ var44.x4[0] = (orc_uint8)var40.x4[0]; var44.x4[1] = (orc_uint8)var40.x4[1]; var44.x4[2] = (orc_uint8)var40.x4[2]; var44.x4[3] = (orc_uint8)var40.x4[3]; /* 2: loadl */ var41 = ptr4[i]; /* 3: convubw */ var45.x4[0] = (orc_uint8)var41.x4[0]; var45.x4[1] = (orc_uint8)var41.x4[1]; var45.x4[2] = (orc_uint8)var41.x4[2]; var45.x4[3] = (orc_uint8)var41.x4[3]; /* 4: splatw3q */ var46.i = ((((orc_uint64)var44.i)>>48) << 48) | ((((orc_uint64)var44.i)>>48)<<32) | ((((orc_uint64)var44.i)>>48) << 16) | ((((orc_uint64)var44.i)>>48)); /* 5: mullw */ var47.x4[0] = (var44.x4[0] * var45.x4[0]) & 0xffff; var47.x4[1] = (var44.x4[1] * var45.x4[1]) & 0xffff; var47.x4[2] = (var44.x4[2] * var45.x4[2]) & 0xffff; var47.x4[3] = (var44.x4[3] * var45.x4[3]) & 0xffff; /* 6: div255w */ var48.x4[0] = ((orc_uint16)(((orc_uint16)(var47.x4[0]+128)) + (((orc_uint16)(var47.x4[0]+128))>>8)))>>8; var48.x4[1] = ((orc_uint16)(((orc_uint16)(var47.x4[1]+128)) + (((orc_uint16)(var47.x4[1]+128))>>8)))>>8; var48.x4[2] = ((orc_uint16)(((orc_uint16)(var47.x4[2]+128)) + (((orc_uint16)(var47.x4[2]+128))>>8)))>>8; var48.x4[3] = ((orc_uint16)(((orc_uint16)(var47.x4[3]+128)) + (((orc_uint16)(var47.x4[3]+128))>>8)))>>8; /* 7: convwb */ var49.x4[0] = var48.x4[0]; var49.x4[1] = var48.x4[1]; var49.x4[2] = var48.x4[2]; var49.x4[3] = var48.x4[3]; /* 8: mullw */ var50.x4[0] = (var45.x4[0] * var46.x4[0]) & 0xffff; var50.x4[1] = (var45.x4[1] * var46.x4[1]) & 0xffff; var50.x4[2] = (var45.x4[2] * var46.x4[2]) & 0xffff; var50.x4[3] = (var45.x4[3] * var46.x4[3]) & 0xffff; /* 9: div255w */ var51.x4[0] = ((orc_uint16)(((orc_uint16)(var50.x4[0]+128)) + (((orc_uint16)(var50.x4[0]+128))>>8)))>>8; var51.x4[1] = ((orc_uint16)(((orc_uint16)(var50.x4[1]+128)) + (((orc_uint16)(var50.x4[1]+128))>>8)))>>8; var51.x4[2] = ((orc_uint16)(((orc_uint16)(var50.x4[2]+128)) + (((orc_uint16)(var50.x4[2]+128))>>8)))>>8; var51.x4[3] = ((orc_uint16)(((orc_uint16)(var50.x4[3]+128)) + (((orc_uint16)(var50.x4[3]+128))>>8)))>>8; /* 10: loadl */ var52 = ptr0[i]; /* 11: convubw */ var53.x4[0] = (orc_uint8)var52.x4[0]; var53.x4[1] = (orc_uint8)var52.x4[1]; var53.x4[2] = (orc_uint8)var52.x4[2]; var53.x4[3] = (orc_uint8)var52.x4[3]; /* 13: xorw */ var54.x4[0] = var51.x4[0] ^ var42.x4[0]; var54.x4[1] = var51.x4[1] ^ var42.x4[1]; var54.x4[2] = var51.x4[2] ^ var42.x4[2]; var54.x4[3] = var51.x4[3] ^ var42.x4[3]; /* 14: mullw */ var55.x4[0] = (var53.x4[0] * var54.x4[0]) & 0xffff; var55.x4[1] = (var53.x4[1] * var54.x4[1]) & 0xffff; var55.x4[2] = (var53.x4[2] * var54.x4[2]) & 0xffff; var55.x4[3] = (var53.x4[3] * var54.x4[3]) & 0xffff; /* 15: div255w */ var56.x4[0] = ((orc_uint16)(((orc_uint16)(var55.x4[0]+128)) + (((orc_uint16)(var55.x4[0]+128))>>8)))>>8; var56.x4[1] = ((orc_uint16)(((orc_uint16)(var55.x4[1]+128)) + (((orc_uint16)(var55.x4[1]+128))>>8)))>>8; var56.x4[2] = ((orc_uint16)(((orc_uint16)(var55.x4[2]+128)) + (((orc_uint16)(var55.x4[2]+128))>>8)))>>8; var56.x4[3] = ((orc_uint16)(((orc_uint16)(var55.x4[3]+128)) + (((orc_uint16)(var55.x4[3]+128))>>8)))>>8; /* 16: convwb */ var57.x4[0] = var56.x4[0]; var57.x4[1] = var56.x4[1]; var57.x4[2] = var56.x4[2]; var57.x4[3] = var56.x4[3]; /* 17: addusb */ var43.x4[0] = ORC_CLAMP_UB((orc_uint8)var57.x4[0] + (orc_uint8)var49.x4[0]); var43.x4[1] = ORC_CLAMP_UB((orc_uint8)var57.x4[1] + (orc_uint8)var49.x4[1]); var43.x4[2] = ORC_CLAMP_UB((orc_uint8)var57.x4[2] + (orc_uint8)var49.x4[2]); var43.x4[3] = ORC_CLAMP_UB((orc_uint8)var57.x4[3] + (orc_uint8)var49.x4[3]); /* 18: storel */ ptr0[i] = var43; } } /* cogorc_resample_horiz_1tap */ static void _backup_cogorc_resample_horiz_1tap (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: ldresnearb */ var32 = ptr4[(ex->params[24] + i*ex->params[25])>>16]; /* 1: storeb */ ptr0[i] = var32; } } /* cogorc_resample_horiz_2tap */ static void _backup_cogorc_resample_horiz_2tap (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: ldreslinb */ { int tmp = ex->params[24] + i * ex->params[25]; var32 = ((orc_uint8)ptr4[tmp>>16] * (256-((tmp>>8)&0xff)) + (orc_uint8)ptr4[(tmp>>16)+1] * ((tmp>>8)&0xff))>>8; } /* 1: storeb */ ptr0[i] = var32; } } /* test_float_constant_1 */ static void _backup_test_float_constant_1 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union32 var32; #else orc_union32 var32; #endif orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = (int)0x40000000; /* 1073741824 or 5.30499e-315f */ for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } /* test_float_constant_2 */ static void _backup_test_float_constant_2 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union32 var32; #else orc_union32 var32; #endif orc_union32 var33; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpl */ var32.i = (int)0x40000000; /* 1073741824 or 5.30499e-315f */ for (i = 0; i < n; i++) { /* 1: copyl */ var33.i = var32.i; /* 2: storel */ ptr0[i] = var33; } } /* convert_fc32_to_int32 */ static void _backup_convert_fc32_to_int32 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union64 * ORC_RESTRICT ptr4; orc_union64 var34; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var35; #else orc_union64 var35; #endif orc_union32 var36; orc_union64 var37; orc_union64 var38; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union64 *)ex->arrays[4]; /* 1: loadpl */ var35.x2[0] = (int)0x46fffe00; /* 1191181824 or 5.88522e-315f */ var35.x2[1] = (int)0x46fffe00; /* 1191181824 or 5.88522e-315f */ for (i = 0; i < n; i++) { /* 0: loadq */ var34 = ptr4[i]; /* 2: mulf */ { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var34.x2[0]); _src2.i = ORC_DENORMAL(var35.x2[0]); _dest1.f = _src1.f * _src2.f; var37.x2[0] = ORC_DENORMAL(_dest1.i); } { orc_union32 _src1; orc_union32 _src2; orc_union32 _dest1; _src1.i = ORC_DENORMAL(var34.x2[1]); _src2.i = ORC_DENORMAL(var35.x2[1]); _dest1.f = _src1.f * _src2.f; var37.x2[1] = ORC_DENORMAL(_dest1.i); } /* 3: convfl */ { int tmp; tmp = (int)var37.x2f[0]; if (tmp == 0x80000000 && !(var37.x2[0]&0x80000000)) tmp = 0x7fffffff; var38.x2[0] = tmp; } { int tmp; tmp = (int)var37.x2f[1]; if (tmp == 0x80000000 && !(var37.x2[1]&0x80000000)) tmp = 0x7fffffff; var38.x2[1] = tmp; } /* 4: convlw */ var36.x2[0] = var38.x2[0]; var36.x2[1] = var38.x2[1]; /* 5: storel */ ptr0[i] = var36; } } /* param64 */ static void _backup_param64 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var32; orc_union64 var33; ptr0 = (orc_union64 *)ex->arrays[0]; /* 0: loadpq */ var32.i = (ex->params[24] & 0xffffffff) | ((orc_uint64)(ex->params[24 + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32); for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } /* const64 */ static void _backup_const64 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var32; #else orc_union64 var32; #endif orc_union64 var33; ptr0 = (orc_union64 *)ex->arrays[0]; /* 0: loadpq */ var32.i = ORC_UINT64_C(0x0123456789abcdef); /* 3.5127e-303f */ for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var32.i; /* 2: storeq */ ptr0[i] = var33; } } /* param64_2 */ static void _backup_param64_2 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union64 * ORC_RESTRICT ptr0; orc_union64 var33; orc_union64 var34; ptr0 = (orc_union64 *)ex->arrays[0]; /* 0: loadpq */ var34.i = (ex->params[24] & 0xffffffff) | ((orc_uint64)(ex->params[24 + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32); for (i = 0; i < n; i++) { /* 1: copyq */ var33.i = var34.i; /* 2: storeq */ ptr0[i] = var33; } } /* pa_volume_s16ne_orc_2ch */ static void _backup_pa_volume_s16ne_orc_2ch (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; orc_union32 var37; orc_union32 var38; #if defined(__APPLE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && defined (__i386__) volatile orc_union64 var39; #else orc_union64 var39; #endif orc_union32 var40; orc_union64 var41; orc_union64 var42; orc_union64 var43; orc_union64 var44; orc_union64 var45; orc_union64 var46; orc_union64 var47; orc_union64 var48; orc_union64 var49; orc_union64 var50; ptr0 = (orc_union32 *)ex->arrays[0]; /* 0: loadpq */ var41.i = (ex->params[24] & 0xffffffff) | ((orc_uint64)(ex->params[24 + (ORC_VAR_T1 - ORC_VAR_P1)]) << 32); /* 5: loadpw */ var39.x4[0] = (int)0x00000000; /* 0 or 0f */ var39.x4[1] = (int)0x00000000; /* 0 or 0f */ var39.x4[2] = (int)0x00000000; /* 0 or 0f */ var39.x4[3] = (int)0x00000000; /* 0 or 0f */ for (i = 0; i < n; i++) { /* 1: loadl */ var37 = ptr0[i]; /* 2: convuwl */ var42.x2[0] = (orc_uint16)var37.x2[0]; var42.x2[1] = (orc_uint16)var37.x2[1]; /* 3: loadl */ var38 = ptr0[i]; /* 4: convswl */ var43.x2[0] = var38.x2[0]; var43.x2[1] = var38.x2[1]; /* 6: cmpgtsw */ var44.x4[0] = (var39.x4[0] > var42.x4[0]) ? (~0) : 0; var44.x4[1] = (var39.x4[1] > var42.x4[1]) ? (~0) : 0; var44.x4[2] = (var39.x4[2] > var42.x4[2]) ? (~0) : 0; var44.x4[3] = (var39.x4[3] > var42.x4[3]) ? (~0) : 0; /* 7: andw */ var45.x4[0] = var44.x4[0] & var41.x4[0]; var45.x4[1] = var44.x4[1] & var41.x4[1]; var45.x4[2] = var44.x4[2] & var41.x4[2]; var45.x4[3] = var44.x4[3] & var41.x4[3]; /* 8: mulhuw */ var46.x4[0] = ((orc_uint32)((orc_uint16)var42.x4[0]) * (orc_uint32)((orc_uint16)var41.x4[0])) >> 16; var46.x4[1] = ((orc_uint32)((orc_uint16)var42.x4[1]) * (orc_uint32)((orc_uint16)var41.x4[1])) >> 16; var46.x4[2] = ((orc_uint32)((orc_uint16)var42.x4[2]) * (orc_uint32)((orc_uint16)var41.x4[2])) >> 16; var46.x4[3] = ((orc_uint32)((orc_uint16)var42.x4[3]) * (orc_uint32)((orc_uint16)var41.x4[3])) >> 16; /* 9: subl */ var47.x2[0] = var46.x2[0] - var45.x2[0]; var47.x2[1] = var46.x2[1] - var45.x2[1]; /* 10: shrul */ var48.x2[0] = ((orc_uint32)var41.x2[0]) >> 16; var48.x2[1] = ((orc_uint32)var41.x2[1]) >> 16; /* 11: mulll */ var49.x2[0] = (var43.x2[0] * var48.x2[0]) & 0xffffffff; var49.x2[1] = (var43.x2[1] * var48.x2[1]) & 0xffffffff; /* 12: addl */ var50.x2[0] = var47.x2[0] + var49.x2[0]; var50.x2[1] = var47.x2[1] + var49.x2[1]; /* 13: convssslw */ var40.x2[0] = ORC_CLAMP_SW(var50.x2[0]); var40.x2[1] = ORC_CLAMP_SW(var50.x2[1]); /* 14: storel */ ptr0[i] = var40; } } /* cogorc_convert_YUY2_I420 */ static void _backup_cogorc_convert_YUY2_I420 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_int8 * ORC_RESTRICT ptr2; orc_int8 * ORC_RESTRICT ptr3; const orc_union32 * ORC_RESTRICT ptr4; const orc_union32 * ORC_RESTRICT ptr5; orc_union32 var35; orc_union32 var36; orc_int8 var37; orc_int8 var38; orc_union16 var39; orc_union16 var40; orc_union16 var41; orc_union16 var42; orc_union16 var43; ptr0 = (orc_union16 *)ex->arrays[0]; ptr1 = (orc_union16 *)ex->arrays[1]; ptr2 = (orc_int8 *)ex->arrays[2]; ptr3 = (orc_int8 *)ex->arrays[3]; ptr4 = (orc_union32 *)ex->arrays[4]; ptr5 = (orc_union32 *)ex->arrays[5]; for (i = 0; i < n; i++) { /* 0: loadl */ var35 = ptr4[i]; /* 1: splitwb */ { orc_union16 _src; _src.i = var35.x2[0]; var39.x2[0] = _src.x2[1]; var40.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var35.x2[1]; var39.x2[1] = _src.x2[1]; var40.x2[1] = _src.x2[0]; } /* 2: storew */ ptr0[i] = var40; /* 3: loadl */ var36 = ptr5[i]; /* 4: splitwb */ { orc_union16 _src; _src.i = var36.x2[0]; var41.x2[0] = _src.x2[1]; var42.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var36.x2[1]; var41.x2[1] = _src.x2[1]; var42.x2[1] = _src.x2[0]; } /* 5: storew */ ptr1[i] = var42; /* 6: avgub */ var43.x2[0] = ((orc_uint8)var39.x2[0] + (orc_uint8)var41.x2[0] + 1)>>1; var43.x2[1] = ((orc_uint8)var39.x2[1] + (orc_uint8)var41.x2[1] + 1)>>1; /* 7: splitwb */ { orc_union16 _src; _src.i = var43.i; var37 = _src.x2[1]; var38 = _src.x2[0]; } /* 8: storeb */ ptr3[i] = var37; /* 9: storeb */ ptr2[i] = var38; } } /* cogorc_convert_AYUV_I420 */ static void _backup_cogorc_convert_AYUV_I420 (OrcExecutor * ORC_RESTRICT ex) { int i; int j; int n = ex->n; int m = ex->params[ORC_VAR_A1]; orc_union16 * ORC_RESTRICT ptr0; orc_union16 * ORC_RESTRICT ptr1; orc_int8 * ORC_RESTRICT ptr2; orc_int8 * ORC_RESTRICT ptr3; const orc_union64 * ORC_RESTRICT ptr4; const orc_union64 * ORC_RESTRICT ptr5; orc_union64 var40; orc_union16 var41; orc_union64 var42; orc_union16 var43; orc_int8 var44; orc_int8 var45; orc_union32 var46; orc_union32 var47; orc_union32 var48; orc_union32 var49; orc_union32 var50; orc_union16 var51; orc_union16 var52; orc_int8 var53; orc_int8 var54; orc_int8 var55; orc_int8 var56; for (j = 0; j < m; j++) { ptr0 = ORC_PTR_OFFSET(ex->arrays[0], ex->params[0] * j); ptr1 = ORC_PTR_OFFSET(ex->arrays[1], ex->params[1] * j); ptr2 = ORC_PTR_OFFSET(ex->arrays[2], ex->params[2] * j); ptr3 = ORC_PTR_OFFSET(ex->arrays[3], ex->params[3] * j); ptr4 = ORC_PTR_OFFSET(ex->arrays[4], ex->params[4] * j); ptr5 = ORC_PTR_OFFSET(ex->arrays[5], ex->params[5] * j); for (i = 0; i < n; i++) { /* 0: loadq */ var40 = ptr4[i]; /* 1: splitlw */ { orc_union32 _src; _src.i = var40.x2[0]; var46.x2[0] = _src.x2[1]; var47.x2[0] = _src.x2[0]; } { orc_union32 _src; _src.i = var40.x2[1]; var46.x2[1] = _src.x2[1]; var47.x2[1] = _src.x2[0]; } /* 2: select1wb */ { orc_union16 _src; _src.i = var47.x2[0]; var41.x2[0] = _src.x2[1]; } { orc_union16 _src; _src.i = var47.x2[1]; var41.x2[1] = _src.x2[1]; } /* 3: storew */ ptr0[i] = var41; /* 4: loadq */ var42 = ptr5[i]; /* 5: splitlw */ { orc_union32 _src; _src.i = var42.x2[0]; var48.x2[0] = _src.x2[1]; var49.x2[0] = _src.x2[0]; } { orc_union32 _src; _src.i = var42.x2[1]; var48.x2[1] = _src.x2[1]; var49.x2[1] = _src.x2[0]; } /* 6: select1wb */ { orc_union16 _src; _src.i = var49.x2[0]; var43.x2[0] = _src.x2[1]; } { orc_union16 _src; _src.i = var49.x2[1]; var43.x2[1] = _src.x2[1]; } /* 7: storew */ ptr1[i] = var43; /* 8: avgub */ var50.x4[0] = ((orc_uint8)var46.x4[0] + (orc_uint8)var48.x4[0] + 1)>>1; var50.x4[1] = ((orc_uint8)var46.x4[1] + (orc_uint8)var48.x4[1] + 1)>>1; var50.x4[2] = ((orc_uint8)var46.x4[2] + (orc_uint8)var48.x4[2] + 1)>>1; var50.x4[3] = ((orc_uint8)var46.x4[3] + (orc_uint8)var48.x4[3] + 1)>>1; /* 9: splitwb */ { orc_union16 _src; _src.i = var50.x2[0]; var51.x2[0] = _src.x2[1]; var52.x2[0] = _src.x2[0]; } { orc_union16 _src; _src.i = var50.x2[1]; var51.x2[1] = _src.x2[1]; var52.x2[1] = _src.x2[0]; } /* 10: splitwb */ { orc_union16 _src; _src.i = var52.i; var53 = _src.x2[1]; var54 = _src.x2[0]; } /* 11: avgub */ var44 = ((orc_uint8)var53 + (orc_uint8)var54 + 1)>>1; /* 12: storeb */ ptr2[i] = var44; /* 13: splitwb */ { orc_union16 _src; _src.i = var51.i; var55 = _src.x2[1]; var56 = _src.x2[0]; } /* 14: avgub */ var45 = ((orc_uint8)var55 + (orc_uint8)var56 + 1)>>1; /* 15: storeb */ ptr3[i] = var45; } } } /* memcpy_aligned */ static void _backup_memcpy_aligned (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } /* memcpy_large */ static void _backup_memcpy_large (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } /* memcpy_small */ static void _backup_memcpy_small (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } /* memcpy_aligned_n16 */ static void _backup_memcpy_aligned_n16 (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_int8 * ORC_RESTRICT ptr0; const orc_int8 * ORC_RESTRICT ptr4; orc_int8 var32; orc_int8 var33; ptr0 = (orc_int8 *)ex->arrays[0]; ptr4 = (orc_int8 *)ex->arrays[4]; for (i = 0; i < n; i++) { /* 0: loadb */ var32 = ptr4[i]; /* 1: copyb */ var33 = var32; /* 2: storeb */ ptr0[i] = var33; } } static int quiet = 0; static int benchmark = 0; static void help (const char *argv0) { printf("Usage:\n"); printf(" %s [OPTION]\n", argv0); printf("Help Options:\n"); printf(" -h, --help Show help options\n"); printf("Application Options:\n"); printf(" -b, --benchmark Run benchmark and show results\n"); printf(" -q, --quiet Don't output anything except on failures\n"); exit(0); } int main (int argc, char *argv[]) { int error = FALSE; int i; orc_test_init (); for(i=1;i int main (int argc, char *argv[]) { /* This is mostly just to test that compilation works */ return 0; } orc-0.4.18/testsuite/compile_parse_c.c0000664000175000017500000000306412057245267014650 00000000000000 #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = "test.orc"; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } code = read_file (filename); if (!code) { printf("compile_parse_test \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;iname); ret = orc_test_gcc_compile (programs[i]); if (ret == ORC_TEST_FAILED) { error = TRUE; } } if (error) return 1; return 0; } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } orc-0.4.18/testsuite/compile_opcodes_sys.c0000664000175000017500000000363712057245267015574 00000000000000 #include "config.h" #include #include #include #include #include int error = FALSE; void test_opcode (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; srand(time(NULL)); orc_init(); orc_test_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("%s:\n", opcode_set->opcodes[i].name); test_opcode (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("%s_const:\n", opcode_set->opcodes[i].name); test_opcode_const (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("%s_param:\n", opcode_set->opcodes[i].name); test_opcode_param (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode (opcode); if (!p) return; ret = orc_test_gcc_compile (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_const (opcode); if (!p) return; ret = orc_test_gcc_compile (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_param (opcode); if (!p) return; ret = orc_test_gcc_compile (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } orc-0.4.18/testsuite/test.orc0000644000175000017500000010070312111016477013026 00000000000000 .function orc_add2_rshift_add_s16_22_op .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .temp 2 t1 addw t1, s2, s3 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, s1, t1 .function orc_add2_rshift_add_s16_22 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 addw t1, s1, s2 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_22_op .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .temp 2 t1 addw t1, s2, s3 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, s1, t1 .function orc_add2_rshift_sub_s16_22 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 addw t1, s1, s2 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, d1, t1 .function orc_add2_rshift_add_s16_11_op .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .temp 2 t1 avgsw t1, s2, s3 addw d1, s1, t1 .function orc_add2_rshift_add_s16_11 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 avgsw t1, s1, s2 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_11_op .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .temp 2 t1 avgsw t1, s2, s3 subw d1, s1, t1 .function orc_add2_rshift_sub_s16_11 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 avgsw t1, s1, s2 subw d1, d1, t1 .function orc_add_const_rshift_s16_11 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .temp 2 t1 addw t1, s1, 1 shrsw d1, t1, 1 .function orc_add_const_rshift_s16 .dest 2 d1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 addw t1, d1, p1 shrsw d1, t1, p2 .function orc_add_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 addw d1, s1, s2 .function orc_add_s16_2d .flags 2d .dest 2 d1 orc_int16 .source 2 s1 orc_int16 addw d1, d1, s1 .function orc_addc_rshift_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .param 2 p1 addw t1, s1, s2 shrsw d1, t1, p1 .function orc_lshift1_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 shlw d1, s1, 1 .function orc_lshift2_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 shlw d1, s1, 2 .function orc_lshift_s16_ip .dest 2 d1 orc_int16 .param 2 p1 shlw d1, d1, p1 .function orc_mas2_add_s16_op .dest 2 d1 orc_int16 .source 2 s0 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 addw d1, s0, t1 .function orc_mas2_add_s16_ip .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 addw d1, d1, t1 .function orc_mas2_sub_s16_op .dest 2 d1 orc_int16 .source 2 s0 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 subw d1, s0, t1 .function orc_mas2_sub_s16_ip .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 4 t2 .param 2 p1 .param 4 p2 .param 4 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shrsl t2, t2, p3 convlw t1, t2 subw d1, d1, t1 .function orc_mas4_across_add_s16_1991_op .dest 2 d1 orc_int16 .source 2 s0 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .source 2 s4 orc_int16 .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 addw d1, s0, t1 .function orc_mas4_across_add_s16_1991_ip .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .source 2 s4 orc_int16 .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 addw d1, d1, t1 .function orc_mas4_across_sub_s16_1991_op .dest 2 d1 orc_int16 .source 2 s0 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .source 2 s4 orc_int16 .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 subw d1, s0, t1 .function orc_mas4_across_sub_s16_1991_ip .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .source 2 s3 orc_int16 .source 2 s4 orc_int16 .param 4 p1 .param 4 p2 .temp 2 t1 .temp 2 t2 .temp 4 t3 .temp 4 t4 addw t1, s2, s3 mulswl t3, t1, 9 addw t2, s1, s4 convswl t4, t2 subl t3, t3, t4 addl t3, t3, p1 shrsl t3, t3, p2 convlw t1, t3 subw d1, d1, t1 .function orc_subtract_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 subw d1, s1, s2 .function orc_add_s16_u8 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 1 s2 .temp 2 t1 convubw t1, s2 addw d1, t1, s1 .function orc_add_s16_u8_2d .flags 2d .dest 2 d1 orc_int16 .source 1 s1 .temp 2 t1 convubw t1, s1 addw d1, d1, t1 .function orc_convert_s16_u8 .dest 2 d1 .source 1 s1 convubw d1, s1 .function orc_convert_u8_s16 .dest 1 d1 .source 2 s1 orc_int16 convsuswb d1, s1 .function orc_offsetconvert_u8_s16 .dest 1 d1 .source 2 s1 orc_int16 .temp 2 t1 addw t1, s1, 128 convsuswb d1, t1 .function orc_offsetconvert_s16_u8 .dest 2 d1 orc_int16 .source 1 s1 .temp 2 t1 convubw t1, s1 subw d1, t1, 128 .function orc_subtract_s16_u8 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 1 s2 .temp 2 t1 convubw t1, s2 subw d1, s1, t1 .function orc_multiply_and_add_s16_u8 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 1 s2 .temp 2 t1 convubw t1, s2 mullw t1, t1, s1 addw d1, d1, t1 .function orc_splat_s16_ns .dest 2 d1 orc_int16 .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d_4xn .n 4 .flags 2d .dest 2 d1 orc_int16 .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d_8xn .n 8 .flags 2d .dest 2 d1 orc_int16 .param 2 p1 copyw d1, p1 .function orc_splat_s16_2d .flags 2d .dest 2 d1 orc_int16 .param 2 p1 copyw d1, p1 .function orc_splat_u8_ns .dest 1 d1 .param 1 p1 copyb d1, p1 .function orc_splat_u8_2d .flags 2d .dest 1 d1 .param 1 p1 copyb d1, p1 .function orc_average_u8 .dest 1 d1 .source 1 s1 .source 1 s2 avgub d1, s1, s2 .function orc_rrshift6_add_s16_2d .flags 2d .dest 1 d1 orc_uint8 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 addw t1, s2, 32 shrsw t1, t1, 6 addw t1, s1, t1 convsuswb d1, t1 .function orc_rrshift6_sub_s16_2d .flags 2d .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .temp 2 t1 subw t1, d2, 8160 shrsw t1, t1, 6 copyw d2, t1 subw d1, d1, t1 .function orc_rrshift6_s16_ip_2d .flags 2d .dest 2 d1 orc_int16 .temp 2 t1 subw t1, d1, 8160 shrsw d1, t1, 6 .function orc_rrshift6_s16_ip .dest 2 d1 orc_int16 .temp 2 t1 subw t1, d1, 8160 shrsw d1, t1, 6 .function orc_unpack_yuyv_y .dest 1 d1 .source 2 s1 select0wb d1, s1 .function orc_unpack_yuyv_u .dest 1 d1 .source 4 s1 .temp 2 t1 select0lw t1, s1 select1wb d1, t1 .function orc_unpack_yuyv_v .dest 1 d1 .source 4 s1 .temp 2 t1 select1lw t1, s1 select1wb d1, t1 .function orc_packyuyv .dest 4 d1 .source 2 s1 orc_uint8 .source 1 s2 .source 1 s3 .temp 1 t1 .temp 1 t2 .temp 2 t3 .temp 2 t4 .temp 2 t5 copyw t5, s1 select0wb t1, t5 select1wb t2, t5 mergebw t3, t1, s2 mergebw t4, t2, s3 mergewl d1, t3, t4 .function orc_unpack_uyvy_y .dest 1 d1 .source 2 s1 select1wb d1, s1 .function orc_unpack_uyvy_u .dest 1 d1 .source 4 s1 .temp 2 t1 select0lw t1, s1 select0wb d1, t1 .function orc_unpack_uyvy_v .dest 1 d1 .source 4 s1 .temp 2 t1 select1lw t1, s1 select0wb d1, t1 .function orc_interleave2_s16 .dest 4 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 mergewl d1, s1, s2 .function orc_interleave2_rrshift1_s16 .dest 4 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 addw t1, s1, 1 shrsw t1, t1, 1 addw t2, s2, 1 shrsw t2, t2, 1 mergewl d1, t1, t2 .function orc_deinterleave2_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .source 4 s1 orc_int16 .temp 4 t1 copyl t1, s1 select0lw d1, t1 select1lw d2, t1 .function orc_deinterleave2_lshift1_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .source 4 s1 orc_int16 .temp 4 t1 .temp 2 t2 .temp 2 t3 copyl t1, s1 select0lw t2, t1 shlw d1, t2, 1 select1lw t3, t1 shlw d2, t3, 1 .function orc_haar_deint_lshift1_split_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .source 4 s1 orc_int16 .temp 2 t1 .temp 2 t2 .temp 4 t3 copyl t3, s1 select0lw t1, t3 select1lw t2, t3 shlw t1, t1, 1 shlw t2, t2, 1 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_deint_split_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .source 4 s1 orc_int16 .temp 2 t1 .temp 2 t2 .temp 4 t3 copyl t3, s1 select0lw t1, t3 select1lw t2, t3 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16_lo .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 copyw t1, s1 subw t2, s2, t1 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16_hi .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 subw d1, s2, s1 .function orc_haar_split_s16_op .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 copyw t1, s1 subw t2, s2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_split_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .temp 2 t1 .temp 2 t2 copyw t1, d1 copyw t2, d2 subw t2, t2, t1 copyw d2, t2 avgsw t2, t2, 0 addw d1, t1, t2 .function orc_haar_synth_s16_lo .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 avgsw t1, s2, 0 subw d1, s1, t1 .function orc_haar_synth_s16_hi .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t2, s2 avgsw t3, t2, 0 subw t1, s1, t3 addw d1, t2, t1 .function orc_haar_synth_s16_op .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t2, s2 avgsw t3, t2, 0 subw t1, s1, t3 copyw d1, t1 addw d2, t2, t1 .function orc_haar_synth_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .temp 2 t1 .temp 2 t2 .temp 2 t3 copyw t1, d1 copyw t2, d2 avgsw t3, t2, 0 subw t1, t1, t3 copyw d1, t1 addw d2, t2, t1 .function orc_haar_synth_rrshift1_int_s16 .dest 4 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 copyw t2, s2 avgsw t1, t2, 0 subw t1, s1, t1 addw t2, t2, t1 avgsw t1, t1, 0 avgsw t2, t2, 0 mergewl d1, t1, t2 .function orc_haar_synth_int_s16 .dest 4 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 copyw t2, s2 avgsw t1, t2, 0 subw t1, s1, t1 addw t2, t2, t1 mergewl d1, t1, t2 .function orc_haar_sub_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 subw d1, d1, s1 .function orc_haar_add_half_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .temp 2 t1 avgsw t1, s1, 0 addw d1, d1, t1 .function orc_haar_add_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 addw d1, d1, s1 .function orc_haar_sub_half_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .temp 2 t1 avgsw t1, s1, 0 subw d1, d1, t1 .function orc_sum_u8 .accumulator 4 a1 orc_int32 .source 1 s1 .temp 2 t1 .temp 4 t2 convubw t1, s1 convuwl t2, t1 accl a1, t2 .function orc_sum_s16 .accumulator 4 a1 orc_int32 .source 2 s1 orc_int16 .temp 4 t1 convswl t1, s1 accl a1, t1 .function orc_sum_square_diff_u8 .accumulator 4 a1 orc_int32 .source 1 s1 .source 1 s2 .temp 2 t1 .temp 2 t2 .temp 4 t3 convubw t1, s1 convubw t2, s2 subw t1, t1, t2 mullw t1, t1, t1 convuwl t3, t1 accl a1, t3 .function orc_dequantise_s16_2d_4xn .n 4 .flags 2d .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_2d_8xn .n 8 .flags 2d .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip_2d_8xn .n 8 .flags 2d .dest 2 d1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip_2d .flags 2d .dest 2 d1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16_ip .dest 2 d1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 mullw t1, t1, p1 addw t1, t1, p2 shrsw t1, t1, 2 mullw d1, t1, t2 .function orc_dequantise_var_s16_ip .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .source 2 s2 orc_int16 .temp 2 t1 .temp 2 t2 copyw t1, d1 signw t2, t1 absw t1, t1 mullw t1, t1, s1 addw t1, t1, s2 shrsw t1, t1, 2 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantise1_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .param 2 p1 .param 2 p2 .param 2 p3 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 mulhuw t1, t1, p1 shruw t1, t1, p3 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantise2_s16 .dest 2 d1 orc_int16 .source 2 s1 orc_int16 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 copyw t1, s1 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 shruw t1, t1, p1 mullw d1, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant1_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .param 2 p5 .temp 2 t1 .temp 2 t2 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 mulhuw t1, t1, p1 shruw t1, t1, p3 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant3_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .param 2 p5 .param 4 p6 .temp 2 t1 .temp 2 t2 .temp 4 t3 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 muluwl t3, t1, p1 addl t3, t3, p6 shrul t3, t3, p3 convlw t1, t3 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 # only works for values between -16384 and 16384 .function orc_quantdequant2_s16 .dest 2 d1 orc_int16 .dest 2 d2 orc_int16 .param 2 p1 .param 2 p2 .param 2 p4 .param 2 p5 .temp 2 t1 .temp 2 t2 copyw t1, d2 signw t2, t1 absw t1, t1 shlw t1, t1, 2 subw t1, t1, p2 shruw t1, t1, p1 mullw t2, t1, t2 copyw d1, t2 signw t2, t2 mullw t1, t1, p4 addw t1, t1, p5 shrsw t1, t1, 2 mullw d2, t1, t2 .function orc_downsample_vert_u8 .dest 1 d1 .source 1 s1 .source 1 s2 .source 1 s3 .source 1 s4 .temp 2 t1 .temp 2 t2 .temp 2 t3 convubw t1, s1 convubw t2, s4 addw t1, t1, t2 mullw t1, t1, 6 convubw t2, s2 convubw t3, s3 addw t2, t2, t3 mullw t2, t2, 26 addw t2, t2, t1 addw t2, t2, 32 shruw t2, t2, 6 convwb d1, t2 .function orc_downsample_horiz_u8 .dest 1 d1 .source 2 s1 orc_uint8 .source 2 s2 orc_uint8 .temp 2 t1 .temp 2 t2 .temp 1 t3 .temp 2 t4 .temp 2 t5 .temp 2 t6 copyw t1, s1 copyw t2, s2 select0wb t3, t1 convubw t4, t3 select1wb t3, t2 convubw t5, t3 addw t4, t4, t5 mullw t4, t4, 6 select1wb t3, t1 convubw t5, t3 select0wb t3, t2 convubw t6, t3 addw t5, t5, t6 mullw t5, t5, 26 addw t4, t4, t5 addw t4, t4, 32 shruw t4, t4, 6 convwb d1, t4 .function orc_stats_moment_s16 .source 2 s1 orc_int16 .accumulator 4 a1 orc_int32 .temp 2 t1 .temp 4 t2 absw t1, s1 subw t1, t1, 2 maxsw t1, t1, 0 convuwl t2, t1 accl a1, t2 .function orc_stats_above_s16 .source 2 s1 orc_int16 .accumulator 4 a1 orc_int32 .temp 2 t1 .temp 4 t2 absw t1, s1 subw t1, t1, 1 maxsw t1, t1, 0 minsw t1, t1, 1 convuwl t2, t1 accl a1, t2 .function orc_accw .accumulator 2 a1 int .source 2 s1 orc_int16 .temp 2 t1 absw t1, s1 accw a1, t1 .function orc_avg2_8xn_u8 .flags 2d .n 8 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 avgub d1, s1, s2 .function orc_avg2_12xn_u8 .flags 2d .n 12 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 avgub d1, s1, s2 .function orc_avg2_16xn_u8 .flags 2d .n 16 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 avgub d1, s1, s2 .function orc_avg2_32xn_u8 .flags 2d .n 32 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 avgub d1, s1, s2 .function orc_avg2_nxm_u8 .flags 2d .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 avgub d1, s1, s2 .function orc_combine4_8xn_u8 .flags 2d .n 8 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .source 1 s3 orc_uint8 .source 1 s4 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_12xn_u8 .flags 2d .n 12 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .source 1 s3 orc_uint8 .source 1 s4 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_16xn_u8 .flags 2d .n 16 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .source 1 s3 orc_uint8 .source 1 s4 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_24xn_u8 .flags 2d .n 24 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .source 1 s3 orc_uint8 .source 1 s4 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_32xn_u8 .flags 2d .n 32 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .source 1 s3 orc_uint8 .source 1 s4 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 convsuswb d1, t2 .function orc_combine4_nxm_u8 .flags 2d .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .source 1 s3 orc_uint8 .source 1 s4 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 mullw t2, t1, p1 convubw t1, s2 mullw t1, t1, p2 addw t2, t2, t1 convubw t1, s3 mullw t1, t1, p3 addw t2, t2, t1 convubw t1, s4 mullw t1, t1, p4 addw t2, t2, t1 addw t2, t2, 8 shrsw t2, t2, 4 convsuswb d1, t2 .function orc_combine2_8xn_u8 .flags 2d .n 8 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_12xn_u8 .flags 2d .n 12 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_16xn_u8 .flags 2d .n 16 .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_combine2_nxm_u8 .flags 2d .dest 1 d1 orc_uint8 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 .param 2 p1 .param 2 p2 .param 2 p3 .param 2 p4 .temp 2 t1 .temp 2 t2 convubw t1, s1 convubw t2, s2 mullw t1, t1, p1 mullw t2, t2, p2 addw t1, t1, t2 addw t1, t1, p3 shrsw t1, t1, p4 convsuswb d1, t1 .function orc_sad_nxm_u8 .flags 2d .accumulator 4 a1 orc_uint32 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 accsadubl a1, s1, s2 .function orc_sad_8x8_u8 .flags 2d .n 8 .m 8 .accumulator 4 a1 orc_uint32 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 accsadubl a1, s1, s2 .function orc_sad_12x12_u8 .flags 2d .n 12 .m 12 .accumulator 4 a1 orc_uint32 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 accsadubl a1, s1, s2 .function orc_sad_16xn_u8 .flags 2d .n 16 .accumulator 4 a1 orc_uint32 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 accsadubl a1, s1, s2 .function orc_sad_32xn_u8 .flags 2d .n 32 .accumulator 4 a1 orc_uint32 .source 1 s1 orc_uint8 .source 1 s2 orc_uint8 accsadubl a1, s1, s2 .function convert_rgb_to_gray .dest 1 d1 .source 4 s1 .temp 1 l_t1 .temp 2 l_t2 .temp 2 l_gray2 # Red * ((0.299) * (1<<16) + 0.5) select0lw l_t2, s1 select0wb l_t1, l_t2 convubw l_gray2, l_t1 swapw l_gray2, l_gray2 mulhuw l_gray2, l_gray2, 19595 # Green * ((0.587) * (1<<16) + 0.5) select0lw l_t2, s1 select1wb l_t1, l_t2 convubw l_t2, l_t1 swapw l_t2, l_t2 mulhuw l_t2, l_t2, 38470 addusw l_gray2, l_gray2, l_t2 # Blue * ((0.114) * (1<<16) + 0.5) select1lw l_t2, s1 select0wb l_t1, l_t2 convubw l_t2, l_t1 swapw l_t2, l_t2 mulhuw l_t2, l_t2, 7471 addusw l_gray2, l_gray2, l_t2 # Add 1/2 => (1 << (8 - 1)) addusw l_gray2, l_gray2, 128 select1wb d1, l_gray2 .function canny_calc_delta_x .dest 4 d1 orc_int32 .source 4 s1 orc_uint8 .source 4 s2 orc_uint8 .temp 2 t1 .temp 2 t2 .temp 1 t3 .temp 2 t4 .temp 1 t5 .temp 2 t6 .temp 4 t7 .temp 4 td1 select0lw t2, s1 select1wb t3, t2 select0lw t4, s2 select1wb t5, t4 convubw t4, t3 convubw t6, t5 subw t1, t4, t6 convswl t7, t1 mulll td1, t7, t7 select1lw t2, s1 select0wb t3, t2 select1lw t4, s2 select0wb t5, t4 convubw t4, t3 convubw t6, t5 subw t1, t4, t6 convswl t7, t1 mulll t7, t7, t7 addl td1, td1, t7 select1lw t2, s1 select1wb t3, t2 select1lw t4, s2 select1wb t5, t4 convubw t4, t3 convubw t6, t5 subw t1, t4, t6 convswl t7, t1 mulll t7, t7, t7 addl d1, td1, t7 .function i420_to_ayuv .dest 4 d1 .source 1 y .source 1 u .source 1 v .param 1 a .temp 1 tu .temp 1 tv .temp 1 ty .temp 2 t1 .temp 2 t2 loadupdb tu, u loadupdb tv, v loadb ty, y mergebw t1, a, ty mergebw t2, tu, tv mergewl d1, t1, t2 .function test_4x .dest 4 d1 .source 4 s1 .source 4 s2 x4 addusb d1, s1, s2 .function test_4x_2 .dest 4 d1 .source 4 s1 .param 4 p1 x4 addusb d1, s1, p1 .function orc_splat_u16 .dest 2 d1 orc_uint16 .param 2 p1 copyw d1, p1 .function orc_splat_u32 .dest 4 d1 orc_uint32 .param 4 p1 copyl d1, p1 .function orc_splat_u16_2d .dest 2 d1 orc_uint16 .param 2 p1 .flags 2d copyw d1, p1 .function orc_splat_u32_2d .dest 4 d1 orc_uint32 .param 4 p1 .flags 2d copyl d1, p1 .function orc_copy_u16_2d .dest 2 d1 .source 2 s1 .flags 2d copyw d1, s1 .function orc_copy_u32_2d .dest 4 d1 .source 4 s1 .flags 2d copyl d1, s1 .function orc_composite_add_8888_8888_2d .flags 2d .dest 4 d1 .source 4 s1 x4 addusb d1, d1, s1 .function orc_composite_add_8_8_line .dest 1 d1 .source 1 s1 addusb d1, d1, s1 .function orc_composite_add_n_8_8_line .dest 1 d1 .source 1 s1 .param 2 p1 .temp 2 t1 .temp 1 t2 #compina t1, p1, s1 convubw t1, s1 mullw t1, t1, p1 div255w t1, t1 convwb t2, t1 addusb d1, d1, t2 .function orc_code_combine_add_u .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 t1 .temp 8 t2 .temp 4 t3 x4 convubw t1, s1 x4 convubw t2, s2 splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 x4 addusb d1, d1, t3 .function orc_code_combine_add_u_n .dest 4 d1 .source 4 s1 x4 addusb d1, d1, s1 .function orc_code_combine_over_u .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 t1 .temp 8 t2 .temp 4 t3 .temp 4 d .temp 8 d_wide #compin t1, s1, s2 #compover d1, d1, t1 x4 convubw t1, s1 x4 convubw t2, s2 splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 # ((d) + (s) - ORC_MULDIV_255((d),(m))) loadl d, d1 x4 convubw d_wide, d x4 xorw t1, t1, 0x00ff splatw3q t2, t1 x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, t3 .function orc_code_combine_over_u_n .dest 4 d1 .source 4 s1 .temp 8 t1 .temp 8 t2 .temp 4 d .temp 4 s .temp 8 d_wide loadl s, s1 x4 convubw t1, s loadl d, d1 x4 convubw d_wide, d x4 xorw t1, t1, 0x00ff splatw3q t2, t1 x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, s .function orc_code_combine_in_u .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 x4 convubw t1, s1 x4 convubw t2, s2 splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 splatw3q t2, d_wide x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb d1, t1 .function orc_code_combine_in_u_n .dest 4 d1 .source 4 s1 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 x4 convubw t1, s1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 splatw3q t2, d_wide x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb d1, t1 .function orc_code_combine_out_u .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 x4 convubw t1, s1 x4 convubw t2, s2 splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb d1, t1 .function orc_code_combine_out_u_n .dest 4 d1 .source 4 s1 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 x4 convubw t1, s1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb d1, t1 # atop: (ORC_DIVIDE_255((s)*(da))+ORC_DIVIDE_255((d)*(255-(sa)))) .function orc_code_combine_atop_u .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 .temp 8 t3 .temp 4 t4 .temp 4 t5 x4 convubw t1, s1 x4 convubw t2, s2 splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convubw d_wide, d1 splatw3q t2, d_wide x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb t5, t1 x4 addusb d1, t4, t5 .function orc_code_combine_atop_u_n .dest 4 d1 .source 4 s1 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 .temp 8 t3 .temp 4 t4 .temp 4 t5 x4 convubw t1, s1 x4 convubw d_wide, d1 splatw3q t2, d_wide x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb t5, t1 x4 addusb d1, t4, t5 .function orc_code_combine_xor_u .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 .temp 8 t3 .temp 4 t4 .temp 4 t5 x4 convubw t1, s1 x4 convubw t2, s2 splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convubw d_wide, d1 splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb t5, t1 x4 addusb d1, t4, t5 .function orc_code_combine_xor_u_n .dest 4 d1 .source 4 s1 .temp 8 d_wide .temp 8 s_wide .temp 8 m_wide .temp 8 t1 .temp 8 t2 .temp 8 t3 .temp 4 t4 .temp 4 t5 x4 convubw t1, s1 x4 convubw d_wide, d1 splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb t5, t1 x4 addusb d1, t4, t5 .function orc_code_combine_add_ca .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 t1 .temp 8 t2 .temp 4 t3 x4 convubw t1, s1 x4 convubw t2, s2 #splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 x4 addusb d1, d1, t3 .function orc_code_combine_add_ca_n .dest 4 d1 .source 4 s1 x4 addusb d1, d1, s1 .function orc_code_combine_over_ca .dest 4 d1 .source 4 s1 .source 4 s2 .temp 8 t1 .temp 8 t2 .temp 4 d .temp 8 d_wide .temp 8 m_wide .temp 8 s_wide .temp 8 xa .temp 4 s x4 convubw s_wide, s1 x4 convubw m_wide, s2 splatw3q xa, s_wide x4 mullw s_wide, s_wide, m_wide x4 div255w s_wide, s_wide x4 convwb s, s_wide x4 mullw m_wide, m_wide, xa x4 div255w m_wide, m_wide loadl d, d1 x4 convubw d_wide, d x4 xorw m_wide, m_wide, 0x00ff x4 mullw t1, d_wide, m_wide x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, s .function orc_code_combine_over_ca_n .dest 4 d1 .source 4 s1 .temp 8 t1 .temp 8 t2 .temp 4 d .temp 8 d_wide .temp 8 m_wide .temp 8 s_wide .temp 8 xa .temp 4 s x4 convubw s_wide, s1 splatw3q xa, s_wide x4 convwb s, s_wide x4 copyw m_wide, xa loadl d, d1 x4 convubw d_wide, d x4 xorw m_wide, m_wide, 0x00ff x4 mullw t1, d_wide, m_wide x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, s .function orc_composite_over_8888_8_8888_line .dest 4 d1 .source 4 s1 .source 1 s2 .temp 8 t1 .temp 8 t2 .temp 4 t3 .temp 4 d .temp 4 mask .temp 8 d_wide x4 convubw t1, s1 splatbl mask, s2 x4 convubw t2, mask x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 loadl d, d1 x4 convubw d_wide, d x4 xorw t1, t1, 0x00ff splatw3q t2, t1 x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, t3 .function orc_composite_over_n_8888_8888_ca_2d #.flags 2d .dest 4 d1 .source 4 s1 .param 4 p1 .temp 8 t1 .temp 8 t2 .temp 4 d .temp 8 d_wide .temp 8 m_wide .temp 8 s_wide .temp 8 xa .temp 4 s x4 convubw s_wide, p1 x4 convubw m_wide, s1 splatw3q xa, s_wide x4 mullw s_wide, s_wide, m_wide x4 div255w s_wide, s_wide x4 convwb s, s_wide x4 mullw m_wide, m_wide, xa x4 div255w m_wide, m_wide loadl d, d1 x4 convubw d_wide, d x4 xorw m_wide, m_wide, 0x00ff x4 mullw t1, d_wide, m_wide x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, s .function cogorc_resample_horiz_1tap .dest 1 d1 .source 1 s1 .param 2 p1 .param 2 p2 ldresnearb d1, s1, p1, p2 .function cogorc_resample_horiz_2tap .dest 1 d1 .source 1 s1 .param 4 p1 .param 4 p2 ldreslinb d1, s1, p1, p2 .function test_float_constant_1 .dest 4 d1 .const 4 c1 2.0 copyl d1, c1 .function test_float_constant_2 .dest 4 d1 copyl d1, 2.0 .function convert_fc32_to_int32 .source 8 src #one complex float .dest 4 dst #one complex short .temp 8 scaled x2 mulf scaled, src, 32767.0 .temp 8 lscaled x2 convfl lscaled, scaled x2 convlw dst, lscaled .function param64 .dest 8 d .param 8 s copyq d, s .function const64 .dest 8 d .const 8 s 0x0123456789abcdef copyq d, s .function param64_2 .dest 8 d .longparam 8 p .temp 8 t loadpq t, p copyq d, t .function pa_volume_s16ne_orc_2ch .dest 4 samples orc_int16 .longparam 8 vols .temp 8 v .temp 8 s .temp 8 ss .temp 8 m .temp 8 signc loadpq v, vols x2 convuwl s, samples x2 convswl ss, samples x4 cmpgtsw signc, 0, s x4 andw signc, signc, v x4 mulhuw m, s, v x2 subl m, m, signc x2 shrul v, v, 16 x2 mulll ss, ss, v x2 addl m, m, ss x2 convssslw samples, m .function cogorc_convert_YUY2_I420 .dest 2 y1 .dest 2 y2 .dest 1 u .dest 1 v .source 4 yuv1 .source 4 yuv2 .temp 2 t1 .temp 2 t2 .temp 2 ty x2 splitwb t1, ty, yuv1 storew y1, ty x2 splitwb t2, ty, yuv2 storew y2, ty x2 avgub t1, t1, t2 splitwb v, u, t1 .function cogorc_convert_AYUV_I420 .flags 2d .dest 2 y1 .dest 2 y2 .dest 1 u .dest 1 v .source 8 ayuv1 .source 8 ayuv2 .temp 4 ay .temp 4 uv1 .temp 4 uv2 .temp 4 uv .temp 2 uu .temp 2 vv .temp 1 t1 .temp 1 t2 x2 splitlw uv1, ay, ayuv1 x2 select1wb y1, ay x2 splitlw uv2, ay, ayuv2 x2 select1wb y2, ay x4 avgub uv, uv1, uv2 x2 splitwb vv, uu, uv splitwb t1, t2, uu avgub u, t1, t2 splitwb t1, t2, vv avgub v, t1, t2 .function memcpy_aligned .dest 1 d1 align 16 void .source 1 s1 align 16 void copyb d1, s1 .function memcpy_large .n minimum 4096 .dest 1 d1 void .source 1 s1 void copyb d1, s1 .function memcpy_small .n maximum 4096 .dest 1 d1 void .source 1 s1 void copyb d1, s1 .function memcpy_aligned_n16 .n multiple 16 .dest 1 d1 align 16 void .source 1 s1 align 16 void copyb d1, s1 orc-0.4.18/testsuite/perf_opcodes_sys.c0000664000175000017500000000132712057245267015072 00000000000000 #include "config.h" #include #include #include int error = FALSE; void test_opcode_src (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_test_init(); orc_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("opcode_%-20s ", opcode_set->opcodes[i].name); test_opcode_src (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode_src (OrcStaticOpcode *opcode) { OrcProgram *p; int flags = 0; p = orc_test_get_program_for_opcode (opcode); printf("%g\n", orc_test_performance_full (p, flags, NULL)); orc_program_free (p); } orc-0.4.18/testsuite/compile_opcodes_sys_mips.c0000664000175000017500000000722112111024531016571 00000000000000/* Copyright 2002 - 2009 David A. Schleef Copyright 2012 MIPS Technologies, Inc. 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 "config.h" #include #include #include #include int error = FALSE; void test_opcode (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_init(); orc_test_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("/* %s %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("/* %s const %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_const (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ printf("/* %s param %d,%d,%d */\n", opcode_set->opcodes[i].name, opcode_set->opcodes[i].dest_size[0], opcode_set->opcodes[i].src_size[0], opcode_set->opcodes[i].src_size[1]); test_opcode_param (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode (opcode); if (!p) return; ret = orc_test_gcc_compile_mips (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_const (opcode); if (!p) return; ret = orc_test_gcc_compile_mips (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; OrcTestResult ret; p = orc_test_get_program_for_opcode_param (opcode); if (!p) return; ret = orc_test_gcc_compile_mips (p); if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (p)); error = TRUE; return; } orc_program_free (p); } orc-0.4.18/testsuite/benchmorc/0000775000175000017500000000000012206165374013371 500000000000000orc-0.4.18/testsuite/benchmorc/Makefile.in0000664000175000017500000003645212206165330015360 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = benchmorc$(EXEEXT) subdir = testsuite/benchmorc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) benchmorc_SOURCES = benchmorc.c benchmorc_OBJECTS = benchmorc.$(OBJEXT) benchmorc_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = benchmorc.c DIST_SOURCES = benchmorc.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = $(ORC_LIBS) $(top_builddir)/orc-test/liborc-test-@ORC_MAJORMINOR@.la LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(ORC_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu testsuite/benchmorc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu testsuite/benchmorc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list benchmorc$(EXEEXT): $(benchmorc_OBJECTS) $(benchmorc_DEPENDENCIES) $(EXTRA_benchmorc_DEPENDENCIES) @rm -f benchmorc$(EXEEXT) $(LINK) $(benchmorc_OBJECTS) $(benchmorc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmorc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/testsuite/benchmorc/benchmorc.c0000664000175000017500000011307012057245267015423 00000000000000 #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; double weights_ginger[]; double weights_feathers[]; //double weights_preston[]; double weights_n900[]; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = NULL; double sum; orc_init (); orc_test_init (); filename = "bench10.orc"; code = read_file (filename); if (!code) { printf("benchmorc needs bench10.orc file in current directory\n"); exit(1); } n = orc_parse (code, &programs); #if 0 sum = 0; for(i=0;iname); } printf("sum = %g\n", sum); #else sum = 0; for(i=0;i #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); int error = FALSE; int main (int argc, char *argv[]) { char *code; int n; int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); if (argc >= 2) { filename = argv[1]; } if (filename == NULL) { filename = getenv ("testfile"); } if (filename == NULL) { filename = "test.orc"; } code = read_file (filename); if (!code) { printf("compile_parse_test \n"); exit(1); } n = orc_parse (code, &programs); for(i=0;iname); ret = orc_test_gcc_compile_neon (programs[i]); if (ret == ORC_TEST_FAILED) { error = TRUE; } } if (error) return 1; return 0; } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } orc-0.4.18/testsuite/generate_xml_table2.c0000664000175000017500000003014412177015514015417 00000000000000 #include "config.h" #include #include #include #include #include int error = FALSE; char * get_desc (OrcStaticOpcode *opcode); char * get_code (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_init(); orc_test_init(); printf( "\n" "\n" "Table of Opcodes\n" "\n" "\n" "\n" "opcode\n" "destination size\n" "source 1 size\n" "source 2 size\n" "description\n" "pseudo code\n" "\n" "\n" "\n"); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ printf("\n"); printf("%s\n", opcode_set->opcodes[i].name); printf("%d\n", opcode_set->opcodes[i].dest_size[0]); printf("%d\n", opcode_set->opcodes[i].src_size[0]); if (opcode_set->opcodes[i].src_size[1]) { printf("%d%s\n", opcode_set->opcodes[i].src_size[1], (opcode_set->opcodes[i].flags & ORC_STATIC_OPCODE_SCALAR) ? "S" : ""); } else { printf("\n"); } printf("%s\n", get_desc(&opcode_set->opcodes[i])); printf("%s\n", get_code(&opcode_set->opcodes[i])); printf("\n"); } printf( "\n" "\n" "
\n"); return 0; } struct a { char *name; char *code; char *desc; }; struct a ops[] = { { "absb", "(a < 0) ? -a : a", "absolute value" }, { "addb", "a + b", "add" }, { "addssb", "clamp(a + b)", "add with signed saturate" }, { "addusb", "clamp(a + b)", "add with unsigned saturate" }, { "andb", "a & b", "bitwise AND" }, { "andnb", "a & (~b)", "bitwise AND NOT" }, { "avgsb", "(a + b + 1)>>1", "signed average" }, { "avgub", "(a + b + 1)>>1", "unsigned average" }, { "cmpeqb", "(a == b) ? (~0) : 0", "compare equal" }, { "cmpgtsb", "(a > b) ? (~0) : 0", "compare greater than" }, { "copyb", "a", "copy" }, { "maxsb", "(a > b) ? a : b", "signed maximum" }, { "maxub", "(a > b) ? a : b", "unsigned maximum" }, { "minsb", "(a < b) ? a : b", "signed minimum" }, { "minub", "(a < b) ? a : b", "unsigned minimum" }, { "mullb", "a * b", "low bits of multiply" }, { "mulhsb", "(a * b) >> 8", "high bits of signed multiply" }, { "mulhub", "(a * b) >> 8", "high bits of unsigned multiply" }, { "orb", "a | b", "bitwise or" }, { "shlb", "a << b", "shift left" }, { "shrsb", "a >> b", "signed shift right" }, { "shrub", "a >> b", "unsigned shift right" }, { "signb", "sign(a)", "sign" }, { "subb", "a - b", "subtract" }, { "subssb", "clamp(a - b)", "subtract with signed saturate" }, { "subusb", "clamp(a - b)", "subtract with unsigned saturate" }, { "xorb", "a ^ b", "bitwise XOR" }, { "absw", "(a < 0) ? -a : a", "absolute value" }, { "addw", "a + b", "add" }, { "addssw", "clamp(a + b)", "add with signed saturate" }, { "addusw", "clamp(a + b)", "add with unsigned saturate" }, { "andw", "a & b", "bitwise AND" }, { "andnw", "a & (~b)", "bitwise AND NOT" }, { "avgsw", "(a + b + 1)>>1", "signed average" }, { "avguw", "(a + b + 1)>>1", "unsigned average" }, { "cmpeqw", "(a == b) ? (~0) : 0", "compare equal" }, { "cmpgtsw", "(a > b) ? (~0) : 0", "compare greater than" }, { "copyw", "a", "copy" }, { "maxsw", "(a > b) ? a : b", "signed maximum" }, { "maxuw", "(a > b) ? a : b", "unsigned maximum" }, { "minsw", "(a < b) ? a : b", "signed minimum" }, { "minuw", "(a < b) ? a : b", "unsigned minimum" }, { "mullw", "a * b", "low bits of multiply" }, { "mulhsw", "(a * b) >> 8", "high bits of signed multiply" }, { "mulhuw", "(a * b) >> 8", "high bits of unsigned multiply" }, { "orw", "a | b", "bitwise or" }, { "shlw", "a << b", "shift left" }, { "shrsw", "a >> b", "signed shift right" }, { "shruw", "a >> b", "unsigned shift right" }, { "signw", "sign(a)", "sign" }, { "subw", "a - b", "subtract" }, { "subssw", "clamp(a - b)", "subtract with signed saturate" }, { "subusw", "clamp(a - b)", "subtract with unsigned saturate" }, { "xorw", "a ^ b", "bitwise XOR" }, { "absl", "(a < 0) ? -a : a", "absolute value" }, { "addl", "a + b", "add" }, { "addssl", "clamp(a + b)", "add with signed saturate" }, { "addusl", "clamp(a + b)", "add with unsigned saturate" }, { "andl", "a & b", "bitwise AND" }, { "andnl", "a & (~b)", "bitwise AND NOT" }, { "avgsl", "(a + b + 1)>>1", "signed average" }, { "avgul", "(a + b + 1)>>1", "unsigned average" }, { "cmpeql", "(a == b) ? (~0) : 0", "compare equal" }, { "cmpgtsl", "(a > b) ? (~0) : 0", "compare greater than" }, { "copyl", "a", "copy" }, { "maxsl", "(a > b) ? a : b", "signed maximum" }, { "maxul", "(a > b) ? a : b", "unsigned maximum" }, { "minsl", "(a < b) ? a : b", "signed minimum" }, { "minul", "(a < b) ? a : b", "unsigned minimum" }, { "mulll", "a * b", "low bits of multiply" }, { "mulhsl", "(a * b) >> 16", "high bits of signed multiply" }, { "mulhul", "(a * b) >> 16", "high bits of unsigned multiply" }, { "orl", "a | b", "bitwise or" }, { "shll", "a << b", "shift left" }, { "shrsl", "a >> b", "signed shift right" }, { "shrul", "a >> b", "unsigned shift right" }, { "signl", "sign(a)", "sign" }, { "subl", "a - b", "subtract" }, { "subssl", "clamp(a - b)", "subtract with signed saturate" }, { "subusl", "clamp(a - b)", "subtract with unsigned saturate" }, { "xorl", "a ^ b", "bitwise XOR" }, { "addq", "a + b", "add" }, { "andq", "a & b", "bitwise AND" }, { "andnq", "a & (~b)", "bitwise AND NOT" }, { "cmpeqq", "(a == b) ? (~0) : 0", "compare equal" }, { "cmpgtsq", "(a > b) ? (~0) : 0", "compare greater than" }, { "copyq", "a", "copy" }, { "orq", "a | b", "bitwise or" }, { "shlq", "a << b", "shift left" }, { "shrsq", "a >> b", "signed shift right" }, { "shruq", "a >> b", "unsigned shift right" }, { "subq", "a - b", "subtract" }, { "xorq", "a ^ b", "bitwise XOR" }, { "convsbw", "a", "convert signed" }, { "convubw", "a", "convert unsigned" }, { "convswl", "a", "convert signed" }, { "convuwl", "a", "convert unsigned" }, { "convwb", "a", "convert" }, { "convssswb", "clamp(a)", "convert signed to signed with saturation" }, { "convsuswb", "clamp(a)", "convert signed to unsigned with saturation" }, { "convusswb", "clamp(a)", "convert unsigned to signed with saturation" }, { "convuuswb", "clamp(a)", "convert unsigned to unsigned with saturation" }, { "convlw", "a", "convert" }, { "convssslw", "clamp(a)", "convert signed to signed with saturation" }, { "convsuslw", "clamp(a)", "convert signed to unsigned with saturation" }, { "convusslw", "clamp(a)", "convert unsigned to signed with saturation" }, { "convuuslw", "clamp(a)", "convert unsigned to unsigned with saturation" }, { "mulsbw", "a * b", "multiply signed" }, { "mulubw", "a * b", "multiply unsigned" }, { "mulswl", "a * b", "multiply signed" }, { "muluwl", "a * b", "multiply unsigned" }, { "mulslq", "a * b", "multiply signed" }, { "mululq", "a * b", "multiply unsigned" }, { "mergelq", "special", "merge halves" }, { "mergewl", "special", "merge halves" }, { "mergebw", "special", "merge halves" }, { "select0wb", "special", "select first half" }, { "select1wb", "special", "select second half" }, { "select0lw", "special", "select first half" }, { "select1lw", "special", "select second half" }, { "select0ql", "special", "select first half" }, { "select1ql", "special", "select second half" }, { "swapq", "special", "endianness byte swap" }, { "swapw", "special", "endianness byte swap" }, { "swapl", "special", "endianness byte swap" }, { "swapwl", "special", "endianness word swap" }, { "swaplq", "special", "endianness long word swap" }, { "accw", "+= a", "accumulate" }, { "accl", "+= a", "accumulate" }, { "accsadubl", "+= abs(a - b)", "accumulate absolute difference" }, { "splitql" , "special", "split first/second long words" }, { "splitlw" , "special", "split first/second words" }, { "splitwb" , "special", "split first/second bytes" }, { "addf", "a + b", "add" }, { "addd", "a + b", "add" }, { "subf", "a - b", "subtract" }, { "subd", "a - b", "subtract" }, { "mulf", "a * b", "multiply" }, { "muld", "a * b", "multiply" }, { "divf", "a / b", "divide" }, { "divd", "a / b", "divide" }, { "sqrtf", "sqrt(a)", "square root" }, { "sqrtd", "sqrt(a)", "square root" }, { "maxf", "max(a,b)", "maximum" }, { "maxd", "max(a,b)", "maximum" }, { "minf", "min(a,b)", "minimum" }, { "mind", "min(a,b)", "minimum" }, { "cmpeqf", "(a == b) ? (~0) : 0", "compare equal" }, { "cmpeqd", "(a == b) ? (~0) : 0", "compare equal" }, { "cmpltf", "(a == b) ? (~0) : 0", "compare less than" }, { "cmpltd", "(a == b) ? (~0) : 0", "compare less than" }, { "cmplef", "(a == b) ? (~0) : 0", "compare less than or equal" }, { "cmpled", "(a == b) ? (~0) : 0", "compare less than or equal" }, { "convfl", "a", "convert float point to integer" }, { "convlf", "a", "convert integer to floating point" }, { "convdl", "a", "convert double point to integer" }, { "convld", "a", "convert integer to double point" }, { "convfd", "a", "convert float to double" }, { "convdf", "a", "convert double to float" }, { "loadb", "array[i]", "load from memory" }, { "loadw", "array[i]", "load from memory" }, { "loadl", "array[i]", "load from memory" }, { "loadq", "array[i]", "load from memory" }, { "storeb", "special", "store to memory" }, { "storew", "special", "store to memory" }, { "storel", "special", "store to memory" }, { "storeq", "special", "store to memory" }, { "loadoffb", "array[i+offset]", "load from memory with offset" }, { "loadoffw", "array[i+offset]", "load from memory with offset" }, { "loadoffl", "array[i+offset]", "load from memory with offset" }, { "loadoffq", "array[i+offset]", "load from memory with offset" }, { "loadpb", "scalar", "load parameter or constant" }, { "loadpw", "scalar", "load parameter or constant" }, { "loadpl", "scalar", "load parameter or constant" }, { "loadpq", "scalar", "load parameter or constant" }, { "loadupdb", "array[i>>1]", "load upsampled duplicate" }, { "loadupib", "(array[i>>1] + array[(i+1)>>1] + 1)>>1", "load upsampled interpolate" }, { "ldresnearb", "array[(b+c*i)>>8]", "load, nearest neighbor resampled" }, { "ldreslinb", "special", "load, bilinear resampled" }, { "ldresnearl", "array[(b+c*i)>>8]", "load, nearest neighbor resampled" }, { "ldreslinl", "special", "load, bilinear resampled" }, { "div255w", "a/255", "divide by 255" }, { "divluw", "clamp(a/(b & 255),0,255)", "saturated unsigned divide 16-bit by 8-bit" }, { "splatw3q", "special", "duplicates high 16-bits to lower 48 bits" }, { "splatbw", "special", "duplicates 8 bits to both halfs of 16 bits" }, { "splatbl", "special", "duplicates 8 bits to all parts of 32 bits" }, { "convql", "a", "convert" }, { "convslq", "a", "signed convert" }, { "convulq", "a", "unsigned convert" }, { "convhwb", "a>>8", "shift and convert" }, { "convhlw", "a>>16", "shift and convert" }, { "convsssql", "clamp(a)", "convert signed to signed with saturation" }, { "convsusql", "clamp(a)", "convert signed to unsigned with saturation" }, { "convussql", "clamp(a)", "convert unsigned to signed with saturation" }, { "convuusql", "clamp(a)", "convert unsigned to unsigned with saturation" }, }; char * get_desc (OrcStaticOpcode *opcode) { int i; for(i=0;iname, ops[i].name) == 0) { return ops[i].desc; } } return ""; } char * get_code (OrcStaticOpcode *opcode) { int i; for(i=0;iname, ops[i].name) == 0) { return ops[i].code; } } return ""; } orc-0.4.18/testsuite/perf_opcodes_sys_compare.c0000664000175000017500000000337412177015514016575 00000000000000 #include "config.h" #include #include #include int error = FALSE; void test_opcode_src (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) { int i; OrcOpcodeSet *opcode_set; orc_test_init(); orc_init(); opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ //printf("opcode_%-20s ", opcode_set->opcodes[i].name); test_opcode_src (opcode_set->opcodes + i); } if (error) return 1; return 0; } void test_opcode_src (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int flags = 0; double perf_mmx, perf_sse; p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { orc_program_add_constant (p, opcode->src_size[1], 1, "s2"); } else { orc_program_add_source (p, opcode->src_size[1], "s2"); } } if (opcode->flags & ORC_STATIC_OPCODE_FLOAT) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s ", opcode->name); orc_program_set_name (p, s); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } perf_mmx = orc_test_performance_full (p, flags, "mmx"); perf_sse = orc_test_performance_full (p, flags, "sse"); printf("%g %g\n", perf_mmx, perf_sse); orc_program_free (p); } orc-0.4.18/Makefile.am0000664000175000017500000000115312057245266011357 00000000000000 AUTOMAKE_OPTIONS = foreign SUBDIRS = orc orc-test tools examples doc testsuite EXTRA_DIST = COPYING autogen.sh gtk-doc.make orc.m4 DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc pkgconfig_DATA = orc-$(ORC_MAJORMINOR).pc orc-$(ORC_MAJORMINOR).pc: orc.pc cp orc.pc orc-$(ORC_MAJORMINOR).pc orc-$(ORC_MAJORMINOR)-uninstalled.pc: orc-uninstalled.pc cp orc-uninstalled.pc orc-$(ORC_MAJORMINOR)-uninstalled.pc BUILT_SOURCES=orc-$(ORC_MAJORMINOR)-uninstalled.pc CLEANFILES = orc-$(ORC_MAJORMINOR).pc orc-$(ORC_MAJORMINOR)-uninstalled.pc ACLOCAL_AMFLAGS = -I m4 aclocaldir = $(datadir)/aclocal aclocal_DATA = orc.m4 orc-0.4.18/config.sub0000755000175000017500000010532712206165327011307 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: orc-0.4.18/orc.m40000644000175000017500000000415011642227040010333 00000000000000dnl pkg-config-based checks for Orc dnl specific: dnl ORC_CHECK([REQUIRED_VERSION]) AC_DEFUN([ORC_CHECK], [ ORC_REQ=ifelse([$1], , "0.4.6", [$1]) AC_ARG_ENABLE(orc, AC_HELP_STRING([--enable-orc],[use Orc if installed]), [case "${enableval}" in auto) enable_orc=auto ;; yes) enable_orc=yes ;; no) enable_orc=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-orc) ;; esac ], [enable_orc=auto]) dnl Default value if test "x$enable_orc" != "xno" ; then PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [ AC_DEFINE(HAVE_ORC, 1, [Use Orc]) HAVE_ORC=yes if test "x$ORCC" = "x" ; then AC_MSG_CHECKING(for usable orcc) ORCC=`$PKG_CONFIG --variable=orcc orc-0.4` dnl check whether the orcc found by pkg-config can be run from the build environment dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`]) AC_MSG_RESULT($ORCC) fi AC_SUBST(ORCC) ORCC_FLAGS="--compat $ORC_REQ" AC_SUBST(ORCC_FLAGS) AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes]) ], [ if test "x$enable_orc" = "xyes" ; then AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found]) fi AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) HAVE_ORC=no HAVE_ORCC=no ]) else AC_DEFINE(DISABLE_ORC, 1, [Disable Orc]) HAVE_ORC=no HAVE_ORCC=no fi AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"]) AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"]) ])) AC_DEFUN([ORC_OUTPUT], [ if test "$HAVE_ORC" = yes ; then printf "configure: *** Orc acceleration enabled.\n" else if test "x$enable_orc" = "xno" ; then printf "configure: *** Orc acceleration disabled by --disable-orc. Slower code paths\n" printf " will be used.\n" else printf "configure: *** Orc acceleration disabled. Requires Orc >= $ORC_REQ, which was\n" printf " not found. Slower code paths will be used.\n" fi fi printf "\n" ]) orc-0.4.18/doc/0000775000175000017500000000000012206165374010145 500000000000000orc-0.4.18/doc/tutorial.xml0000644000175000017500000003565511572035031012455 00000000000000 %version-entities; ]> Orc Tutorial 3 Orc Orc Tutorial Getting started writing Orc code. Orc Tutorial This section walks you through several examples of increasing complexity to get you started working with Orc. Each of these examples are available in the Orc source code, in the examples directory. The first three examples use static Orc code that is in a source file, and is compiled into intermediate C code by the orcc tool. The first example demonstrates how to add two arrays of 16-bit signed integers together. A possible use case for this is combining two stereo audio streams together. The second example builds from the first, replacing one of the stereo input streams with a mono stream, converting it to stereo in the process, and also adjusting the volume of the stream. The third example shows how to convert a planar 4:2:0 video image into a packed 4:4:4 video image with an alpha channel. Example 1 This example demonstrates combining two stereo audio streams by adding. Uncompressed audio streams (i.e., PCM format) can be in a variety of formats, but one of the most common is interleaved signed 16-bit integers, and we will choose that for the purposes of this example. Extending to other formats is left as an exercise for the reader. Interleaved means that left and right channel samples are consecutive: in memory, the data look like LRLRLR... The sampling rate is unimportant, as long as both streams are the same. One important feature/limitation of signed 16-bit audio samples is that adding two together could cause an overflow. For example, adding the value 25000 to 10000 gives 35000, but this overflows 16 bits, so a standard addition would instead give the value -30536 (35000-65536). Overflows handled this way sound like crackling or worse, so we would like a better solution. One solution is to use saturating addition: in this case, the addition of 25000 and 10000 would be limited by the upper end of signed 16-bit values to give 32767. Although this still causes distortion in the output signal, it is much less audible and annoying. In normal C code, 16-bit saturating addition is difficult to express without using 32-bit intermediates. In Orc, saturating addition is a basic operation with opcodes for each size, both signed and unsigned. In this case, we want "addssw", for "add signed saturated word". Also, we're going to make a one simplification: Adding two interleaved stereo streams is the same as adding two mono streams with twice as many samples. So we'll use 2*n_samples in the calling code. To the code: .function audio_add_s16 .dest 2 d1 .source 2 s1 .source 2 s2 addssw d1, s1, s2 Line by line: .function audio_add_s16 This starts a function. A function (represented internally by the object OrcProgram) is equivalent to a C function. When you generate C code from this Orc exmaple using the orcc tool, it generates a C stub function called "audio_add_s16()", which at runtime will generate an OrcProgram object corresponding to the above code, compile it, and then run it. .dest 2 d1 short This specifies that you want a destination (output) array named "d1", with the element size being 2. Orc does not differentiate between signed and unsigned arrays (or even floating point), however, you may optionally specify a type afterwards that will be used in any autogenerated C code. .source 2 s1 short .source 2 s2 short This specifies that you want two source (input) arrays, "s1" and "s2", similar to the destination array. addssw d1, s1, s2 This specifies the (only) opcode that we want for this program: signed saturated addition of each member of the two source arrays, and store the result in the destination array. A few notes about the above program: The loop over the array members is implied. Everything that Orc does is based on looping over each array element and executing the opcodes in a program. When you generate C code from the above Orc code using 'orcc --implementation example1.orc', you get a bunch of boilerplate code, plus three C functions: /* audio_add_s16 */ #ifdef DISABLE_ORC void audio_add_s16 (int16 * d1, const int16 * s1, const int16 * s2, int n) { ... } This function is used if DISABLE_ORC is defined. As one might guess, if you define DISABLE_ORC, no runtime Orc features are used, and all calls to audio_add_s16() use this function. The interior of the function is a for() loop that implements the Orc function. The generated code may not necessarily be easy to read, but it is straightforward: all the verbosity and use of unions is to avoid compiler warnings without making the compiler too complex. But this is the place to go if you are trying to understand what Orc is doing. #else static void _backup_audio_add_s16 (OrcExecutor * ORC_RESTRICT ex) { ... } This function is used when runtime Orc is enabled, but Orc was unable to generate code for the function at runtime. There are various reasons why that might happen -- unimplemented rules for a target, or more temporary variables used than available registers. void audio_add_s16 (short * d1, const short * s1, const short * s2, int n) { ... } The third generated function is the important part: It is used when Orc is enabled at runtime, and creates the OrcProgram corresponding to the function you defined. Then it compiles the function and calls it. After generating the C code, you should generate the header file, using: 'orcc --header example1orc.orc -o example1orc.h'. After similar boilerplate code, there is the expected declaration of audio_add_s16(): void audio_add_s16 (short * d1, const short * s1, const short * s2, int n); Some C code to generate sample data, call the generated code, and print out the results: #include <stdio.h> #include "example1orc.h" #define N 10 short a[N]; short b[N]; short c[N]; int main (int argc, char *argv[]) { int i; /* Create some data in the source arrays */ for(i=0;i < N;i++){ a[i] = 100*i; b[i] = 32000; } /* Call a function that uses Orc */ audio_add_s16 (c, a, b, N); /* Print the results */ for(i=0;i < N;i++){ printf("%d: %d %d -> %d\n", i, a[i], b[i], c[i]); } return 0; } The output of the program: 0: 0 32000 -> 32000 1: 100 32000 -> 32100 2: 200 32000 -> 32200 3: 300 32000 -> 32300 4: 400 32000 -> 32400 5: 500 32000 -> 32500 6: 600 32000 -> 32600 7: 700 32000 -> 32700 8: 800 32000 -> 32767 9: 900 32000 -> 32767 Example 2 In this example, we will expand on the previous example by making one of the input arrays a mono stream, and also scale the mono input stream by a volume. Rather than iterating over each signed 16-bit value, in this example we will iterate over samples, meaning the member size for the stereo arrays is 4, since each array member contains a left and right 16 bit value. .function audio_add_mono_to_stereo_scaled_s16 .dest 4 d1 short .source 4 s1 short .source 2 s2 short .param 2 volume .temp 4 s2_scaled .temp 2 t .temp 4 s2_stereo mulswl s2_scaled, s2, volume shrsl s2_scaled, s2_scaled, 12 convssslw t, s2_scaled mergewl s2_stereo, t, t x2 addssw d1, s1, s2_stereo Piece by piece: .function audio_add_mono_to_stereo_scaled_s16 .dest 4 d1 short .source 4 s1 short .source 2 s2 short This is the same as the previous example, except that the stereo arrays are increased in size to 4. However, we'll use the short type, since Orc does not care what type we use, and short is the type of the array we want to use in the C code. .param 2 volume This specifies a parameter, which is an integer that is passed to an Orc function. In the generated C code, parameters are always of type int. There are also float parameters for the floating point equivalent. .temp 4 s2_scaled .temp 2 t .temp 4 s2_stereo This specifies a few temporary variables that are used later in the code. These definitions are similar to defining local variables in C code. Note that the size is important: each opcode has specific sizes for source and destination operands, and it is important to match these correctly with temporary variables. mulswl s2_scaled, s2, volume shrsl s2_scaled, s2_scaled, 12 This scales the mono input: signed multiply of s2 and volume, giving a 32-bit value, and then a signed right shift by 12. Since the second operand of mulswl is 16-bit, only the lower 16 bits of volume will be used in the multiply. The right shift is effectively the same as dividing by 4096. Thus, a neutral scaling that does not increase or decrease the mono input would correspond to calling the function with a parameter value of 4096. convssslw t, s2_scaled mergewl s2_stereo, t, t The first instruction is "convert saturated signed 32-bit to signed 16-bit", and the second merges the two values of (16 bit) t into the high and low halves of s2_stereo. This duplicates the mono signal into the right and left channels. It is important to use the saturated conversion, since the effective scaling value may have been greater than 1.0, thus the larger values may need to be clipped. x2 addssw d1, s1, s2_stereo The "x2" prefix indicates that we want the operation specified to be done twice, first to the upper half of all operands, and again separately to the lower half of all operands. Since addssw is normally a 16-bit operation, the x2 prefix causes it to be a 32-bit operation. And so, it adds the newly created right and left values of the scaled mono signal into the s1 signal. There are several variations of the above program that might be more suitable for a particular application. This function only handles a limited dynamic range of volume scaling factors, however, by changing the shift constant, or turning the shift into a parameter, the dynamic range can be increased significantly. Example 3 The third example shows how to convert a planar 4:2:0 video image into a packed 4:4:4 video image with an alpha channel. The first format is often referred to as I420 and the second as AYUV. For simplicity in the following discussion, we'll assume that the image dimensions are 640x480. The 4:2:0 subsampling means the input chroma planes are 320x240 (subsampled by 2 in each direction). These need to be upsampled to 640x480, then repacked with the input Y plane, with an added dummy alpha value. There are many ways to perform upsampling; the simplest is to duplicate each value horizontally and vertically. The result is low quality, but adequate for demonstration purposes. There are several choices for the Orc array size and dimensionality. Iterating vertically can be done in the C code or in the Orc code. If done in the Orc code, we would need to use an array size of 240 and have two separate arrays for the even and odd Y rows. If done in the C code, there is no such limitation. Horizontally, the story is different: we can use the loadupsdb opcode to duplicate each byte in the U and V arrays, so we can iterate over 640 array elements. It is also possible to iterate over 320 elements and duplicate the U and V elements using mergebw. There is a very slight speed advantage to iterating vertically in Orc, and for demonstration purposes, we will choose to use the loadupsdb opcode, thus we will be iterating over 320x240 elements. The code: .function convert_I420_AYUV .flags 2d .dest 4 d1 .dest 4 d2 .source 1 y1 .source 1 y2 .source 1 u .source 1 v .const 1 c255 255 .temp 2 uv .temp 2 ay .temp 1 tu .temp 1 tv loadupdb tu, u loadupdb tv, v mergebw uv, tu, tv mergebw ay, c255, y1 mergewl d1, ay, uv mergebw ay, c255, y2 mergewl d2, ay, uv A few things of note: The ".flags 2d" line is used to indicate that Orc should iterate over two dimensions, and generate a prototype that includes row strides for each array and a size parameter for the second dimension. Since we are working on two input Y lines and two output AYUV lines at a time, we need two source and destination arrays corresponding to the even and odd lines. The row strides for these are doubled compared to the normal 2-D array. The mergebw and mergewl opcodes join two 8-bit values into one 16-bit value (or 16-bit values into a 32-bit value) by concatinating them in memory order. Thus, to get AYUV in memory order, we merge AY and UV, and to get UV, we merge U and V. Since we're duplicating each U and V line, we use the same UV value for the even and odd output lines. The prototype that is generated is: void convert_I420_AYUV (orc_uint32 * d1, int d1_stride, orc_uint32 * d2, int d2_stride, const orc_uint8 * s1, int s1_stride, const orc_uint8 * s2, int s2_stride, const orc_uint8 * s3, int s3_stride, const orc_uint8 * s4, int s4_stride, int n, int m); The orcc tool unhelpfully changed the names of the parameters, however, the order is standard: first destinations, then sources, then parameters, then array sizes. Think of it like memcpy() or memset(). Calling the function: convert_I420_AYUV (output, 1280*4, output + 640, 1280 * 4, input_y, 1280, input_y + 640, 1280, input_u, 320, input_v, 320, 320, 240); orc-0.4.18/doc/Makefile.in0000664000175000017500000005402412206165327012135 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/version.entities.in $(top_srcdir)/gtk-doc.make subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = version.entities CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = orc # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = ../orc # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/orc/*.h CFILE_GLOB = $(top_srcdir)/orc/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h EXTRA_HFILES = # Header files to ignore when scanning. Use base file name, no paths # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = orc-stdint.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = building.xml concepts.xml opcode_table.xml opcodes.xml \ program.xml running.xml tutorial.xml table.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS = GTKDOC_LIBS = @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ pdf-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ $(srcdir)/pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): version.entities: $(top_builddir)/config.status $(srcdir)/version.entities.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi @touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) @cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) @cp version.entities $(srcdir)/xml/ @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/html @mkdir $(srcdir)/html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options=--path="$(srcdir)"; \ fi; \ cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) @touch html-build.stamp #### pdf #### pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building PDF' @-chmod -R u+w $(srcdir) @rm -rf $(srcdir)/$(DOC_MODULE).pdf @mkpdf_imgdirs=""; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \ fi; \ done; \ fi; \ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: @installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ mv -f $${installdir}/$(DOC_MODULE).devhelp \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl cp $(srcdir)/html/* $(distdir)/html -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/ -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += # Comment this out if you want your docs-status tested during 'make check' #TESTS_ENVIRONMENT = cd $(srcsrc) && #TESTS = $(GTKDOC_CHECK) -include $(top_srcdir)/git.mk update-www: rsync -a html/* cooker.entropywave.com:/srv/code.entropywave.com/www/documentation/orc update-tables: $(top_builddir)/testsuite/generate_xml_table $(top_builddir)/testsuite/generate_xml_table2 $(top_builddir)/testsuite/generate_xml_table >table.xml $(top_builddir)/testsuite/generate_xml_table2 >opcode_table.xml # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/doc/orc-docs.sgml0000664000175000017500000000333412177015514012462 00000000000000 %version-entities; ]> Orc Reference Manual for Orc-&ORC_VERSION;. The latest version of this documentation can be found on-line at http://code.entropywave.com/documentation/orc/. Overview Application API Extension API Code Generation Herein lie dragons orc-0.4.18/doc/html/0000775000175000017500000000000012206165374011111 500000000000000orc-0.4.18/doc/html/index.html0000664000175000017500000001123112206165374013024 00000000000000 Orc Reference Manual

for Orc-0.4.18. The latest version of this documentation can be found on-line at http://code.entropywave.com/documentation/orc/.


Overview
Building Orc and Applications That Use Orc — How to build Orc and applications using it.
Running Orc Applications — How to run applications using ORC.
Orc Concepts — High-level view of what Orc does.
Orc Tutorial — Getting started writing Orc code.
Application API
Orc — Library Initialization
OrcProgram — Creating and manipulating Orc programs
OrcCompiler — Compile Orc programs
OrcExecutor — Running Orc programs
Orc Program Syntax — Description of the Orc program syntax
Orc Opcodes — Description of Opcodes
Extension API
OrcDebug — Printing and formatting debug information
OrcOpcode — Operations
Utility functions — Orc utility functions
OrcRule — Creating rules for code generation
Code Generation
ARM — code generation for ARM
MMX — code generation for MMX
PowerPC — code generation for PowerPC
SSE — code generation for SSE
x86 — code generation for x86
Herein lie dragons
misc
orc-0.4.18/doc/html/orc-concepts.html0000664000175000017500000002435212206165374014324 00000000000000 Orc Concepts

Orc Concepts

Orc Concepts — High-level view of what Orc does.

Orc Concepts

Orc is a compiler for a simple assembly-like language. Unlike most compilers, Orc is primarily a library, which means that all its features can be controlled from any application that uses it. Also unlike most compilers, Orc creates code that can be immediately exectued by the application.

Orc is mainly useful for generating code that performs simple mathematical operations on continguous arrays. An example Orc function, translated to C, might look like:

      void function (int *dest, int *src1, int *src2, int n)
      {
        int i;
	for (i = 0; i < n; i++) {
	  dest[i] = (src1[i] + src2[i] + 1) >> 1;
	}
      }
    

Orc is primarily targetted toward generating code for vector CPU extensions such as SSE, Altivec, and NEON.

Possible usage patterns:

The application generates Orc code programmatically. Generate Orc programs programmatically at runtime, compile at runtime, and execute. This is what many of the Orc test programs do, and is the most flexible and well-developed method at this time. This requires depending on the Orc library at runtime.

The application developer uses Orc to produce assembly source code that is then compiled into the application. This requires the developer to have Orc installed at build time. The advantage of this method is no Orc dependency at runtime. Disadvantages are a more complex build process, potential for compiler incompatibilities with generated assembly source code, and any Orc improvements require the application to be recompiled.

The application developer writes Orc source files, and compiles them into Orc bytecode to be included in the application. At runtime, Orc compiles the bytecode into executable code. This has the advantage of being easily editable. This method is still somewhat experimental.

A wide variety of additional workflows are possible, although tools are not yet available to make it convenient.

Concepts

The OrcProgram is the primary object that applications use when using Orc to create code. It contains all the information related to what is essentially a function definition in C. Orc programs can be compiled into assembly source code, or directly into binary code that can be executed as part of the running process. On CPUs that are not supported, programs can also be executed via emulation. Orc programs can also be compiled into C source code.

A program contains one or more instructions and operates on one or more source and destination arrays, and may use scalar parameters. When compiled and executed, or emulated, the instructions define the operations performed on each source array member, and the results are placed in the destination array. Another way of thinking about it is that the compiler generates code that iterates over the destination array, calculating the value of each members based on the program instructions and the corresponding values in the source arrays and scalar parameters.

The form of programs is strictly limited so that they may be compiled into vector instructions effectively. It is anticipated that future versions of Orc will allow more complex programs.

The arrays that Orc programs operate on must be contiguous.

Some example operations are "addw" which adds two 16-bit integers, "convsbw" which converts a signed byte to a signed 16-bit integer, and "minul" which selects the lesser of two 32-bit unsigned integers. Orc only checks that the size of the operand matches the size of the variable. Thus, the compiler will not warn against using "minul" with signed 32-bit integers, because it does not know that the variables are signed or unsigned.

Orc has a main set of opcodes, that is, an OrcOpcodeSet, with the name "sys". These opcodes are always available. They cover most common arithmetic and conversion instructions for 8, 16, and 32-bit integers. There are two auxiliary libraries that provide additional opcode sets, the liborc-float library that contains the "float" opcode set for 32 and 64-bit floating point operations, and the liborc-pixel library containing the "pixel" opcode set for operations on 32-bit RGBA pixels.

Orc programs are compiled using the function orc_program_compile(). The compiled code will be targetted for the current processor, which is useful for compiling code that will be immediately executed. Compiling for other processor families or processor family variants, in order to produce assembly source code, can be accomplished using one of the orc_program_compile variants.

Once an Orc program is compiled, it can be executed by creating an OrcExecutor structure, linking it to the program to be executed, setting the arrays and parameters, and setting the iteration count. Orc executors are the equivalent of stack frames in a called function in normal C code. However, all Orc programs use the same OrcExecutor structure, which makes code that manipulates executors simpler in respect to those that manipulate stack frames. Executors can be reused.

An OrcTarget represents a particular instruction set or CPU family for which code can be generated. Current targets include MMX, SSE, Altivec, NEON, and ARM. There is also a special target that generates C source code, but is not capable of producing executable code at runtime. In most cases, the default target is the most appropriate target for the current CPU.

Individual Orc targets may have various options that control code generation for that target. For example, the various CPUs handled by the SSE target have different subsets of SSE instructions that are supported. The target flags for SSE enable generation of the different subsets of SSE instructions.

In order to produce target code, the Orc compiler finds an appropriate OrcRule to translate the instruction to target code. An OrcRuleSet is an array of rules that all have the required target flags, and a target may have one or more rule sets that can be enabled or disabled based on the target flags. In many cases, Orc instructions can be translated into one or two target instructions, which generates fast code. In other cases, the CPU indicated by the target and target flags does not have a fast method of performing the Orc instruction, and a slower method is chosen. This is indicated in the value returned by the compiling function call. In yet other cases, there is no implemented rule to translate an Orc instruction to target code, so compilation fails.

Compilation can fail for one of two main reasons. One reason is that the compiler was unable to parse the correct meaning, such as an unknown opcode, undeclared variable, or a size mismatch. These are uncorrectible errors, and the program cannot be executed or emulated. The other reason for a compilation failure is that target code could not be generated for a variety of reasons, including missing rules or unimplemented features. In this case, the program can be emulated. This process occurs automatically.

Emulation is generally slower than corresponding C code. Since the Orc compiler can produce C source code, it is possible to generate and compile backup C code for programs. This process is not yet automatic.

Extending Orc

Developers can extend Orc primarily by adding new opcode sets, adding new targets, and by adding new target rules.

Additional opcode sets can be created and registered in a manner similar to how the liborc-float and liborc-pixel libraries. In order to make full use of new opcode sets, one must also define rules for translating these opcodes into target code. The example libraries do this by registering rule sets for various targets (mainly SSE) for their opcode sets. Orc provides low-level API for generating target code. Not all possible target instructions can be generated with the target API, so developers may need to modify and add functions to the main Orc library as necessary to generate target code.

orc-0.4.18/doc/html/ch04.html0000664000175000017500000000424212206165374012457 00000000000000 Code Generation

Code Generation

ARM — code generation for ARM
MMX — code generation for MMX
PowerPC — code generation for PowerPC
SSE — code generation for SSE
x86 — code generation for x86
orc-0.4.18/doc/html/orc-ARM.html0000664000175000017500000006052112206165374013123 00000000000000 ARM

ARM

ARM — code generation for ARM

Synopsis

enum                OrcArmCond;
enum                OrcArmDP;
enum                OrcArmRegister;
void                orc_arm_do_fixups                   (OrcCompiler *compiler);
void                orc_arm_emit                        (OrcCompiler *compiler,
                                                         orc_uint32 insn);
void                orc_arm_emit_add                    (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int src2);
void                orc_arm_emit_add_imm                (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int value);
void                orc_arm_emit_branch                 (OrcCompiler *compiler,
                                                         int cond,
                                                         int label);
void                orc_arm_emit_bx_lr                  (OrcCompiler *compiler);
void                orc_arm_emit_cmp_imm                (OrcCompiler *compiler,
                                                         int src1,
                                                         int value);
void                orc_arm_emit_label                  (OrcCompiler *compiler,
                                                         int label);
void                orc_arm_emit_load_reg               (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int offset);
void                orc_arm_emit_mov                    (OrcCompiler *compiler,
                                                         int dest,
                                                         int src);
void                orc_arm_emit_pop                    (OrcCompiler *compiler,
                                                         int regs);
void                orc_arm_emit_push                   (OrcCompiler *compiler,
                                                         int regs);
void                orc_arm_emit_sub                    (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int src2);
void                orc_arm_emit_sub_imm                (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int value,
                                                         int record);
void                orc_arm_loadw                       (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int offset);
const char *        orc_arm_reg_name                    (int reg);
void                orc_arm_storew                      (OrcCompiler *compiler,
                                                         int dest,
                                                         int offset,
                                                         int src1);

Description

Details

enum OrcArmCond

typedef enum {
  ORC_ARM_COND_EQ = 0,
  ORC_ARM_COND_NE,
  ORC_ARM_COND_CS,
  ORC_ARM_COND_CC,
  ORC_ARM_COND_MI,
  ORC_ARM_COND_PL,
  ORC_ARM_COND_VS,
  ORC_ARM_COND_VC,
  ORC_ARM_COND_HI,
  ORC_ARM_COND_LS,
  ORC_ARM_COND_GE,
  ORC_ARM_COND_LT,
  ORC_ARM_COND_GT,
  ORC_ARM_COND_LE,
  ORC_ARM_COND_AL,
} OrcArmCond;


enum OrcArmDP

typedef enum {
  ORC_ARM_DP_AND = 0,
  ORC_ARM_DP_EOR,
  ORC_ARM_DP_SUB,
  ORC_ARM_DP_RSB,
  ORC_ARM_DP_ADD,
  ORC_ARM_DP_ADC,
  ORC_ARM_DP_SBC,
  ORC_ARM_DP_RSC,
  ORC_ARM_DP_TST,
  ORC_ARM_DP_TEQ,
  ORC_ARM_DP_CMP,
  ORC_ARM_DP_CMN,
  ORC_ARM_DP_ORR,
  ORC_ARM_DP_MOV,
  ORC_ARM_DP_BIC,
  ORC_ARM_DP_MVN
} OrcArmDP;


enum OrcArmRegister

typedef enum {
  ORC_ARM_A1 = ORC_GP_REG_BASE+0,
  ORC_ARM_A2,
  ORC_ARM_A3,
  ORC_ARM_A4,
  ORC_ARM_V1,
  ORC_ARM_V2,
  ORC_ARM_V3,
  ORC_ARM_V4,
  ORC_ARM_V5,
  ORC_ARM_V6,
  ORC_ARM_V7,
  ORC_ARM_V8,
  ORC_ARM_IP,
  ORC_ARM_SP,
  ORC_ARM_LR,
  ORC_ARM_PC
} OrcArmRegister;


orc_arm_do_fixups ()

void                orc_arm_do_fixups                   (OrcCompiler *compiler);


orc_arm_emit ()

void                orc_arm_emit                        (OrcCompiler *compiler,
                                                         orc_uint32 insn);


orc_arm_emit_add ()

void                orc_arm_emit_add                    (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int src2);


orc_arm_emit_add_imm ()

void                orc_arm_emit_add_imm                (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int value);


orc_arm_emit_branch ()

void                orc_arm_emit_branch                 (OrcCompiler *compiler,
                                                         int cond,
                                                         int label);


orc_arm_emit_bx_lr ()

void                orc_arm_emit_bx_lr                  (OrcCompiler *compiler);


orc_arm_emit_cmp_imm ()

void                orc_arm_emit_cmp_imm                (OrcCompiler *compiler,
                                                         int src1,
                                                         int value);


orc_arm_emit_label ()

void                orc_arm_emit_label                  (OrcCompiler *compiler,
                                                         int label);


orc_arm_emit_load_reg ()

void                orc_arm_emit_load_reg               (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int offset);


orc_arm_emit_mov ()

void                orc_arm_emit_mov                    (OrcCompiler *compiler,
                                                         int dest,
                                                         int src);


orc_arm_emit_pop ()

void                orc_arm_emit_pop                    (OrcCompiler *compiler,
                                                         int regs);


orc_arm_emit_push ()

void                orc_arm_emit_push                   (OrcCompiler *compiler,
                                                         int regs);


orc_arm_emit_sub ()

void                orc_arm_emit_sub                    (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int src2);


orc_arm_emit_sub_imm ()

void                orc_arm_emit_sub_imm                (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int value,
                                                         int record);


orc_arm_loadw ()

void                orc_arm_loadw                       (OrcCompiler *compiler,
                                                         int dest,
                                                         int src1,
                                                         int offset);


orc_arm_reg_name ()

const char *        orc_arm_reg_name                    (int reg);


orc_arm_storew ()

void                orc_arm_storew                      (OrcCompiler *compiler,
                                                         int dest,
                                                         int offset,
                                                         int src1);

orc-0.4.18/doc/html/orc-OrcCompiler.html0000664000175000017500000002221112206165374014714 00000000000000 OrcCompiler

OrcCompiler

OrcCompiler — Compile Orc programs

Synopsis

enum                OrcCompileResult;
                    OrcCompiler;
                    OrcConstant;
#define             ORC_COMPILER_ERROR                  (compiler,
                                                         ...)
#define             ORC_COMPILE_RESULT_IS_FATAL         (x)
#define             ORC_COMPILE_RESULT_IS_SUCCESSFUL    (x)
#define             ORC_ASM_CODE                        (compiler,
                                                         ...)
#define             ORC_ENABLE_ASM_CODE
void                orc_compiler_append_code            (OrcCompiler *p,
                                                         const char *fmt);
int                 orc_compiler_label_new              (OrcCompiler *compiler);

Description

OrcCompiler is the object used to convert Orc programs contained in an OrcProgram object into assembly code and object code.

The OrcCompileResult enum is used to indicate whether or not a compilation attempt was successful or not. The macros ORC_COMPILE_RESULT_IS_SUCCESSFUL() and ORC_COMPILE_RESULT_IS_FATAL() should be used instead of checking values directly.

When a program is compiled, the compiler calls the functions contained in various OrcRule structures. These functions generate assembly and object instructions by calling ORC_ASM_CODE() or functions that use ORC_ASM_CODE() internally.

Details

enum OrcCompileResult

typedef enum {
  ORC_COMPILE_RESULT_OK = 0,

  ORC_COMPILE_RESULT_UNKNOWN_COMPILE = 0x100,
  ORC_COMPILE_RESULT_MISSING_RULE = 0x101,

  ORC_COMPILE_RESULT_UNKNOWN_PARSE = 0x200,
  ORC_COMPILE_RESULT_PARSE = 0x201,
  ORC_COMPILE_RESULT_VARIABLE = 0x202
} OrcCompileResult;


OrcCompiler

typedef struct {
} OrcCompiler;

The OrcCompiler structure has no public members


OrcConstant

typedef struct {
} OrcConstant;

The OrcConstant structure has no public members


ORC_COMPILER_ERROR()

#define             ORC_COMPILER_ERROR(compiler, ...)


ORC_COMPILE_RESULT_IS_FATAL()

#define ORC_COMPILE_RESULT_IS_FATAL(x) ((x) >= 0x200)


ORC_COMPILE_RESULT_IS_SUCCESSFUL()

#define ORC_COMPILE_RESULT_IS_SUCCESSFUL(x) ((x) < 0x100)


ORC_ASM_CODE()

#define ORC_ASM_CODE(compiler,...) orc_compiler_append_code(compiler, __VA_ARGS__)


ORC_ENABLE_ASM_CODE

#define ORC_ENABLE_ASM_CODE


orc_compiler_append_code ()

void                orc_compiler_append_code            (OrcCompiler *p,
                                                         const char *fmt);

Generates a string using sprintf() on the given format and arguments, and appends that string to the generated assembly code for the compiler.

This function is used by the ORC_ASM_CODE() macro.

This function is useful in a function implementing an OrcRule or implementing a target.

p :

an OrcCompiler object

fmt :

a printf-style format string

orc_compiler_label_new ()

int                 orc_compiler_label_new              (OrcCompiler *compiler);

orc-0.4.18/doc/html/orc.devhelp20000664000175000017500000006231012206165374013251 00000000000000 orc-0.4.18/doc/html/orc-runninging.html0000664000175000017500000000562112206165374014662 00000000000000 Running Orc Applications

Running Orc Applications

Running Orc Applications — How to run applications using ORC.

Running Orc Applications

At runtime several environment variables can be used to control ORC.

ORC_DEBUG.  This environment variable can be set to a number indicating the level for debug logging. A value of 0 (default) results in no debug logging. The higher the value to more detail is logged.

ORC_CODE.  This variable can be set to a comma separated list of flags to control the code selection and execution. Supported values are: backup, emulate and debug. The value 'backup' would instruct ORC to select the C based backup functions. Selecting 'emulate' will run the ORC code through an interpreter. Using 'debug' enables debuggers such as gdb to create useful backtraces from ORC-generated code

ORC_CPU_FLAGS.  This environment variable can be used to manually specify cpu capabilities.

orc-0.4.18/doc/html/orc-OrcRule.html0000664000175000017500000001000612206165374014050 00000000000000 OrcRule

OrcRule

OrcRule — Creating rules for code generation

Synopsis

void                orc_rule_register                   (OrcRuleSet *rule_set,
                                                         const char *opcode_name,
                                                         OrcRuleEmitFunc emit,
                                                         void *emit_user);

Description

Details

orc_rule_register ()

void                orc_rule_register                   (OrcRuleSet *rule_set,
                                                         const char *opcode_name,
                                                         OrcRuleEmitFunc emit,
                                                         void *emit_user);

orc-0.4.18/doc/html/orc-misc.html0000664000175000017500000002336712206165374013446 00000000000000 misc

misc

misc

Synopsis

struct              OrcVariable;
                    OrcInstruction;
struct              OrcRule;
struct              OrcFixup;
void                (*OrcRuleEmitFunc)                  (OrcCompiler *p,
                                                         void *user,
                                                         OrcInstruction *insn);
#define             ORC_N_REGS
#define             ORC_N_INSNS
#define             ORC_N_VARIABLES
#define             ORC_N_REGISTERS
#define             ORC_N_FIXUPS
#define             ORC_N_LABELS
#define             ORC_GP_REG_BASE
#define             ORC_VEC_REG_BASE
enum                OrcVarType;
void                orc_powerpc_init                    (void);
void                orc_arm_init                        (void);
void                orc_c_init                          (void);
int                 orc_parse                           (const char *code,
                                                         OrcProgram ***programs);

Description

Details

struct OrcVariable

struct OrcVariable {
};

The OrcVariable structure has no public members


OrcInstruction

typedef struct {
} OrcInstruction;

The OrcInstruction structure has no public members


struct OrcRule

struct OrcRule {
};

The OrcRule structure has no public members


struct OrcFixup

struct OrcFixup {
};

The OrcFixup structure has no public members


OrcRuleEmitFunc ()

void                (*OrcRuleEmitFunc)                  (OrcCompiler *p,
                                                         void *user,
                                                         OrcInstruction *insn);


ORC_N_REGS

#define ORC_N_REGS (32*4)


ORC_N_INSNS

#define ORC_N_INSNS 100


ORC_N_VARIABLES

#define ORC_N_VARIABLES 64


ORC_N_REGISTERS

#define ORC_N_REGISTERS 20


ORC_N_FIXUPS

#define ORC_N_FIXUPS 100


ORC_N_LABELS

#define ORC_N_LABELS 40


ORC_GP_REG_BASE

#define ORC_GP_REG_BASE 32


ORC_VEC_REG_BASE

#define ORC_VEC_REG_BASE 64


enum OrcVarType

typedef enum {
  ORC_VAR_TYPE_TEMP,
  ORC_VAR_TYPE_SRC,
  ORC_VAR_TYPE_DEST,
  ORC_VAR_TYPE_CONST,
  ORC_VAR_TYPE_PARAM,
  ORC_VAR_TYPE_ACCUMULATOR
} OrcVarType;


orc_powerpc_init ()

void                orc_powerpc_init                    (void);


orc_arm_init ()

void                orc_arm_init                        (void);


orc_c_init ()

void                orc_c_init                          (void);


orc_parse ()

int                 orc_parse                           (const char *code,
                                                         OrcProgram ***programs);

orc-0.4.18/doc/html/orc-OrcExecutor.html0000664000175000017500000003623612206165374014754 00000000000000 OrcExecutor

OrcExecutor

OrcExecutor — Running Orc programs

Synopsis

struct              OrcExecutor;
OrcExecutor *       orc_executor_new                    (OrcProgram *program);
void                orc_executor_free                   (OrcExecutor *ex);
void                orc_executor_set_array              (OrcExecutor *ex,
                                                         int var,
                                                         void *ptr);
void                orc_executor_set_array_str          (OrcExecutor *ex,
                                                         const char *name,
                                                         void *ptr);
void                orc_executor_set_n                  (OrcExecutor *ex,
                                                         int n);
void                orc_executor_emulate                (OrcExecutor *ex);
void                orc_executor_run                    (OrcExecutor *ex);
int                 orc_executor_get_accumulator        (OrcExecutor *ex,
                                                         int var);
int                 orc_executor_get_accumulator_str    (OrcExecutor *ex,
                                                         const char *name);
void                orc_executor_set_param              (OrcExecutor *ex,
                                                         int var,
                                                         int value);
void                orc_executor_set_param_str          (OrcExecutor *ex,
                                                         const char *name,
                                                         int value);
void                orc_executor_set_program            (OrcExecutor *ex,
                                                         OrcProgram *program);

Description

Details

struct OrcExecutor

struct OrcExecutor {
};

orc_executor_new ()

OrcExecutor *       orc_executor_new                    (OrcProgram *program);


orc_executor_free ()

void                orc_executor_free                   (OrcExecutor *ex);


orc_executor_set_array ()

void                orc_executor_set_array              (OrcExecutor *ex,
                                                         int var,
                                                         void *ptr);


orc_executor_set_array_str ()

void                orc_executor_set_array_str          (OrcExecutor *ex,
                                                         const char *name,
                                                         void *ptr);


orc_executor_set_n ()

void                orc_executor_set_n                  (OrcExecutor *ex,
                                                         int n);


orc_executor_emulate ()

void                orc_executor_emulate                (OrcExecutor *ex);


orc_executor_run ()

void                orc_executor_run                    (OrcExecutor *ex);


orc_executor_get_accumulator ()

int                 orc_executor_get_accumulator        (OrcExecutor *ex,
                                                         int var);


orc_executor_get_accumulator_str ()

int                 orc_executor_get_accumulator_str    (OrcExecutor *ex,
                                                         const char *name);


orc_executor_set_param ()

void                orc_executor_set_param              (OrcExecutor *ex,
                                                         int var,
                                                         int value);


orc_executor_set_param_str ()

void                orc_executor_set_param_str          (OrcExecutor *ex,
                                                         const char *name,
                                                         int value);


orc_executor_set_program ()

void                orc_executor_set_program            (OrcExecutor *ex,
                                                         OrcProgram *program);

orc-0.4.18/doc/html/ch01.html0000664000175000017500000000431712206165374012457 00000000000000 Overview

Overview

Building Orc and Applications That Use Orc — How to build Orc and applications using it.
Running Orc Applications — How to run applications using ORC.
Orc Concepts — High-level view of what Orc does.
Orc Tutorial — Getting started writing Orc code.
orc-0.4.18/doc/html/ch05.html0000664000175000017500000000312312206165374012455 00000000000000 Herein lie dragons

Herein lie dragons

orc-0.4.18/doc/html/orc-opcodes.html0000664000175000017500000033115612206165374014145 00000000000000 Orc Opcodes

Orc Opcodes

Orc Opcodes — Description of Opcodes

Orc Opcodes

Opcodes only work with variables of a particular size. In the table below, destination and source indicate the size of the destination and source operands, in bytes. In general, opcodes have a suffix indicating the sizes, "b" for 1-byte operations, "w" for 2-byte operations, and "l" for 4-byte operations. If the source and destination have different sizes, the source size suffix is listed first, then the destination suffix. For example, converting a 1-byte variable to 2-byte can be performed using the "convsbw" opcode.

Signed, unsigned, and saturating operations are indicated by the letters "s", "u", and "s". If signed or unsigned is not indicated, it generally means that the signedness is not relevant to the definition of the opcode, and that the operation on signed or unsigned values will give the same result.

The "select" opcodes divide the bits in the source value into two halves. For "select0", the half that is first in memory order is selected, and the latter half for "select1". In other words, "convwb" is the same as "select0wb" on little-endian systems, and "select1wb" on big-endian systems.

The "merge" opcodes take two values and put them together in memory order.

Accumulating opcodes require an accumulator variable as the destination. Accumulating opcodes start with "acc". These opcodes sum the source values over the entire array, and can be read from the OrcExecutor structure after an execution of an Orc program.

Shift opcodes only work with constants or parameters as the second source value.

For more precise understanding of operations, it is recommended to compile a program for the C target and examine the resulting C source code.

Table 1. Table of Opcodes

opcode destination size source 1 size source 2 size description pseudo code
absb 1 1   absolute value (a < 0) ? -a : a
addb 1 1 1 add a + b
addssb 1 1 1 add with signed saturate clamp(a + b)
addusb 1 1 1 add with unsigned saturate clamp(a + b)
andb 1 1 1 bitwise AND a & b
andnb 1 1 1 bitwise AND NOT a & (~b)
avgsb 1 1 1 signed average (a + b + 1)>>1
avgub 1 1 1 unsigned average (a + b + 1)>>1
cmpeqb 1 1 1 compare equal (a == b) ? (~0) : 0
cmpgtsb 1 1 1 compare greater than (a > b) ? (~0) : 0
copyb 1 1   copy a
loadb 1 1   load from memory array[i]
loadoffb 1 1 4S load from memory with offset array[i+offset]
loadupdb 1 1   load upsampled duplicate array[i>>1]
loadupib 1 1   load upsampled interpolate (array[i>>1] + array[(i+1)>>1] + 1)>>1
loadpb 1 1   load parameter or constant scalar
ldresnearb 1 1 4S load, nearest neighbor resampled array[(b+c*i)>>8]
ldresnearl 4 4 4S load, nearest neighbor resampled array[(b+c*i)>>8]
ldreslinb 1 1 4S load, bilinear resampled special
ldreslinl 4 4 4S load, bilinear resampled special
maxsb 1 1 1 signed maximum (a > b) ? a : b
maxub 1 1 1 unsigned maximum (a > b) ? a : b
minsb 1 1 1 signed minimum (a < b) ? a : b
minub 1 1 1 unsigned minimum (a < b) ? a : b
mullb 1 1 1 low bits of multiply a * b
mulhsb 1 1 1 high bits of signed multiply (a * b) >> 8
mulhub 1 1 1 high bits of unsigned multiply (a * b) >> 8
orb 1 1 1 bitwise or a | b
shlb 1 1 1S shift left a << b
shrsb 1 1 1S signed shift right a >> b
shrub 1 1 1S unsigned shift right a >> b
signb 1 1   sign sign(a)
storeb 1 1   store to memory special
subb 1 1 1 subtract a - b
subssb 1 1 1 subtract with signed saturate clamp(a - b)
subusb 1 1 1 subtract with unsigned saturate clamp(a - b)
xorb 1 1 1 bitwise XOR a ^ b
absw 2 2   absolute value (a < 0) ? -a : a
addw 2 2 2 add a + b
addssw 2 2 2 add with signed saturate clamp(a + b)
addusw 2 2 2 add with unsigned saturate clamp(a + b)
andw 2 2 2 bitwise AND a & b
andnw 2 2 2 bitwise AND NOT a & (~b)
avgsw 2 2 2 signed average (a + b + 1)>>1
avguw 2 2 2 unsigned average (a + b + 1)>>1
cmpeqw 2 2 2 compare equal (a == b) ? (~0) : 0
cmpgtsw 2 2 2 compare greater than (a > b) ? (~0) : 0
copyw 2 2   copy a
div255w 2 2   divide by 255 a/255
divluw 2 2 2 saturated unsigned divide 16-bit by 8-bit clamp(a/(b & 255),0,255)
loadw 2 2   load from memory array[i]
loadoffw 2 2 4S load from memory with offset array[i+offset]
loadpw 2 2   load parameter or constant scalar
maxsw 2 2 2 signed maximum (a > b) ? a : b
maxuw 2 2 2 unsigned maximum (a > b) ? a : b
minsw 2 2 2 signed minimum (a < b) ? a : b
minuw 2 2 2 unsigned minimum (a < b) ? a : b
mullw 2 2 2 low bits of multiply a * b
mulhsw 2 2 2 high bits of signed multiply (a * b) >> 8
mulhuw 2 2 2 high bits of unsigned multiply (a * b) >> 8
orw 2 2 2 bitwise or a | b
shlw 2 2 2S shift left a << b
shrsw 2 2 2S signed shift right a >> b
shruw 2 2 2S unsigned shift right a >> b
signw 2 2   sign sign(a)
storew 2 2   store to memory special
subw 2 2 2 subtract a - b
subssw 2 2 2 subtract with signed saturate clamp(a - b)
subusw 2 2 2 subtract with unsigned saturate clamp(a - b)
xorw 2 2 2 bitwise XOR a ^ b
absl 4 4   absolute value (a < 0) ? -a : a
addl 4 4 4 add a + b
addssl 4 4 4 add with signed saturate clamp(a + b)
addusl 4 4 4 add with unsigned saturate clamp(a + b)
andl 4 4 4 bitwise AND a & b
andnl 4 4 4 bitwise AND NOT a & (~b)
avgsl 4 4 4 signed average (a + b + 1)>>1
avgul 4 4 4 unsigned average (a + b + 1)>>1
cmpeql 4 4 4 compare equal (a == b) ? (~0) : 0
cmpgtsl 4 4 4 compare greater than (a > b) ? (~0) : 0
copyl 4 4   copy a
loadl 4 4   load from memory array[i]
loadoffl 4 4 4S load from memory with offset array[i+offset]
loadpl 4 4   load parameter or constant scalar
maxsl 4 4 4 signed maximum (a > b) ? a : b
maxul 4 4 4 unsigned maximum (a > b) ? a : b
minsl 4 4 4 signed minimum (a < b) ? a : b
minul 4 4 4 unsigned minimum (a < b) ? a : b
mulll 4 4 4 low bits of multiply a * b
mulhsl 4 4 4 high bits of signed multiply (a * b) >> 16
mulhul 4 4 4 high bits of unsigned multiply (a * b) >> 16
orl 4 4 4 bitwise or a | b
shll 4 4 4S shift left a << b
shrsl 4 4 4S signed shift right a >> b
shrul 4 4 4S unsigned shift right a >> b
signl 4 4   sign sign(a)
storel 4 4   store to memory special
subl 4 4 4 subtract a - b
subssl 4 4 4 subtract with signed saturate clamp(a - b)
subusl 4 4 4 subtract with unsigned saturate clamp(a - b)
xorl 4 4 4 bitwise XOR a ^ b
loadq 8 8   load from memory array[i]
loadpq 8 8   load parameter or constant scalar
storeq 8 8   store to memory special
splatw3q 8 8   duplicates high 16-bits to lower 48 bits special
copyq 8 8      
cmpeqq 8 8 8    
cmpgtsq 8 8 8    
andq 8 8 8    
andnq 8 8 8    
orq 8 8 8    
xorq 8 8 8    
addq 8 8 8    
subq 8 8 8    
shlq 8 8 8S    
shrsq 8 8 8S    
shruq 8 8 8S    
convsbw 2 1   convert signed a
convubw 2 1   convert unsigned a
splatbw 2 1   duplicates 8 bits to both halfs of 16 bits special
splatbl 4 1   duplicates 8 bits to all parts of 32 bits special
convswl 4 2   convert signed a
convuwl 4 2   convert unsigned a
convslq 8 4   signed convert a
convulq 8 4   unsigned convert a
convwb 1 2   convert a
convhwb 1 2   shift and convert a>>8
convssswb 1 2   convert signed to signed with saturation clamp(a)
convsuswb 1 2   convert signed to unsigned with saturation clamp(a)
convusswb 1 2   convert unsigned to signed with saturation clamp(a)
convuuswb 1 2   convert unsigned to unsigned with saturation clamp(a)
convlw 2 4   convert a
convhlw 2 4   shift and convert a>>16
convssslw 2 4   convert signed to signed with saturation clamp(a)
convsuslw 2 4   convert signed to unsigned with saturation clamp(a)
convusslw 2 4   convert unsigned to signed with saturation clamp(a)
convuuslw 2 4   convert unsigned to unsigned with saturation clamp(a)
convql 4 8   convert a
convsssql 4 8   convert signed to signed with saturation clamp(a)
convsusql 4 8   convert signed to unsigned with saturation clamp(a)
convussql 4 8   convert unsigned to signed with saturation clamp(a)
convuusql 4 8   convert unsigned to unsigned with saturation clamp(a)
mulsbw 2 1 1 multiply signed a * b
mulubw 2 1 1 multiply unsigned a * b
mulswl 4 2 2 multiply signed a * b
muluwl 4 2 2 multiply unsigned a * b
mulslq 8 4 4    
mululq 8 4 4    
accw 2 2   accumulate += a
accl 4 4   accumulate += a
accsadubl 4 1 1 accumulate absolute difference += abs(a - b)
swapw 2 2   endianness swap special
swapl 4 4   endianness swap special
swapwl 4 4      
swapq 8 8      
swaplq 8 8      
select0wb 1 2   select first half special
select1wb 1 2   select second half special
select0lw 2 4   select first half special
select1lw 2 4   select second half special
select0ql 4 8      
select1ql 4 8      
mergelq 8 4 4    
mergewl 4 2 2 merge halves special
mergebw 2 1 1 merge halves special
splitql 4 8      
splitlw 2 4   split first/second words special
splitwb 1 2   split first/second bytes special
addf 4 4 4 add a + b
subf 4 4 4 subtract a - b
mulf 4 4 4 multiply a * b
divf 4 4 4 divide a / b
sqrtf 4 4   square root sqrt(a)
maxf 4 4 4 maximum max(a,b)
minf 4 4 4 minimum min(a,b)
cmpeqf 4 4 4 compare equal (a == b) ? (~0) : 0
cmpltf 4 4 4 compare less than (a == b) ? (~0) : 0
cmplef 4 4 4 compare less than or equal (a == b) ? (~0) : 0
convfl 4 4   convert float point to integer a
convlf 4 4   convert integer to floating point a
addd 8 8 8    
subd 8 8 8    
muld 8 8 8    
divd 8 8 8    
sqrtd 8 8      
maxd 8 8 8    
mind 8 8 8    
cmpeqd 8 8 8    
cmpltd 8 8 8    
cmpled 8 8 8    
convdl 4 8      
convld 8 4      
convfd 8 4      
convdf 4 8      

In the pseudo code of the above table, abs() indicates absolute value, clamp() indicates that any values outside the destination range are set to the nearest value in the destination range, and sign() evaluates to -1 for values less than 0, 1 for values greater than 0, and 0 for 0.

Rule Coverage

The values for shift operations are not correct in this table.

Table 2. Table of Opcode Rule Coverage

opcode name sse mmx altivec arm neon c64x-c
absb yes yes yes no yes no
addb yes yes yes no yes no
addssb yes yes yes no yes no
addusb yes yes yes no yes no
andb yes yes yes yes yes no
andnb yes yes yes yes yes no
avgsb yes yes yes yes yes no
avgub yes yes yes yes yes no
cmpeqb yes yes yes yes yes no
cmpgtsb yes yes yes yes yes no
copyb yes yes yes yes yes no
loadb yes yes yes yes yes no
loadoffb yes yes no no yes no
loadupdb yes yes no no no no
loadupib yes yes no no no no
loadpb yes yes yes yes yes no
ldresnearb no no no no no no
ldresnearl yes yes no no no no
ldreslinb no no no no no no
ldreslinl yes yes no no no no
maxsb yes yes yes no yes no
maxub yes yes yes no yes no
minsb yes yes yes no yes no
minub yes yes yes no yes no
mullb yes yes yes no yes no
mulhsb yes yes yes no yes no
mulhub yes yes yes no yes no
orb yes yes yes yes yes no
shlb yes yes yes yes yes no
shrsb yes yes yes no yes no
shrub yes yes yes no yes no
signb yes yes yes no yes no
storeb yes yes yes yes yes no
subb yes yes yes no yes no
subssb yes yes yes no yes no
subusb yes yes yes no yes no
xorb yes yes yes yes yes no
absw yes yes yes no yes no
addw yes yes yes no yes no
addssw yes yes yes no yes no
addusw yes yes yes no yes no
andw yes yes yes yes yes no
andnw yes yes yes yes yes no
avgsw yes yes yes no yes no
avguw yes yes yes yes yes no
cmpeqw yes yes yes yes yes no
cmpgtsw yes yes yes yes yes no
copyw yes yes yes yes yes no
div255w yes yes yes no yes no
divluw yes yes no no no no
loadw yes yes yes yes yes no
loadoffw yes yes no no yes no
loadpw yes yes yes yes yes no
maxsw yes yes yes no yes no
maxuw yes yes yes no yes no
minsw yes yes yes no yes no
minuw yes yes yes no yes no
mullw yes yes yes yes yes no
mulhsw yes yes yes yes yes no
mulhuw yes yes yes no yes no
orw yes yes yes yes yes no
shlw yes yes yes yes yes no
shrsw yes yes yes no yes no
shruw yes yes yes yes yes no
signw yes yes yes no yes no
storew yes yes yes yes yes no
subw yes yes yes no yes no
subssw yes yes yes no yes no
subusw yes yes yes no yes no
xorw yes yes yes yes yes no
absl yes yes yes no yes no
addl yes yes yes yes yes no
addssl yes yes yes yes yes no
addusl yes yes yes yes yes no
andl yes yes yes yes yes no
andnl yes yes yes yes yes no
avgsl yes yes yes no yes no
avgul yes yes yes no yes no
cmpeql yes yes yes yes yes no
cmpgtsl yes yes yes yes yes no
copyl yes yes yes yes yes no
loadl yes yes yes yes yes no
loadoffl yes yes no no yes no
loadpl yes yes yes yes yes no
maxsl yes yes yes yes yes no
maxul yes yes yes yes yes no
minsl yes yes yes yes yes no
minul yes yes yes yes yes no
mulll yes no no yes yes no
mulhsl yes no no yes yes no
mulhul yes no no no yes no
orl yes yes yes yes yes no
shll yes yes yes yes yes no
shrsl yes yes yes yes yes no
shrul yes yes yes yes yes no
signl yes yes yes no yes no
storel yes yes yes yes yes no
subl yes yes yes yes yes no
subssl yes yes yes no yes no
subusl yes yes yes yes yes no
xorl yes yes yes yes yes no
loadq yes yes yes no yes no
loadpq yes yes no no no no
storeq yes yes yes no yes no
splatw3q yes yes yes no yes no
copyq yes yes no no yes no
cmpeqq no no no no no no
cmpgtsq no no no no no no
andq yes yes no no yes no
andnq yes yes no no yes no
orq yes yes no no yes no
xorq yes yes no no yes no
addq yes no no no yes no
subq yes no no no yes no
shlq yes yes no no no no
shrsq yes yes no no no no
shruq yes yes no no no no
convsbw yes yes yes yes yes no
convubw yes yes yes no yes no
splatbw yes yes yes no yes no
splatbl yes yes yes no yes no
convswl yes yes yes no yes no
convuwl yes yes yes no yes no
convslq yes yes yes no yes no
convulq yes yes yes no yes no
convwb yes yes yes yes yes no
convhwb yes yes yes no yes no
convssswb yes yes yes no yes no
convsuswb yes yes yes no yes no
convusswb no no no no no no
convuuswb yes yes yes no yes no
convlw yes yes yes yes yes no
convhlw yes yes yes no yes no
convssslw yes yes yes no yes no
convsuslw no no yes no yes no
convusslw no no no no no no
convuuslw no no yes no yes no
convql yes yes yes no yes no
convsssql no no no no yes no
convsusql no no no no yes no
convussql no no no no no no
convuusql no no no no yes no
mulsbw yes yes yes yes yes no
mulubw yes yes yes no yes no
mulswl yes yes yes no yes no
muluwl yes yes yes no yes no
mulslq no no no no no no
mululq yes no no no no no
accw yes yes no no yes no
accl yes yes yes no yes no
accsadubl yes yes no no yes no
swapw yes yes yes no yes no
swapl yes yes yes no yes no
swapwl yes yes no no yes no
swapq yes yes no no yes no
swaplq yes yes no no yes no
select0wb yes yes yes yes yes no
select1wb yes yes yes yes yes no
select0lw yes yes yes yes yes no
select1lw yes yes yes yes yes no
select0ql yes yes no no yes no
select1ql yes yes no no no no
mergelq yes yes no no yes no
mergewl yes yes yes yes yes no
mergebw yes yes yes no yes no
splitql yes yes no no yes no
splitlw yes yes yes no yes no
splitwb yes yes yes no yes no
addf yes no yes no yes no
subf yes no yes no yes no
mulf yes no yes no yes no
divf yes no no no yes no
sqrtf yes no no no yes no
maxf yes no yes no yes no
minf yes no yes no yes no
cmpeqf yes no yes no yes no
cmpltf yes no yes no no no
cmplef yes no yes no no no
convfl yes no yes no yes no
convlf yes no yes no yes no
addd yes no no no yes no
subd yes no no no yes no
muld yes no no no yes no
divd yes no no no yes no
sqrtd yes no no no no no
maxd yes no no no no no
mind yes no no no no no
cmpeqd yes no no no no no
cmpltd yes no no no no no
cmpled yes no no no no no
convdl yes no no no no no
convld yes no no no no no
convfd yes no no no no no
convdf yes no no no no no

orc-0.4.18/doc/html/orc-OrcProgram.html0000664000175000017500000014065212206165374014563 00000000000000 OrcProgram

OrcProgram

OrcProgram — Creating and manipulating Orc programs

Synopsis

                    OrcProgram;
#define             ORC_N_CONSTANTS
#define             ORC_N_RULE_SETS
#define             ORC_N_TARGETS
#define             ORC_PROGRAM_ERROR                   (program,
                                                         ...)
OrcProgram *        orc_program_new                     (void);
OrcProgram *        orc_program_new_dss                 (int size1,
                                                         int size2,
                                                         int size3);
OrcProgram *        orc_program_new_as                  (int size1,
                                                         int size2);
OrcProgram *        orc_program_new_ass                 (int size1,
                                                         int size2,
                                                         int size3);
OrcProgram *        orc_program_new_ds                  (int size1,
                                                         int size2);
void                orc_program_free                    (OrcProgram *program);
const char *        orc_program_get_name                (OrcProgram *program);
void                orc_program_set_name                (OrcProgram *program,
                                                         const char *name);
int                 orc_program_add_temporary           (OrcProgram *program,
                                                         int size,
                                                         const char *name);
int                 orc_program_add_source              (OrcProgram *program,
                                                         int size,
                                                         const char *name);
int                 orc_program_add_destination         (OrcProgram *program,
                                                         int size,
                                                         const char *name);
int                 orc_program_add_constant            (OrcProgram *program,
                                                         int size,
                                                         int value,
                                                         const char *name);
int                 orc_program_add_accumulator         (OrcProgram *program,
                                                         int size,
                                                         const char *name);
int                 orc_program_add_parameter           (OrcProgram *program,
                                                         int size,
                                                         const char *name);
void                orc_program_append                  (OrcProgram *p,
                                                         const char *opcode,
                                                         int arg0,
                                                         int arg1,
                                                         int arg2);
void                orc_program_append_str              (OrcProgram *p,
                                                         const char *opcode,
                                                         const char *arg0,
                                                         const char *arg1,
                                                         const char *arg2);
void                orc_program_append_ds               (OrcProgram *program,
                                                         const char *opcode,
                                                         int arg0,
                                                         int arg1);
void                orc_program_append_ds_str           (OrcProgram *p,
                                                         const char *opcode,
                                                         const char *arg0,
                                                         const char *arg1);
OrcCompileResult    orc_program_compile                 (OrcProgram *p);
OrcCompileResult    orc_program_compile_for_target      (OrcProgram *p,
                                                         OrcTarget *target);
OrcCompileResult    orc_program_compile_full            (OrcProgram *p,
                                                         OrcTarget *target,
                                                         unsigned int flags);
const char *        orc_program_get_asm_code            (OrcProgram *program);

int                 orc_program_find_var_by_name        (OrcProgram *program,
                                                         const char *name);
int                 orc_program_allocate_register       (OrcProgram *program,
                                                         int is_data);
int                 orc_program_dup_temporary           (OrcProgram *program,
                                                         int i,
                                                         int j);

Description

Details

OrcProgram

typedef struct {
} OrcProgram;

The OrcProgram structure has no public members


ORC_N_CONSTANTS

#define ORC_N_CONSTANTS 20


ORC_N_RULE_SETS

#define ORC_N_RULE_SETS 10


ORC_N_TARGETS

#define ORC_N_TARGETS 10


ORC_PROGRAM_ERROR()

#define             ORC_PROGRAM_ERROR(program, ...)


orc_program_new ()

OrcProgram *        orc_program_new                     (void);

Create a new OrcProgram. The program should be freed using orc_program_free().

Returns :

a pointer to an OrcProgram structure

orc_program_new_dss ()

OrcProgram *        orc_program_new_dss                 (int size1,
                                                         int size2,
                                                         int size3);

Create a new OrcProgram, with a destination named "d1" and two sources named "s1" and "s2".

size1 :

size of destination array members

size2 :

size of first source array members

size3 :

size of second source array members

Returns :

a pointer to an OrcProgram structure

orc_program_new_as ()

OrcProgram *        orc_program_new_as                  (int size1,
                                                         int size2);

Create a new OrcProgram, with an accumulator named "a1" and one source named "s1".

size1 :

size of destination array members

size2 :

size of source array members

Returns :

a pointer to an OrcProgram structure

orc_program_new_ass ()

OrcProgram *        orc_program_new_ass                 (int size1,
                                                         int size2,
                                                         int size3);

Create a new OrcProgram, with an accumulator named "a1" and two source named "s1" and "s2".

size1 :

size of destination array members

size2 :

size of first source array members

size3 :

size of second source array members

Returns :

a pointer to an OrcProgram structure

orc_program_new_ds ()

OrcProgram *        orc_program_new_ds                  (int size1,
                                                         int size2);

Create a new OrcProgram, with a destination named "d1" and one source named "s1".

size1 :

size of destination array members

size2 :

size of source array members

Returns :

a pointer to an OrcProgram structure

orc_program_free ()

void                orc_program_free                    (OrcProgram *program);

Frees an OrcProgram.

program :

a pointer to an OrcProgram structure

orc_program_get_name ()

const char *        orc_program_get_name                (OrcProgram *program);

Gets the name of the program. The string is valid until the name is changed or the program is freed.

program :

a pointer to an OrcProgram structure

Returns :

a character string

orc_program_set_name ()

void                orc_program_set_name                (OrcProgram *program,
                                                         const char *name);

Sets the name of the program. The string is copied.

program :

a pointer to an OrcProgram structure

name :

string to set the name to

orc_program_add_temporary ()

int                 orc_program_add_temporary           (OrcProgram *program,
                                                         int size,
                                                         const char *name);

Creates a new variable holding temporary values.

program :

a pointer to an OrcProgram structure

size :

size of data values

name :

name of variable

Returns :

the index of the new variable

orc_program_add_source ()

int                 orc_program_add_source              (OrcProgram *program,
                                                         int size,
                                                         const char *name);

Creates a new variable representing a source array.

program :

a pointer to an OrcProgram structure

size :

size of data values

name :

name of variable

Returns :

the index of the new variable

orc_program_add_destination ()

int                 orc_program_add_destination         (OrcProgram *program,
                                                         int size,
                                                         const char *name);

Creates a new variable representing a destination array.

program :

a pointer to an OrcProgram structure

size :

size of data values

name :

name of variable

Returns :

the index of the new variable

orc_program_add_constant ()

int                 orc_program_add_constant            (OrcProgram *program,
                                                         int size,
                                                         int value,
                                                         const char *name);

Creates a new variable representing a constant value.

program :

a pointer to an OrcProgram structure

size :

size of data value

value :

the value

name :

name of variable

Returns :

the index of the new variable

orc_program_add_accumulator ()

int                 orc_program_add_accumulator         (OrcProgram *program,
                                                         int size,
                                                         const char *name);

Creates a new variable representing an accumulator.

program :

a pointer to an OrcProgram structure

size :

size of data value

name :

name of variable

Returns :

the index of the new variable

orc_program_add_parameter ()

int                 orc_program_add_parameter           (OrcProgram *program,
                                                         int size,
                                                         const char *name);

Creates a new variable representing a scalar parameter.

program :

a pointer to an OrcProgram structure

size :

size of data value

name :

name of variable

Returns :

the index of the new variable

orc_program_append ()

void                orc_program_append                  (OrcProgram *p,
                                                         const char *opcode,
                                                         int arg0,
                                                         int arg1,
                                                         int arg2);


orc_program_append_str ()

void                orc_program_append_str              (OrcProgram *p,
                                                         const char *opcode,
                                                         const char *arg0,
                                                         const char *arg1,
                                                         const char *arg2);

Appends an instruction to the program, with arguments arg0, arg1, and arg2. The instruction must take 3 operands.

arg0 :

name of first variable

arg1 :

name of second variable

arg2 :

name of third variable

orc_program_append_ds ()

void                orc_program_append_ds               (OrcProgram *program,
                                                         const char *opcode,
                                                         int arg0,
                                                         int arg1);

Appends an instruction to the program, with arguments arg0, arg1, and arg2. The instruction must take 3 operands.

program :

a pointer to an OrcProgram structure

arg0 :

index of first variable

arg1 :

index of second variable

orc_program_append_ds_str ()

void                orc_program_append_ds_str           (OrcProgram *p,
                                                         const char *opcode,
                                                         const char *arg0,
                                                         const char *arg1);

Appends an instruction to the program, with arguments arg0 and arg2. The instruction must take 2 operands.

arg0 :

name of first variable

arg1 :

name of second variable

orc_program_compile ()

OrcCompileResult    orc_program_compile                 (OrcProgram *p);

Compiles an Orc program for the current CPU. If successful, executable code for the program was generated and can be executed.

The return value indicates various levels of success or failure. Success can be determined by checking for a true value of the macro ORC_COMPILE_RESULT_IS_SUCCESSFUL() on the return value. This indicates that executable code was generated. If the macro ORC_COMPILE_RESULT_IS_FATAL() on the return value evaluates to true, then there was a syntactical error in the program. If the result is neither successful nor fatal, the program can still be emulated.

Returns :

an OrcCompileResult

orc_program_compile_for_target ()

OrcCompileResult    orc_program_compile_for_target      (OrcProgram *p,
                                                         OrcTarget *target);

Compiles an Orc program for the given target, using the default target flags for that target.

Returns :

an OrcCompileResult

orc_program_compile_full ()

OrcCompileResult    orc_program_compile_full            (OrcProgram *p,
                                                         OrcTarget *target,
                                                         unsigned int flags);

Compiles an Orc program for the given target, using the given target flags.

Returns :

an OrcCompileResult

orc_program_get_asm_code ()

const char *        orc_program_get_asm_code            (OrcProgram *program);

Returns a character string containing the assembly code created by compiling the program. This string is valid until the program is compiled again or the program is freed.

program :

a pointer to an OrcProgram structure

Returns :

a character string

orc_program_find_var_by_name ()

int                 orc_program_find_var_by_name        (OrcProgram *program,
                                                         const char *name);

Finds the variable with the name name. If no variable with the given name exists in the program, -1 is returned.

program :

a pointer to an OrcProgram structure

name :

name of instruction

Returns :

the index of the variable

orc_program_allocate_register ()

int                 orc_program_allocate_register       (OrcProgram *program,
                                                         int is_data);


orc_program_dup_temporary ()

int                 orc_program_dup_temporary           (OrcProgram *program,
                                                         int i,
                                                         int j);

Internal function.

program :

a pointer to an OrcProgram structure

j :

index

Returns :

the index of the new variable
orc-0.4.18/doc/html/orc-PowerPC.html0000664000175000017500000007131212206165374014023 00000000000000 PowerPC

PowerPC

PowerPC — code generation for PowerPC

Synopsis

const char *        powerpc_get_regname                 (int i);
int                 powerpc_regnum                      (int i);
void                powerpc_add_fixup                   (OrcCompiler *compiler,
                                                         int type,
                                                         unsigned char *ptr,
                                                         int label);
void                powerpc_do_fixups                   (OrcCompiler *compiler);
void                powerpc_emit                        (OrcCompiler *compiler,
                                                         unsigned int insn);
void                powerpc_emit_655510                 (OrcCompiler *compiler,
                                                         int major,
                                                         int d,
                                                         int a,
                                                         int b,
                                                         int minor);
void                powerpc_emit_VA                     (OrcCompiler *compiler,
                                                         const char *name,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b,
                                                         int c);
void                powerpc_emit_VX                     (OrcCompiler *compiler,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b);
void                powerpc_emit_VX_2                   (OrcCompiler *p,
                                                         const char *name,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b);
void                powerpc_emit_X                      (OrcCompiler *compiler,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b);
void                powerpc_emit_addi                   (OrcCompiler *compiler,
                                                         int regd,
                                                         int rega,
                                                         int imm);
void                powerpc_emit_b                      (OrcCompiler *compiler,
                                                         int label);
void                powerpc_emit_beq                    (OrcCompiler *compiler,
                                                         int label);
void                powerpc_emit_bne                    (OrcCompiler *compiler,
                                                         int label);
void                powerpc_emit_label                  (OrcCompiler *compiler,
                                                         int label);
void                powerpc_emit_lwz                    (OrcCompiler *compiler,
                                                         int regd,
                                                         int rega,
                                                         int imm);
void                powerpc_emit_ret                    (OrcCompiler *compiler);
void                powerpc_emit_srawi                  (OrcCompiler *compiler,
                                                         int regd,
                                                         int rega,
                                                         int shift,
                                                         int record);
void                powerpc_emit_stwu                   (OrcCompiler *compiler,
                                                         int regs,
                                                         int rega,
                                                         int offset);
int                 powerpc_get_constant                (OrcCompiler *p,
                                                         int type,
                                                         int value);

Description

Details

powerpc_get_regname ()

const char *        powerpc_get_regname                 (int i);


powerpc_regnum ()

int                 powerpc_regnum                      (int i);


powerpc_add_fixup ()

void                powerpc_add_fixup                   (OrcCompiler *compiler,
                                                         int type,
                                                         unsigned char *ptr,
                                                         int label);


powerpc_do_fixups ()

void                powerpc_do_fixups                   (OrcCompiler *compiler);


powerpc_emit ()

void                powerpc_emit                        (OrcCompiler *compiler,
                                                         unsigned int insn);


powerpc_emit_655510 ()

void                powerpc_emit_655510                 (OrcCompiler *compiler,
                                                         int major,
                                                         int d,
                                                         int a,
                                                         int b,
                                                         int minor);


powerpc_emit_VA ()

void                powerpc_emit_VA                     (OrcCompiler *compiler,
                                                         const char *name,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b,
                                                         int c);


powerpc_emit_VX ()

void                powerpc_emit_VX                     (OrcCompiler *compiler,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b);


powerpc_emit_VX_2 ()

void                powerpc_emit_VX_2                   (OrcCompiler *p,
                                                         const char *name,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b);


powerpc_emit_X ()

void                powerpc_emit_X                      (OrcCompiler *compiler,
                                                         unsigned int insn,
                                                         int d,
                                                         int a,
                                                         int b);


powerpc_emit_addi ()

void                powerpc_emit_addi                   (OrcCompiler *compiler,
                                                         int regd,
                                                         int rega,
                                                         int imm);


powerpc_emit_b ()

void                powerpc_emit_b                      (OrcCompiler *compiler,
                                                         int label);


powerpc_emit_beq ()

void                powerpc_emit_beq                    (OrcCompiler *compiler,
                                                         int label);


powerpc_emit_bne ()

void                powerpc_emit_bne                    (OrcCompiler *compiler,
                                                         int label);


powerpc_emit_label ()

void                powerpc_emit_label                  (OrcCompiler *compiler,
                                                         int label);


powerpc_emit_lwz ()

void                powerpc_emit_lwz                    (OrcCompiler *compiler,
                                                         int regd,
                                                         int rega,
                                                         int imm);


powerpc_emit_ret ()

void                powerpc_emit_ret                    (OrcCompiler *compiler);


powerpc_emit_srawi ()

void                powerpc_emit_srawi                  (OrcCompiler *compiler,
                                                         int regd,
                                                         int rega,
                                                         int shift,
                                                         int record);


powerpc_emit_stwu ()

void                powerpc_emit_stwu                   (OrcCompiler *compiler,
                                                         int regs,
                                                         int rega,
                                                         int offset);


powerpc_get_constant ()

int                 powerpc_get_constant                (OrcCompiler *p,
                                                         int type,
                                                         int value);

orc-0.4.18/doc/html/orc-x86.html0000664000175000017500000013564412206165374013142 00000000000000 x86

x86

x86 — code generation for x86

Synopsis

#define             orc_x86_emit_add_imm_memoffset      (p,
                                                         size,
                                                         value,
                                                         offset,
                                                         reg)
void                orc_x86_emit_add_imm_reg            (OrcCompiler *compiler,
                                                         int size,
                                                         int value,
                                                         int reg,
                                                         orc_bool record);
#define             orc_x86_emit_add_reg_memoffset      (p,
                                                         size,
                                                         src,
                                                         offset,
                                                         dest)
#define             orc_x86_emit_align                  (p,
                                                         align_shift)
#define             orc_x86_emit_and_imm_memoffset      (p,
                                                         size,
                                                         value,
                                                         offset,
                                                         reg)
#define             orc_x86_emit_and_imm_reg            (p,
                                                         size,
                                                         value,
                                                         reg)
void                orc_x86_emit_cmp_imm_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int value,
                                                         int offset,
                                                         int reg);
#define             orc_x86_emit_cmp_reg_memoffset      (p,
                                                         size,
                                                         src,
                                                         offset,
                                                         dest)
void                orc_x86_emit_dec_memoffset          (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg);
#define             orc_x86_emit_emms                   (p)
void                orc_x86_emit_epilogue               (OrcCompiler *compiler);
#define             orc_x86_emit_je                     (p,
                                                         label)
#define             orc_x86_emit_jle                    (p,
                                                         label)
#define             orc_x86_emit_jmp                    (p,
                                                         label)
#define             orc_x86_emit_jne                    (p,
                                                         label)
#define             orc_x86_emit_label                  (p,
                                                         label)
void                orc_x86_emit_modrm_memoffset        (OrcCompiler *compiler,
                                                         int offset,
                                                         int reg1,
                                                         int reg2);
void                orc_x86_emit_modrm_reg              (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);
#define             orc_x86_emit_mov_imm_reg            (p,
                                                         size,
                                                         value,
                                                         reg)
void                orc_x86_emit_mov_memoffset_mmx      (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg1,
                                                         int reg2,
                                                         int is_aligned);
void                orc_x86_emit_mov_memoffset_reg      (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg1,
                                                         int reg2);
void                orc_x86_emit_mov_memoffset_sse      (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg1,
                                                         int reg2,
                                                         int is_aligned);
void                orc_x86_emit_mov_mmx_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int offset,
                                                         int reg2,
                                                         int aligned,
                                                         int uncached);
void                orc_x86_emit_mov_mmx_reg            (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);
void                orc_x86_emit_mov_mmx_reg_reg        (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);
void                orc_x86_emit_mov_reg_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int offset,
                                                         int reg2);
void                orc_x86_emit_mov_reg_mmx            (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);
#define             orc_x86_emit_mov_reg_reg            (p,
                                                         size,
                                                         src,
                                                         dest)
void                orc_x86_emit_mov_sse_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int offset,
                                                         int reg2,
                                                         int aligned,
                                                         int uncached);
void                orc_x86_emit_pop                    (OrcCompiler *compiler,
                                                         int size,
                                                         int reg);
void                orc_x86_emit_prologue               (OrcCompiler *compiler);
void                orc_x86_emit_push                   (OrcCompiler *compiler,
                                                         int size,
                                                         int reg);
#define             orc_x86_emit_ret                    (p)
void                orc_x86_emit_rex                    (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int reg2,
                                                         int reg3);
#define             orc_x86_emit_sar_imm_reg            (p,
                                                         size,
                                                         value,
                                                         reg)
#define             orc_x86_emit_sub_memoffset_reg      (p,
                                                         size,
                                                         offset,
                                                         src,
                                                         dest)
#define             orc_x86_emit_sub_reg_reg            (p,
                                                         size,
                                                         src,
                                                         dest)
#define             orc_x86_emit_test_reg_reg           (p,
                                                         size,
                                                         src,
                                                         dest)
const char *        orc_x86_get_regname                 (int i);
const char *        orc_x86_get_regname_16              (int i);
const char *        orc_x86_get_regname_64              (int i);
const char *        orc_x86_get_regname_mmx             (int i);
const char *        orc_x86_get_regname_ptr             (OrcCompiler *compiler,
                                                         int i);
const char *        orc_x86_get_regname_sse             (int i);
int                 orc_x86_get_regnum                  (int i);
void                orc_x86_do_fixups                   (OrcCompiler *compiler);

Description

Details

orc_x86_emit_add_imm_memoffset()

#define             orc_x86_emit_add_imm_memoffset(p,size,value,offset,reg)


orc_x86_emit_add_imm_reg ()

void                orc_x86_emit_add_imm_reg            (OrcCompiler *compiler,
                                                         int size,
                                                         int value,
                                                         int reg,
                                                         orc_bool record);


orc_x86_emit_add_reg_memoffset()

#define             orc_x86_emit_add_reg_memoffset(p,size,src,offset,dest)


orc_x86_emit_align()

#define             orc_x86_emit_align(p,align_shift)


orc_x86_emit_and_imm_memoffset()

#define             orc_x86_emit_and_imm_memoffset(p,size,value,offset,reg)


orc_x86_emit_and_imm_reg()

#define             orc_x86_emit_and_imm_reg(p,size,value,reg)


orc_x86_emit_cmp_imm_memoffset ()

void                orc_x86_emit_cmp_imm_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int value,
                                                         int offset,
                                                         int reg);


orc_x86_emit_cmp_reg_memoffset()

#define             orc_x86_emit_cmp_reg_memoffset(p,size,src,offset,dest)


orc_x86_emit_dec_memoffset ()

void                orc_x86_emit_dec_memoffset          (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg);


orc_x86_emit_emms()

#define             orc_x86_emit_emms(p)


orc_x86_emit_epilogue ()

void                orc_x86_emit_epilogue               (OrcCompiler *compiler);


orc_x86_emit_je()

#define             orc_x86_emit_je(p,label)


orc_x86_emit_jle()

#define             orc_x86_emit_jle(p,label)


orc_x86_emit_jmp()

#define             orc_x86_emit_jmp(p,label)


orc_x86_emit_jne()

#define             orc_x86_emit_jne(p,label)


orc_x86_emit_label()

#define             orc_x86_emit_label(p,label)


orc_x86_emit_modrm_memoffset ()

void                orc_x86_emit_modrm_memoffset        (OrcCompiler *compiler,
                                                         int offset,
                                                         int reg1,
                                                         int reg2);


orc_x86_emit_modrm_reg ()

void                orc_x86_emit_modrm_reg              (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);


orc_x86_emit_mov_imm_reg()

#define             orc_x86_emit_mov_imm_reg(p,size,value,reg)


orc_x86_emit_mov_memoffset_mmx ()

void                orc_x86_emit_mov_memoffset_mmx      (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg1,
                                                         int reg2,
                                                         int is_aligned);


orc_x86_emit_mov_memoffset_reg ()

void                orc_x86_emit_mov_memoffset_reg      (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg1,
                                                         int reg2);


orc_x86_emit_mov_memoffset_sse ()

void                orc_x86_emit_mov_memoffset_sse      (OrcCompiler *compiler,
                                                         int size,
                                                         int offset,
                                                         int reg1,
                                                         int reg2,
                                                         int is_aligned);


orc_x86_emit_mov_mmx_memoffset ()

void                orc_x86_emit_mov_mmx_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int offset,
                                                         int reg2,
                                                         int aligned,
                                                         int uncached);


orc_x86_emit_mov_mmx_reg ()

void                orc_x86_emit_mov_mmx_reg            (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);


orc_x86_emit_mov_mmx_reg_reg ()

void                orc_x86_emit_mov_mmx_reg_reg        (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);


orc_x86_emit_mov_reg_memoffset ()

void                orc_x86_emit_mov_reg_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int offset,
                                                         int reg2);


orc_x86_emit_mov_reg_mmx ()

void                orc_x86_emit_mov_reg_mmx            (OrcCompiler *compiler,
                                                         int reg1,
                                                         int reg2);


orc_x86_emit_mov_reg_reg()

#define             orc_x86_emit_mov_reg_reg(p,size,src,dest)


orc_x86_emit_mov_sse_memoffset ()

void                orc_x86_emit_mov_sse_memoffset      (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int offset,
                                                         int reg2,
                                                         int aligned,
                                                         int uncached);


orc_x86_emit_pop ()

void                orc_x86_emit_pop                    (OrcCompiler *compiler,
                                                         int size,
                                                         int reg);


orc_x86_emit_prologue ()

void                orc_x86_emit_prologue               (OrcCompiler *compiler);


orc_x86_emit_push ()

void                orc_x86_emit_push                   (OrcCompiler *compiler,
                                                         int size,
                                                         int reg);


orc_x86_emit_ret()

#define             orc_x86_emit_ret(p)


orc_x86_emit_rex ()

void                orc_x86_emit_rex                    (OrcCompiler *compiler,
                                                         int size,
                                                         int reg1,
                                                         int reg2,
                                                         int reg3);


orc_x86_emit_sar_imm_reg()

#define             orc_x86_emit_sar_imm_reg(p,size,value,reg)


orc_x86_emit_sub_memoffset_reg()

#define             orc_x86_emit_sub_memoffset_reg(p,size,offset,src,dest)


orc_x86_emit_sub_reg_reg()

#define             orc_x86_emit_sub_reg_reg(p,size,src,dest)


orc_x86_emit_test_reg_reg()

#define             orc_x86_emit_test_reg_reg(p,size,src,dest)


orc_x86_get_regname ()

const char *        orc_x86_get_regname                 (int i);


orc_x86_get_regname_16 ()

const char *        orc_x86_get_regname_16              (int i);


orc_x86_get_regname_64 ()

const char *        orc_x86_get_regname_64              (int i);


orc_x86_get_regname_mmx ()

const char *        orc_x86_get_regname_mmx             (int i);


orc_x86_get_regname_ptr ()

const char *        orc_x86_get_regname_ptr             (OrcCompiler *compiler,
                                                         int i);


orc_x86_get_regname_sse ()

const char *        orc_x86_get_regname_sse             (int i);


orc_x86_get_regnum ()

int                 orc_x86_get_regnum                  (int i);


orc_x86_do_fixups ()

void                orc_x86_do_fixups                   (OrcCompiler *compiler);

orc-0.4.18/doc/html/orc-program.html0000664000175000017500000001115612206165374014153 00000000000000 Orc Program Syntax

Orc Program Syntax

Orc Program — Description of the Orc program syntax

Orc Program

An orc program is an UTF-8 file containing the source read by the Orc-compiler. Each program consists of several blocks. Each block contains a directives and opcodes.

.init

Global initialisation for a module.


.function

.function <function-name>

Starts a new function. Takes one arg which is the function name.


.flags

.flags (1d|2d)

Tells wheter arrays are 1 or 2 dimensional. The default is 1d.


.source

.source <size> <var-name> [<type-name>]

Input data array parameter for functions. Arguments denote size of the items in the array (1,2,4,8), name of the variable and optional name of the type. Only reads are allowed.


.dest

.dest <size> <var-name> [<type-name>]

Output data array parameter for functions. Arguments denote size of the items in the array (1,2,4,8), name of the variable and optional name of the type. This directive can also be used for in/out array parameters.


.accumulator

.accumulator <size> <var-name> [<type-name>]

Output value parameter for functions. Arguments denote size of the variable (1,2,4,8), name of the variable and optional name of the type.


.param

.param <size> <var-name> [<type-name>]

Parameter for functions. Arguments denote size of the variable (1,2,4,8), name of the variable and optional name of the type.

This directive has variants named: .longparam, .floatparam and .doubleparam.


.const

.const <size> <var-name>

Constant for functions. Arguments denote size of the constant (1,2,4,8) and the name.


.temp

.temp <size> <var-name>

Local variable for functions. Arguments denote size of the variable (1,2,4,8) and then name.

orc-0.4.18/doc/html/orc-OrcOpcode.html0000664000175000017500000004520012206165374014356 00000000000000 OrcOpcode

OrcOpcode

OrcOpcode — Operations

Synopsis

void                (*OrcOpcodeEmulateFunc)             (OrcOpcodeExecutor *ex,
                                                         void *user);
struct              OrcOpcodeExecutor;
struct              OrcOpcodeSet;
struct              OrcRuleSet;
struct              OrcStaticOpcode;
                    OrcTarget;
#define             ORC_OPCODE_N_ARGS
#define             ORC_STATIC_OPCODE_ACCUMULATOR
#define             ORC_STATIC_OPCODE_N_DEST
#define             ORC_STATIC_OPCODE_N_SRC
OrcStaticOpcode *   orc_opcode_find_by_name             (const char *name);
void                orc_opcode_init                     (void);
int                 orc_opcode_register_static          (OrcStaticOpcode *sopcode,
                                                         char *prefix);
int                 orc_opcode_set_find_by_name         (OrcOpcodeSet *opcode_set,
                                                         const char *name);
OrcOpcodeSet *      orc_opcode_set_get                  (const char *name);
OrcRuleSet *        orc_rule_set_new                    (OrcOpcodeSet *opcode_set,
                                                         OrcTarget *target,
                                                         unsigned int required_flags);
const char *        orc_target_get_asm_preamble         (const char *target);
OrcTarget *         orc_target_get_by_name              (const char *target_name);
OrcTarget *         orc_target_get_default              (void);
unsigned int        orc_target_get_default_flags        (OrcTarget *target);
const char *        orc_target_get_name                 (OrcTarget *target);
OrcRule *           orc_target_get_rule                 (OrcTarget *target,
                                                         OrcStaticOpcode *opcode,
                                                         unsigned int target_flags);
void                orc_target_register                 (OrcTarget *target);

Description

Details

OrcOpcodeEmulateFunc ()

void                (*OrcOpcodeEmulateFunc)             (OrcOpcodeExecutor *ex,
                                                         void *user);


struct OrcOpcodeExecutor

struct OrcOpcodeExecutor {
};

The OrcOpcodeExecutor structure has no public members


struct OrcOpcodeSet

struct OrcOpcodeSet {
};

The OrcOpcodeSet structure has no public members


struct OrcRuleSet

struct OrcRuleSet {
};

The OrcRuleSet structure has no public members


struct OrcStaticOpcode

struct OrcStaticOpcode {
  char name[16];
  unsigned int flags;
  int dest_size[ORC_STATIC_OPCODE_N_DEST];
  int src_size[ORC_STATIC_OPCODE_N_SRC];
  OrcOpcodeEmulateNFunc emulateN;
};


OrcTarget

typedef struct {
  const char *name;
  orc_bool executable;
  int data_register_offset;

  unsigned int (*get_default_flags)(void);
  void (*compiler_init)(OrcCompiler *compiler);
  void (*compile)(OrcCompiler *compiler);

  OrcRuleSet rule_sets[ORC_N_RULE_SETS];
  int n_rule_sets;

  const char * (*get_asm_preamble)(void);
  void (*load_constant)(OrcCompiler *compiler, int reg, int size, int value);
  const char * (*get_flag_name)(int shift);
  void (*flush_cache) (OrcCode *code);
  void (*load_constant_long)(OrcCompiler *compiler, int reg,
      OrcConstant *constant);

  void *_unused[5];
} OrcTarget;

ORC_OPCODE_N_ARGS

#define ORC_OPCODE_N_ARGS 4


ORC_STATIC_OPCODE_ACCUMULATOR

#define ORC_STATIC_OPCODE_ACCUMULATOR (1<<0)


ORC_STATIC_OPCODE_N_DEST

#define ORC_STATIC_OPCODE_N_DEST 2


ORC_STATIC_OPCODE_N_SRC

#define ORC_STATIC_OPCODE_N_SRC 4


orc_opcode_find_by_name ()

OrcStaticOpcode *   orc_opcode_find_by_name             (const char *name);


orc_opcode_init ()

void                orc_opcode_init                     (void);


orc_opcode_register_static ()

int                 orc_opcode_register_static          (OrcStaticOpcode *sopcode,
                                                         char *prefix);


orc_opcode_set_find_by_name ()

int                 orc_opcode_set_find_by_name         (OrcOpcodeSet *opcode_set,
                                                         const char *name);


orc_opcode_set_get ()

OrcOpcodeSet *      orc_opcode_set_get                  (const char *name);


orc_rule_set_new ()

OrcRuleSet *        orc_rule_set_new                    (OrcOpcodeSet *opcode_set,
                                                         OrcTarget *target,
                                                         unsigned int required_flags);


orc_target_get_asm_preamble ()

const char *        orc_target_get_asm_preamble         (const char *target);


orc_target_get_by_name ()

OrcTarget *         orc_target_get_by_name              (const char *target_name);


orc_target_get_default ()

OrcTarget *         orc_target_get_default              (void);


orc_target_get_default_flags ()

unsigned int        orc_target_get_default_flags        (OrcTarget *target);


orc_target_get_name ()

const char *        orc_target_get_name                 (OrcTarget *target);


orc_target_get_rule ()

OrcRule *           orc_target_get_rule                 (OrcTarget *target,
                                                         OrcStaticOpcode *opcode,
                                                         unsigned int target_flags);


orc_target_register ()

void                orc_target_register                 (OrcTarget *target);

orc-0.4.18/doc/html/up.png0000644000175000017500000000044312206165374012162 00000000000000‰PNG  IHDRàw=øêIDATxÚí•!ƒ0†ÈЉ $11Dp°·p€Ê‰É‰É‰‰ D%²˜@ o%/!ò¶–eˆýÉg*¾/išÔYÔ`ƒ„߻ȡ]1§ü„@Y– µ¦È ³Êƒ Ïó ( &b(Çã&b'ç"ör>b/ç#ör>b/ç#«~@šÉ‡‘<Ï)¢·“¯¨ëšäV!@)E‘ˆ®ç‹ãxRæû>ô§µ~Ñ4 …tE R†k‘÷d¯ô˜ãX~àŒ€”Ò4%Ë2 ÜM ÒÂ{Û™~:[dÏ9¿Üt¾) À ¿IEND®B`‚orc-0.4.18/doc/html/orc-building.html0000664000175000017500000001021312206165374014272 00000000000000 Building Orc and Applications That Use Orc

Building Orc and Applications That Use Orc

Building Orc and Applications that use Orc — How to build Orc and applications using it.

Building Orc on UNIX

On UNIX, Orc uses the standard GNU build system, using autoconf for package configuration and resolving portability issues, automake for building makefiles that comply with the GNU Coding Standards, and libtool for building shared libraries on multiple platforms. The normal sequence for compiling and installing the Orc library is thus:


      ./configure
      make
      make install
    

The standard options provided by GNU autoconf may be passed to the configure script. Please see the autoconf documentation or run ./configure --help for information about the standard options.

By default, code generators for all targets are built into the library. Embedded system developers may wish to use the --enable-backed option, which will disable all other code generators, saving about 200 kB in binary size. Outside of embedded systems, using --enable-backend is not recommended.

Building Orc Applications

Applications and libraries can use pkg-config to get all the needed compiler and linker flags to build against Orc. The following commands will provide the necessary compiler and linker flags:


  pkg-config --cflags orc-0.4
  pkg-config --libs orc-0.4

When compiling from source, the default installation directory is not in the default path for the pkg-config, so you may need to set the PKG_CONFIG_DIR environment variable.

orc-0.4.18/doc/html/index.sgml0000664000175000017500000005555112206165374013037 00000000000000 orc-0.4.18/doc/html/left.png0000644000175000017500000000056512206165374012475 00000000000000‰PNG  IHDRשÍÊ~PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(((;;;@@@€€€ƒƒƒ§§§×××ßßßãããçççëëëóóóûûûÿÿÿv:òütRNS $04 Utility functions

Utility functions

Utility functions — Orc utility functions

Synopsis

#define             ORC_ASSERT                          (test)

Description

Details

ORC_ASSERT()

#define             ORC_ASSERT(test)

orc-0.4.18/doc/html/ch03.html0000664000175000017500000000414412206165374012457 00000000000000 Extension API

Extension API

OrcDebug — Printing and formatting debug information
OrcOpcode — Operations
Utility functions — Orc utility functions
OrcRule — Creating rules for code generation
orc-0.4.18/doc/html/home.png0000644000175000017500000000110212206165374012457 00000000000000‰PNG  IHDRשÍÊðPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  $$$(((,,,000888<<<@@@OOOPPP[[[___```lll{{{€€€‹‹‹£££¯¯¯¿¿¿ÃÃÃÇÇÇÏÏÏÓÓÓÛÛÛßßßãããëëëïïïóóó÷÷÷ÿÿÿÕ?“*tRNS  $(,4@GKSghkotw‡‹›Ÿ«·»¿ÃËÏÓÛßçïó÷ûa7™Þ×IDATxÚ­Ï[W‚P†áÁ̳ijÓ2¡†LK<`[Ñ4jg8ÿÿ߸öb³è¢‹žËy/¾5ðéÓF~QЈŒJ¾T*ìÄðæN½‘³‡/ q°]1¶àzJœ•+z ÏD›=9”…ƒã­ñ€Ó4bv‰Â«1;ÈõâP=š• ]j*P gãúot ×»>&¹*´ööŸ™ÄBËþî@Ñ ŽŒ$nè¾ì?q— ½ øn’AƒÿC&‰ÐÞ™c~¨a¨ßÄ|Ò„ê·ZL÷\!éC‰VF@Ú~IEND®B`‚orc-0.4.18/doc/html/orc-Orc.html0000664000175000017500000000553612206165374013234 00000000000000 Orc

Orc

Orc — Library Initialization

Synopsis

void                orc_init                            (void);

Description

Details

orc_init ()

void                orc_init                            (void);

This function initializes the Orc library, and should be called before using any other Orc function. Subsequent calls to this function have no effect.

orc-0.4.18/doc/html/ch02.html0000664000175000017500000000461312206165374012457 00000000000000 Application API

Application API

Orc — Library Initialization
OrcProgram — Creating and manipulating Orc programs
OrcCompiler — Compile Orc programs
OrcExecutor — Running Orc programs
Orc Program Syntax — Description of the Orc program syntax
Orc Opcodes — Description of Opcodes
orc-0.4.18/doc/html/orc-SSE.html0000664000175000017500000001420312206165374013132 00000000000000 SSE

SSE

SSE — code generation for SSE

Synopsis

enum                OrcSSERegister;
enum                OrcTargetSSEFlags;
#define             ORC_SSE_SHUF                        (a,
                                                         b,
                                                         c,
                                                         d)
#define             orc_sse_emit_pshufd                 (p,
                                                         imm,
                                                         a,
                                                         b)
#define             orc_sse_emit_pshuflw                (p,
                                                         imm,
                                                         a,
                                                         b)
unsigned int        orc_sse_get_cpu_flags               (void);
void                orc_sse_init                        (void);

Description

Details

enum OrcSSERegister

typedef enum {
  X86_XMM0 = ORC_VEC_REG_BASE + 16,
  X86_XMM1,
  X86_XMM2,
  X86_XMM3,
  X86_XMM4,
  X86_XMM5,
  X86_XMM6,
  X86_XMM7,
  X86_XMM8,
  X86_XMM9,
  X86_XMM10,
  X86_XMM11,
  X86_XMM12,
  X86_XMM13,
  X86_XMM14,
  X86_XMM15
} OrcSSERegister;


enum OrcTargetSSEFlags

typedef enum {
  ORC_TARGET_SSE_SSE2 = (1<<0),
  ORC_TARGET_SSE_SSE3 = (1<<1),
  ORC_TARGET_SSE_SSSE3 = (1<<2),
  ORC_TARGET_SSE_SSE4_1 = (1<<3),
  ORC_TARGET_SSE_SSE4_2 = (1<<4),
  ORC_TARGET_SSE_SSE4A = (1<<5),
  ORC_TARGET_SSE_SSE5 = (1<<6),
  ORC_TARGET_SSE_FRAME_POINTER = (1<<7),
  ORC_TARGET_SSE_SHORT_JUMPS = (1<<8),
  ORC_TARGET_SSE_64BIT = (1<<9)
} OrcTargetSSEFlags;


ORC_SSE_SHUF()

#define ORC_SSE_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0))


orc_sse_emit_pshufd()

#define orc_sse_emit_pshufd(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufd, imm, a, b)


orc_sse_emit_pshuflw()

#define orc_sse_emit_pshuflw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshuflw, imm, a, b)


orc_sse_get_cpu_flags ()

unsigned int        orc_sse_get_cpu_flags               (void);


orc_sse_init ()

void                orc_sse_init                        (void);

orc-0.4.18/doc/html/orc-tutorial.html0000664000175000017500000004023512206165374014347 00000000000000 Orc Tutorial

Orc Tutorial

Orc Tutorial — Getting started writing Orc code.

Orc Tutorial

This section walks you through several examples of increasing complexity to get you started working with Orc. Each of these examples are available in the Orc source code, in the examples directory. The first three examples use static Orc code that is in a source file, and is compiled into intermediate C code by the orcc tool.

The first example demonstrates how to add two arrays of 16-bit signed integers together. A possible use case for this is combining two stereo audio streams together.

The second example builds from the first, replacing one of the stereo input streams with a mono stream, converting it to stereo in the process, and also adjusting the volume of the stream.

The third example shows how to convert a planar 4:2:0 video image into a packed 4:4:4 video image with an alpha channel.

Example 1

This example demonstrates combining two stereo audio streams by adding. Uncompressed audio streams (i.e., PCM format) can be in a variety of formats, but one of the most common is interleaved signed 16-bit integers, and we will choose that for the purposes of this example. Extending to other formats is left as an exercise for the reader. Interleaved means that left and right channel samples are consecutive: in memory, the data look like LRLRLR... The sampling rate is unimportant, as long as both streams are the same.

One important feature/limitation of signed 16-bit audio samples is that adding two together could cause an overflow. For example, adding the value 25000 to 10000 gives 35000, but this overflows 16 bits, so a standard addition would instead give the value -30536 (35000-65536). Overflows handled this way sound like crackling or worse, so we would like a better solution. One solution is to use saturating addition: in this case, the addition of 25000 and 10000 would be limited by the upper end of signed 16-bit values to give 32767. Although this still causes distortion in the output signal, it is much less audible and annoying.

In normal C code, 16-bit saturating addition is difficult to express without using 32-bit intermediates. In Orc, saturating addition is a basic operation with opcodes for each size, both signed and unsigned. In this case, we want "addssw", for "add signed saturated word".

Also, we're going to make a one simplification: Adding two interleaved stereo streams is the same as adding two mono streams with twice as many samples. So we'll use 2*n_samples in the calling code.

To the code:

.function audio_add_s16
.dest 2 d1
.source 2 s1
.source 2 s2

addssw d1, s1, s2

Line by line:

.function audio_add_s16

This starts a function. A function (represented internally by the object OrcProgram) is equivalent to a C function. When you generate C code from this Orc exmaple using the orcc tool, it generates a C stub function called "audio_add_s16()", which at runtime will generate an OrcProgram object corresponding to the above code, compile it, and then run it.

.dest 2 d1 short

This specifies that you want a destination (output) array named "d1", with the element size being 2. Orc does not differentiate between signed and unsigned arrays (or even floating point), however, you may optionally specify a type afterwards that will be used in any autogenerated C code.

.source 2 s1 short
.source 2 s2 short

This specifies that you want two source (input) arrays, "s1" and "s2", similar to the destination array.

addssw d1, s1, s2

This specifies the (only) opcode that we want for this program: signed saturated addition of each member of the two source arrays, and store the result in the destination array.

A few notes about the above program: The loop over the array members is implied. Everything that Orc does is based on looping over each array element and executing the opcodes in a program.

When you generate C code from the above Orc code using 'orcc --implementation example1.orc', you get a bunch of boilerplate code, plus three C functions:

/* audio_add_s16 */
#ifdef DISABLE_ORC
void
audio_add_s16 (int16 * d1, const int16 * s1, const int16 * s2, int n)
{
  ...
}

This function is used if DISABLE_ORC is defined. As one might guess, if you define DISABLE_ORC, no runtime Orc features are used, and all calls to audio_add_s16() use this function. The interior of the function is a for() loop that implements the Orc function. The generated code may not necessarily be easy to read, but it is straightforward: all the verbosity and use of unions is to avoid compiler warnings without making the compiler too complex. But this is the place to go if you are trying to understand what Orc is doing.

#else
static void
_backup_audio_add_s16 (OrcExecutor * ORC_RESTRICT ex)
{
  ...
}

This function is used when runtime Orc is enabled, but Orc was unable to generate code for the function at runtime. There are various reasons why that might happen -- unimplemented rules for a target, or more temporary variables used than available registers.

void
audio_add_s16 (short * d1, const short * s1, const short * s2, int n)
{
  ...
}

The third generated function is the important part: It is used when Orc is enabled at runtime, and creates the OrcProgram corresponding to the function you defined. Then it compiles the function and calls it.

After generating the C code, you should generate the header file, using: 'orcc --header example1orc.orc -o example1orc.h'. After similar boilerplate code, there is the expected declaration of audio_add_s16():

void audio_add_s16 (short * d1, const short * s1, const short * s2, int n);

Some C code to generate sample data, call the generated code, and print out the results:

#include <stdio.h>
#include "example1orc.h"

#define N 10

short a[N];
short b[N];
short c[N];

int
main (int argc, char *argv[])
{
  int i;

  /* Create some data in the source arrays */
  for(i=0;i < N;i++){
    a[i] = 100*i;
    b[i] = 32000;
  }

  /* Call a function that uses Orc */
  audio_add_s16 (c, a, b, N);

  /* Print the results */
  for(i=0;i < N;i++){
    printf("%d: %d %d -> %d\n", i, a[i], b[i], c[i]);
  }

  return 0;
}

The output of the program:

0: 0 32000 -> 32000
1: 100 32000 -> 32100
2: 200 32000 -> 32200
3: 300 32000 -> 32300
4: 400 32000 -> 32400
5: 500 32000 -> 32500
6: 600 32000 -> 32600
7: 700 32000 -> 32700
8: 800 32000 -> 32767
9: 900 32000 -> 32767

Example 2

In this example, we will expand on the previous example by making one of the input arrays a mono stream, and also scale the mono input stream by a volume. Rather than iterating over each signed 16-bit value, in this example we will iterate over samples, meaning the member size for the stereo arrays is 4, since each array member contains a left and right 16 bit value.

.function audio_add_mono_to_stereo_scaled_s16
.dest 4 d1 short
.source 4 s1 short
.source 2 s2 short
.param 2 volume
.temp 4 s2_scaled
.temp 2 t
.temp 4 s2_stereo

mulswl s2_scaled, s2, volume
shrsl s2_scaled, s2_scaled, 12
convssslw t, s2_scaled
mergewl s2_stereo, t, t
x2 addssw d1, s1, s2_stereo

Piece by piece:

.function audio_add_mono_to_stereo_scaled_s16
.dest 4 d1 short
.source 4 s1 short
.source 2 s2 short

This is the same as the previous example, except that the stereo arrays are increased in size to 4. However, we'll use the short type, since Orc does not care what type we use, and short is the type of the array we want to use in the C code.

.param 2 volume

This specifies a parameter, which is an integer that is passed to an Orc function. In the generated C code, parameters are always of type int. There are also float parameters for the floating point equivalent.

.temp 4 s2_scaled
.temp 2 t
.temp 4 s2_stereo

This specifies a few temporary variables that are used later in the code. These definitions are similar to defining local variables in C code. Note that the size is important: each opcode has specific sizes for source and destination operands, and it is important to match these correctly with temporary variables.

mulswl s2_scaled, s2, volume
shrsl s2_scaled, s2_scaled, 12

This scales the mono input: signed multiply of s2 and volume, giving a 32-bit value, and then a signed right shift by 12. Since the second operand of mulswl is 16-bit, only the lower 16 bits of volume will be used in the multiply. The right shift is effectively the same as dividing by 4096. Thus, a neutral scaling that does not increase or decrease the mono input would correspond to calling the function with a parameter value of 4096.

convssslw t, s2_scaled
mergewl s2_stereo, t, t

The first instruction is "convert saturated signed 32-bit to signed 16-bit", and the second merges the two values of (16 bit) t into the high and low halves of s2_stereo. This duplicates the mono signal into the right and left channels. It is important to use the saturated conversion, since the effective scaling value may have been greater than 1.0, thus the larger values may need to be clipped.

x2 addssw d1, s1, s2_stereo

The "x2" prefix indicates that we want the operation specified to be done twice, first to the upper half of all operands, and again separately to the lower half of all operands. Since addssw is normally a 16-bit operation, the x2 prefix causes it to be a 32-bit operation. And so, it adds the newly created right and left values of the scaled mono signal into the s1 signal.

There are several variations of the above program that might be more suitable for a particular application. This function only handles a limited dynamic range of volume scaling factors, however, by changing the shift constant, or turning the shift into a parameter, the dynamic range can be increased significantly.

Example 3

The third example shows how to convert a planar 4:2:0 video image into a packed 4:4:4 video image with an alpha channel. The first format is often referred to as I420 and the second as AYUV.

For simplicity in the following discussion, we'll assume that the image dimensions are 640x480. The 4:2:0 subsampling means the input chroma planes are 320x240 (subsampled by 2 in each direction). These need to be upsampled to 640x480, then repacked with the input Y plane, with an added dummy alpha value. There are many ways to perform upsampling; the simplest is to duplicate each value horizontally and vertically. The result is low quality, but adequate for demonstration purposes.

There are several choices for the Orc array size and dimensionality. Iterating vertically can be done in the C code or in the Orc code. If done in the Orc code, we would need to use an array size of 240 and have two separate arrays for the even and odd Y rows. If done in the C code, there is no such limitation. Horizontally, the story is different: we can use the loadupsdb opcode to duplicate each byte in the U and V arrays, so we can iterate over 640 array elements. It is also possible to iterate over 320 elements and duplicate the U and V elements using mergebw. There is a very slight speed advantage to iterating vertically in Orc, and for demonstration purposes, we will choose to use the loadupsdb opcode, thus we will be iterating over 320x240 elements.

The code:

.function convert_I420_AYUV
.flags 2d
.dest 4 d1
.dest 4 d2
.source 1 y1
.source 1 y2
.source 1 u
.source 1 v
.const 1 c255 255
.temp 2 uv
.temp 2 ay
.temp 1 tu
.temp 1 tv

loadupdb tu, u
loadupdb tv, v
mergebw uv, tu, tv
mergebw ay, c255, y1
mergewl d1, ay, uv
mergebw ay, c255, y2
mergewl d2, ay, uv

A few things of note: The ".flags 2d" line is used to indicate that Orc should iterate over two dimensions, and generate a prototype that includes row strides for each array and a size parameter for the second dimension.

Since we are working on two input Y lines and two output AYUV lines at a time, we need two source and destination arrays corresponding to the even and odd lines. The row strides for these are doubled compared to the normal 2-D array.

The mergebw and mergewl opcodes join two 8-bit values into one 16-bit value (or 16-bit values into a 32-bit value) by concatinating them in memory order. Thus, to get AYUV in memory order, we merge AY and UV, and to get UV, we merge U and V. Since we're duplicating each U and V line, we use the same UV value for the even and odd output lines.

The prototype that is generated is:

void convert_I420_AYUV (orc_uint32 * d1, int d1_stride, orc_uint32 * d2,
  int d2_stride, const orc_uint8 * s1, int s1_stride, const orc_uint8 * s2,
  int s2_stride, const orc_uint8 * s3, int s3_stride, const orc_uint8 * s4,
  int s4_stride, int n, int m);

The orcc tool unhelpfully changed the names of the parameters, however, the order is standard: first destinations, then sources, then parameters, then array sizes. Think of it like memcpy() or memset().

Calling the function:

convert_I420_AYUV (output, 1280*4, output + 640, 1280 * 4,
    input_y, 1280, input_y + 640, 1280,
    input_u, 320, input_v, 320,
    320, 240);

orc-0.4.18/doc/html/style.css0000644000175000017500000001210012206165374012673 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } orc-0.4.18/doc/html/orc-OrcDebug.html0000664000175000017500000004300312206165374014172 00000000000000 OrcDebug

OrcDebug

OrcDebug — Printing and formatting debug information

Synopsis

enum                OrcDebugLevel;
void                (*OrcDebugPrintFunc)                (int level,
                                                         const char *file,
                                                         const char *func,
                                                         int line,
                                                         const char *format,
                                                         va_list varargs);
#define             ORC_DEBUG_PRINT                     (level,
                                                         ...)
#define             ORC_ERROR                           (...)
#define             ORC_WARNING                         (...)
#define             ORC_INFO                            (...)
#define             ORC_DEBUG                           (...)
#define             ORC_LOG                             (...)
#define             ORC_FUNCTION
int                 orc_debug_get_level                 (void);
void                orc_debug_print                     (int level,
                                                         const char *file,
                                                         const char *func,
                                                         int line,
                                                         const char *format,
                                                         ...);
void                orc_debug_set_level                 (int level);
void                orc_debug_set_print_function        (OrcDebugPrintFunc func);

Description

Details

enum OrcDebugLevel

typedef enum {
  ORC_DEBUG_NONE = 0,
  ORC_DEBUG_ERROR,
  ORC_DEBUG_WARNING,
  ORC_DEBUG_INFO,
  ORC_DEBUG_DEBUG,
  ORC_DEBUG_LOG
} OrcDebugLevel;

Enumeration describing debug levels in Orc.

ORC_DEBUG_NONE

No debugging. Used to disable debugging output.

ORC_DEBUG_ERROR

The level for messages indicating that an error has occurred that causes Orc to produce incorrect results. Also used temporarily by developers for testing code.

ORC_DEBUG_WARNING

Messages at this level indicate something has occurred that a developer looking into an application problem may want to know.

ORC_DEBUG_INFO

Messages at this level provide high-level information about Orc internals.

ORC_DEBUG_DEBUG

The default level for logging messages.

ORC_DEBUG_LOG

The level for messages that probably don't need to be logged at all.

OrcDebugPrintFunc ()

void                (*OrcDebugPrintFunc)                (int level,
                                                         const char *file,
                                                         const char *func,
                                                         int line,
                                                         const char *format,
                                                         va_list varargs);

Typedef describing functions that can be registered using orc_debug_set_print_function() so that it is called to print debugging messages.

level :

the debug level

file :

name of the file where the debug message occurs

func :

name of the function where the debug message occurs

line :

line in the file where the debug message occurs

format :

a printf format

varargs :

varargs for the printf format

ORC_DEBUG_PRINT()

#define             ORC_DEBUG_PRINT(level, ...)

Macro to call orc_debug_print() with the correct values for the name of the source file, line of source file, and function.

level :

debug level of message

ORC_ERROR()

#define ORC_ERROR(...) ORC_DEBUG_PRINT(ORC_DEBUG_ERROR, __VA_ARGS__)

Macro to call ORC_DEBUG_PRINT() with a level of ORC_DEBUG_ERROR.

... :

printf-style format and arguments

ORC_WARNING()

#define ORC_WARNING(...) ORC_DEBUG_PRINT(ORC_DEBUG_WARNING, __VA_ARGS__)

Macro to call ORC_DEBUG_PRINT() with a level of ORC_DEBUG_WARNING.

... :

printf-style format and arguments

ORC_INFO()

#define ORC_INFO(...) ORC_DEBUG_PRINT(ORC_DEBUG_INFO, __VA_ARGS__)

Macro to call ORC_DEBUG_PRINT() with a level of ORC_DEBUG_INFO.

... :

printf-style format and arguments

ORC_DEBUG()

#define ORC_DEBUG(...) ORC_DEBUG_PRINT(ORC_DEBUG_DEBUG, __VA_ARGS__)

Macro to call ORC_DEBUG_PRINT() with a level of ORC_DEBUG_DEBUG.

... :

printf-style format and arguments

ORC_LOG()

#define ORC_LOG(...) ORC_DEBUG_PRINT(ORC_DEBUG_LOG, __VA_ARGS__)

Macro to call ORC_DEBUG_PRINT() with a level of ORC_DEBUG_LOG.

... :

printf-style format and arguments

ORC_FUNCTION

#define ORC_FUNCTION __PRETTY_FUNCTION__

Internal macro that points to __PRETTY_FUNCTION__ or __func__ if the former is not available.


orc_debug_get_level ()

int                 orc_debug_get_level                 (void);

Gets the current debug level.

Returns :

the current debug level

orc_debug_print ()

void                orc_debug_print                     (int level,
                                                         const char *file,
                                                         const char *func,
                                                         int line,
                                                         const char *format,
                                                         ...);


orc_debug_set_level ()

void                orc_debug_set_level                 (int level);

Sets the current debug level.

level :

the new debug level

orc_debug_set_print_function ()

void                orc_debug_set_print_function        (OrcDebugPrintFunc func);

Sets the function to call when outputting debugging information. A value of NULL for func will restore the default handler, which prints debugging information to stderr.

func :

the function to call
orc-0.4.18/doc/html/orc-MMX.html0000664000175000017500000006043412206165374013150 00000000000000 MMX

MMX

MMX — code generation for MMX

Synopsis

enum                OrcMMXRegister;
enum                OrcTargetMMXFlags;
#define             ORC_MMX_SHUF                        (a,
                                                         b,
                                                         c,
                                                         d)
void                orc_mmx_emit_0f                     (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);
void                orc_mmx_emit_660f                   (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);
void                orc_mmx_emit_f20f                   (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);
void                orc_mmx_emit_f30f                   (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);
void                orc_mmx_emit_loadib                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_loadil                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_loadiw                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_loadpb                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_loadpl                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_loadpq                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_loadpw                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);
void                orc_mmx_emit_pshufw                 (OrcCompiler *p,
                                                         int shuf,
                                                         int src,
                                                         int dest);
void                orc_mmx_emit_shiftimm               (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int modrm_code,
                                                         int shift,
                                                         int reg);
unsigned int        orc_mmx_get_cpu_flags               (void);
void                orc_mmx_init                        (void);

Description

Details

enum OrcMMXRegister

typedef enum {
  X86_MM0 = ORC_VEC_REG_BASE,
  X86_MM1,
  X86_MM2,
  X86_MM3,
  X86_MM4,
  X86_MM5,
  X86_MM6,
  X86_MM7
} OrcMMXRegister;


enum OrcTargetMMXFlags

typedef enum {
  ORC_TARGET_MMX_MMX = (1<<0),
  ORC_TARGET_MMX_MMXEXT = (1<<1),
  ORC_TARGET_MMX_3DNOW = (1<<2),
  ORC_TARGET_MMX_3DNOWEXT = (1<<3),
  ORC_TARGET_MMX_SSSE3 = (1<<4),
  ORC_TARGET_MMX_SSE4_1 = (1<<5),
  ORC_TARGET_MMX_SSE4_2 = (1<<6),
  ORC_TARGET_MMX_FRAME_POINTER = (1<<7),
  ORC_TARGET_MMX_SHORT_JUMPS = (1<<8),
  ORC_TARGET_MMX_64BIT = (1<<9)
} OrcTargetMMXFlags;


ORC_MMX_SHUF()

#define ORC_MMX_SHUF(a,b,c,d) ((((a)&3)<<6)|(((b)&3)<<4)|(((c)&3)<<2)|(((d)&3)<<0))


orc_mmx_emit_0f ()

void                orc_mmx_emit_0f                     (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);


orc_mmx_emit_660f ()

void                orc_mmx_emit_660f                   (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);


orc_mmx_emit_f20f ()

void                orc_mmx_emit_f20f                   (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);


orc_mmx_emit_f30f ()

void                orc_mmx_emit_f30f                   (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int src,
                                                         int dest);


orc_mmx_emit_loadib ()

void                orc_mmx_emit_loadib                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_loadil ()

void                orc_mmx_emit_loadil                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_loadiw ()

void                orc_mmx_emit_loadiw                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_loadpb ()

void                orc_mmx_emit_loadpb                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_loadpl ()

void                orc_mmx_emit_loadpl                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_loadpq ()

void                orc_mmx_emit_loadpq                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_loadpw ()

void                orc_mmx_emit_loadpw                 (OrcCompiler *p,
                                                         int reg,
                                                         int value);


orc_mmx_emit_pshufw ()

void                orc_mmx_emit_pshufw                 (OrcCompiler *p,
                                                         int shuf,
                                                         int src,
                                                         int dest);


orc_mmx_emit_shiftimm ()

void                orc_mmx_emit_shiftimm               (OrcCompiler *p,
                                                         const char *insn_name,
                                                         int code,
                                                         int modrm_code,
                                                         int shift,
                                                         int reg);


orc_mmx_get_cpu_flags ()

unsigned int        orc_mmx_get_cpu_flags               (void);


orc_mmx_init ()

void                orc_mmx_init                        (void);

orc-0.4.18/doc/html/right.png0000644000175000017500000000057412206165374012660 00000000000000‰PNG  IHDRשÍÊ{PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ###+++@@@«««¿¿¿ÃÃÃÇÇÇÏÏÏïïïÿÿÿçWôtRNS (48@GX[«·¿ÃÏÓ×ßãçï÷yþ±t–IDATxÚ…ÐÉÂ0 PS–@XZ -%”­eþÿ Iä‰ÁÜ<ï`ÙeAÙ¬Zìç9(ñÆ1'n/îÊ"Á¤²ÜU!‡DЉhŒwÎÅ$¢ñ4QX$°Ô AlþXRü^>8ŽMzšãmtúºü¾Ä>äk¸Ð7â½ œïOŠ$ôÙž³=mVQ.JO£é9 »ñ• IEND®B`‚orc-0.4.18/doc/orc.types0000644000175000017500000000000012206165374011722 00000000000000orc-0.4.18/doc/opcode_table.xml0000644000175000017500000006642211565023074013234 00000000000000Table of Opcodes opcode destination size source 1 size source 2 size description pseudo code absb 1 1 absolute value (a < 0) ? -a : a addb 1 1 1 add a + b addssb 1 1 1 add with signed saturate clamp(a + b) addusb 1 1 1 add with unsigned saturate clamp(a + b) andb 1 1 1 bitwise AND a & b andnb 1 1 1 bitwise AND NOT a & (~b) avgsb 1 1 1 signed average (a + b + 1)>>1 avgub 1 1 1 unsigned average (a + b + 1)>>1 cmpeqb 1 1 1 compare equal (a == b) ? (~0) : 0 cmpgtsb 1 1 1 compare greater than (a > b) ? (~0) : 0 copyb 1 1 copy a loadb 1 1 load from memory array[i] loadoffb 1 1 4S load from memory with offset array[i+offset] loadupdb 1 1 load upsampled duplicate array[i>>1] loadupib 1 1 load upsampled interpolate (array[i>>1] + array[(i+1)>>1] + 1)>>1 loadpb 1 1 load parameter or constant scalar ldresnearb 1 1 4S load, nearest neighbor resampled array[(b+c*i)>>8] ldresnearl 4 4 4S load, nearest neighbor resampled array[(b+c*i)>>8] ldreslinb 1 1 4S load, bilinear resampled special ldreslinl 4 4 4S load, bilinear resampled special maxsb 1 1 1 signed maximum (a > b) ? a : b maxub 1 1 1 unsigned maximum (a > b) ? a : b minsb 1 1 1 signed minimum (a < b) ? a : b minub 1 1 1 unsigned minimum (a < b) ? a : b mullb 1 1 1 low bits of multiply a * b mulhsb 1 1 1 high bits of signed multiply (a * b) >> 8 mulhub 1 1 1 high bits of unsigned multiply (a * b) >> 8 orb 1 1 1 bitwise or a | b shlb 1 1 1S shift left a << b shrsb 1 1 1S signed shift right a >> b shrub 1 1 1S unsigned shift right a >> b signb 1 1 sign sign(a) storeb 1 1 store to memory special subb 1 1 1 subtract a - b subssb 1 1 1 subtract with signed saturate clamp(a - b) subusb 1 1 1 subtract with unsigned saturate clamp(a - b) xorb 1 1 1 bitwise XOR a ^ b absw 2 2 absolute value (a < 0) ? -a : a addw 2 2 2 add a + b addssw 2 2 2 add with signed saturate clamp(a + b) addusw 2 2 2 add with unsigned saturate clamp(a + b) andw 2 2 2 bitwise AND a & b andnw 2 2 2 bitwise AND NOT a & (~b) avgsw 2 2 2 signed average (a + b + 1)>>1 avguw 2 2 2 unsigned average (a + b + 1)>>1 cmpeqw 2 2 2 compare equal (a == b) ? (~0) : 0 cmpgtsw 2 2 2 compare greater than (a > b) ? (~0) : 0 copyw 2 2 copy a div255w 2 2 divide by 255 a/255 divluw 2 2 2 saturated unsigned divide 16-bit by 8-bit clamp(a/(b & 255),0,255) loadw 2 2 load from memory array[i] loadoffw 2 2 4S load from memory with offset array[i+offset] loadpw 2 2 load parameter or constant scalar maxsw 2 2 2 signed maximum (a > b) ? a : b maxuw 2 2 2 unsigned maximum (a > b) ? a : b minsw 2 2 2 signed minimum (a < b) ? a : b minuw 2 2 2 unsigned minimum (a < b) ? a : b mullw 2 2 2 low bits of multiply a * b mulhsw 2 2 2 high bits of signed multiply (a * b) >> 8 mulhuw 2 2 2 high bits of unsigned multiply (a * b) >> 8 orw 2 2 2 bitwise or a | b shlw 2 2 2S shift left a << b shrsw 2 2 2S signed shift right a >> b shruw 2 2 2S unsigned shift right a >> b signw 2 2 sign sign(a) storew 2 2 store to memory special subw 2 2 2 subtract a - b subssw 2 2 2 subtract with signed saturate clamp(a - b) subusw 2 2 2 subtract with unsigned saturate clamp(a - b) xorw 2 2 2 bitwise XOR a ^ b absl 4 4 absolute value (a < 0) ? -a : a addl 4 4 4 add a + b addssl 4 4 4 add with signed saturate clamp(a + b) addusl 4 4 4 add with unsigned saturate clamp(a + b) andl 4 4 4 bitwise AND a & b andnl 4 4 4 bitwise AND NOT a & (~b) avgsl 4 4 4 signed average (a + b + 1)>>1 avgul 4 4 4 unsigned average (a + b + 1)>>1 cmpeql 4 4 4 compare equal (a == b) ? (~0) : 0 cmpgtsl 4 4 4 compare greater than (a > b) ? (~0) : 0 copyl 4 4 copy a loadl 4 4 load from memory array[i] loadoffl 4 4 4S load from memory with offset array[i+offset] loadpl 4 4 load parameter or constant scalar maxsl 4 4 4 signed maximum (a > b) ? a : b maxul 4 4 4 unsigned maximum (a > b) ? a : b minsl 4 4 4 signed minimum (a < b) ? a : b minul 4 4 4 unsigned minimum (a < b) ? a : b mulll 4 4 4 low bits of multiply a * b mulhsl 4 4 4 high bits of signed multiply (a * b) >> 16 mulhul 4 4 4 high bits of unsigned multiply (a * b) >> 16 orl 4 4 4 bitwise or a | b shll 4 4 4S shift left a << b shrsl 4 4 4S signed shift right a >> b shrul 4 4 4S unsigned shift right a >> b signl 4 4 sign sign(a) storel 4 4 store to memory special subl 4 4 4 subtract a - b subssl 4 4 4 subtract with signed saturate clamp(a - b) subusl 4 4 4 subtract with unsigned saturate clamp(a - b) xorl 4 4 4 bitwise XOR a ^ b loadq 8 8 load from memory array[i] loadpq 8 8 load parameter or constant scalar storeq 8 8 store to memory special splatw3q 8 8 duplicates high 16-bits to lower 48 bits special copyq 8 8 cmpeqq 8 8 8 cmpgtsq 8 8 8 andq 8 8 8 andnq 8 8 8 orq 8 8 8 xorq 8 8 8 addq 8 8 8 subq 8 8 8 shlq 8 8 8S shrsq 8 8 8S shruq 8 8 8S convsbw 2 1 convert signed a convubw 2 1 convert unsigned a splatbw 2 1 duplicates 8 bits to both halfs of 16 bits special splatbl 4 1 duplicates 8 bits to all parts of 32 bits special convswl 4 2 convert signed a convuwl 4 2 convert unsigned a convslq 8 4 signed convert a convulq 8 4 unsigned convert a convwb 1 2 convert a convhwb 1 2 shift and convert a>>8 convssswb 1 2 convert signed to signed with saturation clamp(a) convsuswb 1 2 convert signed to unsigned with saturation clamp(a) convusswb 1 2 convert unsigned to signed with saturation clamp(a) convuuswb 1 2 convert unsigned to unsigned with saturation clamp(a) convlw 2 4 convert a convhlw 2 4 shift and convert a>>16 convssslw 2 4 convert signed to signed with saturation clamp(a) convsuslw 2 4 convert signed to unsigned with saturation clamp(a) convusslw 2 4 convert unsigned to signed with saturation clamp(a) convuuslw 2 4 convert unsigned to unsigned with saturation clamp(a) convql 4 8 convert a convsssql 4 8 convert signed to signed with saturation clamp(a) convsusql 4 8 convert signed to unsigned with saturation clamp(a) convussql 4 8 convert unsigned to signed with saturation clamp(a) convuusql 4 8 convert unsigned to unsigned with saturation clamp(a) mulsbw 2 1 1 multiply signed a * b mulubw 2 1 1 multiply unsigned a * b mulswl 4 2 2 multiply signed a * b muluwl 4 2 2 multiply unsigned a * b mulslq 8 4 4 mululq 8 4 4 accw 2 2 accumulate += a accl 4 4 accumulate += a accsadubl 4 1 1 accumulate absolute difference += abs(a - b) swapw 2 2 endianness swap special swapl 4 4 endianness swap special swapwl 4 4 swapq 8 8 swaplq 8 8 select0wb 1 2 select first half special select1wb 1 2 select second half special select0lw 2 4 select first half special select1lw 2 4 select second half special select0ql 4 8 select1ql 4 8 mergelq 8 4 4 mergewl 4 2 2 merge halves special mergebw 2 1 1 merge halves special splitql 4 8 splitlw 2 4 split first/second words special splitwb 1 2 split first/second bytes special addf 4 4 4 add a + b subf 4 4 4 subtract a - b mulf 4 4 4 multiply a * b divf 4 4 4 divide a / b sqrtf 4 4 square root sqrt(a) maxf 4 4 4 maximum max(a,b) minf 4 4 4 minimum min(a,b) cmpeqf 4 4 4 compare equal (a == b) ? (~0) : 0 cmpltf 4 4 4 compare less than (a == b) ? (~0) : 0 cmplef 4 4 4 compare less than or equal (a == b) ? (~0) : 0 convfl 4 4 convert float point to integer a convlf 4 4 convert integer to floating point a addd 8 8 8 subd 8 8 8 muld 8 8 8 divd 8 8 8 sqrtd 8 8 maxd 8 8 8 mind 8 8 8 cmpeqd 8 8 8 cmpltd 8 8 8 cmpled 8 8 8 convdl 4 8 convld 8 4 convfd 8 4 convdf 4 8
orc-0.4.18/doc/building.xml0000644000175000017500000000536111565023074012404 00000000000000 %version-entities; ]> Building Orc and Applications That Use Orc 3 Orc Building Orc and Applications that use Orc How to build Orc and applications using it. Building Orc on UNIX On UNIX, Orc uses the standard GNU build system, using autoconf for package configuration and resolving portability issues, automake for building makefiles that comply with the GNU Coding Standards, and libtool for building shared libraries on multiple platforms. The normal sequence for compiling and installing the Orc library is thus: ./configure make make install The standard options provided by GNU autoconf may be passed to the configure script. Please see the autoconf documentation or run ./configure --help for information about the standard options. By default, code generators for all targets are built into the library. Embedded system developers may wish to use the --enable-backed option, which will disable all other code generators, saving about 200 kB in binary size. Outside of embedded systems, using --enable-backend is not recommended. Building Orc Applications Applications and libraries can use pkg-config to get all the needed compiler and linker flags to build against Orc. The following commands will provide the necessary compiler and linker flags: pkg-config --cflags orc-&ORC_MAJORMINOR; pkg-config --libs orc-&ORC_MAJORMINOR; When compiling from source, the default installation directory is not in the default path for the pkg-config, so you may need to set the PKG_CONFIG_DIR environment variable. orc-0.4.18/doc/table.xml0000644000175000017500000007021211565023074011673 00000000000000Table of Opcode Rule Coverage opcode name sse mmx altivec arm neon c64x-c absb yes yes yes no yes no addb yes yes yes no yes no addssb yes yes yes no yes no addusb yes yes yes no yes no andb yes yes yes yes yes no andnb yes yes yes yes yes no avgsb yes yes yes yes yes no avgub yes yes yes yes yes no cmpeqb yes yes yes yes yes no cmpgtsb yes yes yes yes yes no copyb yes yes yes yes yes no loadb yes yes yes yes yes no loadoffb yes yes no no yes no loadupdb yes yes no no no no loadupib yes yes no no no no loadpb yes yes yes yes yes no ldresnearb no no no no no no ldresnearl yes yes no no no no ldreslinb no no no no no no ldreslinl yes yes no no no no maxsb yes yes yes no yes no maxub yes yes yes no yes no minsb yes yes yes no yes no minub yes yes yes no yes no mullb yes yes yes no yes no mulhsb yes yes yes no yes no mulhub yes yes yes no yes no orb yes yes yes yes yes no shlb yes yes yes yes yes no shrsb yes yes yes no yes no shrub yes yes yes no yes no signb yes yes yes no yes no storeb yes yes yes yes yes no subb yes yes yes no yes no subssb yes yes yes no yes no subusb yes yes yes no yes no xorb yes yes yes yes yes no absw yes yes yes no yes no addw yes yes yes no yes no addssw yes yes yes no yes no addusw yes yes yes no yes no andw yes yes yes yes yes no andnw yes yes yes yes yes no avgsw yes yes yes no yes no avguw yes yes yes yes yes no cmpeqw yes yes yes yes yes no cmpgtsw yes yes yes yes yes no copyw yes yes yes yes yes no div255w yes yes yes no yes no divluw yes yes no no no no loadw yes yes yes yes yes no loadoffw yes yes no no yes no loadpw yes yes yes yes yes no maxsw yes yes yes no yes no maxuw yes yes yes no yes no minsw yes yes yes no yes no minuw yes yes yes no yes no mullw yes yes yes yes yes no mulhsw yes yes yes yes yes no mulhuw yes yes yes no yes no orw yes yes yes yes yes no shlw yes yes yes yes yes no shrsw yes yes yes no yes no shruw yes yes yes yes yes no signw yes yes yes no yes no storew yes yes yes yes yes no subw yes yes yes no yes no subssw yes yes yes no yes no subusw yes yes yes no yes no xorw yes yes yes yes yes no absl yes yes yes no yes no addl yes yes yes yes yes no addssl yes yes yes yes yes no addusl yes yes yes yes yes no andl yes yes yes yes yes no andnl yes yes yes yes yes no avgsl yes yes yes no yes no avgul yes yes yes no yes no cmpeql yes yes yes yes yes no cmpgtsl yes yes yes yes yes no copyl yes yes yes yes yes no loadl yes yes yes yes yes no loadoffl yes yes no no yes no loadpl yes yes yes yes yes no maxsl yes yes yes yes yes no maxul yes yes yes yes yes no minsl yes yes yes yes yes no minul yes yes yes yes yes no mulll yes no no yes yes no mulhsl yes no no yes yes no mulhul yes no no no yes no orl yes yes yes yes yes no shll yes yes yes yes yes no shrsl yes yes yes yes yes no shrul yes yes yes yes yes no signl yes yes yes no yes no storel yes yes yes yes yes no subl yes yes yes yes yes no subssl yes yes yes no yes no subusl yes yes yes yes yes no xorl yes yes yes yes yes no loadq yes yes yes no yes no loadpq yes yes no no no no storeq yes yes yes no yes no splatw3q yes yes yes no yes no copyq yes yes no no yes no cmpeqq no no no no no no cmpgtsq no no no no no no andq yes yes no no yes no andnq yes yes no no yes no orq yes yes no no yes no xorq yes yes no no yes no addq yes no no no yes no subq yes no no no yes no shlq yes yes no no no no shrsq yes yes no no no no shruq yes yes no no no no convsbw yes yes yes yes yes no convubw yes yes yes no yes no splatbw yes yes yes no yes no splatbl yes yes yes no yes no convswl yes yes yes no yes no convuwl yes yes yes no yes no convslq yes yes yes no yes no convulq yes yes yes no yes no convwb yes yes yes yes yes no convhwb yes yes yes no yes no convssswb yes yes yes no yes no convsuswb yes yes yes no yes no convusswb no no no no no no convuuswb yes yes yes no yes no convlw yes yes yes yes yes no convhlw yes yes yes no yes no convssslw yes yes yes no yes no convsuslw no no yes no yes no convusslw no no no no no no convuuslw no no yes no yes no convql yes yes yes no yes no convsssql no no no no yes no convsusql no no no no yes no convussql no no no no no no convuusql no no no no yes no mulsbw yes yes yes yes yes no mulubw yes yes yes no yes no mulswl yes yes yes no yes no muluwl yes yes yes no yes no mulslq no no no no no no mululq yes no no no no no accw yes yes no no yes no accl yes yes yes no yes no accsadubl yes yes no no yes no swapw yes yes yes no yes no swapl yes yes yes no yes no swapwl yes yes no no yes no swapq yes yes no no yes no swaplq yes yes no no yes no select0wb yes yes yes yes yes no select1wb yes yes yes yes yes no select0lw yes yes yes yes yes no select1lw yes yes yes yes yes no select0ql yes yes no no yes no select1ql yes yes no no no no mergelq yes yes no no yes no mergewl yes yes yes yes yes no mergebw yes yes yes no yes no splitql yes yes no no yes no splitlw yes yes yes no yes no splitwb yes yes yes no yes no addf yes no yes no yes no subf yes no yes no yes no mulf yes no yes no yes no divf yes no no no yes no sqrtf yes no no no yes no maxf yes no yes no yes no minf yes no yes no yes no cmpeqf yes no yes no yes no cmpltf yes no yes no no no cmplef yes no yes no no no convfl yes no yes no yes no convlf yes no yes no yes no addd yes no no no yes no subd yes no no no yes no muld yes no no no yes no divd yes no no no yes no sqrtd yes no no no no no maxd yes no no no no no mind yes no no no no no cmpeqd yes no no no no no cmpltd yes no no no no no cmpled yes no no no no no convdl yes no no no no no convld yes no no no no no convfd yes no no no no no convdf yes no no no no no
orc-0.4.18/doc/Makefile.am0000664000175000017500000000734612177015514012130 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=orc # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=../orc # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/orc/*.h CFILE_GLOB=$(top_srcdir)/orc/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h EXTRA_HFILES= # Header files to ignore when scanning. Use base file name, no paths # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES=orc-stdint.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files=building.xml concepts.xml opcode_table.xml opcodes.xml \ program.xml running.xml tutorial.xml table.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS= GTKDOC_LIBS= # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += # Comment this out if you want your docs-status tested during 'make check' if ENABLE_GTK_DOC #TESTS_ENVIRONMENT = cd $(srcsrc) && #TESTS = $(GTKDOC_CHECK) endif -include $(top_srcdir)/git.mk update-www: rsync -a html/* cooker.entropywave.com:/srv/code.entropywave.com/www/documentation/orc update-tables: $(top_builddir)/testsuite/generate_xml_table $(top_builddir)/testsuite/generate_xml_table2 $(top_builddir)/testsuite/generate_xml_table >table.xml $(top_builddir)/testsuite/generate_xml_table2 >opcode_table.xml orc-0.4.18/doc/version.entities.in0000644000175000017500000000012611565023074013717 00000000000000 orc-0.4.18/doc/opcodes.xml0000644000175000017500000000613411565023074012242 00000000000000 %version-entities; ]> Orc Opcodes 3 Orc Orc Opcodes Description of Opcodes Orc Opcodes Opcodes only work with variables of a particular size. In the table below, destination and source indicate the size of the destination and source operands, in bytes. In general, opcodes have a suffix indicating the sizes, "b" for 1-byte operations, "w" for 2-byte operations, and "l" for 4-byte operations. If the source and destination have different sizes, the source size suffix is listed first, then the destination suffix. For example, converting a 1-byte variable to 2-byte can be performed using the "convsbw" opcode. Signed, unsigned, and saturating operations are indicated by the letters "s", "u", and "s". If signed or unsigned is not indicated, it generally means that the signedness is not relevant to the definition of the opcode, and that the operation on signed or unsigned values will give the same result. The "select" opcodes divide the bits in the source value into two halves. For "select0", the half that is first in memory order is selected, and the latter half for "select1". In other words, "convwb" is the same as "select0wb" on little-endian systems, and "select1wb" on big-endian systems. The "merge" opcodes take two values and put them together in memory order. Accumulating opcodes require an accumulator variable as the destination. Accumulating opcodes start with "acc". These opcodes sum the source values over the entire array, and can be read from the OrcExecutor structure after an execution of an Orc program. Shift opcodes only work with constants or parameters as the second source value. For more precise understanding of operations, it is recommended to compile a program for the C target and examine the resulting C source code. In the pseudo code of the above table, abs() indicates absolute value, clamp() indicates that any values outside the destination range are set to the nearest value in the destination range, and sign() evaluates to -1 for values less than 0, 1 for values greater than 0, and 0 for 0. Rule Coverage The values for shift operations are not correct in this table. orc-0.4.18/doc/running.xml0000644000175000017500000000344611565023105012264 00000000000000 %version-entities; ]> Running Orc Applications 3 Orc Running Orc Applications How to run applications using ORC. Running Orc Applications At runtime several environment variables can be used to control ORC. <envar>ORC_DEBUG</envar> This environment variable can be set to a number indicating the level for debug logging. A value of 0 (default) results in no debug logging. The higher the value to more detail is logged. <envar>ORC_CODE</envar> This variable can be set to a comma separated list of flags to control the code selection and execution. Supported values are: backup, emulate and debug. The value 'backup' would instruct ORC to select the C based backup functions. Selecting 'emulate' will run the ORC code through an interpreter. Using 'debug' enables debuggers such as gdb to create useful backtraces from ORC-generated code <envar>ORC_CPU_FLAGS</envar> This environment variable can be used to manually specify cpu capabilities. orc-0.4.18/doc/program.xml0000664000175000017500000000662112177015514012260 00000000000000 %version-entities; ]> Orc Program Syntax 3 Orc Orc Program Description of the Orc program syntax Orc Program An orc program is an UTF-8 file containing the source read by the Orc-compiler. Each program consists of several blocks. Each block contains a directives and opcodes. .init Global initialisation for a module. .function .function <function-name> Starts a new function. Takes one arg which is the function name. .flags .flags (1d|2d) Tells wheter arrays are 1 or 2 dimensional. The default is 1d. .source .source <size> <var-name> [<type-name>] Input data array parameter for functions. Arguments denote size of the items in the array (1,2,4,8), name of the variable and optional name of the type. Only reads are allowed. .dest .dest <size> <var-name> [<type-name>] Output data array parameter for functions. Arguments denote size of the items in the array (1,2,4,8), name of the variable and optional name of the type. This directive can also be used for in/out array parameters. .accumulator .accumulator <size> <var-name> [<type-name>] Output value parameter for functions. Arguments denote size of the variable (1,2,4,8), name of the variable and optional name of the type. .param .param <size> <var-name> [<type-name>] Parameter for functions. Arguments denote size of the variable (1,2,4,8), name of the variable and optional name of the type. This directive has variants named: .longparam, .floatparam and .doubleparam. .const .const <size> <var-name> Constant for functions. Arguments denote size of the constant (1,2,4,8) and the name. .temp .temp <size> <var-name> Local variable for functions. Arguments denote size of the variable (1,2,4,8) and then name. orc-0.4.18/doc/orc-sections.txt0000644000175000017500000001307512206165374013242 00000000000000
orc orc_init
orcprogram OrcProgram ORC_N_CONSTANTS ORC_N_RULE_SETS ORC_N_TARGETS ORC_PROGRAM_ERROR orc_program_new orc_program_new_dss orc_program_new_as orc_program_new_ass orc_program_new_ds orc_program_free orc_program_get_name orc_program_set_name orc_program_add_temporary orc_program_add_source orc_program_add_destination orc_program_add_constant orc_program_add_accumulator orc_program_add_parameter orc_program_append orc_program_append_str orc_program_append_ds orc_program_append_ds_str orc_program_compile orc_program_compile_for_target orc_program_compile_full orc_program_get_asm_code orc_program_find_var_by_name orc_program_allocate_register orc_program_get_max_var_size orc_program_dup_temporary
orcutils orc_bool ORC_ASSERT ORC_BEGIN_DECLS ORC_CLAMP ORC_END_DECLS ORC_EXPORT ORC_GNUC_PREREQ ORC_GNU_PRINTF ORC_INTERNAL ORC_PTR_TO_INT ORC_READ_UINT32_LE ORC_WRITE_UINT32_LE
misc OrcVariable OrcInstruction OrcRule OrcFixup OrcRuleEmitFunc ORC_N_REGS ORC_N_INSNS ORC_N_VARIABLES ORC_N_REGISTERS ORC_N_FIXUPS ORC_N_LABELS ORC_GP_REG_BASE ORC_VEC_REG_BASE ORC_STRUCT_OFFSET OrcVarType orc_powerpc_init orc_arm_init orc_c_init orc_parse ARRAY_SIZE MAX MIN get_cpuinfo_line get_file get_file_int get_tag_value strsplit
orcdebug OrcDebugLevel OrcDebugPrintFunc ORC_DEBUG_PRINT ORC_ERROR ORC_WARNING ORC_INFO ORC_DEBUG ORC_LOG ORC_FUNCTION orc_debug_get_level orc_debug_print orc_debug_set_level orc_debug_set_print_function
orccompiler OrcCompileResult OrcCompiler OrcConstant ORC_COMPILER_ERROR ORC_COMPILE_RESULT_IS_FATAL ORC_COMPILE_RESULT_IS_SUCCESSFUL ORC_ASM_CODE ORC_ENABLE_ASM_CODE orc_compiler_allocate_codemem orc_compiler_append_code orc_compiler_get_dest orc_compiler_label_new
orcopcode OrcOpcodeEmulateFunc OrcOpcodeExecutor OrcOpcodeSet OrcRuleSet OrcStaticOpcode OrcTarget ORC_OPCODE_N_ARGS ORC_STATIC_OPCODE_ACCUMULATOR ORC_STATIC_OPCODE_N_DEST ORC_STATIC_OPCODE_N_SRC orc_opcode_find_by_name orc_opcode_init orc_opcode_register_static orc_opcode_set_find_by_name orc_opcode_set_get orc_rule_set_new orc_target_get_asm_preamble orc_target_get_by_name orc_target_get_default orc_target_get_default_flags orc_target_get_name orc_target_get_rule orc_target_register
orcexecutor OrcExecutor orc_executor_new orc_executor_free orc_executor_set_array orc_executor_set_array_str orc_executor_set_n orc_executor_emulate orc_executor_run orc_executor_get_accumulator orc_executor_get_accumulator_str orc_executor_set_param orc_executor_set_param_str orc_executor_set_program
orcrule orc_rule_register
orcx86 orc_x86_emit_add_imm_memoffset orc_x86_emit_add_imm_reg orc_x86_emit_add_reg_memoffset orc_x86_emit_align orc_x86_emit_and_imm_memoffset orc_x86_emit_and_imm_reg orc_x86_emit_cmp_imm_memoffset orc_x86_emit_cmp_reg_memoffset orc_x86_emit_dec_memoffset orc_x86_emit_emms orc_x86_emit_epilogue orc_x86_emit_je orc_x86_emit_jle orc_x86_emit_jmp orc_x86_emit_jne orc_x86_emit_label orc_x86_emit_modrm_memoffset orc_x86_emit_modrm_reg orc_x86_emit_mov_imm_reg orc_x86_emit_mov_memoffset_mmx orc_x86_emit_mov_memoffset_reg orc_x86_emit_mov_memoffset_sse orc_x86_emit_mov_mmx_memoffset orc_x86_emit_mov_mmx_reg orc_x86_emit_mov_mmx_reg_reg orc_x86_emit_mov_reg_memoffset orc_x86_emit_mov_reg_mmx orc_x86_emit_mov_reg_reg orc_x86_emit_mov_reg_sse orc_x86_emit_mov_sse_memoffset orc_x86_emit_mov_sse_reg orc_x86_emit_mov_sse_reg_reg orc_x86_emit_pop orc_x86_emit_prologue orc_x86_emit_push orc_x86_emit_ret orc_x86_emit_rex orc_x86_emit_sar_imm_reg orc_x86_emit_sub_memoffset_reg orc_x86_emit_sub_reg_reg orc_x86_emit_test_reg_reg orc_x86_get_regname orc_x86_get_regname_16 orc_x86_get_regname_64 orc_x86_get_regname_mmx orc_x86_get_regname_ptr orc_x86_get_regname_sse orc_x86_get_regnum orc_x86_do_fixups
orcsse OrcSSERegister OrcTargetSSEFlags ORC_SSE_SHUF orc_sse_emit_0f orc_sse_emit_660f orc_sse_emit_f20f orc_sse_emit_f30f orc_sse_emit_loadib orc_sse_emit_loadil orc_sse_emit_loadiw orc_sse_emit_loadpb orc_sse_emit_loadpl orc_sse_emit_loadpq orc_sse_emit_loadpw orc_sse_emit_pshufd orc_sse_emit_pshuflw orc_sse_emit_shiftimm orc_sse_get_cpu_flags orc_sse_init
orcmmx OrcMMXRegister OrcTargetMMXFlags ORC_MMX_SHUF orc_mmx_emit_0f orc_mmx_emit_660f orc_mmx_emit_f20f orc_mmx_emit_f30f orc_mmx_emit_loadib orc_mmx_emit_loadil orc_mmx_emit_loadiw orc_mmx_emit_loadpb orc_mmx_emit_loadpl orc_mmx_emit_loadpq orc_mmx_emit_loadpw orc_mmx_emit_pshufw orc_mmx_emit_shiftimm orc_mmx_get_cpu_flags orc_mmx_init
orcarm OrcArmCond OrcArmDP OrcArmRegister orc_arm_do_fixups orc_arm_emit orc_arm_emit_add orc_arm_emit_add_imm orc_arm_emit_branch orc_arm_emit_bx_lr orc_arm_emit_cmp_imm orc_arm_emit_dp_reg orc_arm_emit_label orc_arm_emit_load_reg orc_arm_emit_loadimm orc_arm_emit_mov orc_arm_emit_pop orc_arm_emit_push orc_arm_emit_sub orc_arm_emit_sub_imm orc_arm_loadw orc_arm_reg_name orc_arm_storew
orcpowerpc powerpc_get_regname powerpc_regnum powerpc_add_fixup powerpc_do_fixups powerpc_emit powerpc_emit_655510 powerpc_emit_VA powerpc_emit_VX powerpc_emit_VX_2 powerpc_emit_X powerpc_emit_addi powerpc_emit_b powerpc_emit_beq powerpc_emit_bne powerpc_emit_label powerpc_emit_lwz powerpc_emit_ret powerpc_emit_srawi powerpc_emit_stwu powerpc_flush powerpc_get_constant
orc-0.4.18/doc/tmpl/0000775000175000017500000000000012206165374011121 500000000000000orc-0.4.18/doc/tmpl/orcprogram.sgml0000644000175000017500000000621512206165374014102 00000000000000 orcprogram @program: @...: @void: @Returns: @size1: @size2: @size3: @Returns: @size1: @size2: @Returns: @size1: @size2: @size3: @Returns: @size1: @size2: @Returns: @program: @program: @Returns: @program: @name: @program: @size: @name: @Returns: @program: @size: @name: @Returns: @program: @size: @name: @Returns: @program: @size: @value: @name: @Returns: @program: @size: @name: @Returns: @program: @size: @name: @Returns: @p: @opcode: @arg0: @arg1: @arg2: @p: @opcode: @arg0: @arg1: @arg2: @program: @opcode: @arg0: @arg1: @p: @opcode: @arg0: @arg1: @p: @Returns: @p: @target: @Returns: @p: @target: @flags: @Returns: @program: @Returns: @program: @name: @Returns: @program: @is_data: @Returns: @program: @i: @j: @Returns: orc-0.4.18/doc/tmpl/orcdebug.sgml0000664000175000017500000000260212206165374013517 00000000000000 orcdebug @ORC_DEBUG_NONE: @ORC_DEBUG_ERROR: @ORC_DEBUG_WARNING: @ORC_DEBUG_INFO: @ORC_DEBUG_DEBUG: @ORC_DEBUG_LOG: @level: @file: @func: @line: @format: @varargs: @level: @...: @...: @...: @...: @...: @...: @void: @Returns: @level: @file: @func: @line: @format: @...: @level: @func: orc-0.4.18/doc/tmpl/orcrule.sgml0000644000175000017500000000063212206165374013377 00000000000000 orcrule @rule_set: @opcode_name: @emit: @emit_user: orc-0.4.18/doc/tmpl/orcpowerpc.sgml0000644000175000017500000000424012206165374014106 00000000000000 orcpowerpc @i: @Returns: @i: @Returns: @compiler: @type: @ptr: @label: @compiler: @compiler: @insn: @compiler: @major: @d: @a: @b: @minor: @compiler: @name: @insn: @d: @a: @b: @c: @compiler: @insn: @d: @a: @b: @p: @name: @insn: @d: @a: @b: @compiler: @insn: @d: @a: @b: @compiler: @regd: @rega: @imm: @compiler: @label: @compiler: @label: @compiler: @label: @compiler: @label: @compiler: @regd: @rega: @imm: @compiler: @compiler: @regd: @rega: @shift: @record: @compiler: @regs: @rega: @offset: @p: @type: @value: @Returns: orc-0.4.18/doc/tmpl/orcmmx.sgml0000644000175000017500000000435412206165374013236 00000000000000 orcmmx @X86_MM0: @X86_MM1: @X86_MM2: @X86_MM3: @X86_MM4: @X86_MM5: @X86_MM6: @X86_MM7: @ORC_TARGET_MMX_MMX: @ORC_TARGET_MMX_MMXEXT: @ORC_TARGET_MMX_3DNOW: @ORC_TARGET_MMX_3DNOWEXT: @ORC_TARGET_MMX_SSSE3: @ORC_TARGET_MMX_SSE4_1: @ORC_TARGET_MMX_SSE4_2: @ORC_TARGET_MMX_FRAME_POINTER: @ORC_TARGET_MMX_SHORT_JUMPS: @ORC_TARGET_MMX_64BIT: @a: @b: @c: @d: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @shuf: @src: @dest: @p: @insn_name: @code: @modrm_code: @shift: @reg: @void: @Returns: @void: orc-0.4.18/doc/tmpl/sse.sgml0000644000175000017500000000350312206165374012516 00000000000000 sse @a: @b: @c: @d: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @shuf: @src: @dest: @p: @shuf: @src: @dest: @p: @insn_name: @code: @modrm_code: @shift: @reg: @Returns: orc-0.4.18/doc/tmpl/orcx86.sgml0000644000175000017500000001153612206165374013062 00000000000000 orcx86 @p: @size: @value: @offset: @reg: @compiler: @size: @value: @reg: @record: @p: @size: @src: @offset: @dest: @p: @align_shift: @p: @size: @value: @offset: @reg: @p: @size: @value: @reg: @compiler: @size: @value: @offset: @reg: @p: @size: @src: @offset: @dest: @compiler: @size: @offset: @reg: @p: @compiler: @p: @label: @p: @label: @p: @label: @p: @label: @p: @label: @compiler: @offset: @reg1: @reg2: @compiler: @reg1: @reg2: @p: @size: @value: @reg: @compiler: @size: @offset: @reg1: @reg2: @is_aligned: @compiler: @size: @offset: @reg1: @reg2: @compiler: @size: @offset: @reg1: @reg2: @is_aligned: @compiler: @size: @reg1: @offset: @reg2: @aligned: @uncached: @compiler: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @offset: @reg2: @compiler: @reg1: @reg2: @p: @size: @src: @dest: @compiler: @size: @reg1: @offset: @reg2: @aligned: @uncached: @compiler: @size: @reg: @compiler: @compiler: @size: @reg: @p: @compiler: @size: @reg1: @reg2: @reg3: @p: @size: @value: @reg: @p: @size: @offset: @src: @dest: @p: @size: @src: @dest: @p: @size: @src: @dest: @i: @Returns: @i: @Returns: @i: @Returns: @i: @Returns: @compiler: @i: @Returns: @i: @Returns: @i: @Returns: @compiler: orc-0.4.18/doc/tmpl/orcsse.sgml0000644000175000017500000000240212206165374013217 00000000000000 orcsse @X86_XMM0: @X86_XMM1: @X86_XMM2: @X86_XMM3: @X86_XMM4: @X86_XMM5: @X86_XMM6: @X86_XMM7: @X86_XMM8: @X86_XMM9: @X86_XMM10: @X86_XMM11: @X86_XMM12: @X86_XMM13: @X86_XMM14: @X86_XMM15: @ORC_TARGET_SSE_SSE2: @ORC_TARGET_SSE_SSE3: @ORC_TARGET_SSE_SSSE3: @ORC_TARGET_SSE_SSE4_1: @ORC_TARGET_SSE_SSE4_2: @ORC_TARGET_SSE_SSE4A: @ORC_TARGET_SSE_SSE5: @ORC_TARGET_SSE_FRAME_POINTER: @ORC_TARGET_SSE_SHORT_JUMPS: @ORC_TARGET_SSE_64BIT: @a: @b: @c: @d: @p: @imm: @a: @b: @p: @imm: @a: @b: @void: @Returns: @void: orc-0.4.18/doc/tmpl/orc.sgml0000644000175000017500000000054512206165374012512 00000000000000 orc @void: orc-0.4.18/doc/tmpl/orc-unused.sgml0000664000175000017500000002641312206165374014017 00000000000000 mmx sse x86 @x: @a: @b: @a: @b: @x: @a: @b: @maj: @min: @a: @b: @x: @ptr: @struct_type: @member: @ptr: @val: @var: @is_indirect: @is_indexed: @index_var: @index_scale: @name: @n_src: @n_dest: @dest_size: @src_size: @rules: @emulate: @emulate_user: @var: @is_data: @is_chained: @chained_reg: @merge: @name: @size: @cpuinfo: @tag: @Returns: @file: @Returns: @file: @value: @Returns: @s: @tag: @Returns: @p: @reg: @value: @compiler: @cond: @opcode: @dest: @src1: @src2: @compiler: @dest: @imm: @compiler: @compiler: @Returns: @program: @p: @p: @p: @program: @program: @program: @Returns: @program: @is_data: @Returns: @p: @program: @program: @is_data: @Returns: @p: @program: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @insn_name: @code: @modrm_code: @shift: @reg: @name: @Returns: @name: @size: @var: @Returns: @compiler: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @s: @delimiter: @Returns: @compiler: @size: @value: @offset: @reg: @compiler: @size: @value: @reg: @compiler: @size: @value: @offset: @reg: @compiler: @size: @value: @reg: @compiler: @size: @value: @offset: @reg: @compiler: @size: @offset: @reg: @compiler: @compiler: @label: @compiler: @label: @compiler: @label: @compiler: @reg1: @offset: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @value: @reg1: @compiler: @size: @offset: @reg1: @reg2: @compiler: @size: @offset: @reg1: @reg2: @compiler: @size: @offset: @reg1: @reg2: @is_aligned: @compiler: @size: @reg1: @offset: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @offset: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @offset: @reg2: @aligned: @uncached: @compiler: @reg1: @reg2: @compiler: @size: @reg: @compiler: @size: @reg: @compiler: @compiler: @size: @value: @reg: @compiler: @size: @reg1: @reg2: @i: @Returns: @i: @Returns: @i: @Returns: @i: @Returns: @compiler: @i: @Returns: @i: @Returns: @i: @Returns: @compiler: orc-0.4.18/doc/tmpl/orcopcode.sgml0000644000175000017500000000471012206165374013702 00000000000000 orcopcode @ex: @user: @name: @flags: @dest_size: @src_size: @emulateN: @name: @executable: @data_register_offset: @get_default_flags: @compiler_init: @compile: @rule_sets: @n_rule_sets: @get_asm_preamble: @load_constant: @get_flag_name: @flush_cache: @load_constant_long: @_unused: @name: @Returns: @void: @sopcode: @prefix: @Returns: @opcode_set: @name: @Returns: @name: @Returns: @opcode_set: @target: @required_flags: @Returns: @target: @Returns: @target_name: @Returns: @void: @Returns: @target: @Returns: @target: @Returns: @target: @opcode: @target_flags: @Returns: @target: orc-0.4.18/doc/tmpl/mmx.sgml0000644000175000017500000000334112206165374012525 00000000000000 mmx @a: @b: @c: @d: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @insn_name: @code: @src: @dest: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @reg: @value: @p: @shuf: @src: @dest: @p: @insn_name: @code: @modrm_code: @shift: @reg: @Returns: orc-0.4.18/doc/tmpl/orcarm.sgml0000644000175000017500000000547312206165374013217 00000000000000 orcarm @ORC_ARM_COND_EQ: @ORC_ARM_COND_NE: @ORC_ARM_COND_CS: @ORC_ARM_COND_CC: @ORC_ARM_COND_MI: @ORC_ARM_COND_PL: @ORC_ARM_COND_VS: @ORC_ARM_COND_VC: @ORC_ARM_COND_HI: @ORC_ARM_COND_LS: @ORC_ARM_COND_GE: @ORC_ARM_COND_LT: @ORC_ARM_COND_GT: @ORC_ARM_COND_LE: @ORC_ARM_COND_AL: @ORC_ARM_DP_AND: @ORC_ARM_DP_EOR: @ORC_ARM_DP_SUB: @ORC_ARM_DP_RSB: @ORC_ARM_DP_ADD: @ORC_ARM_DP_ADC: @ORC_ARM_DP_SBC: @ORC_ARM_DP_RSC: @ORC_ARM_DP_TST: @ORC_ARM_DP_TEQ: @ORC_ARM_DP_CMP: @ORC_ARM_DP_CMN: @ORC_ARM_DP_ORR: @ORC_ARM_DP_MOV: @ORC_ARM_DP_BIC: @ORC_ARM_DP_MVN: @ORC_ARM_A1: @ORC_ARM_A2: @ORC_ARM_A3: @ORC_ARM_A4: @ORC_ARM_V1: @ORC_ARM_V2: @ORC_ARM_V3: @ORC_ARM_V4: @ORC_ARM_V5: @ORC_ARM_V6: @ORC_ARM_V7: @ORC_ARM_V8: @ORC_ARM_IP: @ORC_ARM_SP: @ORC_ARM_LR: @ORC_ARM_PC: @compiler: @compiler: @insn: @compiler: @dest: @src1: @src2: @compiler: @dest: @src1: @value: @compiler: @cond: @label: @compiler: @compiler: @src1: @value: @compiler: @label: @compiler: @dest: @src1: @offset: @compiler: @dest: @src: @compiler: @regs: @compiler: @regs: @compiler: @dest: @src1: @src2: @compiler: @dest: @src1: @value: @record: @compiler: @dest: @src1: @offset: @reg: @Returns: @compiler: @dest: @offset: @src1: orc-0.4.18/doc/tmpl/misc.sgml0000664000175000017500000000306012206165374012657 00000000000000 misc @p: @user: @insn: @ORC_VAR_TYPE_TEMP: @ORC_VAR_TYPE_SRC: @ORC_VAR_TYPE_DEST: @ORC_VAR_TYPE_CONST: @ORC_VAR_TYPE_PARAM: @ORC_VAR_TYPE_ACCUMULATOR: @void: @void: @void: @code: @programs: @Returns: orc-0.4.18/doc/tmpl/orccompiler.sgml0000644000175000017500000000233112206165374014240 00000000000000 orccompiler @ORC_COMPILE_RESULT_OK: @ORC_COMPILE_RESULT_UNKNOWN_COMPILE: @ORC_COMPILE_RESULT_MISSING_RULE: @ORC_COMPILE_RESULT_UNKNOWN_PARSE: @ORC_COMPILE_RESULT_PARSE: @ORC_COMPILE_RESULT_VARIABLE: @compiler: @...: @x: @x: @compiler: @...: @p: @fmt: @compiler: @Returns: orc-0.4.18/doc/tmpl/orcutils.sgml0000664000175000017500000000055112206165374013572 00000000000000 orcutils @test: orc-0.4.18/doc/tmpl/x86.sgml0000644000175000017500000001231112206165374012346 00000000000000 x86 @compiler: @size: @value: @offset: @reg: @compiler: @size: @value: @reg: @compiler: @size: @reg1: @offset: @reg: @compiler: @compiler: @size: @value: @offset: @reg: @compiler: @size: @value: @reg: @compiler: @size: @value: @offset: @reg: @compiler: @size: @reg1: @offset: @reg: @compiler: @size: @offset: @reg: @compiler: @compiler: @compiler: @label: @compiler: @label: @compiler: @label: @compiler: @label: @compiler: @label: @compiler: @reg1: @offset: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @value: @reg1: @compiler: @size: @offset: @reg1: @reg2: @is_aligned: @compiler: @size: @offset: @reg1: @reg2: @compiler: @size: @offset: @reg1: @reg2: @is_aligned: @compiler: @size: @reg1: @offset: @reg2: @aligned: @uncached: @compiler: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @offset: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg1: @offset: @reg2: @aligned: @uncached: @compiler: @reg1: @reg2: @compiler: @reg1: @reg2: @compiler: @size: @reg: @compiler: @compiler: @size: @reg: @compiler: @compiler: @size: @reg1: @reg2: @reg3: @compiler: @size: @value: @reg: @compiler: @size: @offset: @reg: @destreg: @compiler: @size: @reg1: @reg2: @compiler: @size: @reg1: @reg2: @i: @Returns: @i: @Returns: @i: @Returns: @i: @Returns: @compiler: @i: @Returns: @i: @Returns: @i: @Returns: orc-0.4.18/doc/tmpl/orcexecutor.sgml0000664000175000017500000000262312206165374014272 00000000000000 orcexecutor @program: @Returns: @ex: @ex: @var: @ptr: @ex: @name: @ptr: @ex: @n: @ex: @ex: @ex: @var: @Returns: @ex: @name: @Returns: @ex: @var: @value: @ex: @name: @value: @ex: @program: orc-0.4.18/doc/concepts.xml0000644000175000017500000002232111565023074012420 00000000000000 %version-entities; ]> Orc Concepts 3 Orc Orc Concepts High-level view of what Orc does. Orc Concepts Orc is a compiler for a simple assembly-like language. Unlike most compilers, Orc is primarily a library, which means that all its features can be controlled from any application that uses it. Also unlike most compilers, Orc creates code that can be immediately exectued by the application. Orc is mainly useful for generating code that performs simple mathematical operations on continguous arrays. An example Orc function, translated to C, might look like: void function (int *dest, int *src1, int *src2, int n) { int i; for (i = 0; i < n; i++) { dest[i] = (src1[i] + src2[i] + 1) >> 1; } } Orc is primarily targetted toward generating code for vector CPU extensions such as SSE, Altivec, and NEON. Possible usage patterns: The application generates Orc code programmatically. Generate Orc programs programmatically at runtime, compile at runtime, and execute. This is what many of the Orc test programs do, and is the most flexible and well-developed method at this time. This requires depending on the Orc library at runtime. The application developer uses Orc to produce assembly source code that is then compiled into the application. This requires the developer to have Orc installed at build time. The advantage of this method is no Orc dependency at runtime. Disadvantages are a more complex build process, potential for compiler incompatibilities with generated assembly source code, and any Orc improvements require the application to be recompiled. The application developer writes Orc source files, and compiles them into Orc bytecode to be included in the application. At runtime, Orc compiles the bytecode into executable code. This has the advantage of being easily editable. This method is still somewhat experimental. A wide variety of additional workflows are possible, although tools are not yet available to make it convenient. Concepts The OrcProgram is the primary object that applications use when using Orc to create code. It contains all the information related to what is essentially a function definition in C. Orc programs can be compiled into assembly source code, or directly into binary code that can be executed as part of the running process. On CPUs that are not supported, programs can also be executed via emulation. Orc programs can also be compiled into C source code. A program contains one or more instructions and operates on one or more source and destination arrays, and may use scalar parameters. When compiled and executed, or emulated, the instructions define the operations performed on each source array member, and the results are placed in the destination array. Another way of thinking about it is that the compiler generates code that iterates over the destination array, calculating the value of each members based on the program instructions and the corresponding values in the source arrays and scalar parameters. The form of programs is strictly limited so that they may be compiled into vector instructions effectively. It is anticipated that future versions of Orc will allow more complex programs. The arrays that Orc programs operate on must be contiguous. Some example operations are "addw" which adds two 16-bit integers, "convsbw" which converts a signed byte to a signed 16-bit integer, and "minul" which selects the lesser of two 32-bit unsigned integers. Orc only checks that the size of the operand matches the size of the variable. Thus, the compiler will not warn against using "minul" with signed 32-bit integers, because it does not know that the variables are signed or unsigned. Orc has a main set of opcodes, that is, an OrcOpcodeSet, with the name "sys". These opcodes are always available. They cover most common arithmetic and conversion instructions for 8, 16, and 32-bit integers. There are two auxiliary libraries that provide additional opcode sets, the liborc-float library that contains the "float" opcode set for 32 and 64-bit floating point operations, and the liborc-pixel library containing the "pixel" opcode set for operations on 32-bit RGBA pixels. Orc programs are compiled using the function orc_program_compile(). The compiled code will be targetted for the current processor, which is useful for compiling code that will be immediately executed. Compiling for other processor families or processor family variants, in order to produce assembly source code, can be accomplished using one of the orc_program_compile variants. Once an Orc program is compiled, it can be executed by creating an OrcExecutor structure, linking it to the program to be executed, setting the arrays and parameters, and setting the iteration count. Orc executors are the equivalent of stack frames in a called function in normal C code. However, all Orc programs use the same OrcExecutor structure, which makes code that manipulates executors simpler in respect to those that manipulate stack frames. Executors can be reused. An OrcTarget represents a particular instruction set or CPU family for which code can be generated. Current targets include MMX, SSE, Altivec, NEON, and ARM. There is also a special target that generates C source code, but is not capable of producing executable code at runtime. In most cases, the default target is the most appropriate target for the current CPU. Individual Orc targets may have various options that control code generation for that target. For example, the various CPUs handled by the SSE target have different subsets of SSE instructions that are supported. The target flags for SSE enable generation of the different subsets of SSE instructions. In order to produce target code, the Orc compiler finds an appropriate OrcRule to translate the instruction to target code. An OrcRuleSet is an array of rules that all have the required target flags, and a target may have one or more rule sets that can be enabled or disabled based on the target flags. In many cases, Orc instructions can be translated into one or two target instructions, which generates fast code. In other cases, the CPU indicated by the target and target flags does not have a fast method of performing the Orc instruction, and a slower method is chosen. This is indicated in the value returned by the compiling function call. In yet other cases, there is no implemented rule to translate an Orc instruction to target code, so compilation fails. Compilation can fail for one of two main reasons. One reason is that the compiler was unable to parse the correct meaning, such as an unknown opcode, undeclared variable, or a size mismatch. These are uncorrectible errors, and the program cannot be executed or emulated. The other reason for a compilation failure is that target code could not be generated for a variety of reasons, including missing rules or unimplemented features. In this case, the program can be emulated. This process occurs automatically. Emulation is generally slower than corresponding C code. Since the Orc compiler can produce C source code, it is possible to generate and compile backup C code for programs. This process is not yet automatic. Extending Orc Developers can extend Orc primarily by adding new opcode sets, adding new targets, and by adding new target rules. Additional opcode sets can be created and registered in a manner similar to how the liborc-float and liborc-pixel libraries. In order to make full use of new opcode sets, one must also define rules for translating these opcodes into target code. The example libraries do this by registering rule sets for various targets (mainly SSE) for their opcode sets. Orc provides low-level API for generating target code. Not all possible target instructions can be generated with the target API, so developers may need to modify and add functions to the main Orc library as necessary to generate target code. orc-0.4.18/doc/orc-overrides.txt0000644000175000017500000000000011565023074013372 00000000000000orc-0.4.18/install-sh0000755000175000017500000003325612206165327011331 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: orc-0.4.18/config.guess0000755000175000017500000012743212206165327011645 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: orc-0.4.18/compile0000755000175000017500000001615212206165327010677 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-03-05.13; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free # Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: orc-0.4.18/aclocal.m40000664000175000017500000011072012206165326011156 00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- # Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_libtool_tags.m4]) m4_include([m4/as-compiler-flag.m4]) m4_include([m4/as-host-defines.m4]) m4_include([m4/as-nano.m4]) m4_include([m4/gtk-doc.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/pkg.m4]) orc-0.4.18/orc-test/0000775000175000017500000000000012206165373011137 500000000000000orc-0.4.18/orc-test/orctest.h0000664000175000017500000000233612111024531012700 00000000000000 #ifndef _ORC_TEST_TEST_H_ #define _ORC_TEST_TEST_H_ #include #include ORC_BEGIN_DECLS typedef enum { ORC_TEST_FAILED = 0, ORC_TEST_INDETERMINATE = 1, ORC_TEST_OK = 2 } OrcTestResult; #define ORC_TEST_FLAGS_BACKUP (1<<0) #define ORC_TEST_FLAGS_FLOAT (1<<1) #define ORC_TEST_FLAGS_EMULATE (1<<2) void orc_test_init (void); OrcTestResult orc_test_gcc_compile (OrcProgram *p); OrcTestResult orc_test_gcc_compile_neon (OrcProgram *p); OrcTestResult orc_test_gcc_compile_c64x (OrcProgram *p); OrcTestResult orc_test_gcc_compile_mips (OrcProgram *p); void orc_test_random_bits (void *data, int n_bytes); OrcTestResult orc_test_compare_output (OrcProgram *program); OrcTestResult orc_test_compare_output_full (OrcProgram *program, int flags); OrcTestResult orc_test_compare_output_backup (OrcProgram *program); OrcProgram *orc_test_get_program_for_opcode (OrcStaticOpcode *opcode); OrcProgram *orc_test_get_program_for_opcode_const (OrcStaticOpcode *opcode); OrcProgram *orc_test_get_program_for_opcode_param (OrcStaticOpcode *opcode); void orc_test_performance (OrcProgram *program, int flags); double orc_test_performance_full (OrcProgram *program, int flags, const char *target); ORC_END_DECLS #endif orc-0.4.18/orc-test/orcrandom.h0000664000175000017500000000073412057245266013224 00000000000000 #ifndef _ORC_RANDOM_H_ #define _ORC_RANDOM_H_ #include ORC_BEGIN_DECLS typedef struct _OrcRandomContext OrcRandomContext; struct _OrcRandomContext { unsigned int x; }; void orc_random_init (OrcRandomContext *context, int seed); void orc_random_bits (OrcRandomContext *context, void *data, int n_bytes); void orc_random_floats (OrcRandomContext *context, float *data, int n); unsigned int orc_random (OrcRandomContext *context); ORC_END_DECLS #endif orc-0.4.18/orc-test/Makefile.in0000664000175000017500000006151512206165327013133 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = orc-test DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = liborc_test_@ORC_MAJORMINOR@_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_liborc_test_@ORC_MAJORMINOR@_la_OBJECTS = \ liborc_test_@ORC_MAJORMINOR@_la-orctest.lo \ liborc_test_@ORC_MAJORMINOR@_la-orcarray.lo \ liborc_test_@ORC_MAJORMINOR@_la-orcrandom.lo \ liborc_test_@ORC_MAJORMINOR@_la-orcprofile.lo liborc_test_@ORC_MAJORMINOR@_la_OBJECTS = \ $(am_liborc_test_@ORC_MAJORMINOR@_la_OBJECTS) liborc_test_@ORC_MAJORMINOR@_la_LINK = $(LIBTOOL) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) \ $(liborc_test_@ORC_MAJORMINOR@_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(liborc_test_@ORC_MAJORMINOR@_la_SOURCES) DIST_SOURCES = $(liborc_test_@ORC_MAJORMINOR@_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgincludedir = $(includedir)/orc-@ORC_MAJORMINOR@/orc-test ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = liborc-test-@ORC_MAJORMINOR@.la liborc_test_@ORC_MAJORMINOR@_la_LIBADD = $(ORC_LIBS) liborc_test_@ORC_MAJORMINOR@_la_LDFLAGS = \ -version-info $(ORC_LIBVERSION) \ -no-undefined -export-symbols-regex 'orc_' liborc_test_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) \ -DORC_ENABLE_UNSTABLE_API liborc_test_@ORC_MAJORMINOR@_la_SOURCES = \ orctest.c \ orcarray.c \ orcrandom.c \ orcprofile.c pkginclude_HEADERS = \ orctest.h \ orcarray.h \ orcrandom.h \ orcprofile.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu orc-test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu orc-test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done liborc-test-@ORC_MAJORMINOR@.la: $(liborc_test_@ORC_MAJORMINOR@_la_OBJECTS) $(liborc_test_@ORC_MAJORMINOR@_la_DEPENDENCIES) $(EXTRA_liborc_test_@ORC_MAJORMINOR@_la_DEPENDENCIES) $(liborc_test_@ORC_MAJORMINOR@_la_LINK) -rpath $(libdir) $(liborc_test_@ORC_MAJORMINOR@_la_OBJECTS) $(liborc_test_@ORC_MAJORMINOR@_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcarray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcprofile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcrandom.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orctest.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< liborc_test_@ORC_MAJORMINOR@_la-orctest.lo: orctest.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_test_@ORC_MAJORMINOR@_la-orctest.lo -MD -MP -MF $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orctest.Tpo -c -o liborc_test_@ORC_MAJORMINOR@_la-orctest.lo `test -f 'orctest.c' || echo '$(srcdir)/'`orctest.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orctest.Tpo $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orctest.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orctest.c' object='liborc_test_@ORC_MAJORMINOR@_la-orctest.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_test_@ORC_MAJORMINOR@_la-orctest.lo `test -f 'orctest.c' || echo '$(srcdir)/'`orctest.c liborc_test_@ORC_MAJORMINOR@_la-orcarray.lo: orcarray.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_test_@ORC_MAJORMINOR@_la-orcarray.lo -MD -MP -MF $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcarray.Tpo -c -o liborc_test_@ORC_MAJORMINOR@_la-orcarray.lo `test -f 'orcarray.c' || echo '$(srcdir)/'`orcarray.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcarray.Tpo $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcarray.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcarray.c' object='liborc_test_@ORC_MAJORMINOR@_la-orcarray.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_test_@ORC_MAJORMINOR@_la-orcarray.lo `test -f 'orcarray.c' || echo '$(srcdir)/'`orcarray.c liborc_test_@ORC_MAJORMINOR@_la-orcrandom.lo: orcrandom.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_test_@ORC_MAJORMINOR@_la-orcrandom.lo -MD -MP -MF $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcrandom.Tpo -c -o liborc_test_@ORC_MAJORMINOR@_la-orcrandom.lo `test -f 'orcrandom.c' || echo '$(srcdir)/'`orcrandom.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcrandom.Tpo $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcrandom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcrandom.c' object='liborc_test_@ORC_MAJORMINOR@_la-orcrandom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_test_@ORC_MAJORMINOR@_la-orcrandom.lo `test -f 'orcrandom.c' || echo '$(srcdir)/'`orcrandom.c liborc_test_@ORC_MAJORMINOR@_la-orcprofile.lo: orcprofile.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -MT liborc_test_@ORC_MAJORMINOR@_la-orcprofile.lo -MD -MP -MF $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcprofile.Tpo -c -o liborc_test_@ORC_MAJORMINOR@_la-orcprofile.lo `test -f 'orcprofile.c' || echo '$(srcdir)/'`orcprofile.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcprofile.Tpo $(DEPDIR)/liborc_test_@ORC_MAJORMINOR@_la-orcprofile.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='orcprofile.c' object='liborc_test_@ORC_MAJORMINOR@_la-orcprofile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liborc_test_@ORC_MAJORMINOR@_la_CFLAGS) $(CFLAGS) -c -o liborc_test_@ORC_MAJORMINOR@_la-orcprofile.lo `test -f 'orcprofile.c' || echo '$(srcdir)/'`orcprofile.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgincludeHEADERS install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/orc-test/orcrandom.c0000664000175000017500000000140712057245266013215 00000000000000 #include "config.h" #include #include #include #include void orc_random_init (OrcRandomContext *context, int seed) { context->x = seed; } void orc_random_bits (OrcRandomContext *context, void *data, int n_bytes) { orc_uint8 *d = data; int i; for(i=0;ix = 1103515245*context->x + 12345; d[i] = context->x>>16; } } void orc_random_floats (OrcRandomContext *context, float *data, int n) { int i; for(i=0;ix = 1103515245*context->x + 12345; data[i] = (double)(context->x>>16) / 32768.0 - 1.0; } } unsigned int orc_random (OrcRandomContext *context) { context->x = 1103515245*context->x + 12345; return context->x; } orc-0.4.18/orc-test/Makefile.am0000664000175000017500000000105312057245266013116 00000000000000 pkgincludedir = $(includedir)/orc-@ORC_MAJORMINOR@/orc-test lib_LTLIBRARIES = liborc-test-@ORC_MAJORMINOR@.la liborc_test_@ORC_MAJORMINOR@_la_LIBADD = $(ORC_LIBS) liborc_test_@ORC_MAJORMINOR@_la_LDFLAGS = \ -version-info $(ORC_LIBVERSION) \ -no-undefined -export-symbols-regex 'orc_' liborc_test_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) \ -DORC_ENABLE_UNSTABLE_API liborc_test_@ORC_MAJORMINOR@_la_SOURCES = \ orctest.c \ orcarray.c \ orcrandom.c \ orcprofile.c pkginclude_HEADERS = \ orctest.h \ orcarray.h \ orcrandom.h \ orcprofile.h orc-0.4.18/orc-test/orcprofile.h0000664000175000017500000000552112057245266013403 00000000000000/* * Orc - Oil Runtime Compiler * Copyright (c) 2003,2004 David A. Schleef * 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 _ORC_PROFILE_H_ #define _ORC_PROFILE_H_ #include ORC_BEGIN_DECLS /** * ORC_PROFILE_HIST_LENGTH * * Internal definition of the number of histogram entries in #OrcProfile. */ #define ORC_PROFILE_HIST_LENGTH 10 typedef struct _OrcProfile OrcProfile; /** * OrcProfile: * * An opaque structure representing profiling information. */ struct _OrcProfile { /*< private >*/ unsigned long start; unsigned long stop; unsigned long min; unsigned long last; unsigned long total; int n; int hist_n; unsigned long hist_time[ORC_PROFILE_HIST_LENGTH]; int hist_count[ORC_PROFILE_HIST_LENGTH]; }; unsigned long orc_profile_stamp(void); void orc_profile_init(OrcProfile *prof); void orc_profile_stop_handle(OrcProfile *prof); void orc_profile_get_ave_std (OrcProfile *prof, double *ave_p, double *std_p); /** * orc_profile_start: * @x: a pointer to an OrcProfile structure * * Starts a profiling run by obtaining a timestamp via orc_profile_stamp() * and writing it into @x. */ #define orc_profile_start(x) do{ \ (x)->start = orc_profile_stamp(); \ }while(0) /** * orc_profile_stop: * @x: a pointer to an OrcProfile structure * * Stops a profiling run by obtaining a timestamp via orc_profile_stamp() * and writing it into @x. It then calls orc_profile_stop_handle() to * handle post-processing of the profiling run. */ #define orc_profile_stop(x) do{ \ (x)->stop = orc_profile_stamp(); \ orc_profile_stop_handle(x); \ }while(0) ORC_END_DECLS #endif orc-0.4.18/orc-test/orcarray.c0000664000175000017500000002063412177015514013050 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_MMAP #include #endif #ifdef HAVE_MMAP /* This can be used to test non-zero high-32-bits of pointers. */ //#define USE_MMAP #endif #define EXTEND_ROWS 16 #define EXTEND_STRIDE 256 #ifdef _MSC_VER #define isnan(x) _isnan(x) #endif #define ALIGNMENT 64 #define MISALIGNMENT 0 OrcArray * orc_array_new (int n, int m, int element_size, int misalignment, int alignment) { OrcArray *ar; void *data; #ifndef USE_MMAP #ifdef HAVE_POSIX_MEMALIGN int ret ORC_GNUC_UNUSED; #endif #endif int offset; #ifdef USE_MMAP static unsigned long idx = 1; #endif ar = malloc (sizeof(OrcArray)); memset (ar, 0, sizeof(OrcArray)); ar->n = n; ar->m = m; ar->element_size = element_size; ar->stride = (n*element_size + EXTEND_STRIDE); ar->stride = (ar->stride + (ALIGNMENT-1)) & (~(ALIGNMENT-1)); ar->alloc_len = ar->stride * (m+2*EXTEND_ROWS) + (ALIGNMENT * element_size); ar->alloc_len = (ar->alloc_len + 4095) & (~4095); #ifdef USE_MMAP data = mmap ((void *)(idx<<32), ar->alloc_len, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); idx++; ar->alloc_data = data; ar->aligned_data = data; #else #ifdef HAVE_POSIX_MEMALIGN ret = posix_memalign (&data, ALIGNMENT, ar->alloc_len); ar->alloc_data = data; ar->aligned_data = data; #else data = malloc (ar->alloc_len + ALIGNMENT); ar->alloc_data = data; ar->aligned_data = (void *)((((unsigned long)data) + (ALIGNMENT-1))&(~(ALIGNMENT-1))); #endif #endif if (alignment == 0) alignment = element_size; offset = (alignment * misalignment) & (ALIGNMENT - 1); ar->data = ORC_PTR_OFFSET (ar->aligned_data, ar->stride * EXTEND_ROWS + offset); return ar; } void orc_array_free (OrcArray *array) { #ifdef USE_MMAP munmap (array->alloc_data, array->alloc_len); #else free (array->alloc_data); #endif free (array); } void orc_array_set_pattern (OrcArray *array, int value) { memset (array->aligned_data, value, array->alloc_len); } void orc_array_set_random (OrcArray *array, OrcRandomContext *context) { orc_random_bits (context, array->aligned_data, array->alloc_len); } #define CREATE_FLOAT(sign,exp,mant) (((sign)<<31)|((exp)<<23)|((mant)<<0)) static const orc_uint32 special_floats[] = { CREATE_FLOAT(0,0,0), /* 0 */ CREATE_FLOAT(1,0,0), /* -0 */ CREATE_FLOAT(0,126,0), /* 0.5 */ CREATE_FLOAT(0,127,0), /* 1 */ CREATE_FLOAT(0,128,0), /* 2 */ CREATE_FLOAT(1,126,0), /* -0.5 */ CREATE_FLOAT(1,127,0), /* -1 */ CREATE_FLOAT(1,128,0), /* -2 */ CREATE_FLOAT(0,255,0), /* infinity */ CREATE_FLOAT(1,255,0), /* -infinity */ CREATE_FLOAT(0,255,1), /* nan */ CREATE_FLOAT(1,255,1), /* -nan */ CREATE_FLOAT(0,0,1), /* denormal */ CREATE_FLOAT(1,0,1), /* -denormal */ CREATE_FLOAT(0,127+31,0), /* MAX_INT+1 */ CREATE_FLOAT(0,127+30,0x7fffff), /* largest float < MAX_INT */ CREATE_FLOAT(0,127+23,0x7fffff), /* largest non-integer float */ CREATE_FLOAT(1,127+31,0), /* MIN_INT */ CREATE_FLOAT(1,127+31,1), /* MIN_INT-1 */ CREATE_FLOAT(1,127+30,0x7fffff), /* largest float >= MIN_INT */ CREATE_FLOAT(1,127+23,0x7fffff), /* (negative) largest non-integer float */ CREATE_FLOAT(0,127+14,(32767-16384)<<(23-14)), /* 32767 */ CREATE_FLOAT(0,127+15,(0)<<(23-15)), /* 32768 */ CREATE_FLOAT(0,127+15,(1)<<(23-15)), /* -32769 */ CREATE_FLOAT(1,127+14,(32767-16384)<<(23-14)), /* -32767 */ CREATE_FLOAT(1,127+15,(0)<<(23-15)), /* -32768 */ CREATE_FLOAT(1,127+15,(1)<<(23-15)), /* -32769 */ CREATE_FLOAT(0,127+4,(27-16)<<(23-4)), /* 27 */ CREATE_FLOAT(0,127+4,(28-16)<<(23-4)), /* 28 */ CREATE_FLOAT(0,127+4,(29-16)<<(23-4)), /* 29 */ CREATE_FLOAT(0,127+4,(30-16)<<(23-4)), /* 30 */ CREATE_FLOAT(0,127+4,(31-16)<<(23-4)), /* 31 */ }; void orc_array_set_pattern_2 (OrcArray *array, OrcRandomContext *context, int type) { int i,j; switch (type) { case ORC_PATTERN_RANDOM: orc_random_bits (context, array->aligned_data, array->alloc_len); break; case ORC_PATTERN_FLOAT_SMALL: { if (array->element_size != 4) return; for(j=0;jm;j++){ orc_union32 *data; int exp; data = ORC_PTR_OFFSET(array->data, array->stride * j); for(i=0;in;i++){ data[i].i = orc_random (context); exp = (data[i].i & 0x7f80000) >> 23; exp &= 0xf; exp += 122; data[i].i &= ~0x7f800000; data[i].i |= (exp&0xff) << 23; } } } break; case ORC_PATTERN_FLOAT_SPECIAL: { if (array->element_size != 4) return; for(j=0;jm;j++){ orc_union32 *data; int x; data = ORC_PTR_OFFSET(array->data, array->stride * j); for(i=0;in;i++){ x = i&0x1f; data[i].i = special_floats[x]; } } } break; case ORC_PATTERN_FLOAT_DENORMAL: { if (array->element_size != 4) return; for(j=0;jm;j++){ orc_union32 *data; data = ORC_PTR_OFFSET(array->data, array->stride * j); for(i=0;in;i++){ data[i].i = orc_random (context); data[i].i &= ~0x7f800000; } } } break; default: break; } } #define MIN_NONDENORMAL (1.1754944909521339405e-38) #define MIN_NONDENORMAL_D (2.2250738585072014e-308) int orc_array_compare (OrcArray *array1, OrcArray *array2, int flags) { if ((flags & ORC_TEST_FLAGS_FLOAT)) { if (array1->element_size == 4) { int j; for(j=0;jm;j++){ float *a, *b; int i; a = ORC_PTR_OFFSET (array1->data, j*array1->stride); b = ORC_PTR_OFFSET (array2->data, j*array2->stride); for (i=0;in;i++){ if (isnan(a[i]) && isnan(b[i])) continue; if (a[i] == b[i]) continue; if (fabs(a[i] - b[i]) < MIN_NONDENORMAL) continue; return FALSE; } } return TRUE; } else if (array1->element_size == 8) { int j; for(j=0;jm;j++){ double *a, *b; int i; a = ORC_PTR_OFFSET (array1->data, j*array1->stride); b = ORC_PTR_OFFSET (array2->data, j*array2->stride); for (i=0;in;i++){ if (isnan(a[i]) && isnan(b[i])) continue; if (a[i] == b[i]) continue; if (abs(a[i] - b[i]) < MIN_NONDENORMAL_D) continue; return FALSE; } } return TRUE; } } else { if (memcmp (array1->aligned_data, array2->aligned_data, array1->alloc_len) == 0) { return TRUE; } } return FALSE; } int orc_array_check_out_of_bounds (OrcArray *array) { int i; int j; unsigned char *data; data = array->aligned_data; for(i=0;istride * EXTEND_ROWS;i++){ if (data[i] != ORC_OOB_VALUE) { printf("OOB check failed at start-%d\n", array->stride * EXTEND_ROWS - i); return FALSE; } } for(j=0;jm;j++){ data = ORC_PTR_OFFSET(array->data, array->stride * j); for(i=array->element_size * array->n;istride;i++){ if (data[i] != ORC_OOB_VALUE) { printf("OOB check failed on row %d, end+%d\n", j, i - array->element_size * array->n); return FALSE; } } } data = ORC_PTR_OFFSET (array->data, array->stride * array->m); for(i=0;istride * EXTEND_ROWS;i++){ if (data[i] != ORC_OOB_VALUE) { printf("OOB check failed at end+%d\n", i); return FALSE; } } return TRUE; } #if 0 void orc_array_print_compare (OrcArray *array1, OrcArray *array2) { for(j=0;jm;j++){ for(i=0;in;i++){ int a,b; int j; printf("%2d %2d:", i, j); for(k=0;kvars[k].name == NULL) continue; if (program->vars[k].vartype == ORC_VAR_TYPE_SRC && program->vars[k].size > 0) { print_array_val_signed (ex->arrays[k], program->vars[k].size, i); } } printf(" ->"); a = print_array_val_signed (dest_emul[k], program->vars[k].size, i); b = print_array_val_signed (dest_exec[k], program->vars[k].size, i); if (a != b) { printf(" *"); } printf("\n"); } } } #endif orc-0.4.18/orc-test/orcarray.h0000664000175000017500000000171312111044765013050 00000000000000 #ifndef _ORC_ARRAY_H_ #define _ORC_ARRAY_H_ #include #include #include #include #define ORC_OOB_VALUE 0xa5 typedef struct _OrcArray OrcArray; struct _OrcArray { void *data; int stride; int element_size; int n,m; void *alloc_data; int alloc_len; void *aligned_data; }; enum { ORC_PATTERN_RANDOM = 0, ORC_PATTERN_FLOAT_SMALL, ORC_PATTERN_FLOAT_SPECIAL, ORC_PATTERN_FLOAT_DENORMAL }; OrcArray *orc_array_new (int n, int m, int element_size, int misalignment, int alignment); void orc_array_free (OrcArray *array); void orc_array_set_pattern (OrcArray *array, int value); void orc_array_set_random (OrcArray *array, OrcRandomContext *context); void orc_array_set_pattern_2 (OrcArray *array, OrcRandomContext *context, int type); int orc_array_compare (OrcArray *array1, OrcArray *array2, int flags); int orc_array_check_out_of_bounds (OrcArray *array); #endif orc-0.4.18/orc-test/orcprofile.c0000664000175000017500000001306112057245266013374 00000000000000/* * Orc - Oil Runtime Compiler * Copyright (c) 2003,2004 David A. Schleef * 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. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include #include /* not used because it requires a kernel patch */ /* #undef USE_CORTEX_A8_COUNTER */ /** * SECTION:orcprofile * @title:OrcProfile * @short_description: * Measuring the length of time needed to execute Orc functions. * */ /** * orc_profile_init: * @prof: the OrcProfile structure * * Initializes a profiling structure. */ void orc_profile_init (OrcProfile *prof) { #if defined(__GNUC__) && defined(HAVE_ARM) && defined(USE_CORTEX_A8_COUNTER) unsigned int flags; __asm__ volatile ("mrc p15, 0, %0, c9, c12, 0" : "=r" (flags)); flags |= 1; __asm__ volatile ("mcr p15, 0, %0, c9, c12, 0" :: "r" (flags)); __asm__ volatile ("mcr p15, 0, %0, c9, c12, 2" :: "r"(1<<31)); __asm__ __volatile__(" mcr p15, 0, %0, c9, c13, 0" :: "r" (0)); __asm__ volatile ("mcr p15, 0, %0, c9, c12, 1" :: "r"(1<<31)); #endif memset(prof, 0, sizeof(OrcProfile)); prof->min = -1; } /** * orc_profile_stop_handle: * @prof: the OrcProfile structure * * Handles post-processing of a single profiling run. * * FIXME: need more info */ void orc_profile_stop_handle (OrcProfile *prof) { int i; prof->last = prof->stop - prof->start; prof->total += prof->last; prof->n++; if (prof->last < prof->min) prof->min = prof->last; for(i=0;ihist_n;i++) { if (prof->last == prof->hist_time[i]) { prof->hist_count[i]++; break; } } if (i == prof->hist_n && prof->hist_n < ORC_PROFILE_HIST_LENGTH) { prof->hist_time[prof->hist_n] = prof->last; prof->hist_count[prof->hist_n] = 1; prof->hist_n++; } } /** * orc_profile_get_ave_std: * @prof: the OrcProfile structure * @ave_p: pointer to average * @std_p: pointer to standard deviation * * Calculates the average and standard deviation of a number of * profiling runs, and places the results in the locations * provided by @ave_p and @std_p. Either @ave_p and @std_p may * be NULL, in which case the values will not be written. */ void orc_profile_get_ave_std (OrcProfile *prof, double *ave_p, double *std_p) { double ave; double std; int max_i; double off; double s; double s2; int i; int n; double x; do { s = s2 = 0; n = 0; max_i = -1; for(i=0;i<10;i++){ x = prof->hist_time[i]; s2 += x * x * prof->hist_count[i]; s += x * prof->hist_count[i]; n += prof->hist_count[i]; if (prof->hist_count[i] > 0) { if (max_i == -1 || prof->hist_time[i] > prof->hist_time[max_i]) { max_i = i; } } } ave = s / n; std = sqrt (s2 - s * s / n + n*n) / (n-1); off = (prof->hist_time[max_i] - ave)/std; if (off > 4.0) { prof->hist_count[max_i] = 0; } } while (off > 4.0); if (ave_p) *ave_p = ave; if (std_p) *std_p = std; } static unsigned long oil_profile_stamp_default (void) { #if defined(__GNUC__) && (defined(HAVE_I386) || defined(HAVE_AMD64)) unsigned long ts; __asm__ __volatile__("rdtsc\n" : "=a" (ts) : : "edx"); return ts; #elif defined(__GNUC__) && defined(HAVE_ARM) && defined(USE_CORTEX_A8_COUNTER) unsigned int ts; //__asm__ __volatile__(" mrc p14, 0, %0, c1, c0, 0 \n" : "=r" (ts)); __asm__ __volatile__(" mrc p15, 0, %0, c9, c13, 0 \n" : "=r" (ts)); return ts; #elif defined(_MSC_VER) && defined(HAVE_I386) unsigned long ts; __asm push edx __asm __emit 0fh __asm __emit 031h __asm mov ts, eax __asm pop edx #elif defined(HAVE_CLOCK_GETTIME) && defined(HAVE_MONOTONIC_CLOCK) struct timespec ts; clock_gettime (CLOCK_MONOTONIC, &ts); return 1000000000*ts.tv_sec + ts.tv_nsec; #elif defined(HAVE_GETTIMEOFDAY) struct timeval tv; gettimeofday(&tv,NULL); return 1000000*(unsigned long)tv.tv_sec + (unsigned long)tv.tv_usec; #else return 0; #endif } static unsigned long (*_orc_profile_stamp)(void) = oil_profile_stamp_default; /** * orc_profile_stamp: * * Creates a timestamp based on a CPU-specific high-frequency * counter, if available. * * Returns: a timestamp */ unsigned long orc_profile_stamp (void) { return _orc_profile_stamp(); } void _orc_profile_init (void) { } orc-0.4.18/orc-test/orctest.c0000664000175000017500000007745612111024531012712 00000000000000/* Copyright 2002 - 2009 David A. Schleef Copyright 2012 MIPS Technologies, Inc. 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 "config.h" #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER #define isnan(x) _isnan(x) #define snprintf _snprintf #endif #define MIN_NONDENORMAL (1.1754944909521339405e-38) void _orc_profile_init(void); OrcRandomContext rand_context; void orc_test_init (void) { orc_init (); setvbuf (stdout, NULL, _IONBF, 0); orc_random_init (&rand_context, 0x12345678); _orc_profile_init (); } OrcTestResult orc_test_gcc_compile (OrcProgram *p) { char cmd[300]; char *base; char source_filename[100]; char obj_filename[100]; char dis_filename[100]; char dump_filename[100]; char dump_dis_filename[100]; int ret; FILE *file; OrcCompileResult result; OrcTarget *target; unsigned int flags; int n; base = "temp-orc-test"; n = snprintf(source_filename, sizeof(source_filename), "%s-source.s", base); ORC_ASSERT(n < sizeof(source_filename)); n = snprintf(obj_filename, sizeof(obj_filename), "%s.o", base); ORC_ASSERT(n < sizeof(obj_filename)); n = snprintf(dis_filename, sizeof(dis_filename), "%s-source.dis", base); ORC_ASSERT(n < sizeof(dis_filename)); n = snprintf(dump_filename, sizeof(dump_filename), "%s-dump.bin", base); ORC_ASSERT(n < sizeof(dump_filename)); n = snprintf(dump_dis_filename, sizeof(dump_dis_filename), "%s-dump.dis", base); ORC_ASSERT(n < sizeof(dump_dis_filename)); target = orc_target_get_default (); flags = orc_target_get_default_flags (target); flags |= ORC_TARGET_CLEAN_COMPILE; if (strcmp (orc_target_get_name (target), "sse") == 0) { flags |= ORC_TARGET_SSE_SHORT_JUMPS; } if (strcmp (orc_target_get_name (target), "mmx") == 0) { flags |= ORC_TARGET_MMX_SHORT_JUMPS; } result = orc_program_compile_full (p, target, flags); if (ORC_COMPILE_RESULT_IS_FATAL(result)) { printf (" error: %s\n", orc_program_get_error (p)); return ORC_TEST_FAILED; } if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf (" no code generated: %s\n", orc_program_get_error (p)); return ORC_TEST_INDETERMINATE; } fflush (stdout); file = fopen (source_filename, "w"); fprintf(file, "%s", orc_program_get_asm_code (p)); fclose (file); file = fopen (dump_filename, "w"); ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); #if defined(HAVE_POWERPC) n = snprintf (cmd, sizeof(cmd), "gcc -Wa,-mregnames -Wall -c %s -o %s", source_filename, obj_filename); #else n = snprintf (cmd, sizeof(cmd), "gcc -Wall -c %s -o %s", source_filename, obj_filename); #endif ORC_ASSERT(n < sizeof(cmd)); ret = system (cmd); if (ret != 0) { ORC_ERROR ("gcc failed"); printf("%s\n", orc_program_get_asm_code (p)); return ORC_TEST_FAILED; } #if 1 n = snprintf (cmd, sizeof(cmd), "objdump -dr %s | sed 's/^[ 0-9a-f]*:/XXX:/' >%s", obj_filename, dis_filename); #else n = snprintf (cmd, sizeof(cmd), "objdump -dr %s >%s", obj_filename, dis_filename); #endif ORC_ASSERT(n < sizeof(cmd)); ret = system (cmd); if (ret != 0) { ORC_ERROR ("objdump failed"); return ORC_TEST_FAILED; } n = snprintf (cmd, sizeof(cmd), "objcopy -I binary " #ifdef HAVE_I386 "-O elf32-i386 -B i386 " #elif defined(HAVE_AMD64) "-O elf64-x86-64 -B i386 " #elif defined(HAVE_POWERPC) "-O elf32-powerpc -B powerpc " #else /* FIXME */ #endif "--rename-section .data=.text " "--redefine-sym _binary_temp_orc_test_dump_bin_start=%s " "%s %s", p->name, dump_filename, obj_filename); ORC_ASSERT(n < sizeof(cmd)); ret = system (cmd); if (ret != 0) { printf("objcopy failed\n"); return ORC_TEST_FAILED; } #if 1 n = snprintf (cmd, sizeof(cmd), "objdump -Dr %s | sed 's/^[ 0-9a-f]*:/XXX:/' >%s", obj_filename, dump_dis_filename); #else n = snprintf (cmd, sizeof(cmd), "objdump -Dr %s >%s", obj_filename, dump_dis_filename); #endif ORC_ASSERT(n < sizeof(cmd)); ret = system (cmd); if (ret != 0) { printf("objdump failed\n"); return ORC_TEST_FAILED; } n = snprintf (cmd, sizeof(cmd), "diff -u %s %s", dis_filename, dump_dis_filename); ORC_ASSERT(n < sizeof(cmd)); ret = system (cmd); if (ret != 0) { printf("diff failed\n"); return ORC_TEST_FAILED; } remove (source_filename); remove (obj_filename); remove (dis_filename); remove (dump_filename); remove (dump_dis_filename); return ORC_TEST_OK; } #define PREFIX "/opt/arm-2008q3/bin/arm-none-linux-gnueabi-" OrcTestResult orc_test_gcc_compile_neon (OrcProgram *p) { char cmd[300]; char *base; char source_filename[100]; char obj_filename[100]; char dis_filename[100]; char dump_filename[100]; char dump_dis_filename[100]; int ret; FILE *file; OrcCompileResult result; OrcTarget *target; unsigned int flags; base = "temp-orc-test"; sprintf(source_filename, "%s-source.s", base); sprintf(obj_filename, "%s.o", base); sprintf(dis_filename, "%s-source.dis", base); sprintf(dump_filename, "%s-dump.bin", base); sprintf(dump_dis_filename, "%s-dump.dis", base); target = orc_target_get_by_name ("neon"); flags = orc_target_get_default_flags (target); flags |= ORC_TARGET_CLEAN_COMPILE; result = orc_program_compile_full (p, target, flags); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf (" no code generated: %s\n", orc_program_get_error (p)); return ORC_TEST_INDETERMINATE; } fflush (stdout); file = fopen (source_filename, "w"); fprintf(file, "%s", orc_program_get_asm_code (p)); fclose (file); file = fopen (dump_filename, "w"); ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); sprintf (cmd, PREFIX "gcc -march=armv6t2 -mcpu=cortex-a8 -mfpu=neon -Wall " "-c %s -o %s", source_filename, obj_filename); ret = system (cmd); if (ret != 0) { ORC_ERROR ("arm gcc failed"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, PREFIX "objdump -dr %s >%s", obj_filename, dis_filename); ret = system (cmd); if (ret != 0) { ORC_ERROR ("objdump failed"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, PREFIX "objcopy -I binary " "-O elf32-littlearm -B arm " "--rename-section .data=.text " "--redefine-sym _binary_temp_orc_test_dump_bin_start=%s " "%s %s", p->name, dump_filename, obj_filename); ret = system (cmd); if (ret != 0) { printf("objcopy failed\n"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, PREFIX "objdump -Dr %s >%s", obj_filename, dump_dis_filename); ret = system (cmd); if (ret != 0) { printf("objdump failed\n"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, "diff -u %s %s", dis_filename, dump_dis_filename); ret = system (cmd); if (ret != 0) { printf("diff failed\n"); return ORC_TEST_FAILED; } remove (source_filename); remove (obj_filename); remove (dis_filename); remove (dump_filename); remove (dump_dis_filename); return ORC_TEST_OK; } #define C64X_PREFIX "/opt/TI/TI_CGT_C6000_6.1.12/bin/" OrcTestResult orc_test_gcc_compile_c64x (OrcProgram *p) { char cmd[300]; char *base; char source_filename[100]; char obj_filename[100]; char dis_filename[100]; char dump_filename[100]; char dump_dis_filename[100]; int ret; FILE *file; OrcCompileResult result; OrcTarget *target; unsigned int flags; base = "temp-orc-test"; sprintf(source_filename, "%s-source.c", base); sprintf(obj_filename, "%s-source.obj", base); sprintf(dis_filename, "%s-source.dis", base); sprintf(dump_filename, "%s-dump.bin", base); sprintf(dump_dis_filename, "%s-dump.dis", base); target = orc_target_get_by_name ("c64x-c"); flags = orc_target_get_default_flags (target); result = orc_program_compile_full (p, target, flags); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf (" no code generated: %s\n", orc_program_get_error (p)); return ORC_TEST_INDETERMINATE; } fflush (stdout); file = fopen (source_filename, "w"); fprintf(file, "%s", orc_target_get_preamble (target)); fprintf(file, "%s", orc_program_get_asm_code (p)); fclose (file); file = fopen (dump_filename, "w"); ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); sprintf (cmd, C64X_PREFIX "cl6x -mv=6400+ " "-c %s", source_filename); ret = system (cmd); if (ret != 0) { ORC_ERROR ("compiler failed"); //printf("%s\n", orc_program_get_asm_code (p)); return ORC_TEST_INDETERMINATE; } sprintf (cmd, C64X_PREFIX "dis6x %s >%s", obj_filename, dis_filename); ret = system (cmd); if (ret != 0) { ORC_ERROR ("objdump failed"); return ORC_TEST_INDETERMINATE; } #if 0 sprintf (cmd, C64X_PREFIX "objcopy -I binary " "-O elf32-littlearm -B arm " "--rename-section .data=.text " "--redefine-sym _binary_temp_orc_test_dump_bin_start=%s " "%s %s", p->name, dump_filename, obj_filename); ret = system (cmd); if (ret != 0) { printf("objcopy failed\n"); return ORC_TEST_FAILED; } #endif #if 0 sprintf (cmd, C64X_PREFIX "dis6x %s >%s", dump_filename, dump_dis_filename); ret = system (cmd); if (ret != 0) { printf("objdump failed\n"); return ORC_TEST_FAILED; } sprintf (cmd, "diff -u %s %s", dis_filename, dump_dis_filename); ret = system (cmd); if (ret != 0) { printf("diff failed\n"); return ORC_TEST_FAILED; } #endif remove (source_filename); remove (obj_filename); remove (dis_filename); remove (dump_filename); remove (dump_dis_filename); return ORC_TEST_OK; } void orc_test_random_bits (void *data, int n_bytes) { #if 1 orc_uint8 *d = data; int i; for(i=0;idata, i*array->element_size + j*array->stride); switch (array->element_size) { case 1: printf(" %4d", *(orc_int8 *)ptr); return *(orc_int8 *)ptr; case 2: printf(" %5d", *(orc_int16 *)ptr); return *(orc_int16 *)ptr; case 4: printf(" %10d", *(orc_int32 *)ptr); return *(orc_int32 *)ptr; case 8: printf(" 0x%08x%08x", (orc_uint32)((*(orc_uint64 *)ptr)>>32), (orc_uint32)((*(orc_uint64 *)ptr))); return *(orc_int64 *)ptr; default: return -1; } } #ifdef unused static orc_uint64 print_array_val_unsigned (OrcArray *array, int i, int j) { void *ptr = ORC_PTR_OFFSET (array->data, i*array->element_size + j*array->stride); switch (array->element_size) { case 1: printf(" %4u", *(orc_uint8 *)ptr); return *(orc_int8 *)ptr; case 2: printf(" %5u", *(orc_uint16 *)ptr); return *(orc_int16 *)ptr; case 4: printf(" %10u", *(orc_uint32 *)ptr); return *(orc_int32 *)ptr; case 8: printf(" 0x%08x%08x", (orc_uint32)((*(orc_uint64 *)ptr)>>32), (orc_uint32)((*(orc_uint64 *)ptr))); return *(orc_int64 *)ptr; default: return -1; } } #endif static orc_uint64 print_array_val_hex (OrcArray *array, int i, int j) { void *ptr = ORC_PTR_OFFSET (array->data, i*array->element_size + j*array->stride); switch (array->element_size) { case 1: printf(" %02x", *(orc_uint8 *)ptr); return *(orc_int8 *)ptr; case 2: printf(" %04x", *(orc_uint16 *)ptr); return *(orc_int16 *)ptr; case 4: printf(" %08x", *(orc_uint32 *)ptr); return *(orc_int32 *)ptr; case 8: printf(" 0x%08x%08x", (orc_uint32)((*(orc_uint64 *)ptr)>>32), (orc_uint32)((*(orc_uint64 *)ptr))); return *(orc_int64 *)ptr; default: return -1; } } static orc_uint64 print_array_val_float (OrcArray *array, int i, int j) { void *ptr = ORC_PTR_OFFSET (array->data, i*array->element_size + j*array->stride); switch (array->element_size) { case 4: if (isnan(*(float *)ptr)) { printf(" nan %08x", *(orc_uint32 *)ptr); /* This is to get around signaling/non-signaling nans in the output */ return (*(orc_uint32 *)ptr) & 0xffbfffff; } else { printf(" %12.5g", *(float *)ptr); return *(orc_int32 *)ptr; } case 8: printf(" %12.5g", *(double *)ptr); return *(orc_int64 *)ptr; default: printf(" ERROR"); return -1; } } int float_compare (OrcArray *array1, OrcArray *array2, int i, int j) { void *ptr1 = ORC_PTR_OFFSET (array1->data, i*array1->element_size + j*array1->stride); void *ptr2 = ORC_PTR_OFFSET (array2->data, i*array2->element_size + j*array2->stride); switch (array1->element_size) { case 4: if (isnan(*(float *)ptr1) && isnan(*(float *)ptr2)) return TRUE; if (*(float *)ptr1 == *(float *)ptr2) return TRUE; if (fabs(*(float *)ptr1 - *(float *)ptr2) < MIN_NONDENORMAL) return TRUE; return FALSE; case 8: /* FIXME */ return FALSE; } return FALSE; } OrcTestResult orc_test_compare_output (OrcProgram *program) { return orc_test_compare_output_full (program, 0); } OrcTestResult orc_test_compare_output_backup (OrcProgram *program) { return orc_test_compare_output_full (program, ORC_TEST_FLAGS_BACKUP); } OrcTestResult orc_test_compare_output_full (OrcProgram *program, int flags) { OrcExecutor *ex; int n; int m; OrcArray *dest_exec[4] = { NULL, NULL, NULL, NULL }; OrcArray *dest_emul[4] = { NULL, NULL, NULL, NULL }; OrcArray *src[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int i; int j; int k; int have_dest ORC_GNUC_UNUSED = FALSE; OrcCompileResult result; int have_acc = FALSE; int acc_exec = 0, acc_emul = 0; int ret = ORC_TEST_OK; int bad = 0; int misalignment; ORC_DEBUG ("got here"); { OrcTarget *target; unsigned int flags; target = orc_target_get_default (); flags = orc_target_get_default_flags (target); result = orc_program_compile_full (program, target, flags); if (ORC_COMPILE_RESULT_IS_FATAL(result)) { ret = ORC_TEST_FAILED; goto out; } if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf (" no code generated: %s\n", orc_program_get_error (program)); ret = ORC_TEST_INDETERMINATE; goto out; } } if (program->constant_n > 0) { n = program->constant_n; } else { n = 64 + (orc_random(&rand_context)&0xf); } ex = orc_executor_new (program); orc_executor_set_n (ex, n); if (program->is_2d) { if (program->constant_m > 0) { m = program->constant_m; } else { m = 8 + (orc_random(&rand_context)&0xf); } } else { m = 1; } orc_executor_set_m (ex, m); ORC_DEBUG("size %d %d", ex->n, ex->params[ORC_VAR_A1]); misalignment = 0; for(i=0;ivars[i].name == NULL) continue; if (program->vars[i].vartype == ORC_VAR_TYPE_SRC) { src[i-ORC_VAR_S1] = orc_array_new (n, m, program->vars[i].size, misalignment, program->vars[i].alignment); orc_array_set_random (src[i-ORC_VAR_S1], &rand_context); misalignment++; } else if (program->vars[i].vartype == ORC_VAR_TYPE_DEST) { dest_exec[i-ORC_VAR_D1] = orc_array_new (n, m, program->vars[i].size, misalignment, program->vars[i].alignment); orc_array_set_pattern (dest_exec[i], ORC_OOB_VALUE); dest_emul[i-ORC_VAR_D1] = orc_array_new (n, m, program->vars[i].size, misalignment, program->vars[i].alignment); orc_array_set_pattern (dest_emul[i], ORC_OOB_VALUE); misalignment++; } else if (program->vars[i].vartype == ORC_VAR_TYPE_PARAM) { switch (program->vars[i].param_type) { case ORC_PARAM_TYPE_INT: orc_executor_set_param (ex, i, 2); break; case ORC_PARAM_TYPE_FLOAT: orc_executor_set_param_float (ex, i, 2.0); break; case ORC_PARAM_TYPE_INT64: orc_executor_set_param_int64 (ex, i, 2); break; case ORC_PARAM_TYPE_DOUBLE: orc_executor_set_param_double (ex, i, 2.0); break; } } } for(i=0;ivars[i].vartype == ORC_VAR_TYPE_DEST) { orc_executor_set_array (ex, i, dest_exec[i-ORC_VAR_D1]->data); orc_executor_set_stride (ex, i, dest_exec[i-ORC_VAR_D1]->stride); have_dest = TRUE; } if (program->vars[i].vartype == ORC_VAR_TYPE_SRC) { orc_executor_set_array (ex, i, src[i-ORC_VAR_S1]->data); orc_executor_set_stride (ex, i, src[i-ORC_VAR_S1]->stride); } } ORC_DEBUG ("running"); if (flags & ORC_TEST_FLAGS_BACKUP) { orc_executor_run_backup (ex); } else { orc_executor_run (ex); } ORC_DEBUG ("done running"); for(i=0;ivars[i].vartype == ORC_VAR_TYPE_ACCUMULATOR) { acc_exec = ex->accumulators[0]; have_acc = TRUE; } } for(i=0;ivars[i].vartype == ORC_VAR_TYPE_DEST) { orc_executor_set_array (ex, i, dest_emul[i]->data); orc_executor_set_stride (ex, i, dest_emul[i]->stride); } if (program->vars[i].vartype == ORC_VAR_TYPE_SRC) { ORC_DEBUG("setting array %p", src[i-ORC_VAR_S1]->data); orc_executor_set_array (ex, i, src[i-ORC_VAR_S1]->data); orc_executor_set_stride (ex, i, src[i-ORC_VAR_S1]->stride); } } orc_executor_emulate (ex); for(i=0;ivars[i].vartype == ORC_VAR_TYPE_ACCUMULATOR) { acc_emul = ex->accumulators[0]; } } for(k=ORC_VAR_D1;kvars[k].size > 0) { if (!orc_array_compare (dest_exec[k-ORC_VAR_D1], dest_emul[k-ORC_VAR_D1], flags)) { printf("dest array %d bad\n", k); bad = TRUE; } if (!orc_array_check_out_of_bounds (dest_exec[k-ORC_VAR_D1])) { printf("out of bounds failure\n"); ret = ORC_TEST_FAILED; } } } if (bad) { for(j=0;jvars[l].size > 0) { if (flags & ORC_TEST_FLAGS_FLOAT) { print_array_val_float (src[l-ORC_VAR_S1], i, j); } else { print_array_val_hex (src[l-ORC_VAR_S1], i, j); } } } printf(" ->"); for(l=ORC_VAR_D1;lvars[l].size > 0) { if (flags & ORC_TEST_FLAGS_FLOAT) { a = print_array_val_float (dest_emul[l-ORC_VAR_D1], i, j); b = print_array_val_float (dest_exec[l-ORC_VAR_D1], i, j); if (!float_compare (dest_emul[l-ORC_VAR_D1], dest_exec[l-ORC_VAR_D1], i, j) != 0) { line_bad = TRUE; } } else { a = print_array_val_hex (dest_emul[l-ORC_VAR_D1], i, j); b = print_array_val_hex (dest_exec[l-ORC_VAR_D1], i, j); if (a != b) { line_bad = TRUE; } } } } if (line_bad) { printf(" *"); } printf("\n"); } } ret = ORC_TEST_FAILED; } if (have_acc) { if (acc_emul != acc_exec) { for(j=0;jvars[k].name == NULL) continue; if (program->vars[k].vartype == ORC_VAR_TYPE_SRC && program->vars[k].size > 0) { if (flags & ORC_TEST_FLAGS_FLOAT) { print_array_val_float (src[k-ORC_VAR_S1], i, j); } else { print_array_val_signed (src[k-ORC_VAR_S1], i, j); } } } printf(" -> acc\n"); } } printf("acc %d %d\n", acc_emul, acc_exec); ret = ORC_TEST_FAILED; } } if (ret == ORC_TEST_FAILED) { printf("%s", orc_program_get_asm_code (program)); } for(i=0;i<4;i++){ if (dest_exec[i]) orc_array_free (dest_exec[i]); if (dest_emul[i]) orc_array_free (dest_emul[i]); } for(i=0;i<8;i++){ if (src[i]) orc_array_free (src[i]); } orc_executor_free (ex); out: orc_program_reset (program); return ret; } OrcProgram * orc_test_get_program_for_opcode (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int flags ORC_GNUC_UNUSED = 0; int args[4] = { -1, -1, -1, -1 }; int n_args = 0; p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { if (opcode->src_size[1] == 0) { args[n_args++] = orc_program_add_constant (p, opcode->src_size[0], 1, "c1"); } else { args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_constant (p, opcode->src_size[1], 1, "c1"); if (opcode->src_size[2] != 0) { args[n_args++] = orc_program_add_constant (p, opcode->src_size[1], 1, "c1"); } } } else { args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_source (p, opcode->src_size[1], "s2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); return p; } OrcProgram * orc_test_get_program_for_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int args[4] = { -1, -1, -1, -1 }; int flags ORC_GNUC_UNUSED; int n_args = 0; p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } if (opcode->src_size[1] == 0) { args[n_args++] = orc_program_add_constant (p, opcode->src_size[0], 1, "c1"); } else { args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_constant (p, opcode->src_size[1], 1, "c1"); if (opcode->src_size[2]) { args[n_args++] = orc_program_add_constant (p, opcode->src_size[2], 1, "c2"); } } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_const_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); return p; } OrcProgram * orc_test_get_program_for_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int args[4] = { -1, -1, -1, -1 }; int flags ORC_GNUC_UNUSED; int n_args = 0; if (opcode->src_size[1] == 0) { return NULL; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_parameter (p, opcode->src_size[1], "p1"); if (opcode->src_size[2]) { args[n_args++] = orc_program_add_parameter (p, opcode->src_size[2], "p2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_p_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); return p; } void orc_test_performance (OrcProgram *program, int flags) { orc_test_performance_full (program, flags, NULL); } double orc_test_performance_full (OrcProgram *program, int flags, const char *target_name) { OrcExecutor *ex; int n; int m; OrcArray *dest_exec[4] = { NULL, NULL, NULL, NULL }; OrcArray *dest_emul[4] = { NULL, NULL, NULL, NULL }; OrcArray *src[8] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; int i, j; OrcCompileResult result; OrcProfile prof; double ave, std; OrcTarget *target; int misalignment; ORC_DEBUG ("got here"); target = orc_target_get_by_name (target_name); if (!(flags & ORC_TEST_FLAGS_BACKUP)) { unsigned int flags; flags = orc_target_get_default_flags (target); result = orc_program_compile_full (program, target, flags); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf("compile failed\n"); orc_program_reset (program); return 0; } } if (program->constant_n > 0) { n = program->constant_n; } else { //n = 64 + (orc_random(&rand_context)&0xf); n = 1000; } ex = orc_executor_new (program); orc_executor_set_n (ex, n); if (program->is_2d) { if (program->constant_m > 0) { m = program->constant_m; } else { m = 8 + (orc_random(&rand_context)&0xf); } } else { m = 1; } orc_executor_set_m (ex, m); ORC_DEBUG("size %d %d", ex->n, ex->params[ORC_VAR_A1]); misalignment = 0; for(i=0;ivars[i].name == NULL) continue; if (program->vars[i].vartype == ORC_VAR_TYPE_SRC) { src[i-ORC_VAR_S1] = orc_array_new (n, m, program->vars[i].size, misalignment, program->vars[i].alignment); orc_array_set_random (src[i-ORC_VAR_S1], &rand_context); misalignment++; } else if (program->vars[i].vartype == ORC_VAR_TYPE_DEST) { dest_exec[i-ORC_VAR_D1] = orc_array_new (n, m, program->vars[i].size, misalignment, program->vars[i].alignment); orc_array_set_pattern (dest_exec[i], ORC_OOB_VALUE); dest_emul[i-ORC_VAR_D1] = orc_array_new (n, m, program->vars[i].size, misalignment, program->vars[i].alignment); orc_array_set_pattern (dest_emul[i], ORC_OOB_VALUE); misalignment++; } else if (program->vars[i].vartype == ORC_VAR_TYPE_PARAM) { orc_executor_set_param (ex, i, 2); } } ORC_DEBUG ("running"); orc_profile_init (&prof); for(i=0;i<10;i++){ orc_executor_set_n (ex, n); orc_executor_set_m (ex, m); for(j=0;jvars[j].vartype == ORC_VAR_TYPE_DEST) { orc_executor_set_array (ex, j, dest_exec[j-ORC_VAR_D1]->data); orc_executor_set_stride (ex, j, dest_exec[j-ORC_VAR_D1]->stride); } if (program->vars[j].vartype == ORC_VAR_TYPE_SRC) { orc_executor_set_array (ex, j, src[j-ORC_VAR_S1]->data); orc_executor_set_stride (ex, j, src[j-ORC_VAR_S1]->stride); } } if (flags & ORC_TEST_FLAGS_BACKUP) { orc_profile_start (&prof); orc_executor_run_backup (ex); orc_profile_stop (&prof); } else if (flags & ORC_TEST_FLAGS_EMULATE) { orc_profile_start (&prof); orc_executor_emulate (ex); orc_profile_stop (&prof); } else { orc_profile_start (&prof); orc_executor_run (ex); orc_profile_stop (&prof); } } ORC_DEBUG ("done running"); orc_profile_get_ave_std (&prof, &ave, &std); for(i=0;i<4;i++){ if (dest_exec[i]) orc_array_free (dest_exec[i]); if (dest_emul[i]) orc_array_free (dest_emul[i]); } for(i=0;i<8;i++){ if (src[i]) orc_array_free (src[i]); } orc_executor_free (ex); orc_program_reset (program); return ave/(n*m); } #define MIPS_PREFIX "mipsel-linux-gnu-" OrcTestResult orc_test_gcc_compile_mips (OrcProgram *p) { char cmd[300]; char *base; char source_filename[100]; char obj_filename[100]; char dis_filename[100]; char dump_filename[100]; char dump_dis_filename[100]; int ret; FILE *file; OrcCompileResult result; OrcTarget *target; unsigned int flags; base = "temp-orc-test"; sprintf(source_filename, "%s-source.s", base); sprintf(obj_filename, "%s.o", base); sprintf(dis_filename, "%s-source.dis", base); sprintf(dump_filename, "%s-dump.bin", base); sprintf(dump_dis_filename, "%s-dump.dis", base); target = orc_target_get_by_name ("mips"); flags = orc_target_get_default_flags (target); flags |= ORC_TARGET_CLEAN_COMPILE; result = orc_program_compile_full (p, target, flags); if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { //printf (" no code generated: %s\n", orc_program_get_error (p)); return ORC_TEST_INDETERMINATE; } fflush (stdout); file = fopen (source_filename, "w"); fprintf(file, "%s", orc_target_get_preamble (target)); fprintf(file, "%s", orc_program_get_asm_code (p)); fclose (file); file = fopen (dump_filename, "w"); ret = fwrite(p->orccode->code, p->orccode->code_size, 1, file); fclose (file); sprintf (cmd, MIPS_PREFIX "gcc -mips32r2 -mdspr2 -Wall " "-c %s -o %s", source_filename, obj_filename); ret = system (cmd); if (ret != 0) { ORC_ERROR ("mips gcc failed"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, MIPS_PREFIX "objdump -Dr -j .text %s >%s", obj_filename, dis_filename); ret = system (cmd); if (ret != 0) { ORC_ERROR ("objdump failed"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, MIPS_PREFIX "objcopy -I binary " "-O elf32-tradlittlemips -B mips:isa32r2 " "--rename-section .data=.text " "--redefine-sym _binary_temp_orc_test_dump_bin_start=%s " "%s %s", p->name, dump_filename, obj_filename); ret = system (cmd); if (ret != 0) { printf("objcopy failed\n"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, MIPS_PREFIX "objdump -Dr %s >%s", obj_filename, dump_dis_filename); ret = system (cmd); if (ret != 0) { printf("objdump failed\n"); return ORC_TEST_INDETERMINATE; } sprintf (cmd, "diff -u %s %s", dis_filename, dump_dis_filename); ret = system (cmd); if (ret != 0) { printf("diff failed\n"); return ORC_TEST_FAILED; } remove (source_filename); remove (obj_filename); remove (dis_filename); remove (dump_filename); remove (dump_dis_filename); return ORC_TEST_OK; } orc-0.4.18/tools/0000775000175000017500000000000012206165373010537 500000000000000orc-0.4.18/tools/Makefile.in0000664000175000017500000004317512206165330012527 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = orcc$(EXEEXT) orc-bugreport$(EXEEXT) subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \ $(top_srcdir)/m4/as-compiler-flag.m4 \ $(top_srcdir)/m4/as-host-defines.m4 \ $(top_srcdir)/m4/as-nano.m4 $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) orc_bugreport_SOURCES = orc-bugreport.c orc_bugreport_OBJECTS = orc-bugreport.$(OBJEXT) am__DEPENDENCIES_1 = orc_bugreport_DEPENDENCIES = $(am__DEPENDENCIES_1) \ ../orc-test/liborc-test-@ORC_MAJORMINOR@.la orcc_SOURCES = orcc.c orcc_OBJECTS = orcc.$(OBJEXT) orcc_LDADD = $(LDADD) orcc_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = orc-bugreport.c orcc.c DIST_SOURCES = orc-bugreport.c orcc.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBRT = @LIBRT@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NANO = @NANO@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORC_CFLAGS = @ORC_CFLAGS@ ORC_LIBS = @ORC_LIBS@ ORC_LIBVERSION = @ORC_LIBVERSION@ ORC_MAJORMINOR = @ORC_MAJORMINOR@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(ORC_CFLAGS) LDADD = $(ORC_LIBS) orc_bugreport_LDADD = $(ORC_LIBS) ../orc-test/liborc-test-@ORC_MAJORMINOR@.la EXTRA_DIST = test.orc all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list orc-bugreport$(EXEEXT): $(orc_bugreport_OBJECTS) $(orc_bugreport_DEPENDENCIES) $(EXTRA_orc_bugreport_DEPENDENCIES) @rm -f orc-bugreport$(EXEEXT) $(LINK) $(orc_bugreport_OBJECTS) $(orc_bugreport_LDADD) $(LIBS) orcc$(EXEEXT): $(orcc_OBJECTS) $(orcc_DEPENDENCIES) $(EXTRA_orcc_DEPENDENCIES) @rm -f orcc$(EXEEXT) $(LINK) $(orcc_OBJECTS) $(orcc_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orc-bugreport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orcc.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: orc-0.4.18/tools/Makefile.am0000664000175000017500000000027012057245267012517 00000000000000 bin_PROGRAMS = orcc orc-bugreport AM_CFLAGS = $(ORC_CFLAGS) LDADD = $(ORC_LIBS) orc_bugreport_LDADD = $(ORC_LIBS) ../orc-test/liborc-test-@ORC_MAJORMINOR@.la EXTRA_DIST = test.orc orc-0.4.18/tools/orc-bugreport.c0000664000175000017500000003277512057245267013440 00000000000000 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include static char * read_file (const char *filename); void test_opcodes (void); int error = FALSE; int main (int argc, char *argv[]) { int i; OrcProgram **programs; const char *filename = NULL; orc_init (); orc_test_init (); for(i=1;i Set debugging level\n"); printf(" ORC_CODE=[KEYWORDS,...] Modify code generation\n"); printf(" General keywords:\n"); printf(" backup Always use backup function\n"); printf(" debug Generate debuggable code (useful for backtraces on i386)\n"); printf(" SSE keywords:\n"); printf(" -sse2 Disable SSE2\n"); printf(" -sse3 Disable SSE3\n"); printf(" -ssse3 Disable SSEE3\n"); printf(" -sse41 Disable SSE4.1\n"); printf(" -sse42 Disable SSE4.2\n"); printf(" -sse4a Disable SSE4a\n"); printf(" -sse5 Disable SSE5\n"); printf("\n"); exit (0); } filename = argv[i]; } printf("Orc " VERSION " - integrated testing tool\n"); printf("Active backend: %s\n", orc_target_get_name(orc_target_get_default())); { int level1, level2, level3; orc_get_data_cache_sizes(&level1, &level2, &level3); printf("L1 cache: %d\n", level1); printf("L2 cache: %d\n", level2); printf("L3 cache: %d\n", level3); } { int family, model, stepping; orc_get_cpu_family_model_stepping (&family, &model, &stepping); printf("Family/Model/Stepping: %d/%d/%d\n", family, model, stepping); printf("CPU name: %s\n", orc_get_cpu_name ()); } { int i; int flags = orc_target_get_default_flags (orc_target_get_default()); printf("Compiler options: "); for(i=0;i<32;i++){ if (flags & (1<name); error = TRUE; } } } else { printf("Opcode test:\n"); test_opcodes(); } if (error) { printf("Errors detected. Please send entire output to ds@schleef.org.\n"); return 1; } else { printf("No errors detected.\n"); return 0; } } static char * read_file (const char *filename) { FILE *file = NULL; char *contents = NULL; long size; int ret; file = fopen (filename, "r"); if (file == NULL) return NULL; ret = fseek (file, 0, SEEK_END); if (ret < 0) goto bail; size = ftell (file); if (size < 0) goto bail; ret = fseek (file, 0, SEEK_SET); if (ret < 0) goto bail; contents = malloc (size + 1); if (contents == NULL) goto bail; ret = fread (contents, size, 1, file); if (ret < 0) goto bail; contents[size] = 0; return contents; bail: /* something failed */ if (file) fclose (file); if (contents) free (contents); return NULL; } void test_opcode_src (OrcStaticOpcode *opcode); void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); void test_opcode_inplace (OrcStaticOpcode *opcode); void test_opcode_src_2d (OrcStaticOpcode *opcode); void test_opcode_src_const_n (OrcStaticOpcode *opcode); void test_opcode_src_const_n_2d (OrcStaticOpcode *opcode); void test_opcodes (void) { int i; OrcOpcodeSet *opcode_set; opcode_set = orc_opcode_set_get ("sys"); for(i=0;in_opcodes;i++){ test_opcode_src (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ test_opcode_const (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ test_opcode_param (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ test_opcode_inplace (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ test_opcode_src_2d (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ test_opcode_src_const_n (opcode_set->opcodes + i); } for(i=0;in_opcodes;i++){ test_opcode_src_const_n_2d (opcode_set->opcodes + i); } } void test_opcode_src (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s src\n", opcode->name); error = TRUE; } orc_program_free (p); } void test_opcode_const (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; int args[4] = { -1, -1, -1, -1 }; int n_args = 0; if (opcode->src_size[1] == 0) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_constant (p, opcode->src_size[1], 1, "c1"); if (opcode->src_size[2]) { args[n_args++] = orc_program_add_constant (p, opcode->src_size[2], 1, "c2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_const_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s const\n", opcode->name); error = TRUE; } orc_program_free (p); } void test_opcode_param (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; int args[4] = { -1, -1, -1, -1 }; int n_args = 0; if (opcode->src_size[1] == 0) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { args[n_args++] = orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { args[n_args++] = orc_program_add_destination (p, opcode->dest_size[1], "d2"); } args[n_args++] = orc_program_add_source (p, opcode->src_size[0], "s1"); args[n_args++] = orc_program_add_parameter (p, opcode->src_size[1], "p1"); if (opcode->src_size[2]) { args[n_args++] = orc_program_add_parameter (p, opcode->src_size[2], "p2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_p_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_2 (p, opcode->name, 0, args[0], args[1], args[2], args[3]); ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s param\n", opcode->name); error = TRUE; } orc_program_free (p); } void test_opcode_inplace (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->dest_size[0] != opcode->src_size[0]) return; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR || opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { return; } p = orc_program_new (); orc_program_add_destination (p, opcode->dest_size[0], "d1"); if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[0], "s2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_inplace_%s", opcode->name); orc_program_set_name (p, s); orc_program_append_str (p, opcode->name, "d1", "d1", "s2"); ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s inplace\n", opcode->name); error = TRUE; } orc_program_free (p); } void test_opcode_src_2d (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); orc_program_set_2d (p); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s src_2d\n", opcode->name); error = TRUE; } orc_program_free (p); } void test_opcode_src_const_n (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); orc_program_set_constant_n (p, 8); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s src_const_n\n", opcode->name); error = TRUE; } orc_program_free (p); } void test_opcode_src_const_n_2d (OrcStaticOpcode *opcode) { OrcProgram *p; char s[40]; int ret; int flags = 0; if (opcode->flags & ORC_STATIC_OPCODE_SCALAR) { return; } p = orc_program_new (); if (opcode->flags & ORC_STATIC_OPCODE_ACCUMULATOR) { orc_program_add_accumulator (p, opcode->dest_size[0], "d1"); } else { orc_program_add_destination (p, opcode->dest_size[0], "d1"); } if (opcode->dest_size[1] != 0) { orc_program_add_destination (p, opcode->dest_size[1], "d2"); } orc_program_add_source (p, opcode->src_size[0], "s1"); if (opcode->src_size[1] != 0) { orc_program_add_source (p, opcode->src_size[1], "s2"); } if ((opcode->flags & ORC_STATIC_OPCODE_FLOAT_SRC) || (opcode->flags & ORC_STATIC_OPCODE_FLOAT_DEST)) { flags = ORC_TEST_FLAGS_FLOAT; } sprintf(s, "test_s_%s", opcode->name); orc_program_set_name (p, s); orc_program_set_2d (p); orc_program_set_constant_n (p, 8); if (opcode->dest_size[1] != 0) { orc_program_append_dds_str (p, opcode->name, "d1", "d2", "s1"); } else { orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); } ret = orc_test_compare_output_full (p, flags); if (!ret) { printf("FAIL: %s src_const_n_2d\n", opcode->name); error = TRUE; } orc_program_free (p); } orc-0.4.18/tools/test.orc0000644000175000017500000000444411551076053012145 00000000000000 .function orc_add2_rshift_add_s16_22 .dest 2 d1 .source 2 s1 .source 2 s2 .temp 2 t1 addw t1, s1, s2 addw t1, t1, 2 shrsw t1, t1, 2 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_22 .dest 2 d1 .source 2 s1 .source 2 s2 .temp 2 t1 addw t1, s1, s2 addw t1, t1, 2 shrsw t1, t1, 2 subw d1, d1, t1 .function orc_add2_rshift_add_s16_11 .dest 2 d1 .source 2 s1 .source 2 s2 .temp 2 t1 addw t1, s1, s2 addw t1, t1, 1 shrsw t1, t1, 1 addw d1, d1, t1 .function orc_add2_rshift_sub_s16_11 .dest 2 d1 .source 2 s1 .source 2 s2 .temp 2 t1 addw t1, s1, s2 addw t1, t1, 1 shrsw t1, t1, 1 subw d1, d1, t1 .function orc_add_const_rshift_s16_11 .dest 2 d1 .source 2 s1 .temp 2 t1 addw t1, s1, 1 shrsw d1, t1, 1 .function orc_add_s16 .dest 2 d1 .source 2 s1 .source 2 s2 .temp 2 t1 addw t1, s1, s2 shrsw d1, t1, 1 .function orc_lshift1_s16 .dest 2 d1 .source 2 s1 shlw d1, s1, 1 .function orc_lshift2_s16 .dest 2 d1 .source 2 s1 shlw d1, s1, 2 .function orc_mas2_add_s16 .dest 2 d1 .source 2 s1 .source 2 s2 .temp 2 t1 .temp 4 t2 .param 2 p1 .param 2 p2 .param 2 p3 addw t1, s1, s2 mulswl t2, t1, p1 addl t2, t2, p2 shll t2, t2, p3 convlw t1, t2 addw d1, d1, t1 .function orc_mas4_add_s16_1991 .dest 2 d1 .source 2 s0 .source 2 s1 .source 2 s2 .source 2 s3 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 addw t1, s1, s2 mullw t1, t1, 9 addw t2, s0, s3 subw t1, t1, t2 addw t1, t1, p1 shrsw t1, t1, p2 addw d1, d1, t1 .function orc_mas4_sub_s16_1991 .dest 2 d1 .source 2 s0 .source 2 s1 .source 2 s2 .source 2 s3 .param 2 p1 .param 2 p2 .temp 2 t1 .temp 2 t2 addw t1, s1, s2 mullw t1, t1, 9 addw t2, s0, s3 subw t1, t1, t2 addw t1, t1, p1 shrsw t1, t1, p2 subw d1, d1, t1 .function orc_subtract_s16 .dest 2 d1 .source 2 s1 .source 2 s2 subw d1, s1, s2 .function orc_memcpy .dest 1 d1 .source 1 s1 copyb d1, s1 .function orc_add_s16_u8 .dest 2 d1 .source 2 s1 .source 1 s2 .temp 2 t1 convubw t1, s2 addw d1, t1, s1 .function orc_convert_s16_u8 .dest 2 d1 .source 1 s1 convubw d1, s1 .function orc_convert_u8_s16 .dest 1 d1 .source 2 s1 convsuswb d1, s1 .function orc_subtract_s16_u8 .dest 2 d1 .source 2 s1 .source 1 s2 .temp 2 t1 convubw t1, s2 subw d1, s1, t1 .function orc_multiply_and_add_s16_u8 .dest 2 d1 .source 2 s1 .source 2 s2 .source 1 s3 .temp 2 t1 convubw t1, s3 mullw t1, t1, s2 addw d1, s1, t1 orc-0.4.18/tools/orcc.c0000664000175000017500000012022712111024531011536 00000000000000 #include "config.h" #define ORC_ENABLE_UNSTABLE_API #include #include #include #include #include #include #include static char * read_file (const char *filename); void output_code (OrcProgram *p, FILE *output); void output_code_header (OrcProgram *p, FILE *output); void output_code_test (OrcProgram *p, FILE *output); void output_code_backup (OrcProgram *p, FILE *output); void output_code_no_orc (OrcProgram *p, FILE *output); void output_code_assembly (OrcProgram *p, FILE *output); void output_code_execute (OrcProgram *p, FILE *output, int is_inline); void output_program_generation (OrcProgram *p, FILE *output, int is_inline); void output_init_function (FILE *output); static char * get_barrier (const char *s); static const char * my_basename (const char *s); int verbose = 0; int error = 0; int compat; int n_programs; OrcProgram **programs; int use_inline = FALSE; int use_code = FALSE; int use_lazy_init = FALSE; int use_backup = TRUE; int use_internal = FALSE; const char *init_function = NULL; char *target = "sse"; #define ORC_VERSION(a,b,c,d) ((a)*1000000 + (b)*10000 + (c)*100 + (d)) #define REQUIRE(a,b,c,d) do { \ if (ORC_VERSION((a),(b),(c),(d)) > compat) { \ fprintf(stderr, "Feature used that is incompatible with --compat in program %s\n", p->name); \ exit (1); \ } \ } while (0) enum { MODE_IMPL, MODE_HEADER, MODE_TEST, MODE_ASSEMBLY }; int mode = MODE_IMPL; void help (void) { printf("Usage:\n"); printf(" orcc [OPTION...] INPUT_FILE\n"); printf("\n"); printf("Help Options:\n"); printf(" -h, --help Show help options\n"); printf("\n"); printf("Application Options:\n"); printf(" -v, --verbose Output more information\n"); printf(" -o, --output FILE Write output to FILE\n"); printf(" --implementation Produce C code implementing functions\n"); printf(" --header Produce C header for functions\n"); printf(" --test Produce test code for functions\n"); printf(" --assembly Produce assembly code for functions\n"); printf(" --include FILE Add #include to code\n"); printf(" --target TARGET Generate assembly for TARGET\n"); printf(" --compat VERSION Generate code compatible with Orc version VERSION\n"); printf(" --inline Generate inline functions in header\n"); printf(" --no-inline Do not generate inline functions in header\n"); printf(" --internal Mark functions in header for internal visibility\n"); printf(" --no-internal Do not mark functions in header for internal visibility\n"); printf(" --init-function FUNCTION Generate initialization function\n"); printf(" --lazy-init Do Orc compile at function execution\n"); printf(" --no-backup Do not generate backup functions\n"); printf("\n"); exit (0); } int main (int argc, char *argv[]) { char *code; int n; int i; char *output_file = NULL; char *input_file = NULL; char *include_file = NULL; char *compat_version = VERSION; FILE *output; char *log = NULL; orc_init (); for(i=1;i= ORC_VERSION(0,4,11,1)) { use_code = TRUE; } if (output_file == NULL) { switch (mode) { case MODE_IMPL: output_file = "out.c"; break; case MODE_HEADER: output_file = "out.h"; break; case MODE_TEST: output_file = "out_test.c"; break; case MODE_ASSEMBLY: output_file = "out.s"; break; } } code = read_file (input_file); if (!code) { printf("Could not read input file: %s\n", input_file); exit(1); } n = orc_parse_full (code, &programs, &log); n_programs = n; printf("%s", log); if (programs == NULL) { printf("no programs\n"); exit(1); } if (init_function == NULL) { init_function = orc_parse_get_init_function (programs[0]); } if (init_function == NULL) { use_lazy_init = TRUE; } output = fopen (output_file, "w"); if (!output) { printf("Could not write output file: %s\n", output_file); exit(1); } fprintf(output, "\n"); fprintf(output, "/* autogenerated from %s */\n", my_basename(input_file)); fprintf(output, "\n"); if (mode == MODE_IMPL) { fprintf(output, "#ifdef HAVE_CONFIG_H\n"); fprintf(output, "#include \"config.h\"\n"); fprintf(output, "#endif\n"); if (include_file) { fprintf(output, "#include <%s>\n", include_file); } fprintf(output, "\n"); fprintf(output, "%s", orc_target_c_get_typedefs ()); fprintf(output, "\n"); fprintf(output, "#ifndef DISABLE_ORC\n"); fprintf(output, "#include \n"); fprintf(output, "#endif\n"); for(i=0;i\n", include_file); } fprintf(output, "\n"); fprintf(output, "#ifdef __cplusplus\n"); fprintf(output, "extern \"C\" {\n"); fprintf(output, "#endif\n"); fprintf(output, "\n"); if (init_function) { fprintf(output, "void %s (void);\n", init_function); fprintf(output, "\n"); } fprintf(output, "\n"); if (!use_inline) { fprintf(output, "\n"); fprintf(output, "%s", orc_target_c_get_typedefs ()); for(i=0;i\n"); fprintf(output, "\n"); for(i=0;i\n"); fprintf(output, "#include \n"); fprintf(output, "#include \n"); fprintf(output, "#include \n"); if (include_file) { fprintf(output, "#include <%s>\n", include_file); } fprintf(output, "\n"); fprintf(output, "%s", orc_target_c_get_typedefs ()); fprintf(output, "#include \n"); fprintf(output, "#include \n"); fprintf(output, "%s", orc_target_get_asm_preamble ("c")); fprintf(output, "\n"); if (use_backup) { for(i=0;iname); output_code_backup (programs[i], output); } } fprintf(output, "\n"); fprintf(output, "static int quiet = 0;\n"); fprintf(output, "static int benchmark = 0;\n"); fprintf(output, "\n"); fprintf(output, "static void help (const char *argv0)\n"); fprintf(output, "{\n"); fprintf(output, " printf(\"Usage:\\n\");\n"); fprintf(output, " printf(\" %%s [OPTION]\\n\", argv0);\n"); fprintf(output, " printf(\"Help Options:\\n\");\n"); fprintf(output, " printf(\" -h, --help Show help options\\n\");\n"); fprintf(output, " printf(\"Application Options:\\n\");\n"); fprintf(output, " printf(\" -b, --benchmark Run benchmark and show results\\n\");\n"); fprintf(output, " printf(\" -q, --quiet Don't output anything except on failures\\n\");\n"); fprintf(output, "\n"); fprintf(output, " exit(0);\n"); fprintf(output, "}\n"); fprintf(output, "\n"); fprintf(output, "int\n"); fprintf(output, "main (int argc, char *argv[])\n"); fprintf(output, "{\n"); fprintf(output, " int error = FALSE;\n"); fprintf(output, " int i;\n"); fprintf(output, "\n"); fprintf(output, " orc_test_init ();\n"); fprintf(output, "\n"); fprintf(output, " for(i=1;iname); need_comma = FALSE; for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->type_name) { fprintf(output, "%s * ORC_RESTRICT %s", orcify_typename(var->type_name), varnames[ORC_VAR_D1 + i]); } else { fprintf(output, "orc_uint%d * ORC_RESTRICT %s", var->size*8, varnames[ORC_VAR_D1 + i]); } if (p->is_2d) { fprintf(output, ", int %s_stride", varnames[ORC_VAR_D1 + i]); } need_comma = TRUE; } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->type_name) { fprintf(output, "%s * ORC_RESTRICT %s", orcify_typename(var->type_name), varnames[ORC_VAR_A1 + i]); } else { fprintf(output, "orc_uint%d * ORC_RESTRICT %s", var->size*8, varnames[ORC_VAR_A1 + i]); } need_comma = TRUE; } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); if (var->type_name) { fprintf(output, "const %s * ORC_RESTRICT %s", orcify_typename(var->type_name), varnames[ORC_VAR_S1 + i]); } else { fprintf(output, "const orc_uint%d * ORC_RESTRICT %s", var->size*8, varnames[ORC_VAR_S1 + i]); } if (p->is_2d) { fprintf(output, ", int %s_stride", varnames[ORC_VAR_S1 + i]); } need_comma = TRUE; } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { if (need_comma) fprintf(output, ", "); switch (var->param_type) { case ORC_PARAM_TYPE_INT: fprintf(output, "int %s", varnames[ORC_VAR_P1 + i]); break; case ORC_PARAM_TYPE_FLOAT: REQUIRE(0,4,5,1); fprintf(output, "float %s", varnames[ORC_VAR_P1 + i]); break; case ORC_PARAM_TYPE_INT64: REQUIRE(0,4,7,1); fprintf(output, "orc_int64 %s", varnames[ORC_VAR_P1 + i]); break; case ORC_PARAM_TYPE_DOUBLE: REQUIRE(0,4,7,1); fprintf(output, "double %s", varnames[ORC_VAR_P1 + i]); break; default: ORC_ASSERT(0); } need_comma = TRUE; } } if (p->constant_n == 0) { if (need_comma) fprintf(output, ", "); fprintf(output, "int n"); need_comma = TRUE; } if (p->is_2d && p->constant_m == 0) { if (need_comma) fprintf(output, ", "); fprintf(output, "int m"); } fprintf(output, ")"); } void output_code_header (OrcProgram *p, FILE *output) { if(use_internal) { fprintf(output, "ORC_INTERNAL void "); } else { fprintf(output, "void "); } output_prototype (p, output); fprintf(output, ";\n"); } void output_code_backup (OrcProgram *p, FILE *output) { fprintf(output, "static void\n"); if (compat < ORC_VERSION(0,4,7,1)) { fprintf(output, "_backup_%s (OrcExecutor * ex)\n", p->name); } else { fprintf(output, "_backup_%s (OrcExecutor * ORC_RESTRICT ex)\n", p->name); } fprintf(output, "{\n"); { OrcCompileResult result; result = orc_program_compile_full (p, orc_target_get_by_name("c"), ORC_TARGET_C_BARE); if (ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { fprintf(output, "%s\n", orc_program_get_asm_code (p)); } else { printf("Failed to compile backup code for '%s'\n", p->name); error = TRUE; } } fprintf(output, "}\n"); fprintf(output, "\n"); } void output_code_no_orc (OrcProgram *p, FILE *output) { fprintf(output, "void\n"); output_prototype (p, output); fprintf(output, "{\n"); { OrcCompileResult result; result = orc_program_compile_full (p, orc_target_get_by_name("c"), ORC_TARGET_C_BARE | ORC_TARGET_C_NOEXEC); if (ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { fprintf(output, "%s\n", orc_program_get_asm_code (p)); } else { printf("Failed to compile no orc for '%s'\n", p->name); error = TRUE; } } fprintf(output, "}\n"); fprintf(output, "\n"); } void output_code (OrcProgram *p, FILE *output) { fprintf(output, "\n"); fprintf(output, "/* %s */\n", p->name); fprintf(output, "#ifdef DISABLE_ORC\n"); output_code_no_orc (p, output); fprintf(output, "#else\n"); if (use_backup) { output_code_backup (p, output); } output_code_execute (p, output, FALSE); fprintf(output, "#endif\n"); fprintf(output, "\n"); } void output_code_execute (OrcProgram *p, FILE *output, int is_inline) { OrcVariable *var; int i; if (!use_lazy_init) { const char *storage; if (is_inline) { storage = "extern "; } else { if (use_inline) { storage = ""; } else { storage = "static "; } } if (use_code) { fprintf(output, "%sOrcCode *_orc_code_%s;\n", storage, p->name); } else { fprintf(output, "%sOrcProgram *_orc_program_%s;\n", storage, p->name); } } if (is_inline) { fprintf(output, "static inline void\n"); } else { fprintf(output, "void\n"); } output_prototype (p, output); fprintf(output, "\n"); fprintf(output, "{\n"); fprintf(output, " OrcExecutor _ex, *ex = &_ex;\n"); if (!use_lazy_init) { if (use_code) { fprintf(output, " OrcCode *c = _orc_code_%s;\n", p->name); } else { fprintf(output, " OrcProgram *p = _orc_program_%s;\n", p->name); } } else { fprintf(output, " static volatile int p_inited = 0;\n"); if (use_code) { fprintf(output, " static OrcCode *c = 0;\n"); } else { fprintf(output, " static OrcProgram *p = 0;\n"); } } fprintf(output, " void (*func) (OrcExecutor *);\n"); fprintf(output, "\n"); if (use_lazy_init) { fprintf(output, " if (!p_inited) {\n"); fprintf(output, " orc_once_mutex_lock ();\n"); fprintf(output, " if (!p_inited) {\n"); if (use_code) { fprintf(output, " OrcProgram *p;\n"); } fprintf(output, "\n"); output_program_generation (p, output, is_inline); fprintf(output, "\n"); fprintf(output, " orc_program_compile (p);\n"); if (use_code) { fprintf(output, " c = orc_program_take_code (p);\n"); fprintf(output, " orc_program_free (p);\n"); } fprintf(output, " }\n"); fprintf(output, " p_inited = TRUE;\n"); fprintf(output, " orc_once_mutex_unlock ();\n"); fprintf(output, " }\n"); } if (use_code) { fprintf(output, " ex->arrays[ORC_VAR_A2] = c;\n"); fprintf(output, " ex->program = 0;\n"); } else { fprintf(output, " ex->program = p;\n"); } fprintf(output, "\n"); if (p->constant_n) { fprintf(output, " ex->n = %d;\n", p->constant_n); } else { fprintf(output, " ex->n = n;\n"); } if (p->is_2d) { if (p->constant_m) { fprintf(output, " ORC_EXECUTOR_M(ex) = %d;\n", p->constant_m); } else { fprintf(output, " ORC_EXECUTOR_M(ex) = m;\n"); } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { fprintf(output, " ex->arrays[%s] = %s;\n", enumnames[ORC_VAR_D1 + i], varnames[ORC_VAR_D1 + i]); if (p->is_2d) { fprintf(output, " ex->params[%s] = %s_stride;\n", enumnames[ORC_VAR_D1 + i], varnames[ORC_VAR_D1 + i]); } } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { fprintf(output, " ex->arrays[%s] = (void *)%s;\n", enumnames[ORC_VAR_S1 + i], varnames[ORC_VAR_S1 + i]); if (p->is_2d) { fprintf(output, " ex->params[%s] = %s_stride;\n", enumnames[ORC_VAR_S1 + i], varnames[ORC_VAR_S1 + i]); } } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { switch (var->param_type) { case ORC_PARAM_TYPE_INT: fprintf(output, " ex->params[%s] = %s;\n", enumnames[ORC_VAR_P1 + i], varnames[ORC_VAR_P1 + i]); break; case ORC_PARAM_TYPE_FLOAT: REQUIRE(0,4,5,1); fprintf(output, " {\n"); fprintf(output, " orc_union32 tmp;\n"); fprintf(output, " tmp.f = %s;\n", varnames[ORC_VAR_P1 + i]); fprintf(output, " ex->params[%s] = tmp.i;\n", enumnames[ORC_VAR_P1 + i]); fprintf(output, " }\n"); break; case ORC_PARAM_TYPE_INT64: REQUIRE(0,4,7,1); fprintf(output, " {\n"); fprintf(output, " orc_union64 tmp;\n"); fprintf(output, " tmp.i = %s;\n", varnames[ORC_VAR_P1 + i]); fprintf(output, " ex->params[%s] = tmp.x2[0];\n", enumnames[ORC_VAR_P1 + i]); fprintf(output, " ex->params[%s] = tmp.x2[1];\n", enumnames[ORC_VAR_T1 + i]); fprintf(output, " }\n"); break; case ORC_PARAM_TYPE_DOUBLE: REQUIRE(0,4,5,1); fprintf(output, " {\n"); fprintf(output, " orc_union64 tmp;\n"); fprintf(output, " tmp.f = %s;\n", varnames[ORC_VAR_P1 + i]); fprintf(output, " ex->params[%s] = tmp.x2[0];\n", enumnames[ORC_VAR_P1 + i]); fprintf(output, " ex->params[%s] = tmp.x2[1];\n", enumnames[ORC_VAR_T1 + i]); fprintf(output, " }\n"); break; default: ORC_ASSERT(0); } } } fprintf(output, "\n"); if (use_code) { fprintf(output, " func = c->exec;\n"); } else { fprintf(output, " func = p->code_exec;\n"); } fprintf(output, " func (ex);\n"); for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { fprintf(output, " *%s = orc_executor_get_accumulator (ex, %s);\n", varnames[ORC_VAR_A1 + i], enumnames[ORC_VAR_A1 + i]); } } fprintf(output, "}\n"); } void output_program_generation (OrcProgram *p, FILE *output, int is_inline) { OrcVariable *var; int i; if (ORC_VERSION(0,4,16,1) <= compat) { OrcBytecode *bytecode; int i; bytecode = orc_bytecode_from_program (p); fprintf(output, "#if 1\n"); //fprintf(output, "#ifdef bytecode\n"); fprintf(output, " static const orc_uint8 bc[] = {\n"); for(i=0;ilength;i++) { if ((i&0xf) == 0) { fprintf(output, " "); } fprintf(output, "%d, ", bytecode->bytecode[i]); if ((i&0xf) == 15) { fprintf(output, "\n"); } } if ((i&0xf) != 15) { fprintf(output, "\n"); } fprintf(output, " };\n"); fprintf(output, " p = orc_program_new_from_static_bytecode (bc);\n"); //fprintf(output, " orc_program_set_name (p, \"%s\");\n", p->name); if (use_backup && !is_inline) { fprintf(output, " orc_program_set_backup_function (p, _backup_%s);\n", p->name); } #if 0 /* CHECK */ { OrcProgram *p2 = orc_program_new_from_static_bytecode (bytecode->bytecode); OrcBytecode *bytecode2 = bytecode2 = orc_bytecode_from_program (p2); fprintf(output, "#ifdef badbytecode\n"); fprintf(output, " static const orc_uint8 bc[] = {\n"); for(i=0;ilength;i++) { if ((i&0xf) == 0) { fprintf(output, " "); } fprintf(output, "%s%d, ", (bytecode->bytecode[i] == bytecode2->bytecode[i]) ? "" : "/* */", bytecode2->bytecode[i]); if ((i&0xf) == 15) { fprintf(output, "\n"); } } if ((i&0xf) != 15) { fprintf(output, "\n"); } fprintf(output, " };\n"); fprintf(output, "#endif\n"); } #endif fprintf(output, "#else\n"); } fprintf(output, " p = orc_program_new ();\n"); if (p->constant_n != 0) { fprintf(output, " orc_program_set_constant_n (p, %d);\n", p->constant_n); } if (p->n_multiple != 0) { REQUIRE(0,4,14,1); fprintf(output, " orc_program_set_n_multiple (p, %d);\n", p->n_multiple); } if (p->n_minimum != 0) { REQUIRE(0,4,14,1); fprintf(output, " orc_program_set_n_minimum (p, %d);\n", p->n_minimum); } if (p->n_maximum != 0) { REQUIRE(0,4,14,1); fprintf(output, " orc_program_set_n_maximum (p, %d);\n", p->n_maximum); } if (p->is_2d) { fprintf(output, " orc_program_set_2d (p);\n"); if (p->constant_m != 0) { fprintf(output, " orc_program_set_constant_m (p, %d);\n", p->constant_m); } } fprintf(output, " orc_program_set_name (p, \"%s\");\n", p->name); if (use_backup && !is_inline) { fprintf(output, " orc_program_set_backup_function (p, _backup_%s);\n", p->name); } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { if (var->alignment != var->size) { REQUIRE(0,4,14,1); fprintf(output, " orc_program_add_destination_full (p, %d, \"%s\", 0, %d);\n", var->size, varnames[ORC_VAR_D1 + i], var->alignment); } else { fprintf(output, " orc_program_add_destination (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_D1 + i]); } } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { if (var->alignment != var->size) { REQUIRE(0,4,14,1); fprintf(output, " orc_program_add_source_full (p, %d, \"%s\", 0, %d);\n", var->size, varnames[ORC_VAR_S1 + i], var->alignment); } else { fprintf(output, " orc_program_add_source (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_S1 + i]); } } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { fprintf(output, " orc_program_add_accumulator (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_A1 + i]); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_C1 + i]; if (var->size == 0) continue; if (var->size <= 4) { fprintf(output, " orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n", var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]); } else if (var->size > 4) { REQUIRE(0,4,8,1); fprintf(output, " orc_program_add_constant_int64 (p, %d, 0x%08x%08xULL, \"%s\");\n", var->size, (orc_uint32)(((orc_uint64)var->value.i)>>32), (orc_uint32)(var->value.i), varnames[ORC_VAR_C1 + i]); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { const char *suffix = NULL; switch (var->param_type) { case ORC_PARAM_TYPE_INT: suffix=""; break; case ORC_PARAM_TYPE_FLOAT: REQUIRE(0,4,5,1); suffix="_float"; break; case ORC_PARAM_TYPE_INT64: REQUIRE(0,4,7,1); suffix="_int64"; break; case ORC_PARAM_TYPE_DOUBLE: REQUIRE(0,4,7,1); suffix="_double"; break; default: ORC_ASSERT(0); } fprintf(output, " orc_program_add_parameter%s (p, %d, \"%s\");\n", suffix, var->size, varnames[ORC_VAR_P1 + i]); } } for(i=0;i<16;i++){ var = &p->vars[ORC_VAR_T1 + i]; if (var->size) { fprintf(output, " orc_program_add_temporary (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_T1 + i]); } } fprintf(output, "\n"); for(i=0;in_insns;i++){ OrcInstruction *insn = p->insns + i; if (compat < ORC_VERSION(0,4,6,1)) { if (insn->flags) { REQUIRE(0,4,6,1); } if (p->vars[insn->src_args[1]].size != 0) { fprintf(output, " orc_program_append (p, \"%s\", %s, %s, %s);\n", insn->opcode->name, enumnames[insn->dest_args[0]], enumnames[insn->src_args[0]], enumnames[insn->src_args[1]]); } else { fprintf(output, " orc_program_append_ds (p, \"%s\", %s, %s);\n", insn->opcode->name, enumnames[insn->dest_args[0]], enumnames[insn->src_args[0]]); } } else { int args[4] = { 0, 0, 0, 0 }; int n_args = 0; if (insn->opcode->dest_size[0] != 0) { args[n_args++] = insn->dest_args[0]; } if (insn->opcode->dest_size[1] != 0) { args[n_args++] = insn->dest_args[1]; } if (insn->opcode->src_size[0] != 0) { args[n_args++] = insn->src_args[0]; } if (insn->opcode->src_size[1] != 0) { args[n_args++] = insn->src_args[1]; } if (insn->opcode->src_size[2] != 0) { args[n_args++] = insn->src_args[2]; } fprintf(output, " orc_program_append_2 (p, \"%s\", %d, %s, %s, %s, %s);\n", insn->opcode->name, insn->flags, enumnames[args[0]], enumnames[args[1]], enumnames[args[2]], enumnames[args[3]]); } } if (ORC_VERSION(0,4,16,1) <= compat) { fprintf(output, "#endif\n"); } } void output_init_function (FILE *output) { int i; fprintf(output, "void\n"); fprintf(output, "%s (void)\n", init_function); fprintf(output, "{\n"); if (!use_lazy_init) { fprintf(output, "#ifndef DISABLE_ORC\n"); for(i=0;iname); fprintf(output, " OrcProgram *p;\n"); fprintf(output, "\n"); output_program_generation (programs[i], output, FALSE); fprintf(output, "\n"); fprintf(output, " orc_program_compile (p);\n"); fprintf(output, "\n"); if (use_code) { fprintf(output, " _orc_code_%s = orc_program_take_code (p);\n", programs[i]->name); fprintf(output, " orc_program_free (p);\n"); } else { fprintf(output, " _orc_program_%s = p;\n", programs[i]->name); } fprintf(output, " }\n"); } fprintf(output, "#endif\n"); } fprintf(output, "}\n"); fprintf(output, "\n"); } void output_code_test (OrcProgram *p, FILE *output) { OrcVariable *var; int i; fprintf(output, " /* %s */\n", p->name); fprintf(output, " {\n"); fprintf(output, " OrcProgram *p = NULL;\n"); fprintf(output, " int ret;\n"); fprintf(output, "\n"); fprintf(output, " if (!quiet)"); fprintf(output, " printf (\"%s:\\n\");\n", p->name); fprintf(output, " p = orc_program_new ();\n"); if (p->constant_n != 0) { fprintf(output, " orc_program_set_constant_n (p, %d);\n", p->constant_n); } if (p->is_2d) { fprintf(output, " orc_program_set_2d (p);\n"); if (p->constant_m != 0) { fprintf(output, " orc_program_set_constant_m (p, %d);\n", p->constant_m); } } fprintf(output, " orc_program_set_name (p, \"%s\");\n", p->name); if (use_backup) { fprintf(output, " orc_program_set_backup_function (p, _backup_%s);\n", p->name); } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_D1 + i]; if (var->size) { fprintf(output, " orc_program_add_destination (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_D1 + i]); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_S1 + i]; if (var->size) { fprintf(output, " orc_program_add_source (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_S1 + i]); } } for(i=0;i<4;i++){ var = &p->vars[ORC_VAR_A1 + i]; if (var->size) { fprintf(output, " orc_program_add_accumulator (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_A1 + i]); } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_C1 + i]; if (var->size) { if (var->size < 8) { if (var->value.i != 0x80000000) { fprintf(output, " orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n", var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]); } else { fprintf(output, " orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n", var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]); } } else { fprintf(output, " orc_program_add_constant_int64 (p, %d, " "0x%08x%08xULL, \"%s\");\n", var->size, (orc_uint32)(((orc_uint64)var->value.i)>>32), (orc_uint32)(var->value.i), varnames[ORC_VAR_C1 + i]); } } } for(i=0;i<8;i++){ var = &p->vars[ORC_VAR_P1 + i]; if (var->size) { const char *suffix = NULL; switch (var->param_type) { case ORC_PARAM_TYPE_INT: suffix=""; break; case ORC_PARAM_TYPE_FLOAT: REQUIRE(0,4,5,1); suffix="_float"; break; case ORC_PARAM_TYPE_INT64: REQUIRE(0,4,7,1); suffix="_int64"; break; case ORC_PARAM_TYPE_DOUBLE: REQUIRE(0,4,7,1); suffix="_double"; break; default: ORC_ASSERT(0); } fprintf(output, " orc_program_add_parameter%s (p, %d, \"%s\");\n", suffix, var->size, varnames[ORC_VAR_P1 + i]); } } for(i=0;i<16;i++){ var = &p->vars[ORC_VAR_T1 + i]; if (var->size) { fprintf(output, " orc_program_add_temporary (p, %d, \"%s\");\n", var->size, varnames[ORC_VAR_T1 + i]); } } fprintf(output, "\n"); for(i=0;in_insns;i++){ OrcInstruction *insn = p->insns + i; if (compat < ORC_VERSION(0,4,6,1)) { if (insn->flags) { REQUIRE(0,4,6,1); } if (p->vars[insn->src_args[1]].size != 0) { fprintf(output, " orc_program_append (p, \"%s\", %s, %s, %s);\n", insn->opcode->name, enumnames[insn->dest_args[0]], enumnames[insn->src_args[0]], enumnames[insn->src_args[1]]); } else { fprintf(output, " orc_program_append_ds (p, \"%s\", %s, %s);\n", insn->opcode->name, enumnames[insn->dest_args[0]], enumnames[insn->src_args[0]]); } } else { int args[4] = { 0, 0, 0, 0 }; int n_args = 0; if (insn->opcode->dest_size[0] != 0) { args[n_args++] = insn->dest_args[0]; } if (insn->opcode->dest_size[1] != 0) { args[n_args++] = insn->dest_args[1]; } if (insn->opcode->src_size[0] != 0) { args[n_args++] = insn->src_args[0]; } if (insn->opcode->src_size[1] != 0) { args[n_args++] = insn->src_args[1]; } if (insn->opcode->src_size[2] != 0) { args[n_args++] = insn->src_args[2]; } fprintf(output, " orc_program_append_2 (p, \"%s\", %d, %s, %s, %s, %s);\n", insn->opcode->name, insn->flags, enumnames[args[0]], enumnames[args[1]], enumnames[args[2]], enumnames[args[3]]); } } fprintf(output, "\n"); if (compat >= ORC_VERSION(0,4,7,1)) { fprintf(output, " if (benchmark) {\n"); fprintf(output, " printf (\" cycles (emulate) : %%g\\n\",\n"); fprintf(output, " orc_test_performance_full (p, ORC_TEST_FLAGS_EMULATE, NULL));\n"); fprintf(output, " }\n"); fprintf(output, "\n"); } if (use_backup) { fprintf(output, " ret = orc_test_compare_output_backup (p);\n"); fprintf(output, " if (!ret) {\n"); fprintf(output, " error = TRUE;\n"); fprintf(output, " } else if (!quiet) {\n"); fprintf(output, " printf (\" backup function : PASSED\\n\");\n"); fprintf(output, " }\n"); fprintf(output, "\n"); if (compat >= ORC_VERSION(0,4,7,1)) { fprintf(output, " if (benchmark) {\n"); fprintf(output, " printf (\" cycles (backup) : %%g\\n\",\n"); fprintf(output, " orc_test_performance_full (p, ORC_TEST_FLAGS_BACKUP, NULL));\n"); fprintf(output, " }\n"); fprintf(output, "\n"); } } fprintf(output, " ret = orc_test_compare_output (p);\n"); fprintf(output, " if (ret == ORC_TEST_INDETERMINATE && !quiet) {\n"); fprintf(output, " printf (\" compiled function: COMPILE FAILED\\n\");\n"); fprintf(output, " } else if (!ret) {\n"); fprintf(output, " error = TRUE;\n"); fprintf(output, " } else if (!quiet) {\n"); fprintf(output, " printf (\" compiled function: PASSED\\n\");\n"); fprintf(output, " }\n"); fprintf(output, "\n"); if (compat >= ORC_VERSION(0,4,7,1)) { fprintf(output, " if (benchmark) {\n"); fprintf(output, " printf (\" cycles (compiled): %%g\\n\",\n"); fprintf(output, " orc_test_performance_full (p, 0, NULL));\n"); fprintf(output, " }\n"); } fprintf(output, "\n"); fprintf(output, " orc_program_free (p);\n"); fprintf(output, " }\n"); fprintf(output, "\n"); } void output_code_assembly (OrcProgram *p, FILE *output) { fprintf(output, "/* %s */\n", p->name); //output_prototype (p, output); { OrcCompileResult result; OrcTarget *t = orc_target_get_by_name(target); result = orc_program_compile_full (p, t, orc_target_get_default_flags (t)); if (ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { fprintf(output, "%s\n", orc_program_get_asm_code (p)); } else { printf("Failed to compile assembly for '%s'\n", p->name); error = TRUE; } } fprintf(output, "\n"); } static const char * my_basename (const char *s) { const char *ret = s; const char *t; t = s; while (t[0] != 0) { if (t[0] == '/') ret = t+1; t++; } return ret; } orc-0.4.18/orc.pc.in0000664000175000017500000000057712111024531011025 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/orc-@ORC_MAJORMINOR@ toolsdir=${exec_prefix}/bin Name: orc-@ORC_MAJORMINOR@ Description: Library of Optimized Inner Loops Runtime Compiler Version: @VERSION@ Libs: -L${libdir} -lorc-@ORC_MAJORMINOR@ Libs.private: @LIBM@ @LIBRT@ @PTHREAD_LIBS@ Cflags: -I${includedir} orcc=${toolsdir}/orcc@EXEEXT@ orc-0.4.18/missing0000755000175000017500000002415212206165327010717 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: orc-0.4.18/configure0000775000175000017500000162011712206165326011234 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for orc 0.4.18. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='orc' PACKAGE_TARNAME='orc' PACKAGE_VERSION='0.4.18' PACKAGE_STRING='orc 0.4.18' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_unique_file="orc/orc.h" ac_header_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgconfigdir ORC_LIBS ORC_CFLAGS ERROR_CFLAGS ENABLE_BACKEND_MIPS_FALSE ENABLE_BACKEND_MIPS_TRUE ENABLE_BACKEND_C64X_FALSE ENABLE_BACKEND_C64X_TRUE ENABLE_BACKEND_ARM_FALSE ENABLE_BACKEND_ARM_TRUE ENABLE_BACKEND_NEON_FALSE ENABLE_BACKEND_NEON_TRUE ENABLE_BACKEND_ALTIVEC_FALSE ENABLE_BACKEND_ALTIVEC_TRUE ENABLE_BACKEND_MMX_FALSE ENABLE_BACKEND_MMX_TRUE ENABLE_BACKEND_SSE_FALSE ENABLE_BACKEND_SSE_TRUE PTHREAD_LIBS PTHREAD_CFLAGS LIBRT LIBM HAVE_OS_LINUX_FALSE HAVE_OS_LINUX_TRUE HAVE_OS_WIN32_FALSE HAVE_OS_WIN32_TRUE HAVE_MIPSEL_FALSE HAVE_MIPSEL_TRUE HAVE_ARM_FALSE HAVE_ARM_TRUE HAVE_POWERPC_FALSE HAVE_POWERPC_TRUE HAVE_AMD64_FALSE HAVE_AMD64_TRUE HAVE_I386_FALSE HAVE_I386_TRUE GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE PKG_CONFIG HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK CROSS_COMPILING_FALSE CROSS_COMPILING_TRUE ACLOCAL_AMFLAGS am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE CCASFLAGS CCAS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LIBTOOL OBJDUMP DLLTOOL AS ORC_LIBVERSION ORC_MAJORMINOR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM host_os host_vendor host_cpu host build_os build_vendor build_cpu build NANO target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf enable_backend ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CCAS CCASFLAGS PKG_CONFIG' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures orc 0.4.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/orc] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of orc 0.4.18:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] --enable-backend sse,mmx,neon,mips,all (default all) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) PKG_CONFIG path to pkg-config utility Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF orc configure 0.4.18 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by orc $as_me 0.4.18, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5 $as_echo_n "checking nano version... " >&6; } NANO=$(echo 0.4.18 | sed 's/[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.*//') if test x"$NANO" = x || test "x$NANO" = "x0" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: 0 (release)" >&5 $as_echo "0 (release)" >&6; } NANO=0 ORC_GIT=no else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NANO" >&5 $as_echo "$NANO" >&6; } ORC_GIT=yes fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='orc' VERSION='0.4.18' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ORC_MAJORMINOR=0.4 ac_config_headers="$ac_config_headers config.h" ORC_LIBVERSION="18:0:18" enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CCAS_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 $as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS" if test "x$cross_compiling" = "xyes"; then CROSS_COMPILING_TRUE= CROSS_COMPILING_FALSE='#' else CROSS_COMPILING_TRUE='#' CROSS_COMPILING_FALSE= fi for ac_func in posix_memalign do : ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" if test "x$ac_cv_func_posix_memalign" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POSIX_MEMALIGN 1 _ACEOF fi done ################################################## # Check for gtk-doc. ################################################## if test "x$cross_compiling" = "xyes" ; then enable_gtk_doc=no fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error $? "You need to have gtk-doc >= 1.0 installed to build $PACKAGE_NAME" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi case "x${host_cpu}" in xi?86 | k?) HAVE_I386=yes $as_echo "#define HAVE_I386 1" >>confdefs.h ;; xx86_64|xamd64) HAVE_AMD64=yes $as_echo "#define HAVE_AMD64 1" >>confdefs.h ;; xpowerpc|xppc|xpowerpc64|xppc64) HAVE_POWERPC=yes $as_echo "#define HAVE_POWERPC 1" >>confdefs.h ;; xarm*) HAVE_ARM=yes $as_echo "#define HAVE_ARM 1" >>confdefs.h ;; xmipsel*) HAVE_MIPSEL=yes $as_echo "#define HAVE_MIPSEL 1" >>confdefs.h esac if test "x$HAVE_I386" = "xyes"; then HAVE_I386_TRUE= HAVE_I386_FALSE='#' else HAVE_I386_TRUE='#' HAVE_I386_FALSE= fi if test "x$HAVE_AMD64" = "xyes"; then HAVE_AMD64_TRUE= HAVE_AMD64_FALSE='#' else HAVE_AMD64_TRUE='#' HAVE_AMD64_FALSE= fi if test "x$HAVE_POWERPC" = "xyes"; then HAVE_POWERPC_TRUE= HAVE_POWERPC_FALSE='#' else HAVE_POWERPC_TRUE='#' HAVE_POWERPC_FALSE= fi if test "x$HAVE_ARM" = "xyes"; then HAVE_ARM_TRUE= HAVE_ARM_FALSE='#' else HAVE_ARM_TRUE='#' HAVE_ARM_FALSE= fi if test "x$HAVE_MIPSEL" = "xyes"; then HAVE_MIPSEL_TRUE= HAVE_MIPSEL_FALSE='#' else HAVE_MIPSEL_TRUE='#' HAVE_MIPSEL_FALSE= fi case "${host_os}" in mingw*) HAVE_OS_WIN32=yes $as_echo "#define HAVE_OS_WIN32 1" >>confdefs.h ;; linux*) HAVE_OS_LINUX=yes $as_echo "#define HAVE_OS_LINUX 1" >>confdefs.h ;; esac if test "$HAVE_OS_WIN32" = "yes"; then HAVE_OS_WIN32_TRUE= HAVE_OS_WIN32_FALSE='#' else HAVE_OS_WIN32_TRUE='#' HAVE_OS_WIN32_FALSE= fi if test "$HAVE_OS_LINUX" = "yes"; then HAVE_OS_LINUX_TRUE= HAVE_OS_LINUX_FALSE='#' else HAVE_OS_LINUX_TRUE='#' HAVE_OS_LINUX_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if ${ac_cv_func_mmap_fixed_mapped+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; const char *cdata2; int i, pagesize; int fd, fd2; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 2; if (write (fd, data, pagesize) != pagesize) return 3; close (fd); /* Next, check that the tail of a page is zero-filled. File must have non-zero length, otherwise we risk SIGBUS for entire page. */ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; cdata2 = ""; if (write (fd2, cdata2, 1) != 1) return 5; data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) if (*(data2 + i)) return 7; close (fd2); if (munmap (data2, pagesize)) return 8; /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 9; if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 10; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 11; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 12; if (read (fd, data3, pagesize) != pagesize) return 13; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 14; close (fd); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_mmap_fixed_mapped=yes else ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in sigaction do : ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" if test "x$ac_cv_func_sigaction" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGACTION 1 _ACEOF fi done for ac_func in sigsetjmp do : ac_fn_c_check_func "$LINENO" "sigsetjmp" "ac_cv_func_sigsetjmp" if test "x$ac_cv_func_sigsetjmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGSETJMP 1 _ACEOF fi done LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 $as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _mwvalidcheckl (); int main () { return _mwvalidcheckl (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mw__mwvalidcheckl=yes else ac_cv_lib_mw__mwvalidcheckl=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 $as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : LIBM="-lmw" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : LIBM="$LIBM -lm" fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : LIBM="-lm" fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h LIBRT=-lrt fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for monotonic clocks" >&5 $as_echo_n "checking for monotonic clocks... " >&6; } if ${orc_cv_monotonic_clock+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { #if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC)) #error No monotonic clock #endif return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : orc_cv_monotonic_clock=yes else orc_cv_monotonic_clock=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $orc_cv_monotonic_clock" >&5 $as_echo "$orc_cv_monotonic_clock" >&6; } if test "$orc_cv_monotonic_clock" = "yes"; then $as_echo "#define HAVE_MONOTONIC_CLOCK 1" >>confdefs.h fi for ac_header in valgrind/valgrind.h do : ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VALGRIND_VALGRIND_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wall" >&5 $as_echo_n "checking to see if compiler understands -Wall... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then ORC_CFLAGS="$ORC_CFLAGS -Wall" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } if test "x$ORC_GIT" = "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 $as_echo_n "checking to see if compiler understands -Werror... " >&6; } save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" if test "X$flag_ok" = Xyes ; then ERROR_CFLAGS="-Werror" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } fi case "${host_os}" in nobody_is_using_this_currently) $as_echo "#define HAVE_CODEMEM_MALLOC 1" >>confdefs.h ;; mingw*|pw32*|cygwin*) $as_echo "#define HAVE_CODEMEM_VIRTUALALLOC 1" >>confdefs.h ;; linux*|darwin*|solaris*|netbsd*|freebsd*|openbsd*|kfreebsd*|dragonfly*|gnu*) $as_echo "#define HAVE_CODEMEM_MMAP 1" >>confdefs.h ;; *) as_fn_error $? "no code allocation backend" "$LINENO" 5 ;; esac case "${host_os}" in mingw*|pw32*|cygwin*) $as_echo "#define HAVE_THREAD_WIN32 1" >>confdefs.h ;; *android*) $as_echo "#define HAVE_THREAD_PTHREAD 1" >>confdefs.h PTHREAD_CFLAGS= PTHREAD_LIBS= ;; *) $as_echo "#define HAVE_THREAD_PTHREAD 1" >>confdefs.h PTHREAD_CFLAGS= PTHREAD_LIBS=-lpthread ;; esac # Check whether --enable-backend was given. if test "${enable_backend+set}" = set; then : enableval=$enable_backend; else enable_backend=all fi case "${enable_backend}" in sse) ENABLE_BACKEND_SSE=yes $as_echo "#define ENABLE_BACKEND_SSE 1" >>confdefs.h ;; mmx) ENABLE_BACKEND_MMX=yes $as_echo "#define ENABLE_BACKEND_MMX 1" >>confdefs.h ;; altivec) ENABLE_BACKEND_ALTIVEC=yes $as_echo "#define ENABLE_BACKEND_ALTIVEC 1" >>confdefs.h ;; neon) ENABLE_BACKEND_NEON=yes $as_echo "#define ENABLE_BACKEND_NEON 1" >>confdefs.h ;; ### ARM backend is disabled until it has decent coverage # arm) # ENABLE_BACKEND_ARM=yes # AC_DEFINE(ENABLE_BACKEND_ARM, 1, [Enable Arm backend]) # ;; c64x) ENABLE_BACKEND_C64X=yes $as_echo "#define ENABLE_BACKEND_C64X 1" >>confdefs.h ;; mips) ENABLE_BACKEND_MIPS=yes $as_echo "#define ENABLE_BACKEND_MIPS 1" >>confdefs.h ;; all|auto) ENABLE_BACKEND_SSE=yes $as_echo "#define ENABLE_BACKEND_SSE 1" >>confdefs.h ENABLE_BACKEND_MMX=yes $as_echo "#define ENABLE_BACKEND_MMX 1" >>confdefs.h ENABLE_BACKEND_ALTIVEC=yes $as_echo "#define ENABLE_BACKEND_ALTIVEC 1" >>confdefs.h ENABLE_BACKEND_NEON=yes $as_echo "#define ENABLE_BACKEND_NEON 1" >>confdefs.h # ENABLE_BACKEND_ARM=yes # AC_DEFINE(ENABLE_BACKEND_ARM, 1, [Enable Arm backend]) ENABLE_BACKEND_C64X=yes $as_echo "#define ENABLE_BACKEND_C64X 1" >>confdefs.h ENABLE_BACKEND_MIPS=yes $as_echo "#define ENABLE_BACKEND_MIPS 1" >>confdefs.h ;; esac if test "x$ENABLE_BACKEND_SSE" = "xyes"; then ENABLE_BACKEND_SSE_TRUE= ENABLE_BACKEND_SSE_FALSE='#' else ENABLE_BACKEND_SSE_TRUE='#' ENABLE_BACKEND_SSE_FALSE= fi if test "x$ENABLE_BACKEND_MMX" = "xyes"; then ENABLE_BACKEND_MMX_TRUE= ENABLE_BACKEND_MMX_FALSE='#' else ENABLE_BACKEND_MMX_TRUE='#' ENABLE_BACKEND_MMX_FALSE= fi if test "x$ENABLE_BACKEND_ALTIVEC" = "xyes"; then ENABLE_BACKEND_ALTIVEC_TRUE= ENABLE_BACKEND_ALTIVEC_FALSE='#' else ENABLE_BACKEND_ALTIVEC_TRUE='#' ENABLE_BACKEND_ALTIVEC_FALSE= fi if test "x$ENABLE_BACKEND_NEON" = "xyes"; then ENABLE_BACKEND_NEON_TRUE= ENABLE_BACKEND_NEON_FALSE='#' else ENABLE_BACKEND_NEON_TRUE='#' ENABLE_BACKEND_NEON_FALSE= fi if test "x$ENABLE_BACKEND_ARM" = "xyes"; then ENABLE_BACKEND_ARM_TRUE= ENABLE_BACKEND_ARM_FALSE='#' else ENABLE_BACKEND_ARM_TRUE='#' ENABLE_BACKEND_ARM_FALSE= fi if test "x$ENABLE_BACKEND_C64X" = "xyes"; then ENABLE_BACKEND_C64X_TRUE= ENABLE_BACKEND_C64X_FALSE='#' else ENABLE_BACKEND_C64X_TRUE='#' ENABLE_BACKEND_C64X_FALSE= fi if test "x$ENABLE_BACKEND_MIPS" = "xyes"; then ENABLE_BACKEND_MIPS_TRUE= ENABLE_BACKEND_MIPS_FALSE='#' else ENABLE_BACKEND_MIPS_TRUE='#' ENABLE_BACKEND_MIPS_FALSE= fi $as_echo "#define ORC_EXPORTS 1" >>confdefs.h ORC_CFLAGS="$ORC_CFLAGS \$(ERROR_CFLAGS) -I\$(top_srcdir)" ORC_LIBS="\$(top_builddir)/orc/liborc-$ORC_MAJORMINOR.la $LIBM $LIBRT" #CFLAGS=`echo $CFLAGS | sed s/O2/O0/` pkgconfigdir="\$(libdir)/pkgconfig" ac_config_files="$ac_config_files Makefile doc/Makefile doc/version.entities orc/Makefile orc-test/Makefile testsuite/Makefile testsuite/orcc/Makefile testsuite/benchmorc/Makefile examples/Makefile tools/Makefile orc-uninstalled.pc orc.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_I386_TRUE}" && test -z "${HAVE_I386_FALSE}"; then as_fn_error $? "conditional \"HAVE_I386\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_AMD64_TRUE}" && test -z "${HAVE_AMD64_FALSE}"; then as_fn_error $? "conditional \"HAVE_AMD64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_POWERPC_TRUE}" && test -z "${HAVE_POWERPC_FALSE}"; then as_fn_error $? "conditional \"HAVE_POWERPC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ARM_TRUE}" && test -z "${HAVE_ARM_FALSE}"; then as_fn_error $? "conditional \"HAVE_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_MIPSEL_TRUE}" && test -z "${HAVE_MIPSEL_FALSE}"; then as_fn_error $? "conditional \"HAVE_MIPSEL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_OS_WIN32_TRUE}" && test -z "${HAVE_OS_WIN32_FALSE}"; then as_fn_error $? "conditional \"HAVE_OS_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_OS_LINUX_TRUE}" && test -z "${HAVE_OS_LINUX_FALSE}"; then as_fn_error $? "conditional \"HAVE_OS_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_SSE_TRUE}" && test -z "${ENABLE_BACKEND_SSE_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_SSE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_MMX_TRUE}" && test -z "${ENABLE_BACKEND_MMX_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_MMX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_ALTIVEC_TRUE}" && test -z "${ENABLE_BACKEND_ALTIVEC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_ALTIVEC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_NEON_TRUE}" && test -z "${ENABLE_BACKEND_NEON_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_NEON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_ARM_TRUE}" && test -z "${ENABLE_BACKEND_ARM_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_C64X_TRUE}" && test -z "${ENABLE_BACKEND_C64X_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_C64X\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_BACKEND_MIPS_TRUE}" && test -z "${ENABLE_BACKEND_MIPS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_BACKEND_MIPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by orc $as_me 0.4.18, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ orc config.status 0.4.18 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/version.entities") CONFIG_FILES="$CONFIG_FILES doc/version.entities" ;; "orc/Makefile") CONFIG_FILES="$CONFIG_FILES orc/Makefile" ;; "orc-test/Makefile") CONFIG_FILES="$CONFIG_FILES orc-test/Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "testsuite/orcc/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/orcc/Makefile" ;; "testsuite/benchmorc/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/benchmorc/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "orc-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES orc-uninstalled.pc" ;; "orc.pc") CONFIG_FILES="$CONFIG_FILES orc.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi